Aggiornato uso di TRelation::lfile e main_app
Aggiunto programma cancellazione movimenti provvisori git-svn-id: svn://10.65.10.50/trunk@276 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5e9b747386
commit
ab754188c1
@ -276,13 +276,13 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
|||||||
chiave = d; chiave << format("%04d%02d%d", _anno, _mese, _tipo);
|
chiave = d; chiave << format("%04d%02d%d", _anno, _mese, _tipo);
|
||||||
delega.put("CODTAB", chiave);
|
delega.put("CODTAB", chiave);
|
||||||
|
|
||||||
f.cursor()->file()->read();
|
f.cursor()->file().read();
|
||||||
const bool cera = atoi(delega.get("S7")) != 0;
|
const bool cera = atoi(delega.get("S7")) != 0;
|
||||||
if (!cera)
|
if (!cera)
|
||||||
{
|
{
|
||||||
delega.put("S7", _azienda);
|
delega.put("S7", _azienda);
|
||||||
delega.put("S8", _dipendenza);
|
delega.put("S8", _dipendenza);
|
||||||
f.cursor()->file()->rewrite();
|
f.cursor()->file().rewrite();
|
||||||
}
|
}
|
||||||
f.cursor()->read(); // Posiziona il cursore
|
f.cursor()->read(); // Posiziona il cursore
|
||||||
|
|
||||||
@ -303,7 +303,7 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
|||||||
scrivi = TRUE;
|
scrivi = TRUE;
|
||||||
}
|
}
|
||||||
if (scrivi)
|
if (scrivi)
|
||||||
f.cursor()->file()->rewrite();
|
f.cursor()->file().rewrite();
|
||||||
}
|
}
|
||||||
printer().close();
|
printer().close();
|
||||||
|
|
||||||
|
92
cg/cg0.cpp
92
cg/cg0.cpp
@ -1,46 +1,46 @@
|
|||||||
|
|
||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
#include <checks.h>
|
#include <checks.h>
|
||||||
//#include <stdlib.h>
|
//#include <stdlib.h>
|
||||||
#include "cg0.h"
|
#include "cg0.h"
|
||||||
|
|
||||||
#define usage "Error - usage : %s -{0|1|2|3|4|5}"
|
#define usage "Error - usage : %s -{0|1|2|3|4|5}"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
const int op = argc < 2 ? 0 : atoi(argv[1]+1)+1;
|
const int op = argc < 2 ? 0 : atoi(argv[1]+1)+1;
|
||||||
int res = 1;
|
int res = 1;
|
||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
case 1: res = cg0100(argc,argv) ; break;
|
case 1: res = cg0100(argc,argv) ; break;
|
||||||
case 2: res = cg0200(argc,argv) ; break;
|
case 2: res = cg0200(argc,argv) ; break;
|
||||||
case 3: res = cg0300(argc,argv) ; break;
|
case 3: res = cg0300(argc,argv) ; break;
|
||||||
case 4: res = cg0400(argc,argv) ; break;
|
case 4: res = cg0400(argc,argv) ; break;
|
||||||
case 5: res = cg0500(argc,argv) ; break;
|
case 5: res = cg0500(argc,argv) ; break;
|
||||||
// case 6: res = cg0600(argc,argv) ; break;
|
// case 6: res = cg0600(argc,argv) ; break;
|
||||||
default: error_box(usage, argv[0]); break;
|
default: error_box(usage, argv[0]); break;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
bool CG0100_application::protected_record(TRectype &rec)
|
bool CG0100_application::protected_record(TRectype &rec)
|
||||||
{
|
{
|
||||||
TMask* m = get_mask(MODE_MOD);
|
TMask* m = get_mask(MODE_MOD);
|
||||||
TLocalisamfile& pconti = *_rel->lfile();
|
TLocalisamfile& pconti = _rel->lfile();
|
||||||
const int gruppo = atoi(m->get(FLD_CM1_GRUPPO));
|
const int gruppo = atoi(m->get(FLD_CM1_GRUPPO));
|
||||||
const int conto = atoi(m->get(FLD_CM1_CONTO));
|
const int conto = atoi(m->get(FLD_CM1_CONTO));
|
||||||
const long sottoc = atol(m->get(FLD_CM1_SOTTOCONTO));
|
const long sottoc = atol(m->get(FLD_CM1_SOTTOCONTO));
|
||||||
@ -138,7 +138,7 @@ void CG0100_application::init_insert_mode(TMask& m)
|
|||||||
else
|
else
|
||||||
m.send_key(K_SHIFT + K_CTRL + 'h', -3);
|
m.send_key(K_SHIFT + K_CTRL + 'h', -3);
|
||||||
|
|
||||||
TLocalisamfile& pconti = *_rel->lfile();
|
TLocalisamfile& pconti = _rel->lfile();
|
||||||
TString s(15), s2(1), s3(8), s4(2);
|
TString s(15), s2(1), s3(8), s4(2);
|
||||||
int s1 = 0;
|
int s1 = 0;
|
||||||
|
|
||||||
@ -229,7 +229,7 @@ HIDDEN bool gruppo_handler(TMask_field& f, KEY key)
|
|||||||
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
||||||
const TFixed_string descrizione(m.get(FLD_CM1_DESC));
|
const TFixed_string descrizione(m.get(FLD_CM1_DESC));
|
||||||
CG0100_application* app = (CG0100_application*) MainApp();
|
CG0100_application* app = (CG0100_application*) MainApp();
|
||||||
TLocalisamfile& pconti = *app->get_relation()->lfile();
|
TLocalisamfile& pconti = app->get_relation()->lfile();
|
||||||
|
|
||||||
if (gruppo == 0 && conto == 0 && sottoc == 0 && descrizione.not_empty())
|
if (gruppo == 0 && conto == 0 && sottoc == 0 && descrizione.not_empty())
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
1262
cg/cg0200.cpp
1262
cg/cg0200.cpp
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,7 @@
|
|||||||
#include "cg0201.h"
|
#include "cg0201.h"
|
||||||
<<<<<<< cg0201.cpp
|
|
||||||
=======
|
|
||||||
#include <lffiles.h>
|
|
||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
#include <indsp.h>
|
#include <indsp.h>
|
||||||
>>>>>>> 1.4
|
|
||||||
|
|
||||||
|
|
||||||
extern bool gest_vend();
|
extern bool gest_vend();
|
||||||
// Definizione dei metodi relativi alla classe TClifoVI
|
// Definizione dei metodi relativi alla classe TClifoVI
|
||||||
@ -36,7 +32,7 @@ TRectype& TClifoVI::indirizzo(int i)
|
|||||||
|
|
||||||
int TClifoVI::read_indirizzi()
|
int TClifoVI::read_indirizzi()
|
||||||
{
|
{
|
||||||
const TLocalisamfile* rind = lfile(LF_INDSP);
|
const TLocalisamfile& rind = lfile(LF_INDSP);
|
||||||
// Put here gest_vend() discrimination
|
// Put here gest_vend() discrimination
|
||||||
if (gest_vend())
|
if (gest_vend())
|
||||||
{
|
{
|
||||||
@ -44,8 +40,8 @@ int TClifoVI::read_indirizzi()
|
|||||||
destroy_rows();
|
destroy_rows();
|
||||||
for (bool ok=is_first_match(LF_INDSP); ok; ok=next_match(LF_INDSP))
|
for (bool ok=is_first_match(LF_INDSP); ok; ok=next_match(LF_INDSP))
|
||||||
{
|
{
|
||||||
const int nriga=rind->get_int(IND_CODIND) -1;
|
const int nriga=rind.get_int(IND_CODIND) -1;
|
||||||
indirizzo(nriga)=rind->curr();
|
indirizzo(nriga)=rind.curr();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_oldindirizzi=indirizzi_items();
|
_oldindirizzi=indirizzi_items();
|
||||||
@ -54,55 +50,55 @@ int TClifoVI::read_indirizzi()
|
|||||||
|
|
||||||
int TClifoVI::read(TIsamop op, TReclock lockop, TDate& atdate)
|
int TClifoVI::read(TIsamop op, TReclock lockop, TDate& atdate)
|
||||||
{
|
{
|
||||||
int err=file()->read(op,lockop,atdate);
|
int err=file().read(op,lockop,atdate);
|
||||||
if (err==NOERR) read_indirizzi();
|
if (err==NOERR) read_indirizzi();
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TClifoVI::write_rec(bool re, const TRectype& rec, TLocalisamfile* f)
|
int TClifoVI::write_rec(bool re, const TRectype& rec, TLocalisamfile& f)
|
||||||
{
|
{
|
||||||
if (re)
|
if (re)
|
||||||
{
|
{
|
||||||
const bool scrivi= (f->rewrite(rec)!=NOERR);
|
const bool scrivi= (f.rewrite(rec)!=NOERR);
|
||||||
if (scrivi) f->write(rec);
|
if (scrivi) f.write(rec);
|
||||||
} else
|
} else
|
||||||
f->write(rec);
|
f.write(rec);
|
||||||
return f->status();
|
return f.status();
|
||||||
}
|
}
|
||||||
|
|
||||||
int TClifoVI::cancella(TLocalisamfile* f, int da, int a)
|
int TClifoVI::cancella(TLocalisamfile& f, int da, int a)
|
||||||
{
|
{
|
||||||
const char tipocf=lfile()->get(IND_TIPOCF)[0];
|
const char tipocf=lfile().get(IND_TIPOCF)[0];
|
||||||
const long codcf=lfile()->get_long(IND_CODCF);
|
const long codcf=lfile().get_long(IND_CODCF);
|
||||||
|
|
||||||
for (int i=da; i<=a;i++)
|
for (int i=da; i<=a;i++)
|
||||||
{
|
{
|
||||||
f->zero();
|
f.zero();
|
||||||
f->put(IND_TIPOCF,tipocf);
|
f.put(IND_TIPOCF,tipocf);
|
||||||
f->put(IND_CODCF,codcf);
|
f.put(IND_CODCF,codcf);
|
||||||
f->put(IND_CODIND,i);
|
f.put(IND_CODIND,i);
|
||||||
if (f->read(_isequal,_lock)==NOERR)
|
if (f.read(_isequal,_lock)==NOERR)
|
||||||
f->remove();
|
f.remove();
|
||||||
}
|
}
|
||||||
return f->status();
|
return f.status();
|
||||||
}
|
}
|
||||||
|
|
||||||
int TClifoVI::registra(bool re, bool force)
|
int TClifoVI::registra(bool re, bool force)
|
||||||
{
|
{
|
||||||
TLocalisamfile* c=lfile(LF_CLIFO);
|
TLocalisamfile& c=lfile(LF_CLIFO);
|
||||||
int err=write_rec(re,c->curr(),c);
|
int err=write_rec(re,c.curr(),c);
|
||||||
if (err!=NOERR) return err;
|
if (err!=NOERR) return err;
|
||||||
|
|
||||||
// Put here gest_vend() discrimination
|
// Put here gest_vend() discrimination
|
||||||
if (gest_vend())
|
if (gest_vend())
|
||||||
{
|
{
|
||||||
TLocalisamfile* v=lfile(LF_CFVEN);
|
TLocalisamfile& v=lfile(LF_CFVEN);
|
||||||
err=write_rec(TRUE,v->curr(),v);
|
err=write_rec(TRUE,v.curr(),v);
|
||||||
if (err!=NOERR) return err;
|
if (err!=NOERR) return err;
|
||||||
|
|
||||||
TLocalisamfile* rind=lfile(LF_INDSP);
|
TLocalisamfile& rind=lfile(LF_INDSP);
|
||||||
const char tipocf=c->get(CLI_TIPOCF)[0];
|
const char tipocf=c.get(CLI_TIPOCF)[0];
|
||||||
const long codcf=c->get_long(CLI_CODCF);
|
const long codcf=c.get_long(CLI_CODCF);
|
||||||
|
|
||||||
for (int i=0; i<indirizzi_items(); i++)
|
for (int i=0; i<indirizzi_items(); i++)
|
||||||
{
|
{
|
||||||
@ -134,19 +130,19 @@ int TClifoVI::rewrite(bool force, TDate&)
|
|||||||
|
|
||||||
int TClifoVI::remove(TDate&)
|
int TClifoVI::remove(TDate&)
|
||||||
{
|
{
|
||||||
TLocalisamfile* c=lfile(LF_CLIFO);
|
TLocalisamfile& c=lfile(LF_CLIFO);
|
||||||
|
|
||||||
c->remove();
|
c.remove();
|
||||||
|
|
||||||
// Put here gest_vend() discrimination
|
// Put here gest_vend() discrimination
|
||||||
if (gest_vend())
|
if (gest_vend())
|
||||||
{
|
{
|
||||||
TLocalisamfile* v=lfile(LF_CFVEN);
|
TLocalisamfile& v=lfile(LF_CFVEN);
|
||||||
TLocalisamfile* rind=lfile(LF_INDSP);
|
TLocalisamfile& rind=lfile(LF_INDSP);
|
||||||
cancella(rind,1,_oldindirizzi);
|
cancella(rind,1,_oldindirizzi);
|
||||||
v->remove();
|
v.remove();
|
||||||
}
|
}
|
||||||
_oldindirizzi=0;
|
_oldindirizzi=0;
|
||||||
|
|
||||||
return c->status();
|
return c.status();
|
||||||
}
|
}
|
||||||
|
70
cg/cg0201.h
70
cg/cg0201.h
@ -1,35 +1,35 @@
|
|||||||
#ifndef __RELATION_H
|
#ifndef __RELATION_H
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class TClifoVI:public TRelation
|
class TClifoVI:public TRelation
|
||||||
{
|
{
|
||||||
// @DPRIV
|
// @DPRIV
|
||||||
TArray _indirizzi;
|
TArray _indirizzi;
|
||||||
int _oldindirizzi;
|
int _oldindirizzi;
|
||||||
// @END
|
// @END
|
||||||
protected:
|
protected:
|
||||||
// @FPROT
|
// @FPROT
|
||||||
int write_rec(bool re, const TRectype& r, TLocalisamfile* f);
|
int write_rec(bool re, const TRectype& r, TLocalisamfile& f);
|
||||||
int cancella(TLocalisamfile* f, int da, int a);
|
int cancella(TLocalisamfile& f, int da, int a);
|
||||||
int registra(bool re, bool force);
|
int registra(bool re, bool force);
|
||||||
int read_indirizzi();
|
int read_indirizzi();
|
||||||
// @END
|
// @END
|
||||||
public:
|
public:
|
||||||
virtual int next(TReclock lockop=_nolock) {return (lfile()->next(lockop) || read_indirizzi());}
|
virtual int next(TReclock lockop=_nolock) {return (lfile().next(lockop) || read_indirizzi());}
|
||||||
virtual int prev(TReclock lockop=_nolock) {return (lfile()->prev(lockop) || read_indirizzi());}
|
virtual int prev(TReclock lockop=_nolock) {return (lfile().prev(lockop) || read_indirizzi());}
|
||||||
virtual int first(TReclock lockop=_nolock) {return (lfile()->first(lockop) || read_indirizzi());}
|
virtual int first(TReclock lockop=_nolock) {return (lfile().first(lockop) || read_indirizzi());}
|
||||||
virtual int last(TReclock lockop=_nolock) {return (lfile()->last(lockop) || read_indirizzi());}
|
virtual int last(TReclock lockop=_nolock) {return (lfile().last(lockop) || read_indirizzi());}
|
||||||
virtual int skip(TReclock lockop=_nolock) {return (lfile()->skip(lockop) || read_indirizzi());}
|
virtual int skip(TReclock lockop=_nolock) {return (lfile().skip(lockop) || read_indirizzi());}
|
||||||
virtual int read(TIsamop = _isgteq, TReclock lockop = _nolock, TDate& atdate = (TDate&) botime);
|
virtual int read(TIsamop = _isgteq, TReclock lockop = _nolock, TDate& atdate = (TDate&) botime);
|
||||||
virtual int write(bool force=TRUE, TDate& atdate = (TDate&) botime);
|
virtual int write(bool force=TRUE, TDate& atdate = (TDate&) botime);
|
||||||
virtual int rewrite(bool force=TRUE, TDate& atdate = (TDate&) botime);
|
virtual int rewrite(bool force=TRUE, TDate& atdate = (TDate&) botime);
|
||||||
virtual int remove(TDate& atdate = (TDate&) botime);
|
virtual int remove(TDate& atdate = (TDate&) botime);
|
||||||
|
|
||||||
TRectype& indirizzo(int i);
|
TRectype& indirizzo(int i);
|
||||||
int indirizzi_items() const {return _indirizzi.items();}
|
int indirizzi_items() const {return _indirizzi.items();}
|
||||||
void destroy_rows();
|
void destroy_rows();
|
||||||
|
|
||||||
TClifoVI();
|
TClifoVI();
|
||||||
virtual ~TClifoVI() {}
|
virtual ~TClifoVI() {}
|
||||||
};
|
};
|
||||||
|
836
cg/cg0400.cpp
836
cg/cg0400.cpp
@ -1,418 +1,418 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <date.h>
|
#include <date.h>
|
||||||
#include <lffiles.h>
|
#include <lffiles.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <anagr.h>
|
#include <anagr.h>
|
||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
#include "cg0.h"
|
#include "cg0.h"
|
||||||
#include "cg0400.h"
|
#include "cg0400.h"
|
||||||
|
|
||||||
|
|
||||||
class CG0400_application : public TPrintapp
|
class CG0400_application : public TPrintapp
|
||||||
{
|
{
|
||||||
|
|
||||||
TTable* _tabpim, * _tabreg;
|
TTable* _tabpim, * _tabreg;
|
||||||
TLocalisamfile* _nditte, * _attiv, * _anag, * _com;
|
TLocalisamfile* _nditte, * _attiv, * _anag, * _com;
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
TDate _data;
|
TDate _data;
|
||||||
int _i, _sospmsk, _tipoprog, _livelloprog, _tipo_crmsk;
|
int _i, _sospmsk, _tipoprog, _livelloprog, _tipo_crmsk;
|
||||||
TString _cap,_cofi,_paiva,_ragsoc,_comunefis,_provfis,_viafis,_codivamsk,_codattmsk;
|
TString _cap,_cofi,_paiva,_ragsoc,_comunefis,_provfis,_viafis,_codivamsk,_codattmsk;
|
||||||
bool _vuoilordi;
|
bool _vuoilordi;
|
||||||
real _imponibile, _imposta, _lordo, _imponibile_v, _imposta_v, _lordo_v;
|
real _imponibile, _imposta, _lordo, _imponibile_v, _imposta_v, _lordo_v;
|
||||||
real _imponibile_vs, _imposta_vs, _lordo_vs, _totimponibile_v, _totimposta_v;
|
real _imponibile_vs, _imposta_vs, _lordo_vs, _totimponibile_v, _totimposta_v;
|
||||||
real _totlordo_v, _totimponibile_vs, _totimposta_vs, _totlordo_vs, _imponibile_acq;
|
real _totlordo_v, _totimponibile_vs, _totimposta_vs, _totlordo_vs, _imponibile_acq;
|
||||||
real _imposta_acq, _lordo_acq, _totimponibile_acq, _totimposta_acq, _totlordo_acq;
|
real _imposta_acq, _lordo_acq, _totimponibile_acq, _totimposta_acq, _totlordo_acq;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void user_create();
|
void user_create();
|
||||||
void user_destroy();
|
void user_destroy();
|
||||||
bool set_print(int);
|
bool set_print(int);
|
||||||
|
|
||||||
bool menu(MENU_TAG m) { return TPrintapp::menu(m); }
|
bool menu(MENU_TAG m) { return TPrintapp::menu(m); }
|
||||||
|
|
||||||
virtual void preprocess_header();
|
virtual void preprocess_header();
|
||||||
virtual bool preprocess_page(int,int);
|
virtual bool preprocess_page(int,int);
|
||||||
virtual print_action postprocess_page(int,int);
|
virtual print_action postprocess_page(int,int);
|
||||||
virtual bool preprocess_print(int,int);
|
virtual bool preprocess_print(int,int);
|
||||||
|
|
||||||
void fai_ricerca(int);
|
void fai_ricerca(int);
|
||||||
void get_dati_ditta();
|
void get_dati_ditta();
|
||||||
int stampa_intestazione_ditta();
|
int stampa_intestazione_ditta();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CG0400_application(){};
|
CG0400_application(){};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void CG0400_application::user_create()
|
void CG0400_application::user_create()
|
||||||
{
|
{
|
||||||
_tabpim = new TTable(TAB_PIM);
|
_tabpim = new TTable(TAB_PIM);
|
||||||
_tabreg = new TTable(TAB_REG);
|
_tabreg = new TTable(TAB_REG);
|
||||||
_anag = new TLocalisamfile(LF_ANAG);
|
_anag = new TLocalisamfile(LF_ANAG);
|
||||||
_nditte = new TLocalisamfile(LF_NDITTE);
|
_nditte = new TLocalisamfile(LF_NDITTE);
|
||||||
_attiv = new TLocalisamfile(LF_ATTIV);
|
_attiv = new TLocalisamfile(LF_ATTIV);
|
||||||
_com = new TLocalisamfile(LF_COMUNI);
|
_com = new TLocalisamfile(LF_COMUNI);
|
||||||
_msk = new TMask("cg0400a");
|
_msk = new TMask("cg0400a");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG0400_application::user_destroy()
|
void CG0400_application::user_destroy()
|
||||||
{
|
{
|
||||||
delete _msk;
|
delete _msk;
|
||||||
delete _tabpim;
|
delete _tabpim;
|
||||||
delete _tabreg;
|
delete _tabreg;
|
||||||
delete _anag;
|
delete _anag;
|
||||||
delete _nditte;
|
delete _nditte;
|
||||||
delete _com;
|
delete _com;
|
||||||
delete _attiv;
|
delete _attiv;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG0400_application::fai_ricerca(int i)
|
void CG0400_application::fai_ricerca(int i)
|
||||||
{
|
{
|
||||||
TString codtab,codreg,dep,codiva,codatt;
|
TString codtab,codreg,dep,codiva,codatt;
|
||||||
int mese;
|
int mese;
|
||||||
long anno;
|
long anno;
|
||||||
|
|
||||||
_imponibile=0;
|
_imponibile=0;
|
||||||
_imponibile_v=0;
|
_imponibile_v=0;
|
||||||
_imponibile_vs=0;
|
_imponibile_vs=0;
|
||||||
_imposta=0;
|
_imposta=0;
|
||||||
_imposta_v=0;
|
_imposta_v=0;
|
||||||
_imposta_vs=0;
|
_imposta_vs=0;
|
||||||
_lordo=0;
|
_lordo=0;
|
||||||
_lordo_v=0;
|
_lordo_v=0;
|
||||||
_lordo_vs=0;
|
_lordo_vs=0;
|
||||||
_imponibile_acq=0;
|
_imponibile_acq=0;
|
||||||
_imposta_acq=0;
|
_imposta_acq=0;
|
||||||
_lordo_acq=0;
|
_lordo_acq=0;
|
||||||
|
|
||||||
_tabpim->first();
|
_tabpim->first();
|
||||||
while (!_tabpim->eof()) //Scorre tutti i record della tabella PIM
|
while (!_tabpim->eof()) //Scorre tutti i record della tabella PIM
|
||||||
{
|
{
|
||||||
_imponibile = 0;
|
_imponibile = 0;
|
||||||
_imposta = 0;
|
_imposta = 0;
|
||||||
_lordo = 0;
|
_lordo = 0;
|
||||||
codtab = _tabpim->curr().get("CODTAB");
|
codtab = _tabpim->curr().get("CODTAB");
|
||||||
mese = atoi(codtab.mid(12,2));
|
mese = atoi(codtab.mid(12,2));
|
||||||
if (_livelloprog == 1) //Se si tratta di una aliquota
|
if (_livelloprog == 1) //Se si tratta di una aliquota
|
||||||
{
|
{
|
||||||
codiva = codtab.mid(15,3);
|
codiva = codtab.mid(15,3);
|
||||||
codatt = codtab.mid(4,5);
|
codatt = codtab.mid(4,5);
|
||||||
}
|
}
|
||||||
else //altrimenti se si tratta di una attivita'
|
else //altrimenti se si tratta di una attivita'
|
||||||
{
|
{
|
||||||
codatt = codtab.mid(4,5);
|
codatt = codtab.mid(4,5);
|
||||||
codiva = codtab.mid(55,3);
|
codiva = codtab.mid(55,3);
|
||||||
}
|
}
|
||||||
if (((mese==i)&&(codiva==_codivamsk))||((mese==i)&&(codatt==_codattmsk)))
|
if (((mese==i)&&(codiva==_codivamsk))||((mese==i)&&(codatt==_codattmsk)))
|
||||||
{
|
{
|
||||||
codreg = codtab.mid(9,3);
|
codreg = codtab.mid(9,3);
|
||||||
anno = atoi(codtab.mid(0,4));
|
anno = atoi(codtab.mid(0,4));
|
||||||
_tabreg->curr().zero();
|
_tabreg->curr().zero();
|
||||||
dep = format("%04d", anno);
|
dep = format("%04d", anno);
|
||||||
dep << format("%3s", (const char*)codreg);
|
dep << format("%3s", (const char*)codreg);
|
||||||
_tabreg->curr().put("CODTAB", (const char*)dep);
|
_tabreg->curr().put("CODTAB", (const char*)dep);
|
||||||
_tabreg->read();
|
_tabreg->read();
|
||||||
if (_tabreg->bad())
|
if (_tabreg->bad())
|
||||||
_tabreg->curr().zero();
|
_tabreg->curr().zero();
|
||||||
int tipo = atoi(_tabreg->curr().get("I0"));
|
int tipo = atoi(_tabreg->curr().get("I0"));
|
||||||
if ((tipo == 1) && (_tipoprog == 1)) //Se si tratta di una vendita
|
if ((tipo == 1) && (_tipoprog == 1)) //Se si tratta di una vendita
|
||||||
{
|
{
|
||||||
int tipo_importo = (int) _tabreg->curr().get_long("I0");
|
int tipo_importo = (int) _tabreg->curr().get_long("I0");
|
||||||
bool sosp = _tabreg->curr().get_bool("B0");
|
bool sosp = _tabreg->curr().get_bool("B0");
|
||||||
if (tipo_importo == 1) // 1=importo netto 2=importo lordo
|
if (tipo_importo == 1) // 1=importo netto 2=importo lordo
|
||||||
{
|
{
|
||||||
_imponibile = _tabpim->curr().get_real("R0");
|
_imponibile = _tabpim->curr().get_real("R0");
|
||||||
|
|
||||||
_imposta = _tabpim->curr().get_real("R1");
|
_imposta = _tabpim->curr().get_real("R1");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_lordo = _tabpim->curr().get_real("R2");
|
_lordo = _tabpim->curr().get_real("R2");
|
||||||
if (sosp) //Se e' una vendita in sospensione d'imposta
|
if (sosp) //Se e' una vendita in sospensione d'imposta
|
||||||
{
|
{
|
||||||
_imponibile_vs += _imponibile;
|
_imponibile_vs += _imponibile;
|
||||||
_imposta_vs += _imposta;
|
_imposta_vs += _imposta;
|
||||||
_lordo_vs += _lordo;
|
_lordo_vs += _lordo;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_imponibile_v += _imponibile;
|
_imponibile_v += _imponibile;
|
||||||
_imposta_v += _imposta;
|
_imposta_v += _imposta;
|
||||||
_lordo_v += _lordo;
|
_lordo_v += _lordo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((tipo == 2) && (_tipoprog == 2)) //Se si tratta di un acquisto
|
else if ((tipo == 2) && (_tipoprog == 2)) //Se si tratta di un acquisto
|
||||||
{
|
{
|
||||||
int tipo_importo = atoi(codtab.mid(15,1));
|
int tipo_importo = atoi(codtab.mid(15,1));
|
||||||
int tipo_cr = atoi(codtab.mid(14,1));
|
int tipo_cr = atoi(codtab.mid(14,1));
|
||||||
if (_tipo_crmsk == tipo_cr)
|
if (_tipo_crmsk == tipo_cr)
|
||||||
{
|
{
|
||||||
if (tipo_importo == 1) // 1=importo netto 2=importo lordo
|
if (tipo_importo == 1) // 1=importo netto 2=importo lordo
|
||||||
{
|
{
|
||||||
_imponibile = _tabpim->curr().get_real("R0");
|
_imponibile = _tabpim->curr().get_real("R0");
|
||||||
|
|
||||||
_imposta = _tabpim->curr().get_real("R1");
|
_imposta = _tabpim->curr().get_real("R1");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_lordo = _tabpim->curr().get_real("R2");
|
_lordo = _tabpim->curr().get_real("R2");
|
||||||
|
|
||||||
_imponibile_acq += _imponibile;
|
_imponibile_acq += _imponibile;
|
||||||
_imposta_acq += _imposta;
|
_imposta_acq += _imposta;
|
||||||
_lordo_acq += _lordo;
|
_lordo_acq += _lordo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_tabpim->next();
|
_tabpim->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
_totimponibile_v+=_imponibile_v;
|
_totimponibile_v+=_imponibile_v;
|
||||||
_totimposta_v+=_imposta_v;
|
_totimposta_v+=_imposta_v;
|
||||||
_totlordo_v+=_lordo_v;
|
_totlordo_v+=_lordo_v;
|
||||||
_totimponibile_vs+=_imponibile_vs;
|
_totimponibile_vs+=_imponibile_vs;
|
||||||
_totimposta_vs+=_imposta_vs;
|
_totimposta_vs+=_imposta_vs;
|
||||||
_totlordo_vs+=_lordo_vs;
|
_totlordo_vs+=_lordo_vs;
|
||||||
_totimponibile_acq+= _imponibile_acq;
|
_totimponibile_acq+= _imponibile_acq;
|
||||||
_totimposta_acq+= _imposta_acq;
|
_totimposta_acq+= _imposta_acq;
|
||||||
_totlordo_acq+= _lordo_acq;
|
_totlordo_acq+= _lordo_acq;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG0400_application::set_print(int)
|
bool CG0400_application::set_print(int)
|
||||||
{
|
{
|
||||||
KEY tasto;
|
KEY tasto;
|
||||||
tasto = _msk->run();
|
tasto = _msk->run();
|
||||||
if (tasto == K_ENTER)
|
if (tasto == K_ENTER)
|
||||||
{
|
{
|
||||||
_sospmsk = atoi(_msk->get(F_TIPOTAB));
|
_sospmsk = atoi(_msk->get(F_TIPOTAB));
|
||||||
_vuoilordi = (bool)(_msk->get(F_VUOILORDI) == "X");
|
_vuoilordi = (bool)(_msk->get(F_VUOILORDI) == "X");
|
||||||
_tipoprog = atoi(_msk->get(F_TIPO));
|
_tipoprog = atoi(_msk->get(F_TIPO));
|
||||||
_livelloprog = atoi(_msk->get(F_LIVELLO));
|
_livelloprog = atoi(_msk->get(F_LIVELLO));
|
||||||
if (_livelloprog == 1) //Se si tratta di una aliquota
|
if (_livelloprog == 1) //Se si tratta di una aliquota
|
||||||
{
|
{
|
||||||
_codivamsk = _msk->get(F_CODIVA);
|
_codivamsk = _msk->get(F_CODIVA);
|
||||||
_tipo_crmsk = atoi(_msk->get(F_TIPOTABE));
|
_tipo_crmsk = atoi(_msk->get(F_TIPOTABE));
|
||||||
}
|
}
|
||||||
else //altrimenti se si tratta di una attivita'
|
else //altrimenti se si tratta di una attivita'
|
||||||
{
|
{
|
||||||
_codattmsk = _msk->get(F_ATTIVITA);
|
_codattmsk = _msk->get(F_ATTIVITA);
|
||||||
_tipo_crmsk = atoi(_msk->get(F_TIPOTABEL));
|
_tipo_crmsk = atoi(_msk->get(F_TIPOTABEL));
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CG0400_application::preprocess_print(int file,int counter)
|
bool CG0400_application::preprocess_print(int file,int counter)
|
||||||
{
|
{
|
||||||
set_real_picture("###.###.###.###");
|
set_real_picture("###.###.###.###");
|
||||||
set_print_zero();
|
set_print_zero();
|
||||||
_totimponibile_v = 0;
|
_totimponibile_v = 0;
|
||||||
_totimposta_v = 0;
|
_totimposta_v = 0;
|
||||||
_totlordo_v = 0;
|
_totlordo_v = 0;
|
||||||
_totimponibile_vs = 0;
|
_totimponibile_vs = 0;
|
||||||
_totimposta_vs = 0;
|
_totimposta_vs = 0;
|
||||||
_totlordo_vs = 0;
|
_totlordo_vs = 0;
|
||||||
_totimponibile_acq = 0;
|
_totimponibile_acq = 0;
|
||||||
_totimposta_acq = 0;
|
_totimposta_acq = 0;
|
||||||
_totlordo_acq = 0;
|
_totlordo_acq = 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG0400_application::preprocess_page(int file, int counter)
|
bool CG0400_application::preprocess_page(int file, int counter)
|
||||||
{
|
{
|
||||||
const char* mese;
|
const char* mese;
|
||||||
reset_print();
|
reset_print();
|
||||||
|
|
||||||
if (counter)
|
if (counter)
|
||||||
_i++;
|
_i++;
|
||||||
else
|
else
|
||||||
_i = 1;
|
_i = 1;
|
||||||
|
|
||||||
fai_ricerca(_i);
|
fai_ricerca(_i);
|
||||||
mese = itom(_i);
|
mese = itom(_i);
|
||||||
set_row(1,"%s", mese);
|
set_row(1,"%s", mese);
|
||||||
if (_tipoprog == 1)
|
if (_tipoprog == 1)
|
||||||
{
|
{
|
||||||
if (_sospmsk == 1)
|
if (_sospmsk == 1)
|
||||||
{
|
{
|
||||||
set_row(1,"@16g%r", &_imponibile_v);
|
set_row(1,"@16g%r", &_imponibile_v);
|
||||||
set_row(1,"@32g%r", &_imposta_v);
|
set_row(1,"@32g%r", &_imposta_v);
|
||||||
if (_vuoilordi)
|
if (_vuoilordi)
|
||||||
set_row(1,"@48g%r", &_lordo_v);
|
set_row(1,"@48g%r", &_lordo_v);
|
||||||
}
|
}
|
||||||
else if (_sospmsk == 2)
|
else if (_sospmsk == 2)
|
||||||
{
|
{
|
||||||
set_row(1,"@16g%r", &_imponibile_vs);
|
set_row(1,"@16g%r", &_imponibile_vs);
|
||||||
set_row(1,"@32g%r", &_imposta_vs);
|
set_row(1,"@32g%r", &_imposta_vs);
|
||||||
if (_vuoilordi)
|
if (_vuoilordi)
|
||||||
set_row(1,"@48g%r",&_lordo_vs);
|
set_row(1,"@48g%r",&_lordo_vs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_tipoprog == 2)
|
else if (_tipoprog == 2)
|
||||||
{
|
{
|
||||||
set_row(1,"@16g%r", &_imponibile_acq);
|
set_row(1,"@16g%r", &_imponibile_acq);
|
||||||
set_row(1,"@32g%r", &_imposta_acq);
|
set_row(1,"@32g%r", &_imposta_acq);
|
||||||
if (_vuoilordi)
|
if (_vuoilordi)
|
||||||
set_row(1,"@48g%r", &_lordo_acq);
|
set_row(1,"@48g%r", &_lordo_acq);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_i == 12)
|
if (_i == 12)
|
||||||
{
|
{
|
||||||
TString dep = "";
|
TString dep = "";
|
||||||
set_row(2,(const char*) dep);
|
set_row(2,(const char*) dep);
|
||||||
set_row(3,"@10gTotale");
|
set_row(3,"@10gTotale");
|
||||||
if (_tipoprog == 1)
|
if (_tipoprog == 1)
|
||||||
{
|
{
|
||||||
if (_sospmsk == 1)
|
if (_sospmsk == 1)
|
||||||
{
|
{
|
||||||
set_row(3,"@16g%r", &_totimponibile_v);
|
set_row(3,"@16g%r", &_totimponibile_v);
|
||||||
set_row(3,"@32g%r", &_totimposta_v);
|
set_row(3,"@32g%r", &_totimposta_v);
|
||||||
if (_vuoilordi)
|
if (_vuoilordi)
|
||||||
set_row(3,"@48g%r", &_totlordo_v);
|
set_row(3,"@48g%r", &_totlordo_v);
|
||||||
}
|
}
|
||||||
else if (_sospmsk == 2)
|
else if (_sospmsk == 2)
|
||||||
{
|
{
|
||||||
set_row(3,"@16g%r", &_totimponibile_vs);
|
set_row(3,"@16g%r", &_totimponibile_vs);
|
||||||
set_row(3,"@32g%r", &_totimposta_vs);
|
set_row(3,"@32g%r", &_totimposta_vs);
|
||||||
if (_vuoilordi)
|
if (_vuoilordi)
|
||||||
set_row(3,"@48g%r", &_totlordo_vs);
|
set_row(3,"@48g%r", &_totlordo_vs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_tipoprog == 2)
|
else if (_tipoprog == 2)
|
||||||
{
|
{
|
||||||
set_row(3,"@16g%r", &_totimponibile_acq);
|
set_row(3,"@16g%r", &_totimponibile_acq);
|
||||||
set_row(3,"@32g%r", &_totimposta_acq);
|
set_row(3,"@32g%r", &_totimposta_acq);
|
||||||
if (_vuoilordi)
|
if (_vuoilordi)
|
||||||
set_row(3,"@48g%r", &_totlordo_acq);
|
set_row(3,"@48g%r", &_totlordo_acq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRectype& look_com (const char * cod, TLocalisamfile *comuni)
|
TRectype& look_com (const char * cod, TLocalisamfile *comuni)
|
||||||
{
|
{
|
||||||
comuni->zero();
|
comuni->zero();
|
||||||
comuni->put(COM_COM, cod);
|
comuni->put(COM_COM, cod);
|
||||||
comuni->read();
|
comuni->read();
|
||||||
if (comuni->bad())
|
if (comuni->bad())
|
||||||
comuni->zero();
|
comuni->zero();
|
||||||
|
|
||||||
return comuni->curr();
|
return comuni->curr();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG0400_application::get_dati_ditta()
|
void CG0400_application::get_dati_ditta()
|
||||||
{
|
{
|
||||||
TLocalisamfile nditte(LF_NDITTE);
|
TLocalisamfile nditte(LF_NDITTE);
|
||||||
TLocalisamfile anag(LF_ANAG);
|
TLocalisamfile anag(LF_ANAG);
|
||||||
TString codanagr;
|
TString codanagr;
|
||||||
TString tipoa;
|
TString tipoa;
|
||||||
|
|
||||||
nditte.zero();
|
nditte.zero();
|
||||||
nditte.put(NDT_CODDITTA, get_firm());
|
nditte.put(NDT_CODDITTA, get_firm());
|
||||||
nditte.read();
|
nditte.read();
|
||||||
|
|
||||||
if (nditte.bad()) nditte.zero();
|
if (nditte.bad()) nditte.zero();
|
||||||
|
|
||||||
codanagr = nditte.get(NDT_CODANAGR);
|
codanagr = nditte.get(NDT_CODANAGR);
|
||||||
tipoa = nditte.get(NDT_TIPOA);
|
tipoa = nditte.get(NDT_TIPOA);
|
||||||
_ragsoc = nditte.get(NDT_RAGSOC);
|
_ragsoc = nditte.get(NDT_RAGSOC);
|
||||||
|
|
||||||
anag.setkey(1);
|
anag.setkey(1);
|
||||||
anag.zero();
|
anag.zero();
|
||||||
anag.put (ANA_TIPOA, tipoa);
|
anag.put (ANA_TIPOA, tipoa);
|
||||||
anag.put (ANA_CODANAGR, codanagr);
|
anag.put (ANA_CODANAGR, codanagr);
|
||||||
anag.read();
|
anag.read();
|
||||||
if (anag.bad()) anag.zero();
|
if (anag.bad()) anag.zero();
|
||||||
|
|
||||||
_cofi = anag.get(ANA_COFI);
|
_cofi = anag.get(ANA_COFI);
|
||||||
_paiva = anag.get(ANA_PAIV);
|
_paiva = anag.get(ANA_PAIV);
|
||||||
//_ragsoc = anag.get(ANA_RAGSOC);
|
//_ragsoc = anag.get(ANA_RAGSOC);
|
||||||
_comunefis = anag.get(ANA_COMRF);
|
_comunefis = anag.get(ANA_COMRF);
|
||||||
|
|
||||||
if (_comunefis.empty())
|
if (_comunefis.empty())
|
||||||
_comunefis = anag.get(ANA_COMRES);
|
_comunefis = anag.get(ANA_COMRES);
|
||||||
|
|
||||||
TRectype dep = look_com (_comunefis, _com);
|
TRectype dep = look_com (_comunefis, _com);
|
||||||
|
|
||||||
_comunefis = dep.get(COM_DENCOM);
|
_comunefis = dep.get(COM_DENCOM);
|
||||||
_provfis = dep.get(COM_PROVCOM);
|
_provfis = dep.get(COM_PROVCOM);
|
||||||
_cap = dep.get(COM_CAPCOM);
|
_cap = dep.get(COM_CAPCOM);
|
||||||
if (_comunefis.empty())
|
if (_comunefis.empty())
|
||||||
{
|
{
|
||||||
_viafis = anag.get(ANA_INDRF);
|
_viafis = anag.get(ANA_INDRF);
|
||||||
_viafis.rtrim();
|
_viafis.rtrim();
|
||||||
_viafis << " " << anag.get (ANA_CIVRF);
|
_viafis << " " << anag.get (ANA_CIVRF);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_viafis = anag.get(ANA_INDRES);
|
_viafis = anag.get(ANA_INDRES);
|
||||||
_viafis.rtrim();
|
_viafis.rtrim();
|
||||||
_viafis << " " << anag.get (ANA_CIVRES);
|
_viafis << " " << anag.get (ANA_CIVRES);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int CG0400_application::stampa_intestazione_ditta()
|
int CG0400_application::stampa_intestazione_ditta()
|
||||||
{
|
{
|
||||||
int r = 3;
|
int r = 3;
|
||||||
TString codice_ditta;
|
TString codice_ditta;
|
||||||
TString riga(132);
|
TString riga(132);
|
||||||
|
|
||||||
get_dati_ditta();
|
get_dati_ditta();
|
||||||
codice_ditta << get_firm();
|
codice_ditta << get_firm();
|
||||||
|
|
||||||
set_header (r, "Ditta %s %s Via %s %s %s %s", (const char*)codice_ditta,
|
set_header (r, "Ditta %s %s Via %s %s %s %s", (const char*)codice_ditta,
|
||||||
(const char*)_ragsoc, (const char*)_viafis,
|
(const char*)_ragsoc, (const char*)_viafis,
|
||||||
(const char*)_cap, (const char*)_comunefis,
|
(const char*)_cap, (const char*)_comunefis,
|
||||||
(const char*)_provfis);
|
(const char*)_provfis);
|
||||||
r++;
|
r++;
|
||||||
printer().setdate(_data);
|
printer().setdate(_data);
|
||||||
riga = "Data @< Pag. @#";
|
riga = "Data @< Pag. @#";
|
||||||
riga.right_just(127);
|
riga.right_just(127);
|
||||||
riga.overwrite (format ("Partita iva %s Codice fiscale %s", (const char*)_paiva, (const char*)_cofi));
|
riga.overwrite (format ("Partita iva %s Codice fiscale %s", (const char*)_paiva, (const char*)_cofi));
|
||||||
set_header (r, "%s", (const char*) riga);
|
set_header (r, "%s", (const char*) riga);
|
||||||
r++;
|
r++;
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG0400_application::preprocess_header()
|
void CG0400_application::preprocess_header()
|
||||||
{
|
{
|
||||||
int r = 1;
|
int r = 1;
|
||||||
|
|
||||||
reset_header();
|
reset_header();
|
||||||
if (_livelloprog == 1)
|
if (_livelloprog == 1)
|
||||||
set_header(1, "@30gProgressivi IVA per Aliquota");
|
set_header(1, "@30gProgressivi IVA per Aliquota");
|
||||||
else set_header(1, "@30gProgressivi IVA per Attivita'");
|
else set_header(1, "@30gProgressivi IVA per Attivita'");
|
||||||
|
|
||||||
r = stampa_intestazione_ditta();
|
r = stampa_intestazione_ditta();
|
||||||
|
|
||||||
if (_tipoprog == 1)
|
if (_tipoprog == 1)
|
||||||
set_header(r, "Vendite");
|
set_header(r, "Vendite");
|
||||||
else set_header(r, "Acquisti");
|
else set_header(r, "Acquisti");
|
||||||
if (_livelloprog == 1)
|
if (_livelloprog == 1)
|
||||||
set_header(r++, "@10gIVA %s",(const char*) _codivamsk);
|
set_header(r++, "@10gIVA %s",(const char*) _codivamsk);
|
||||||
else set_header(r++, "@10gCod.attivita' %s",(const char*)_codattmsk);
|
else set_header(r++, "@10gCod.attivita' %s",(const char*)_codattmsk);
|
||||||
r++;
|
r++;
|
||||||
if (_vuoilordi)
|
if (_vuoilordi)
|
||||||
set_header(r, "@21gImponibile@40gImposta@50gImporto lordo");
|
set_header(r, "@21gImponibile@40gImposta@50gImporto lordo");
|
||||||
else set_header(r, "@21gImponibile@40gImposta");
|
else set_header(r, "@21gImponibile@40gImposta");
|
||||||
}
|
}
|
||||||
|
|
||||||
print_action CG0400_application::postprocess_page(int file, int counter)
|
print_action CG0400_application::postprocess_page(int file, int counter)
|
||||||
{
|
{
|
||||||
if (_i < 12) return REPEAT_PAGE;
|
if (_i < 12) return REPEAT_PAGE;
|
||||||
else return NEXT_PAGE;
|
else return NEXT_PAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cg0400(int argc,char* argv[])
|
int cg0400(int argc,char* argv[])
|
||||||
{
|
{
|
||||||
CG0400_application a;
|
CG0400_application a;
|
||||||
a.run(argc, argv, "Riepilogo progressivi IVA");
|
a.run(argc, argv, "Riepilogo progressivi IVA");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,12 +263,12 @@ bool CG0500_application::leggi_riga(int r, KEY k)
|
|||||||
|
|
||||||
bool filtra_reg(const TRelation * r)
|
bool filtra_reg(const TRelation * r)
|
||||||
{
|
{
|
||||||
TFixed_string codtab(r->lfile()->get("CODTAB"));
|
TFixed_string codtab(r->lfile().get("CODTAB"));
|
||||||
const int anno = atoi(codtab.cut(4));
|
const int anno = atoi(codtab.cut(4));
|
||||||
if (anno == anno_iva())
|
if (anno == anno_iva())
|
||||||
{
|
{
|
||||||
const int tiporeg = r->lfile()->get_int("I0");
|
const int tiporeg = r->lfile().get_int("I0");
|
||||||
const bool corrisp = r->lfile()->get_bool("B0");
|
const bool corrisp = r->lfile().get_bool("B0");
|
||||||
|
|
||||||
switch (app()->_filtro)
|
switch (app()->_filtro)
|
||||||
{
|
{
|
||||||
@ -430,7 +430,7 @@ bool CG0500_application::codcausim_hndl (TMask_field& f, KEY k)
|
|||||||
if (f.to_check(k))
|
if (f.to_check(k))
|
||||||
{
|
{
|
||||||
const TString16 causim(f.get());
|
const TString16 causim(f.get());
|
||||||
TLocalisamfile& caus = *app()->_rel->lfile(LF_CAUSALI);
|
TLocalisamfile& caus = app()->_rel->lfile(LF_CAUSALI);
|
||||||
caus.zero();
|
caus.zero();
|
||||||
caus.put(CAU_CODCAUS, causim);
|
caus.put(CAU_CODCAUS, causim);
|
||||||
if (caus.read() == NOERR)
|
if (caus.read() == NOERR)
|
||||||
@ -847,7 +847,7 @@ void CG0500_application::read_rcaus(TMask& m)
|
|||||||
TString d(50), da(3), civa(3);
|
TString d(50), da(3), civa(3);
|
||||||
char sz, cf;
|
char sz, cf;
|
||||||
bool riva;
|
bool riva;
|
||||||
TLocalisamfile * rcaus = _rel->lfile(LF_RCAUSALI);
|
TLocalisamfile& rcaus = _rel->lfile(LF_RCAUSALI);
|
||||||
|
|
||||||
_rel->update(); // chiamo position_rels()
|
_rel->update(); // chiamo position_rels()
|
||||||
|
|
||||||
@ -857,18 +857,18 @@ void CG0500_application::read_rcaus(TMask& m)
|
|||||||
bool ok = _rel->is_first_match(LF_RCAUSALI);
|
bool ok = _rel->is_first_match(LF_RCAUSALI);
|
||||||
while (ok)
|
while (ok)
|
||||||
{
|
{
|
||||||
numrig = rcaus->get_int(RCA_NRIGA);
|
numrig = rcaus.get_int(RCA_NRIGA);
|
||||||
CHECK(numrig > 0, "Causale con numero riga nullo");
|
CHECK(numrig > 0, "Causale con numero riga nullo");
|
||||||
g = rcaus->get_int(RCA_GRUPPO);
|
g = rcaus.get_int(RCA_GRUPPO);
|
||||||
c = rcaus->get_int(RCA_CONTO);
|
c = rcaus.get_int(RCA_CONTO);
|
||||||
s = rcaus->get_long(RCA_SOTTOCONTO);
|
s = rcaus.get_long(RCA_SOTTOCONTO);
|
||||||
sz = rcaus->get_char(RCA_SEZIONE);
|
sz = rcaus.get_char(RCA_SEZIONE);
|
||||||
d = rcaus->get(RCA_DESC);
|
d = rcaus.get(RCA_DESC);
|
||||||
da = rcaus->get(RCA_CODDESC);
|
da = rcaus.get(RCA_CODDESC);
|
||||||
// cf = rcaus->get(RCA_TIPOCF)[0];
|
// cf = rcaus.get(RCA_TIPOCF)[0];
|
||||||
cf = rcaus->get_char(RCA_TIPOCF);
|
cf = rcaus.get_char(RCA_TIPOCF);
|
||||||
riva = rcaus->get_bool(RCA_RIGAIVA);
|
riva = rcaus.get_bool(RCA_RIGAIVA);
|
||||||
civa = rcaus->get(RCA_CODIVA);
|
civa = rcaus.get(RCA_CODIVA);
|
||||||
TConto tc(g,c,s,cf);
|
TConto tc(g,c,s,cf);
|
||||||
|
|
||||||
add_riga(numrig-1, cf, sz, d, da, riva, civa, tc);
|
add_riga(numrig-1, cf, sz, d, da, riva, civa, tc);
|
||||||
@ -910,7 +910,7 @@ void CG0500_application::array2sheet()
|
|||||||
|
|
||||||
bool CG0500_application::descr2array(TMask& m, bool fromHandler)
|
bool CG0500_application::descr2array(TMask& m, bool fromHandler)
|
||||||
{
|
{
|
||||||
TLocalisamfile& caus = *_rel->lfile();
|
TLocalisamfile& caus = _rel->lfile();
|
||||||
TString16 tpd, codreg;
|
TString16 tpd, codreg;
|
||||||
int tpm, m770, tpr;
|
int tpm, m770, tpr;
|
||||||
|
|
||||||
@ -957,7 +957,7 @@ bool CG0500_application::descr2array(TMask& m, bool fromHandler)
|
|||||||
void CG0500_application::togli_dal_file(const TString& cau)
|
void CG0500_application::togli_dal_file(const TString& cau)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
TLocalisamfile *rcaus = _rel->lfile(LF_RCAUSALI);
|
TLocalisamfile &rcaus = _rel->lfile(LF_RCAUSALI);
|
||||||
long last = _righe_gia_presenti.last_one();
|
long last = _righe_gia_presenti.last_one();
|
||||||
long start = _righe_gia_presenti.first_one();
|
long start = _righe_gia_presenti.first_one();
|
||||||
|
|
||||||
@ -965,11 +965,11 @@ void CG0500_application::togli_dal_file(const TString& cau)
|
|||||||
{
|
{
|
||||||
if (_righe_gia_presenti[i])
|
if (_righe_gia_presenti[i])
|
||||||
{
|
{
|
||||||
rcaus->zero();
|
rcaus.zero();
|
||||||
rcaus->put(RCA_CODCAUS,cau);
|
rcaus.put(RCA_CODCAUS,cau);
|
||||||
rcaus->put(RCA_NRIGA, i);
|
rcaus.put(RCA_NRIGA, i);
|
||||||
// if (rcaus->read() == NOERR)
|
// if (rcaus.read() == NOERR)
|
||||||
rcaus->remove();
|
rcaus.remove();
|
||||||
_righe_gia_presenti.reset(i);
|
_righe_gia_presenti.reset(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -990,8 +990,8 @@ int CG0500_application::re_write(const TMask& m,bool rewrite)
|
|||||||
const TString16 cau(m.get(F_COD_CAUS));
|
const TString16 cau(m.get(F_COD_CAUS));
|
||||||
TString80 desc;
|
TString80 desc;
|
||||||
TString16 coddesc;
|
TString16 coddesc;
|
||||||
TLocalisamfile *caus = _rel->lfile(LF_CAUSALI);
|
TLocalisamfile &caus = _rel->lfile(LF_CAUSALI);
|
||||||
TLocalisamfile *rcaus = _rel->lfile(LF_RCAUSALI);
|
TLocalisamfile &rcaus = _rel->lfile(LF_RCAUSALI);
|
||||||
|
|
||||||
m.autosave(_rel);
|
m.autosave(_rel);
|
||||||
|
|
||||||
@ -1015,36 +1015,36 @@ int CG0500_application::re_write(const TMask& m,bool rewrite)
|
|||||||
|
|
||||||
if (g > 0 || c > 0 || s > 0L)
|
if (g > 0 || c > 0 || s > 0L)
|
||||||
{
|
{
|
||||||
rcaus->zero();
|
rcaus.zero();
|
||||||
rcaus->put (RCA_CODCAUS, (const char *)cau);
|
rcaus.put (RCA_CODCAUS, (const char *)cau);
|
||||||
rcaus->put (RCA_NRIGA, i+1); // Numerare da uno!
|
rcaus.put (RCA_NRIGA, i+1); // Numerare da uno!
|
||||||
rcaus->put (RCA_GRUPPO , g);
|
rcaus.put (RCA_GRUPPO , g);
|
||||||
rcaus->put (RCA_CONTO , c);
|
rcaus.put (RCA_CONTO , c);
|
||||||
rcaus->put (RCA_SOTTOCONTO, s);
|
rcaus.put (RCA_SOTTOCONTO, s);
|
||||||
rcaus->put (RCA_SEZIONE, sezione);
|
rcaus.put (RCA_SEZIONE, sezione);
|
||||||
rcaus->put (RCA_DESC , (const char *)desc);
|
rcaus.put (RCA_DESC , (const char *)desc);
|
||||||
rcaus->put (RCA_CODDESC, (const char *)coddesc);
|
rcaus.put (RCA_CODDESC, (const char *)coddesc);
|
||||||
rcaus->put (RCA_TIPOCF, tipo_cf);
|
rcaus.put (RCA_TIPOCF, tipo_cf);
|
||||||
if (rewrite) {
|
if (rewrite) {
|
||||||
if (_righe_gia_presenti[i+1]) {
|
if (_righe_gia_presenti[i+1]) {
|
||||||
rcaus->rewrite();
|
rcaus.rewrite();
|
||||||
_righe_gia_presenti.reset(i+1);
|
_righe_gia_presenti.reset(i+1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rcaus->write();
|
rcaus.write();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rcaus->write();
|
rcaus.write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rewrite)
|
if (rewrite)
|
||||||
{
|
{
|
||||||
togli_dal_file(cau); // Elimina dal file le righe rimaste nel bitarray
|
togli_dal_file(cau); // Elimina dal file le righe rimaste nel bitarray
|
||||||
return caus->rewrite();
|
return caus.rewrite();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return caus->write();
|
return caus.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1053,8 +1053,8 @@ bool CG0500_application::remove()
|
|||||||
const bool ok = TRelation_application::remove();
|
const bool ok = TRelation_application::remove();
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
const TString cod(_rel->lfile()->get(RCA_CODCAUS));
|
const TString cod(_rel->lfile().get(RCA_CODCAUS));
|
||||||
TLocalisamfile& rcaus = *_rel->lfile(LF_RCAUSALI);
|
TLocalisamfile& rcaus = _rel->lfile(LF_RCAUSALI);
|
||||||
rcaus.zero();
|
rcaus.zero();
|
||||||
rcaus.put(RCA_CODCAUS, cod);
|
rcaus.put(RCA_CODCAUS, cod);
|
||||||
int e = rcaus.read(_isgteq);
|
int e = rcaus.read(_isgteq);
|
||||||
|
@ -83,7 +83,7 @@ BEGIN
|
|||||||
OUTPUT F_CORRISP B0
|
OUTPUT F_CORRISP B0
|
||||||
HELP "Codice registro"
|
HELP "Codice registro"
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
FLAGS "D"
|
FLAGS "DU"
|
||||||
END
|
END
|
||||||
|
|
||||||
// Questo rimane sempre nascosto
|
// Questo rimane sempre nascosto
|
||||||
@ -201,6 +201,7 @@ END
|
|||||||
STRING F_COD_CAUS_IM 3
|
STRING F_COD_CAUS_IM 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 34 6 "Codice causale per l'incasso immediato "
|
PROMPT 34 6 "Codice causale per l'incasso immediato "
|
||||||
|
FLAGS "U"
|
||||||
FIELD LF_CAUSALI->CODCAUSIM
|
FIELD LF_CAUSALI->CODCAUSIM
|
||||||
COPY USE F_COD_CAUS
|
COPY USE F_COD_CAUS
|
||||||
INPUT CODCAUS F_COD_CAUS_IM
|
INPUT CODCAUS F_COD_CAUS_IM
|
||||||
|
196
cg/cg1300.cpp
196
cg/cg1300.cpp
@ -1,98 +1,98 @@
|
|||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
class TEdit_form : public TApplication
|
class TEdit_form : public TApplication
|
||||||
{
|
{
|
||||||
const char* _name;
|
const char* _name;
|
||||||
TMaskmode _mode;
|
TMaskmode _mode;
|
||||||
TForm* _form;
|
TForm* _form;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
virtual bool destroy();
|
virtual bool destroy();
|
||||||
virtual bool menu(MENU_TAG);
|
virtual bool menu(MENU_TAG);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TEdit_form(const char* name, TMaskmode mode);
|
TEdit_form(const char* name, TMaskmode mode);
|
||||||
const char* name() const { return _name; }
|
const char* name() const { return _name; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
TEdit_form::TEdit_form(const char* name, TMaskmode mode)
|
TEdit_form::TEdit_form(const char* name, TMaskmode mode)
|
||||||
: _name(name), _mode(mode), _form(NULL)
|
: _name(name), _mode(mode), _form(NULL)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
bool TEdit_form::create()
|
bool TEdit_form::create()
|
||||||
{
|
{
|
||||||
_form = new TForm(name());
|
_form = new TForm(name());
|
||||||
dispatch_e_menu(MENU_ITEM(2));
|
dispatch_e_menu(MENU_ITEM(2));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TEdit_form::destroy()
|
bool TEdit_form::destroy()
|
||||||
{
|
{
|
||||||
delete _form;
|
delete _form;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TEdit_form::menu(MENU_TAG tag)
|
bool TEdit_form::menu(MENU_TAG tag)
|
||||||
{
|
{
|
||||||
int sec = 1;
|
int sec = 1;
|
||||||
switch(tag)
|
switch(tag)
|
||||||
{
|
{
|
||||||
case MENU_ITEM(1): sec = 0; break;
|
case MENU_ITEM(1): sec = 0; break;
|
||||||
case MENU_ITEM(3): sec = 2; break;
|
case MENU_ITEM(3): sec = 2; break;
|
||||||
default : sec = 1; break;
|
default : sec = 1; break;
|
||||||
}
|
}
|
||||||
_form->edit(_mode, sec);
|
_form->edit(_mode, sec);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int cg1300(int argc, char* argv[])
|
int cg1300(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
if (argc < 3)
|
if (argc < 3)
|
||||||
{
|
{
|
||||||
error_box("Specificare il nome del profilo di stampa");
|
error_box("Specificare il nome del profilo di stampa");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TFilename form(argv[2]); form.ext("frm");
|
TFilename form(argv[2]); form.ext("frm");
|
||||||
|
|
||||||
const char mode = argc > 3 ? toupper(argv[3][1]) : ' ';
|
const char mode = argc > 3 ? toupper(argv[3][1]) : ' ';
|
||||||
|
|
||||||
const bool crea = (mode == 'C') || !fexist(form);
|
const bool crea = (mode == 'C') || !fexist(form);
|
||||||
if (crea)
|
if (crea)
|
||||||
{
|
{
|
||||||
TFilename base(form.left(3)); base.ext("frm");
|
TFilename base(form.left(3)); base.ext("frm");
|
||||||
if (!fexist(base))
|
if (!fexist(base))
|
||||||
{
|
{
|
||||||
error_box("Non esiste il file %s", (const char*)base);
|
error_box("Non esiste il file %s", (const char*)base);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (!fcopy(base, form))
|
if (!fcopy(base, form))
|
||||||
{
|
{
|
||||||
error_box("Impossibile copiare %s in %s", (const char*)base, (const char*)form);
|
error_box("Impossibile copiare %s in %s", (const char*)base, (const char*)form);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fexist(form))
|
if (!fexist(form))
|
||||||
{
|
{
|
||||||
error_box("Non esiste il file %s", (const char*)form);
|
error_box("Non esiste il file %s", (const char*)form);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEdit_form a(form, (mode == 'I') ? MODE_INS : MODE_MOD);
|
TEdit_form a(form, (mode == 'I') ? MODE_INS : MODE_MOD);
|
||||||
TString title(40);
|
TString title(40);
|
||||||
title << "Modifica modello: " << a.name();
|
title << "Modifica modello: " << a.name();
|
||||||
a.run(argc, argv, title);
|
a.run(argc, argv, title);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -276,13 +276,13 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
|||||||
chiave = d; chiave << format("%04d%02d%d", _anno, _mese, _tipo);
|
chiave = d; chiave << format("%04d%02d%d", _anno, _mese, _tipo);
|
||||||
delega.put("CODTAB", chiave);
|
delega.put("CODTAB", chiave);
|
||||||
|
|
||||||
f.cursor()->file()->read();
|
f.cursor()->file().read();
|
||||||
const bool cera = atoi(delega.get("S7")) != 0;
|
const bool cera = atoi(delega.get("S7")) != 0;
|
||||||
if (!cera)
|
if (!cera)
|
||||||
{
|
{
|
||||||
delega.put("S7", _azienda);
|
delega.put("S7", _azienda);
|
||||||
delega.put("S8", _dipendenza);
|
delega.put("S8", _dipendenza);
|
||||||
f.cursor()->file()->rewrite();
|
f.cursor()->file().rewrite();
|
||||||
}
|
}
|
||||||
f.cursor()->read(); // Posiziona il cursore
|
f.cursor()->read(); // Posiziona il cursore
|
||||||
|
|
||||||
@ -303,7 +303,7 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
|||||||
scrivi = TRUE;
|
scrivi = TRUE;
|
||||||
}
|
}
|
||||||
if (scrivi)
|
if (scrivi)
|
||||||
f.cursor()->file()->rewrite();
|
f.cursor()->file().rewrite();
|
||||||
}
|
}
|
||||||
printer().close();
|
printer().close();
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ bool CG1700_application::preprocess_page(int file,int count)
|
|||||||
switch (file)
|
switch (file)
|
||||||
{
|
{
|
||||||
case LF_CAUSALI:
|
case LF_CAUSALI:
|
||||||
cau_descr = current_cursor()->file(LF_CAUSALI)->get(CAU_DESCR);
|
cau_descr = current_cursor()->file(LF_CAUSALI).get(CAU_DESCR);
|
||||||
*_descr_causale = (const char*) cau_descr;
|
*_descr_causale = (const char*) cau_descr;
|
||||||
setta_righe_descr(_descr_causale,causale);
|
setta_righe_descr(_descr_causale,causale);
|
||||||
set_row(1, "@0g@3s", FLD(LF_CAUSALI,CAU_CODCAUS));
|
set_row(1, "@0g@3s", FLD(LF_CAUSALI,CAU_CODCAUS));
|
||||||
@ -196,7 +196,7 @@ bool CG1700_application::preprocess_page(int file,int count)
|
|||||||
set_row(1, "@130g@f", FLD(LF_CAUSALI,CAU_RITFATT));
|
set_row(1, "@130g@f", FLD(LF_CAUSALI,CAU_RITFATT));
|
||||||
break;
|
break;
|
||||||
case LF_RCAUSALI:
|
case LF_RCAUSALI:
|
||||||
rcau_descr = current_cursor()->file(LF_RCAUSALI)->get(RCA_DESC);
|
rcau_descr = current_cursor()->file(LF_RCAUSALI).get(RCA_DESC);
|
||||||
*_descr_conto = (const char*) rcau_descr;
|
*_descr_conto = (const char*) rcau_descr;
|
||||||
setta_righe_descr(_descr_conto,conto);
|
setta_righe_descr(_descr_conto,conto);
|
||||||
set_row (1, "@35g@3n", FLD(LF_RCAUSALI,RCA_GRUPPO));
|
set_row (1, "@35g@3n", FLD(LF_RCAUSALI,RCA_GRUPPO));
|
||||||
|
28
cg/cg2.cpp
28
cg/cg2.cpp
@ -1,10 +1,18 @@
|
|||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
|
|
||||||
#include "cg2.h"
|
#include "cg2.h"
|
||||||
|
|
||||||
int main(int argc,char** argv)
|
int main(int argc,char** argv)
|
||||||
{
|
{
|
||||||
return cg2100(argc,argv) ;
|
const int n = (argc > 1) ? (argv[1][1]-'0') : 0;
|
||||||
}
|
switch(n)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
cg2200(argc, argv); break;
|
||||||
|
default:
|
||||||
|
cg2100(argc,argv); break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
1
cg/cg2.h
1
cg/cg2.h
@ -2,6 +2,7 @@
|
|||||||
#define __CG2_H
|
#define __CG2_H
|
||||||
|
|
||||||
int cg2100(int argc, char** argv);
|
int cg2100(int argc, char** argv);
|
||||||
|
int cg2200(int argc, char** argv);
|
||||||
|
|
||||||
#endif // __CG2_H
|
#endif // __CG2_H
|
||||||
|
|
||||||
|
14
cg/cg2.url
14
cg/cg2.url
@ -1,4 +1,10 @@
|
|||||||
#include <default.url>
|
#include <default.url>
|
||||||
|
|
||||||
MENU TASK_MENUBAR
|
MENU TASK_MENUBAR
|
||||||
SUBMENU MENU_FILE "~File"
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
||||||
|
MENUBAR MENU_BAR(1)
|
||||||
|
|
||||||
|
MENU MENU_BAR(1)
|
||||||
|
SUBMENU MENU_FILE "~File"
|
||||||
|
|
||||||
|
@ -118,8 +118,8 @@ bool TPrimanota_application::user_create()
|
|||||||
_nditte = new TLocalisamfile(LF_NDITTE);
|
_nditte = new TLocalisamfile(LF_NDITTE);
|
||||||
|
|
||||||
_rel = new TMovimentoPN;
|
_rel = new TMovimentoPN;
|
||||||
_rel->lfile()->last();
|
_rel->lfile().last();
|
||||||
_lastreg = _rel->lfile()->get_long(MOV_NUMREG); // Init last registration number
|
_lastreg = _rel->lfile().get_long(MOV_NUMREG); // Init last registration number
|
||||||
|
|
||||||
set_search_field(F_NUMREG); // Set field for default search
|
set_search_field(F_NUMREG); // Set field for default search
|
||||||
|
|
||||||
@ -204,9 +204,9 @@ bool TPrimanota_application::changing_mask(int mode)
|
|||||||
read_caus(causale, annoiva);
|
read_caus(causale, annoiva);
|
||||||
break;
|
break;
|
||||||
case MODE_MOD:
|
case MODE_MOD:
|
||||||
annoes = _rel->lfile()->get_int("ANNOES");
|
annoes = _rel->lfile().get_int("ANNOES");
|
||||||
annoiva = _rel->lfile()->get_int("ANNOIVA");
|
annoiva = _rel->lfile().get_int("ANNOIVA");
|
||||||
causale = _rel->lfile()->get("CODCAUS");
|
causale = _rel->lfile().get("CODCAUS");
|
||||||
giornale().read(annoes);
|
giornale().read(annoes);
|
||||||
read_caus(causale, annoiva);
|
read_caus(causale, annoiva);
|
||||||
break;
|
break;
|
||||||
@ -304,7 +304,7 @@ void TPrimanota_application::init_insert_mode(TMask& m)
|
|||||||
|
|
||||||
init_mask(m);
|
init_mask(m);
|
||||||
_saldi.reset(); // Inizializza saldi
|
_saldi.reset(); // Inizializza saldi
|
||||||
_saldi.set_movprovv(_rel->lfile()->get_char("PROVVIS") > ' ' ? TRUE : FALSE);
|
_saldi.set_movprovv(_rel->lfile().get_char("PROVVIS") > ' ' ? TRUE : FALSE);
|
||||||
_saldi.set_movap(_causale.apertura());
|
_saldi.set_movap(_causale.apertura());
|
||||||
_saldi.set_anno_es(m.get_int(F_ANNOES));
|
_saldi.set_anno_es(m.get_int(F_ANNOES));
|
||||||
_saldi.set_num_ulmov(m.get_long(F_NUMREG));
|
_saldi.set_num_ulmov(m.get_long(F_NUMREG));
|
||||||
@ -336,7 +336,7 @@ void TPrimanota_application::init_insert_mode(TMask& m)
|
|||||||
const int nriga = rcaus->get_int(RCA_NRIGA);
|
const int nriga = rcaus->get_int(RCA_NRIGA);
|
||||||
if (nriga < 1) continue; // Considera solo righe reali (non riempimenti)
|
if (nriga < 1) continue; // Considera solo righe reali (non riempimenti)
|
||||||
|
|
||||||
TConto tc; _causale.bill(nriga, tc);
|
TBill tc; _causale.bill(nriga, tc);
|
||||||
if (tc.conto() < 1) continue; // Considera solo conti validi
|
if (tc.conto() < 1) continue; // Considera solo conti validi
|
||||||
|
|
||||||
char sezione = rcaus->get_char(RCA_SEZIONE);
|
char sezione = rcaus->get_char(RCA_SEZIONE);
|
||||||
@ -382,14 +382,14 @@ void TPrimanota_application::init_modify_mode(TMask& m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TPrimanota_application::get_conto(const TRectype& r, TConto& c) const
|
bool TPrimanota_application::get_conto(const TRectype& r, TBill& c) const
|
||||||
{
|
{
|
||||||
c.set(r.get_int("GRUPPO"), r.get_int("CONTO"),
|
c.set(r.get_int("GRUPPO"), r.get_int("CONTO"),
|
||||||
r.get_long("SOTTOCONTO"), r.get_char("TIPOC"));
|
r.get_long("SOTTOCONTO"), r.get_char("TIPOC"));
|
||||||
return c.ok();
|
return c.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPrimanota_application::put_conto(TRectype& r, const TConto& c) const
|
void TPrimanota_application::put_conto(TRectype& r, const TBill& c) const
|
||||||
{
|
{
|
||||||
r.put("TIPOC", c.tipo());
|
r.put("TIPOC", c.tipo());
|
||||||
r.put("GRUPPO", c.gruppo());
|
r.put("GRUPPO", c.gruppo());
|
||||||
@ -413,7 +413,7 @@ int TPrimanota_application::read(TMask& m)
|
|||||||
|
|
||||||
if (_iva != nessuna_iva)
|
if (_iva != nessuna_iva)
|
||||||
{
|
{
|
||||||
const TString16 occode(_rel->lfile()->get("OCFPI"));
|
const TString16 occode(_rel->lfile().get("OCFPI"));
|
||||||
occas_mask().set(O_CODICE, occode);
|
occas_mask().set(O_CODICE, occode);
|
||||||
|
|
||||||
const char clifo = toupper(m.get(F_CLIFO)[0]);
|
const char clifo = toupper(m.get(F_CLIFO)[0]);
|
||||||
@ -434,7 +434,7 @@ int TPrimanota_application::read(TMask& m)
|
|||||||
cgs.reset();
|
cgs.reset();
|
||||||
|
|
||||||
_saldi.reset(); // Azzera saldi
|
_saldi.reset(); // Azzera saldi
|
||||||
_saldi.set_movprovv(_rel->lfile()->get_char("PROVVIS") > ' ' ? TRUE : FALSE);
|
_saldi.set_movprovv(_rel->lfile().get_char("PROVVIS") > ' ' ? TRUE : FALSE);
|
||||||
_saldi.set_movap(_causale.apertura());
|
_saldi.set_movap(_causale.apertura());
|
||||||
_saldi.set_anno_es(m.get_int(F_ANNOES));
|
_saldi.set_anno_es(m.get_int(F_ANNOES));
|
||||||
_saldi.set_num_ulmov(m.get_long(F_NUMREG));
|
_saldi.set_num_ulmov(m.get_long(F_NUMREG));
|
||||||
@ -506,7 +506,7 @@ int TPrimanota_application::read(TMask& m)
|
|||||||
riga.add(r.get("TIPODET")); // Detrazione 103
|
riga.add(r.get("TIPODET")); // Detrazione 103
|
||||||
riga.add(r.get("IMPOSTA")); // Imposta 104
|
riga.add(r.get("IMPOSTA")); // Imposta 104
|
||||||
|
|
||||||
TConto c; get_conto(r, c);
|
TBill c; get_conto(r, c);
|
||||||
if (c.ok())
|
if (c.ok())
|
||||||
c.add_to(riga, 4, 0x7); // 105-110
|
c.add_to(riga, 4, 0x7); // 105-110
|
||||||
else
|
else
|
||||||
@ -525,7 +525,7 @@ int TPrimanota_application::read(TMask& m)
|
|||||||
|
|
||||||
void TPrimanota_application::mask2rel(const TMask& m)
|
void TPrimanota_application::mask2rel(const TMask& m)
|
||||||
{
|
{
|
||||||
_rel->lfile()->zero();
|
_rel->lfile().zero();
|
||||||
m.autosave(_rel);
|
m.autosave(_rel);
|
||||||
|
|
||||||
const long numreg = m.get_long(F_NUMREG);
|
const long numreg = m.get_long(F_NUMREG);
|
||||||
@ -571,7 +571,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
|||||||
r.put("DESCR", row.get()); // Descrizione riga
|
r.put("DESCR", row.get()); // Descrizione riga
|
||||||
|
|
||||||
int rcontr = 0; // Riga contropartita
|
int rcontr = 0; // Riga contropartita
|
||||||
const TConto contro(row, -1, 0x3); // Conto contropartita
|
const TBill contro(row, -1, 0x3); // Conto contropartita
|
||||||
if (contro.ok())
|
if (contro.ok())
|
||||||
{
|
{
|
||||||
rcontr = bill2contr(contro, n.sezione())+1;
|
rcontr = bill2contr(contro, n.sezione())+1;
|
||||||
@ -593,7 +593,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
|||||||
|
|
||||||
if (causale().corrispettivi())
|
if (causale().corrispettivi())
|
||||||
{
|
{
|
||||||
TRectype& rec = _rel->lfile()->curr();
|
TRectype& rec = _rel->lfile().curr();
|
||||||
rec.put("TIPO", "");
|
rec.put("TIPO", "");
|
||||||
rec.put("CODCF", ""); // Azzera il cliente nei movimenti dei corrispettivi
|
rec.put("CODCF", ""); // Azzera il cliente nei movimenti dei corrispettivi
|
||||||
}
|
}
|
||||||
@ -611,11 +611,11 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
|||||||
err = occas.rewrite();
|
err = occas.rewrite();
|
||||||
|
|
||||||
if (err == NOERR)
|
if (err == NOERR)
|
||||||
_rel->lfile()->put("OCFPI", occas_mask().get(O_CODICE));
|
_rel->lfile().put("OCFPI", occas_mask().get(O_CODICE));
|
||||||
else
|
else
|
||||||
error_box("Errore di scrittura sul file dei clienti/fornitori occasionali: %d", err);
|
error_box("Errore di scrittura sul file dei clienti/fornitori occasionali: %d", err);
|
||||||
}
|
}
|
||||||
if (err) _rel->lfile()->zero("OCFPI");
|
if (err) _rel->lfile().zero("OCFPI");
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool to_swap = test_swap(FALSE);
|
const bool to_swap = test_swap(FALSE);
|
||||||
@ -642,7 +642,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
|||||||
r.put("IMPOSTA", row.get());
|
r.put("IMPOSTA", row.get());
|
||||||
r.put("TIPOCR", row.get());
|
r.put("TIPOCR", row.get());
|
||||||
|
|
||||||
const TConto c(row, -1, 0x1);
|
const TBill c(row, -1, 0x1);
|
||||||
const int rimp = bill2pos(c, 'I')+1;
|
const int rimp = bill2pos(c, 'I')+1;
|
||||||
r.put("RIGAIMP", rimp);
|
r.put("RIGAIMP", rimp);
|
||||||
put_conto(r, c);
|
put_conto(r, c);
|
||||||
@ -729,7 +729,7 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
|||||||
TRectype r(_rel->cg(0)); // Copia la prima riga contabile
|
TRectype r(_rel->cg(0)); // Copia la prima riga contabile
|
||||||
m.autosave(&inc);
|
m.autosave(&inc);
|
||||||
|
|
||||||
inc.lfile()->put("REG", ""); // Annulla eventuale registro IVA
|
inc.lfile().put("REG", ""); // Annulla eventuale registro IVA
|
||||||
|
|
||||||
const real imp(m.get(F_TOTALE));
|
const real imp(m.get(F_TOTALE));
|
||||||
const char sez = r.get_char("SEZIONE");
|
const char sez = r.get_char("SEZIONE");
|
||||||
@ -741,7 +741,7 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
|||||||
r.put("SEZIONE", sez == 'A' ? 'D' : 'A');
|
r.put("SEZIONE", sez == 'A' ? 'D' : 'A');
|
||||||
inc.cg(0) = r;
|
inc.cg(0) = r;
|
||||||
|
|
||||||
TConto conto; caus.bill(2, conto); // Conto della seconda riga della causale
|
TBill conto; caus.bill(2, conto); // Conto della seconda riga della causale
|
||||||
|
|
||||||
r.put("TIPOC", conto.tipo());
|
r.put("TIPOC", conto.tipo());
|
||||||
r.put("GRUPPO", conto.gruppo());
|
r.put("GRUPPO", conto.gruppo());
|
||||||
@ -753,7 +753,7 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
|||||||
inc.cg(1) = r;
|
inc.cg(1) = r;
|
||||||
|
|
||||||
while (inc.write() == _isreinsert) // In caso di riscrittura
|
while (inc.write() == _isreinsert) // In caso di riscrittura
|
||||||
inc.lfile()->put("NUMREG", ++_lastreg); // Incrementa numero registrazione
|
inc.lfile().put("NUMREG", ++_lastreg); // Incrementa numero registrazione
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
416
cg/cg2100b.uml
416
cg/cg2100b.uml
@ -1,208 +1,208 @@
|
|||||||
#include "cg2100.h"
|
#include "cg2100.h"
|
||||||
|
|
||||||
TOOLBAR "" 0 20 0 2
|
TOOLBAR "" 0 20 0 2
|
||||||
|
|
||||||
#include <toolbar.h>
|
#include <toolbar.h>
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "OPERAZIONE DI PRIMA NOTA" -1 -1 77 20
|
PAGE "OPERAZIONE DI PRIMA NOTA" -1 -1 77 20
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 3
|
GROUPBOX DLG_NULL 78 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 0 "@BMovimento di sola contabilita'"
|
PROMPT 1 0 "@BMovimento di sola contabilita'"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_CODDITTA 5
|
NUMBER F_CODDITTA 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 3 1 "Ditta "
|
PROMPT 3 1 "Ditta "
|
||||||
FLAGS "FRD"
|
FLAGS "FRD"
|
||||||
USE LF_NDITTE KEY 1
|
USE LF_NDITTE KEY 1
|
||||||
INPUT CODDITTA F_CODDITTA
|
INPUT CODDITTA F_CODDITTA
|
||||||
DISPLAY "Codice" CODDITTA
|
DISPLAY "Codice" CODDITTA
|
||||||
OUTPUT F_RAGSOC RAGSOC
|
OUTPUT F_RAGSOC RAGSOC
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_RAGSOC 50
|
STRING F_RAGSOC 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 17 1 "Ragione "
|
PROMPT 17 1 "Ragione "
|
||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_NUMREG 7
|
NUMBER F_NUMREG 7
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 57 3 "Operazione n."
|
PROMPT 57 3 "Operazione n."
|
||||||
FIELD NUMREG
|
FIELD NUMREG
|
||||||
FLAGS "RD"
|
FLAGS "RD"
|
||||||
KEY 1
|
KEY 1
|
||||||
END
|
END
|
||||||
|
|
||||||
DATE F_DATAREG
|
DATE F_DATAREG
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 3 "Data operazione "
|
PROMPT 1 3 "Data operazione "
|
||||||
FIELD DATAREG
|
FIELD DATAREG
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
DATE F_DATACOMP
|
DATE F_DATACOMP
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 4 "Data di competenza "
|
PROMPT 1 4 "Data di competenza "
|
||||||
FIELD DATACOMP
|
FIELD DATACOMP
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_ANNOES 4
|
NUMBER F_ANNOES 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 57 4 "Esercizio "
|
PROMPT 57 4 "Esercizio "
|
||||||
FIELD ANNOES
|
FIELD ANNOES
|
||||||
FLAGS "DRZ"
|
FLAGS "DRZ"
|
||||||
END
|
END
|
||||||
|
|
||||||
DATE F_DATADOC
|
DATE F_DATADOC
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 5 "Data del documento "
|
PROMPT 1 5 "Data del documento "
|
||||||
FIELD DATADOC
|
FIELD DATADOC
|
||||||
WARNING "Specificare una data del documento non superiore a quella di registrazione"
|
WARNING "Specificare una data del documento non superiore a quella dell'operazione"
|
||||||
VALIDATE DATE_CMP_FUNC <= F_DATAREG
|
VALIDATE DATE_CMP_FUNC <= F_DATAREG
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_NUMDOC 7
|
STRING F_NUMDOC 7
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 57 5 "Documento n. "
|
PROMPT 57 5 "Documento n. "
|
||||||
FIELD NUMDOC
|
FIELD NUMDOC
|
||||||
WARNING "La causale impone di specificare il numero documento"
|
WARNING "La causale impone di specificare il numero documento"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_ANNOIVA 4
|
NUMBER F_ANNOIVA 4
|
||||||
BEGIN
|
BEGIN
|
||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DESCAGG 5
|
STRING F_DESCAGG 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 6 "Descrizione "
|
PROMPT 1 6 "Descrizione "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE %DPN
|
USE %DPN
|
||||||
INPUT CODTAB F_DESCAGG
|
INPUT CODTAB F_DESCAGG
|
||||||
DISPLAY "Codice" CODTAB
|
DISPLAY "Codice" CODTAB
|
||||||
DISPLAY "Descrizione@50" S0
|
DISPLAY "Descrizione@50" S0
|
||||||
OUTPUT F_DESCAGG CODTAB
|
OUTPUT F_DESCAGG CODTAB
|
||||||
OUTPUT F_DESCR S0
|
OUTPUT F_DESCR S0
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DESCR 50
|
STRING F_DESCR 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 25 6 ""
|
PROMPT 25 6 ""
|
||||||
FIELD DESCR
|
FIELD DESCR
|
||||||
USE %DPN KEY 2
|
USE %DPN KEY 2
|
||||||
INPUT S0 F_DESCR
|
INPUT S0 F_DESCR
|
||||||
DISPLAY "Descrizione@50" S0
|
DISPLAY "Descrizione@50" S0
|
||||||
DISPLAY "Codice" CODTAB
|
DISPLAY "Codice" CODTAB
|
||||||
COPY OUTPUT F_DESCAGG
|
COPY OUTPUT F_DESCAGG
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST F_PROVVISORIO 1 25
|
LIST F_PROVVISORIO 1 25
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 7 "Movimento provvisorio "
|
PROMPT 1 7 "Movimento provvisorio "
|
||||||
FIELD PROVVIS
|
FIELD PROVVIS
|
||||||
ITEM " |No (movimento normale)"
|
ITEM " |No (movimento normale)"
|
||||||
ITEM "P|Si (cancellabile)"
|
ITEM "P|Si (cancellabile)"
|
||||||
ITEM "N|Si (non cancellabile)"
|
ITEM "N|Si (non cancellabile)"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_CODCAUS 3
|
STRING F_CODCAUS 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 8 "Causale "
|
PROMPT 1 8 "Causale "
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
FIELD CODCAUS
|
FIELD CODCAUS
|
||||||
USE LF_CAUSALI KEY 1
|
USE LF_CAUSALI KEY 1
|
||||||
INPUT CODCAUS F_CODCAUS
|
INPUT CODCAUS F_CODCAUS
|
||||||
DISPLAY "Codice" CODCAUS
|
DISPLAY "Codice" CODCAUS
|
||||||
DISPLAY "Descrizione@50" DESCR
|
DISPLAY "Descrizione@50" DESCR
|
||||||
OUTPUT F_CODCAUS CODCAUS
|
OUTPUT F_CODCAUS CODCAUS
|
||||||
OUTPUT F_DESCRCAUS DESCR
|
OUTPUT F_DESCRCAUS DESCR
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
ADD RUN cg0 -4
|
ADD RUN cg0 -4
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DESCRCAUS 50
|
STRING F_DESCRCAUS 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 23 8 ""
|
PROMPT 23 8 ""
|
||||||
USE LF_CAUSALI KEY 2
|
USE LF_CAUSALI KEY 2
|
||||||
INPUT DESCR F_DESCRCAUS
|
INPUT DESCR F_DESCRCAUS
|
||||||
DISPLAY "Descrizione@50" DESCR
|
DISPLAY "Descrizione@50" DESCR
|
||||||
DISPLAY "Codice" CODCAUS
|
DISPLAY "Codice" CODCAUS
|
||||||
COPY OUTPUT F_CODCAUS
|
COPY OUTPUT F_CODCAUS
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_VALUTA 3
|
STRING F_VALUTA 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 9 "Valuta "
|
PROMPT 1 9 "Valuta "
|
||||||
FIELD CODVAL
|
FIELD CODVAL
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
USE %VAL
|
USE %VAL
|
||||||
INPUT CODTAB F_VALUTA
|
INPUT CODTAB F_VALUTA
|
||||||
DISPLAY "Codice" CODTAB
|
DISPLAY "Codice" CODTAB
|
||||||
DISPLAY "Nome@50" S0
|
DISPLAY "Nome@50" S0
|
||||||
DISPLAY "Cambio corrente" R0
|
DISPLAY "Cambio corrente" R0
|
||||||
OUTPUT F_VALUTA CODTAB
|
OUTPUT F_VALUTA CODTAB
|
||||||
OUTPUT F_CAMBIO R0
|
OUTPUT F_CAMBIO R0
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_CAMBIO 10
|
NUMBER F_CAMBIO 10
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 16 9 "Cambio "
|
PROMPT 16 9 "Cambio "
|
||||||
FIELD CAMBIO
|
FIELD CAMBIO
|
||||||
FLAGS "RU"
|
FLAGS "RU"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
PICTURE ".3"
|
PICTURE ".3"
|
||||||
END
|
END
|
||||||
|
|
||||||
BOOLEAN F_VISVAL
|
BOOLEAN F_VISVAL
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 42 9 "Visualizza importi in valuta"
|
PROMPT 42 9 "Visualizza importi in valuta"
|
||||||
GROUP 3
|
GROUP 3
|
||||||
END
|
END
|
||||||
|
|
||||||
SPREADSHEET F_SHEETCG
|
SPREADSHEET F_SHEETCG
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 0 9 ""
|
PROMPT 0 9 ""
|
||||||
ITEM "Dare@17"
|
ITEM "Dare@17"
|
||||||
ITEM "Avere@17"
|
ITEM "Avere@17"
|
||||||
ITEM " @1"
|
ITEM " @1"
|
||||||
ITEM "Gr."
|
ITEM "Gr."
|
||||||
ITEM "Co."
|
ITEM "Co."
|
||||||
ITEM "Sottoc."
|
ITEM "Sottoc."
|
||||||
ITEM "Descrizione conto@50"
|
ITEM "Descrizione conto@50"
|
||||||
ITEM "Codice"
|
ITEM "Codice"
|
||||||
ITEM "Descrizione riga@50"
|
ITEM "Descrizione riga@50"
|
||||||
ITEM " @1"
|
ITEM " @1"
|
||||||
ITEM "Gr./c"
|
ITEM "Gr./c"
|
||||||
ITEM "Co./c"
|
ITEM "Co./c"
|
||||||
ITEM "Sottoc./c"
|
ITEM "Sottoc./c"
|
||||||
ITEM "Descrizione contropartita@50"
|
ITEM "Descrizione contropartita@50"
|
||||||
ITEM " @1"
|
ITEM " @1"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_DARE 17
|
NUMBER F_DARE 17
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 -1 "Sbilancio Dare "
|
PROMPT 1 -1 "Sbilancio Dare "
|
||||||
FLAGS "DRV"
|
FLAGS "DRV"
|
||||||
PICTURE "."
|
PICTURE "."
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER F_AVERE 17
|
NUMBER F_AVERE 17
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 41 -1 "Sbilancio Avere "
|
PROMPT 41 -1 "Sbilancio Avere "
|
||||||
FLAGS "DRV"
|
FLAGS "DRV"
|
||||||
PICTURE "."
|
PICTURE "."
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
|
||||||
#include "cg21cg.uml"
|
#include "cg21cg.uml"
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <xvtmacro.h>
|
|
||||||
|
|
||||||
|
#include <xvtmacro.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
|
|
||||||
#include "cg2101.h"
|
#include "cg2101.h"
|
||||||
@ -73,22 +73,22 @@ TRectype& TMovimentoPN::iva(int i)
|
|||||||
|
|
||||||
int TMovimentoPN::read_mov_rows()
|
int TMovimentoPN::read_mov_rows()
|
||||||
{
|
{
|
||||||
const TLocalisamfile* rm = lfile(LF_RMOV);
|
const TLocalisamfile& rm = lfile(LF_RMOV);
|
||||||
const TLocalisamfile* ri = lfile(LF_RMOVIVA);
|
const TLocalisamfile& ri = lfile(LF_RMOVIVA);
|
||||||
position_rels();
|
position_rels();
|
||||||
|
|
||||||
destroy_rows();
|
destroy_rows();
|
||||||
for(bool ok = is_first_match(LF_RMOV); ok; ok = next_match(LF_RMOV))
|
for(bool ok = is_first_match(LF_RMOV); ok; ok = next_match(LF_RMOV))
|
||||||
{
|
{
|
||||||
const int row = rm->get_int(RMV_NUMRIG) - 1;
|
const int row = rm.get_int(RMV_NUMRIG) - 1;
|
||||||
cg(row) = rm->curr();
|
cg(row) = rm.curr();
|
||||||
}
|
}
|
||||||
_oldcg = cg_items();
|
_oldcg = cg_items();
|
||||||
|
|
||||||
for(ok = is_first_match(LF_RMOVIVA); ok; ok = next_match(LF_RMOVIVA))
|
for(ok = is_first_match(LF_RMOVIVA); ok; ok = next_match(LF_RMOVIVA))
|
||||||
{
|
{
|
||||||
const int row = ri->get_int(RMI_NUMRIG) - 1;
|
const int row = ri.get_int(RMI_NUMRIG) - 1;
|
||||||
iva(row) = ri->curr();
|
iva(row) = ri.curr();
|
||||||
}
|
}
|
||||||
_oldiva = iva_items();
|
_oldiva = iva_items();
|
||||||
|
|
||||||
@ -98,54 +98,54 @@ int TMovimentoPN::read_mov_rows()
|
|||||||
|
|
||||||
int TMovimentoPN::read(TIsamop op, TReclock lockop, TDate& atdate)
|
int TMovimentoPN::read(TIsamop op, TReclock lockop, TDate& atdate)
|
||||||
{
|
{
|
||||||
int err = file()->read(op, lockop, atdate);
|
int err = file().read(op, lockop, atdate);
|
||||||
if (err == NOERR) err = read_mov_rows();
|
if (err == NOERR) err = read_mov_rows();
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TMovimentoPN::write_rec(bool re, const TRectype& rec, TLocalisamfile* f)
|
int TMovimentoPN::write_rec(bool re, const TRectype& rec, TLocalisamfile& f)
|
||||||
{
|
{
|
||||||
if (re)
|
if (re)
|
||||||
{
|
{
|
||||||
const bool scrivi = f->rewrite(rec) != NOERR;
|
const bool scrivi = f.rewrite(rec) != NOERR;
|
||||||
if (scrivi) f->write(rec);
|
if (scrivi) f.write(rec);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
f->write(rec);
|
f.write(rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
return f->status();
|
return f.status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TMovimentoPN::cancella(TLocalisamfile* f, int da, int a)
|
int TMovimentoPN::cancella(TLocalisamfile& f, int da, int a)
|
||||||
{
|
{
|
||||||
const long numreg = lfile()->get_long("NUMREG");
|
const long numreg = lfile().get_long(MOV_NUMREG);
|
||||||
for (int i = da; i <= a; i++)
|
for (int i = da; i <= a; i++)
|
||||||
{
|
{
|
||||||
f->zero();
|
f.zero();
|
||||||
f->put("NUMREG", numreg);
|
f.put(MOV_NUMREG, numreg);
|
||||||
f->put("NUMRIG", i);
|
f.put(RMV_NUMRIG, i);
|
||||||
if (f->read(_isequal, _lock) == NOERR)
|
if (f.read(_isequal, _lock) == NOERR)
|
||||||
f->remove();
|
f.remove();
|
||||||
}
|
}
|
||||||
return f->status();
|
return f.status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TMovimentoPN::registra(bool re, bool force)
|
int TMovimentoPN::registra(bool re, bool force)
|
||||||
{
|
{
|
||||||
TLocalisamfile* m = lfile();
|
TLocalisamfile& m = lfile();
|
||||||
|
|
||||||
const int err = write_rec(re, m->curr(), m);
|
const int err = write_rec(re, m.curr(), m);
|
||||||
if (err != NOERR) return err;
|
if (err != NOERR) return err;
|
||||||
|
|
||||||
TLocalisamfile* rm = lfile(LF_RMOV);
|
TLocalisamfile& rm = lfile(LF_RMOV);
|
||||||
TLocalisamfile* ri = lfile(LF_RMOVIVA);
|
TLocalisamfile& ri = lfile(LF_RMOVIVA);
|
||||||
|
|
||||||
const long numreg = m->get_long("NUMREG");
|
const long numreg = m.get_long("NUMREG");
|
||||||
|
|
||||||
for (int i = 0 ; i < cg_items(); i++)
|
for (int i = 0 ; i < cg_items(); i++)
|
||||||
{
|
{
|
||||||
@ -174,7 +174,7 @@ int TMovimentoPN::registra(bool re, bool force)
|
|||||||
|
|
||||||
int TMovimentoPN::write(bool force, TDate&)
|
int TMovimentoPN::write(bool force, TDate&)
|
||||||
{
|
{
|
||||||
const TLocalisamfile& r = *lfile();
|
const TLocalisamfile& r = lfile();
|
||||||
const int annoiva = r.get_int("ANNOIVA");
|
const int annoiva = r.get_int("ANNOIVA");
|
||||||
const TString16 reg(r.get("REG"));
|
const TString16 reg(r.get("REG"));
|
||||||
TRegistro registro(reg, annoiva);
|
TRegistro registro(reg, annoiva);
|
||||||
@ -194,7 +194,7 @@ int TMovimentoPN::write(bool force, TDate&)
|
|||||||
const char tipo = r.get_char("TIPOC");
|
const char tipo = r.get_char("TIPOC");
|
||||||
if (tipo == ' ')
|
if (tipo == ' ')
|
||||||
{
|
{
|
||||||
TConto c(r.get_int("GRUPPO"), r.get_int("CONTO"), r.get_long("SOTTOCONTO"));
|
TBill c(r.get_int("GRUPPO"), r.get_int("CONTO"), r.get_long("SOTTOCONTO"));
|
||||||
TRectype conto(LF_PCON); c.read(conto);
|
TRectype conto(LF_PCON); c.read(conto);
|
||||||
const TIndbil ib = (TIndbil)conto.get_int("INDBIL");
|
const TIndbil ib = (TIndbil)conto.get_int("INDBIL");
|
||||||
if (ib == ib_passivita || ib == ib_ricavi)
|
if (ib == ib_passivita || ib == ib_ricavi)
|
||||||
@ -238,14 +238,14 @@ int TMovimentoPN::rewrite(bool force, TDate&)
|
|||||||
|
|
||||||
int TMovimentoPN::remove(TDate&)
|
int TMovimentoPN::remove(TDate&)
|
||||||
{
|
{
|
||||||
TLocalisamfile* m = lfile();
|
TLocalisamfile& m = lfile();
|
||||||
TLocalisamfile* rm = lfile(LF_RMOV);
|
TLocalisamfile& rm = lfile(LF_RMOV);
|
||||||
TLocalisamfile* ri = lfile(LF_RMOVIVA);
|
TLocalisamfile& ri = lfile(LF_RMOVIVA);
|
||||||
|
|
||||||
cancella(rm, 1, _oldcg);
|
cancella(rm, 1, _oldcg);
|
||||||
cancella(ri, 1, _oldiva);
|
cancella(ri, 1, _oldiva);
|
||||||
m->remove();
|
m.remove();
|
||||||
_oldcg = _oldiva = 0;
|
_oldcg = _oldiva = 0;
|
||||||
return m->status();
|
return m.status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
102
cg/cg2101.h
102
cg/cg2101.h
@ -1,51 +1,51 @@
|
|||||||
#ifndef __CG2101_H
|
#ifndef __CG2101_H
|
||||||
#define __CG2101_H
|
#define __CG2101_H
|
||||||
|
|
||||||
#ifndef __RELATION_H
|
#ifndef __RELATION_H
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int date2esc(const TDate& d, int* prevesc = NULL);
|
int date2esc(const TDate& d, int* prevesc = NULL);
|
||||||
|
|
||||||
class TMovimentoPN : public TRelation
|
class TMovimentoPN : public TRelation
|
||||||
{
|
{
|
||||||
// class TMovimentoPN : public TRelation
|
// class TMovimentoPN : public TRelation
|
||||||
// @END
|
// @END
|
||||||
|
|
||||||
// @DPRIV
|
// @DPRIV
|
||||||
TArray _cg, _iva;
|
TArray _cg, _iva;
|
||||||
int _oldcg, _oldiva;
|
int _oldcg, _oldiva;
|
||||||
real _balance;
|
real _balance;
|
||||||
// @END
|
// @END
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// @FPROT
|
// @FPROT
|
||||||
int write_rec(bool re, const TRectype&r, TLocalisamfile* f);
|
int write_rec(bool re, const TRectype&r, TLocalisamfile& f);
|
||||||
int cancella(TLocalisamfile* f, int da, int a);
|
int cancella(TLocalisamfile& f, int da, int a);
|
||||||
int registra(bool re, bool force);
|
int registra(bool re, bool force);
|
||||||
int read_mov_rows();
|
int read_mov_rows();
|
||||||
// @END
|
// @END
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// @FPUB
|
// @FPUB
|
||||||
virtual int next(TReclock lockop = _nolock) { return (file()->next(lockop) || read_mov_rows()); }
|
virtual int next(TReclock lockop = _nolock) { return (file().next(lockop) || read_mov_rows()); }
|
||||||
virtual int prev(TReclock lockop = _nolock) { return (file()->prev(lockop) || read_mov_rows()); }
|
virtual int prev(TReclock lockop = _nolock) { return (file().prev(lockop) || read_mov_rows()); }
|
||||||
virtual int first(TReclock lockop = _nolock) { return (file()->first(lockop) || read_mov_rows()); }
|
virtual int first(TReclock lockop = _nolock) { return (file().first(lockop) || read_mov_rows()); }
|
||||||
virtual int last(TReclock lockop = _nolock) { return (file()->last(lockop) || read_mov_rows()); }
|
virtual int last(TReclock lockop = _nolock) { return (file().last(lockop) || read_mov_rows()); }
|
||||||
virtual int skip(TRecnotype nrec, TReclock lockop = _nolock) { return (file()->skip(nrec, lockop) || read_mov_rows()); }
|
virtual int skip(TRecnotype nrec, TReclock lockop = _nolock) { return (file().skip(nrec, lockop) || read_mov_rows()); }
|
||||||
virtual int read(TIsamop op = _isgteq, TReclock lockop = _nolock, TDate& atdate = (TDate&)botime);
|
virtual int read(TIsamop op = _isgteq, TReclock lockop = _nolock, TDate& atdate = (TDate&)botime);
|
||||||
virtual int write (bool force = TRUE, TDate& atdate = (TDate&)botime);
|
virtual int write (bool force = TRUE, TDate& atdate = (TDate&)botime);
|
||||||
virtual int rewrite(bool force = TRUE, TDate& atdate = (TDate&)botime);
|
virtual int rewrite(bool force = TRUE, TDate& atdate = (TDate&)botime);
|
||||||
virtual int remove (TDate& atdate = (TDate&)botime);
|
virtual int remove (TDate& atdate = (TDate&)botime);
|
||||||
|
|
||||||
TRectype& cg(int i);
|
TRectype& cg(int i);
|
||||||
TRectype& iva(int i);
|
TRectype& iva(int i);
|
||||||
int cg_items() const { return _cg.items(); }
|
int cg_items() const { return _cg.items(); }
|
||||||
int iva_items() const { return _iva.items(); }
|
int iva_items() const { return _iva.items(); }
|
||||||
void destroy_rows();
|
void destroy_rows();
|
||||||
|
|
||||||
TMovimentoPN();
|
TMovimentoPN();
|
||||||
virtual ~TMovimentoPN() {}
|
virtual ~TMovimentoPN() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -88,10 +88,10 @@ bool TPrimanota_application::suspended_handler(TMask_field& f, KEY k)
|
|||||||
const TEdit_field& c = (const TEdit_field&)f;
|
const TEdit_field& c = (const TEdit_field&)f;
|
||||||
const TBrowse* b = c.browse();
|
const TBrowse* b = c.browse();
|
||||||
CHECKD(b, "Can't check suspension of a edit-field without a USE ", f.dlg());
|
CHECKD(b, "Can't check suspension of a edit-field without a USE ", f.dlg());
|
||||||
const TLocalisamfile* i = b->cursor()->file();
|
const TLocalisamfile& i = b->cursor()->file();
|
||||||
|
|
||||||
const char* sf = i->tab() ? "B2" : "SOSPESO";
|
const char* sf = i.tab() ? "B2" : "SOSPESO";
|
||||||
const bool suspended = i->get_bool(sf);
|
const bool suspended = i.get_bool(sf);
|
||||||
if (suspended)
|
if (suspended)
|
||||||
{
|
{
|
||||||
sf = f.get();
|
sf = f.get();
|
||||||
@ -141,7 +141,7 @@ int TPrimanota_application::type2pos(char tipo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TPrimanota_application::bill2pos(const TConto& conto, char tipo)
|
int TPrimanota_application::bill2pos(const TBill& conto, char tipo)
|
||||||
{
|
{
|
||||||
TSheet_field& cg = app().cgs();
|
TSheet_field& cg = app().cgs();
|
||||||
for (int i = 0; i < cg.items(); i++)
|
for (int i = 0; i < cg.items(); i++)
|
||||||
@ -149,7 +149,7 @@ int TPrimanota_application::bill2pos(const TConto& conto, char tipo)
|
|||||||
TToken_string& s = cg.row(i);
|
TToken_string& s = cg.row(i);
|
||||||
if (s[s.len()-1] == tipo)
|
if (s[s.len()-1] == tipo)
|
||||||
{
|
{
|
||||||
const TConto c(s, 3, 0x0);
|
const TBill c(s, 3, 0x0);
|
||||||
if (c == conto)
|
if (c == conto)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ int TPrimanota_application::bill2pos(const TConto& conto, char tipo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TPrimanota_application::bill2contr(const TConto& conto, char sezione) const
|
int TPrimanota_application::bill2contr(const TBill& conto, char sezione) const
|
||||||
{
|
{
|
||||||
const TArray& rows = cgs().rows_array();
|
const TArray& rows = cgs().rows_array();
|
||||||
for (int i = 0; i < rows.items(); i++)
|
for (int i = 0; i < rows.items(); i++)
|
||||||
@ -167,7 +167,7 @@ int TPrimanota_application::bill2contr(const TConto& conto, char sezione) const
|
|||||||
const char sez = row.get(0)[0] > ' ' ? 'D' : 'A';
|
const char sez = row.get(0)[0] > ' ' ? 'D' : 'A';
|
||||||
if (sez == sezione) // Devo cercare sezione contraria
|
if (sez == sezione) // Devo cercare sezione contraria
|
||||||
continue;
|
continue;
|
||||||
const TConto c(row, 3, 0x0);
|
const TBill c(row, 3, 0x0);
|
||||||
if (conto == c)
|
if (conto == c)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ int TPrimanota_application::bill2contr(const TConto& conto, char sezione) const
|
|||||||
|
|
||||||
|
|
||||||
// Controlla se un conto e' usato nelle righe IVA
|
// Controlla se un conto e' usato nelle righe IVA
|
||||||
int TPrimanota_application::bill_used(const TConto& conto) const
|
int TPrimanota_application::bill_used(const TBill& conto) const
|
||||||
{
|
{
|
||||||
int users = 0;
|
int users = 0;
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ int TPrimanota_application::bill_used(const TConto& conto) const
|
|||||||
TToken_string& row = (TToken_string&)rows[i];
|
TToken_string& row = (TToken_string&)rows[i];
|
||||||
if (!row.empty_items())
|
if (!row.empty_items())
|
||||||
{
|
{
|
||||||
const TConto c(row, 6, 0x0);
|
const TBill c(row, 6, 0x0);
|
||||||
if (conto == c) users++;
|
if (conto == c) users++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -318,7 +318,7 @@ void TPrimanota_application::disable_cgs_cells(int n, char tipo)
|
|||||||
|
|
||||||
|
|
||||||
int TPrimanota_application::set_cgs_row(int n, const TImporto& imp,
|
int TPrimanota_application::set_cgs_row(int n, const TImporto& imp,
|
||||||
TConto& conto, const char* desc,
|
TBill& conto, const char* desc,
|
||||||
char tipo)
|
char tipo)
|
||||||
{
|
{
|
||||||
TSheet_field& cg = cgs();
|
TSheet_field& cg = cgs();
|
||||||
@ -333,7 +333,7 @@ int TPrimanota_application::set_cgs_row(int n, const TImporto& imp,
|
|||||||
int pos = 0;
|
int pos = 0;
|
||||||
if (tipo == 'I' && (pos = type2pos('T')) >= 0)
|
if (tipo == 'I' && (pos = type2pos('T')) >= 0)
|
||||||
{
|
{
|
||||||
TConto contro(cg.row(pos), 2, 0x3);
|
TBill contro(cg.row(pos), 2, 0x3);
|
||||||
row.add(contro.string(0x3));
|
row.add(contro.string(0x3));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -461,9 +461,9 @@ bool TPrimanota_application::cg_notify(int r, KEY k)
|
|||||||
if (r == 0 && app().iva() == nessuna_iva && cg.row(1).empty_items())
|
if (r == 0 && app().iva() == nessuna_iva && cg.row(1).empty_items())
|
||||||
{
|
{
|
||||||
TImporto i; i = row; i.swap_section();
|
TImporto i; i = row; i.swap_section();
|
||||||
TConto contro(row, 9, 0x3);
|
TBill contro(row, 9, 0x3);
|
||||||
app().set_cgs_row(1, i, contro, "", ' ');
|
app().set_cgs_row(1, i, contro, "", ' ');
|
||||||
TConto conto(row, 2, 0x3);
|
TBill conto(row, 2, 0x3);
|
||||||
conto.add_to(cg.row(1), 9, 0x3);
|
conto.add_to(cg.row(1), 9, 0x3);
|
||||||
app().cgs().force_update(1);
|
app().cgs().force_update(1);
|
||||||
}
|
}
|
||||||
@ -513,7 +513,7 @@ TSheet_field& TPrimanota_application::ivas() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TPrimanota_application::set_ivas_row(int nriga, const char* codiva, TConto& tc,
|
void TPrimanota_application::set_ivas_row(int nriga, const char* codiva, TBill& tc,
|
||||||
const char* desc)
|
const char* desc)
|
||||||
{
|
{
|
||||||
TToken_string& riga = ivas().row(nriga);
|
TToken_string& riga = ivas().row(nriga);
|
||||||
@ -638,11 +638,11 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
|
|||||||
oldposiva = type2pos(tipod); // Tipodet 4
|
oldposiva = type2pos(tipod); // Tipodet 4
|
||||||
if (oldposiva < 0 && oldiva != ZERO)
|
if (oldposiva < 0 && oldiva != ZERO)
|
||||||
{
|
{
|
||||||
TConto c; app().causale().bill(tipod == 'D' ? 3 : 4, c);
|
TBill c; app().causale().bill(tipod == 'D' ? 3 : 4, c);
|
||||||
oldposiva = app().set_cgs_row(-1, app().real2imp(ZERO, 'I'), c, "", tipod);
|
oldposiva = app().set_cgs_row(-1, app().real2imp(ZERO, 'I'), c, "", tipod);
|
||||||
}
|
}
|
||||||
|
|
||||||
TConto oldconto(row, 5, 0x1); // t/g/c/s 5 6 7 8
|
TBill oldconto(row, 5, 0x1); // t/g/c/s 5 6 7 8
|
||||||
oldpos = bill2pos(oldconto, 'I');
|
oldpos = bill2pos(oldconto, 'I');
|
||||||
if (oldpos < 0 && oldconto.ok())
|
if (oldpos < 0 && oldconto.ok())
|
||||||
oldpos = app().set_cgs_row(-1, app().real2imp(ZERO, 'I'), oldconto, "", 'I');
|
oldpos = app().set_cgs_row(-1, app().real2imp(ZERO, 'I'), oldconto, "", 'I');
|
||||||
@ -666,7 +666,7 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
|
|||||||
|
|
||||||
// Aggiorna conto sulla riga contabile
|
// Aggiorna conto sulla riga contabile
|
||||||
real imp(row.get(0)); // Imponibile
|
real imp(row.get(0)); // Imponibile
|
||||||
TConto conto(row, 5, 0x3);
|
TBill conto(row, 5, 0x3);
|
||||||
const int newpos = bill2pos(conto, 'I');
|
const int newpos = bill2pos(conto, 'I');
|
||||||
|
|
||||||
if (newpos < 0)
|
if (newpos < 0)
|
||||||
@ -952,7 +952,7 @@ bool TPrimanota_application::occas_code_handler(TMask_field& f, KEY key)
|
|||||||
if (*code)
|
if (*code)
|
||||||
{
|
{
|
||||||
TRelation occas(LF_OCCAS);
|
TRelation occas(LF_OCCAS);
|
||||||
occas.lfile()->put("CFPI", code);
|
occas.lfile().put("CFPI", code);
|
||||||
if (occas.read() == NOERR)
|
if (occas.read() == NOERR)
|
||||||
{
|
{
|
||||||
f.mask().autoload(&occas);
|
f.mask().autoload(&occas);
|
||||||
@ -996,14 +996,14 @@ void TPrimanota_application::add_cgs_tot(TMask& m)
|
|||||||
// Se l'utente non ha ancora specificato un conto lo prendo dalla prima riga della causale
|
// Se l'utente non ha ancora specificato un conto lo prendo dalla prima riga della causale
|
||||||
if (conto == 0)
|
if (conto == 0)
|
||||||
{
|
{
|
||||||
TConto bill; _causale.bill(1, bill);
|
TBill bill; _causale.bill(1, bill);
|
||||||
gruppo = bill.gruppo(); m.set(F_GRUPPOCLIFO, gruppo);
|
gruppo = bill.gruppo(); m.set(F_GRUPPOCLIFO, gruppo);
|
||||||
conto = bill.conto(); m.set(F_CONTOCLIFO, conto);
|
conto = bill.conto(); m.set(F_CONTOCLIFO, conto);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tipo == 'C' && causale().corrispettivi())
|
if (tipo == 'C' && causale().corrispettivi())
|
||||||
tipo = ' ';
|
tipo = ' ';
|
||||||
TConto c(gruppo, conto, codice, tipo);
|
TBill c(gruppo, conto, codice, tipo);
|
||||||
real tot(m.get(F_TOTALE));
|
real tot(m.get(F_TOTALE));
|
||||||
|
|
||||||
// Creazione/Aggiornamento riga totale
|
// Creazione/Aggiornamento riga totale
|
||||||
@ -1055,7 +1055,7 @@ bool TPrimanota_application::main_codiva_handler(TMask_field& f, KEY key)
|
|||||||
row.add(iva.codice(), 1); // codice IVA
|
row.add(iva.codice(), 1); // codice IVA
|
||||||
row.add(imposta.string(), 3); // imposta
|
row.add(imposta.string(), 3); // imposta
|
||||||
|
|
||||||
TConto bill; // Conto della prima riga IVA
|
TBill bill; // Conto della prima riga IVA
|
||||||
const TString& tipo = iva.tipo();
|
const TString& tipo = iva.tipo();
|
||||||
if (tipo.not_empty())
|
if (tipo.not_empty())
|
||||||
{
|
{
|
||||||
@ -1106,7 +1106,7 @@ void TPrimanota_application::add_cgs_rit(bool fiscali)
|
|||||||
if (pos < 0)
|
if (pos < 0)
|
||||||
{
|
{
|
||||||
const int riga = fiscali ? 8 : 9;
|
const int riga = fiscali ? 8 : 9;
|
||||||
TConto conto; _causale.bill(riga, conto);
|
TBill conto; _causale.bill(riga, conto);
|
||||||
|
|
||||||
TString80 desc("Ritenute ");
|
TString80 desc("Ritenute ");
|
||||||
desc << (fiscali ? "fiscali" : "sociali");
|
desc << (fiscali ? "fiscali" : "sociali");
|
||||||
|
16
cg/cg2102.h
16
cg/cg2102.h
@ -44,7 +44,7 @@ class TPrimanota_application : public TRelation_application
|
|||||||
|
|
||||||
TMask* _msk[4]; // Maschere di query, cg, iva
|
TMask* _msk[4]; // Maschere di query, cg, iva
|
||||||
long _lastreg; // Numero ultima registrazione
|
long _lastreg; // Numero ultima registrazione
|
||||||
int _mode; // Modo maschera corrente
|
int _mode; // Modo maschera corrente
|
||||||
|
|
||||||
static bool suspended_handler(TMask_field& f, KEY k);
|
static bool suspended_handler(TMask_field& f, KEY k);
|
||||||
static bool num_handler(TMask_field& f, KEY key);
|
static bool num_handler(TMask_field& f, KEY key);
|
||||||
@ -96,8 +96,8 @@ protected:
|
|||||||
TMask* load_mask(int n);
|
TMask* load_mask(int n);
|
||||||
TMask& occas_mask() { return *load_mask(3); }
|
TMask& occas_mask() { return *load_mask(3); }
|
||||||
|
|
||||||
bool get_conto(const TRectype& r, TConto& c) const;
|
bool get_conto(const TRectype& r, TBill& c) const;
|
||||||
void put_conto(TRectype& r, const TConto& c) const;
|
void put_conto(TRectype& r, const TBill& c) const;
|
||||||
|
|
||||||
void mask2rel(const TMask& m);
|
void mask2rel(const TMask& m);
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ protected:
|
|||||||
TSheet_field& cgs() const;
|
TSheet_field& cgs() const;
|
||||||
TSheet_field& ivas() const;
|
TSheet_field& ivas() const;
|
||||||
|
|
||||||
static int bill2pos(const TConto& conto, char tipo);
|
static int bill2pos(const TBill& conto, char tipo);
|
||||||
static TipoIVA reg2IVA(const char* registro, int anno);
|
static TipoIVA reg2IVA(const char* registro, int anno);
|
||||||
static TipoIVA cau2IVA(const char* causale, int anno);
|
static TipoIVA cau2IVA(const char* causale, int anno);
|
||||||
static int type2pos(char tipo);
|
static int type2pos(char tipo);
|
||||||
@ -118,8 +118,8 @@ protected:
|
|||||||
static real scorpora(real& imponibile, const real& percentuale);
|
static real scorpora(real& imponibile, const real& percentuale);
|
||||||
static bool detraibile(int tipodet);
|
static bool detraibile(int tipodet);
|
||||||
|
|
||||||
int bill2contr(const TConto& c, char sezione) const;
|
int bill2contr(const TBill& c, char sezione) const;
|
||||||
int bill_used(const TConto& conto) const;
|
int bill_used(const TBill& conto) const;
|
||||||
int det_used(char detraib) const;
|
int det_used(char detraib) const;
|
||||||
|
|
||||||
bool read_caus(const char* cod, int year);
|
bool read_caus(const char* cod, int year);
|
||||||
@ -139,8 +139,8 @@ protected:
|
|||||||
real calcola_saldo() const;
|
real calcola_saldo() const;
|
||||||
real calcola_imp() const;
|
real calcola_imp() const;
|
||||||
|
|
||||||
void set_ivas_row(int n, const char* codiva, TConto& tc, const char* desc);
|
void set_ivas_row(int n, const char* codiva, TBill& tc, const char* desc);
|
||||||
int set_cgs_row(int n, const TImporto& importo, TConto& conto, const char* desc, char tipo);
|
int set_cgs_row(int n, const TImporto& importo, TBill& conto, const char* desc, char tipo);
|
||||||
void disable_cgs_cells(int n, char tipo);
|
void disable_cgs_cells(int n, char tipo);
|
||||||
void add_cgs_tot(TMask& m);
|
void add_cgs_tot(TMask& m);
|
||||||
void add_cgs_rit(bool fisc);
|
void add_cgs_rit(bool fisc);
|
||||||
|
@ -57,6 +57,7 @@ bool TRegistro::read(const char* cod, int year)
|
|||||||
_att.zero();
|
_att.zero();
|
||||||
if (err != NOERR)
|
if (err != NOERR)
|
||||||
_rec.zero();
|
_rec.zero();
|
||||||
|
|
||||||
return err == NOERR;
|
return err == NOERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +201,7 @@ bool TLibro_giornale::read(int y)
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Now obsolete
|
||||||
TDate TLibro_giornale::global_last_print() const
|
TDate TLibro_giornale::global_last_print() const
|
||||||
{
|
{
|
||||||
TTable reg("REG");
|
TTable reg("REG");
|
||||||
@ -300,7 +301,7 @@ const TRectype& TCausale::row(int num) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TConto& TCausale::bill(int num, TConto& conto) const
|
TBill& TCausale::bill(int num, TBill& conto) const
|
||||||
{
|
{
|
||||||
const TRectype& rec = row(num);
|
const TRectype& rec = row(num);
|
||||||
conto.set(rec.get_int("GRUPPO"), rec.get_int("CONTO"),
|
conto.set(rec.get_int("GRUPPO"), rec.get_int("CONTO"),
|
||||||
|
@ -78,7 +78,7 @@ protected:
|
|||||||
const TRectype& row(int num) const;
|
const TRectype& row(int num) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TConto& bill(int num, TConto& c) const;
|
TBill& bill(int num, TBill& c) const;
|
||||||
|
|
||||||
bool data_doc() const;
|
bool data_doc() const;
|
||||||
bool num_doc() const;
|
bool num_doc() const;
|
||||||
|
84
cg/cg2200.cpp
Executable file
84
cg/cg2200.cpp
Executable file
@ -0,0 +1,84 @@
|
|||||||
|
#include <applicat.h>
|
||||||
|
#include <mask.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
|
||||||
|
#include "cg2200.h"
|
||||||
|
#include "cg2101.h"
|
||||||
|
|
||||||
|
#include <mov.h>
|
||||||
|
#include <rmov.h>
|
||||||
|
#include <rmoviva.h>
|
||||||
|
|
||||||
|
class TDeleteprovv_app : public TApplication
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual bool create();
|
||||||
|
virtual bool destroy();
|
||||||
|
virtual bool menu(MENU_TAG m);
|
||||||
|
|
||||||
|
public:
|
||||||
|
TDeleteprovv_app() {};
|
||||||
|
};
|
||||||
|
|
||||||
|
bool TDeleteprovv_app::create()
|
||||||
|
{
|
||||||
|
dispatch_e_menu(BAR_ITEM(1));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDeleteprovv_app::destroy()
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TDeleteprovv_app::menu(MENU_TAG)
|
||||||
|
{
|
||||||
|
TLocalisamfile mov(LF_MOV), rmov(LF_RMOV), rmoviva(LF_RMOVIVA);
|
||||||
|
TMask m("cg2200a");
|
||||||
|
|
||||||
|
while (m.run() != K_QUIT)
|
||||||
|
{
|
||||||
|
mov.setkey(2);
|
||||||
|
rmov.setkey(1);
|
||||||
|
rmoviva.setkey(1);
|
||||||
|
|
||||||
|
TRectype to(mov.curr());
|
||||||
|
to.zero();
|
||||||
|
to.put(MOV_DATAREG, m.get(F_TODATE));
|
||||||
|
to.put(MOV_NUMREG, m.get(F_TOREG));
|
||||||
|
|
||||||
|
mov.zero();
|
||||||
|
mov.put(MOV_DATAREG, m.get(F_FROMDATE));
|
||||||
|
mov.put(MOV_NUMREG, m.get(F_FROMREG));
|
||||||
|
for (mov.read(_isequal, _lock); mov.good(); mov.next())
|
||||||
|
{
|
||||||
|
if (mov.curr() > to) break;
|
||||||
|
const long numreg = mov.get_long(MOV_NUMREG);
|
||||||
|
for (int rig = 1; ; rig++)
|
||||||
|
{
|
||||||
|
rmov.put(RMV_NUMREG, numreg);
|
||||||
|
rmov.put(RMV_NUMRIG, rig);
|
||||||
|
if (rmov.read(_isequal, _lock) != NOERR) break;
|
||||||
|
rmov.remove();
|
||||||
|
}
|
||||||
|
for (rig = 1; ; rig++)
|
||||||
|
{
|
||||||
|
rmov.put(RMI_NUMREG, numreg);
|
||||||
|
rmoviva.put(RMI_NUMRIG, rig);
|
||||||
|
if (rmoviva.read(_isequal, _lock) != NOERR) break;
|
||||||
|
rmov.remove();
|
||||||
|
}
|
||||||
|
mov.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int cg2200(int argc, char** argv)
|
||||||
|
{
|
||||||
|
TDeleteprovv_app a;
|
||||||
|
a.run(argc, argv, "Cancellazione movimenti provvisori");
|
||||||
|
return 0;
|
||||||
|
}
|
4
cg/cg2200.h
Executable file
4
cg/cg2200.h
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#define F_FROMDATE 101
|
||||||
|
#define F_FROMREG 102
|
||||||
|
#define F_TODATE 103
|
||||||
|
#define F_TOREG 104
|
60
cg/cg2200a.uml
Executable file
60
cg/cg2200a.uml
Executable file
@ -0,0 +1,60 @@
|
|||||||
|
#include "cg2200.h"
|
||||||
|
|
||||||
|
PAGE "Eliminazione Movimenti Provvisori" -1 -1 44 9
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 42 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Dal movimento"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_FROMDATE
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 2 "Data "
|
||||||
|
USE LF_MOV KEY 2 SELECT PROVVIS="P"
|
||||||
|
INPUT DATAREG F_FROMDATE
|
||||||
|
INPUT NUMREG F_FROMREG
|
||||||
|
DISPLAY "Data@10" DATAREG
|
||||||
|
DISPLAY "Numero@6" NUMREG
|
||||||
|
DISPLAY "Causale" CODCAUS
|
||||||
|
DISPLAY "Documento" NUMDOC
|
||||||
|
DISPLAY "Descrizione@50" DESCR
|
||||||
|
OUTPUT F_FROMDATE DATAREG
|
||||||
|
OUTPUT F_FROMREG NUMREG
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_FROMREG 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 2 "Operazione "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
GROUPBOX DLG_NULL 42 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Al movimento"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_TODATE
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 5 "Data "
|
||||||
|
COPY ALL F_FROMDATE
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER F_TOREG 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 22 5 "Operazione "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_DELREC 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -12 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -22 -1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
271
cg/cg3100.cpp
271
cg/cg3100.cpp
@ -8,8 +8,6 @@
|
|||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
#include <lffiles.h>
|
|
||||||
|
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmov.h>
|
#include <rmov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
@ -102,7 +100,7 @@ public:
|
|||||||
void incrementa_totali();
|
void incrementa_totali();
|
||||||
void compila_clifo();
|
void compila_clifo();
|
||||||
void compila_comuni();
|
void compila_comuni();
|
||||||
int my_next (TLocalisamfile*);
|
int my_next (TLocalisamfile&);
|
||||||
|
|
||||||
CG3100_application() {}
|
CG3100_application() {}
|
||||||
};
|
};
|
||||||
@ -160,17 +158,17 @@ bool annoes(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
bool data_inizio(TMask_field& f, KEY k)
|
bool data_inizio(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
CG3100_application * app = (CG3100_application*)MainApp();
|
CG3100_application &app = (CG3100_application&)main_app();
|
||||||
|
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
int decidi;
|
int decidi;
|
||||||
int anno = f.mask().get_int (F_ANNO);
|
int anno = f.mask().get_int (F_ANNO);
|
||||||
TDate data = f.mask().get(F_DATAINI);
|
TDate data = f.mask().get(F_DATAINI);
|
||||||
if (app->_masc == "cg3100a")
|
if (app._masc == "cg3100a")
|
||||||
decidi = f.mask().get_int (F_DECIDI);
|
decidi = f.mask().get_int (F_DECIDI);
|
||||||
if ( anno != 0 && ( (app->_masc == "cg3100b") ||
|
if ( anno != 0 && ( (app._masc == "cg3100b") ||
|
||||||
((app->_masc == "cg3100a" ) && (decidi == 2)) ) )
|
((app._masc == "cg3100a" ) && (decidi == 2)) ) )
|
||||||
{
|
{
|
||||||
if (!data.ok()) //se la data e' vuota
|
if (!data.ok()) //se la data e' vuota
|
||||||
f.mask().field(F_DATAINI).set(InizioEsercizio(anno));
|
f.mask().field(F_DATAINI).set(InizioEsercizio(anno));
|
||||||
@ -187,7 +185,7 @@ bool data_inizio(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
bool data_fine(TMask_field& f, KEY k)
|
bool data_fine(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
CG3100_application * app = (CG3100_application*)MainApp();
|
CG3100_application & app = (CG3100_application&)main_app();
|
||||||
|
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
@ -195,18 +193,18 @@ bool data_fine(TMask_field& f, KEY k)
|
|||||||
int anno = f.mask().get_int (F_ANNO);
|
int anno = f.mask().get_int (F_ANNO);
|
||||||
TDate dataini = f.mask().get(F_DATAINI);
|
TDate dataini = f.mask().get(F_DATAINI);
|
||||||
TDate datafin = f.mask().get(F_DATAFIN);
|
TDate datafin = f.mask().get(F_DATAFIN);
|
||||||
if (app->_masc == "cg3100a")
|
if (app._masc == "cg3100a")
|
||||||
decidi = f.mask().get_int (F_DECIDI);
|
decidi = f.mask().get_int (F_DECIDI);
|
||||||
if ( (app->_masc == "cg3100b") ||
|
if ( (app._masc == "cg3100b") ||
|
||||||
((app->_masc == "cg3100a" ) && (decidi == 2)) )
|
((app._masc == "cg3100a" ) && (decidi == 2)) )
|
||||||
if ( dataini.ok() && datafin.ok() )
|
if ( dataini.ok() && datafin.ok() )
|
||||||
if (dataini > datafin)
|
if (dataini > datafin)
|
||||||
{
|
{
|
||||||
f.error_box("La data iniziale non deve essere superiore alla data finale");
|
f.error_box("La data iniziale non deve essere superiore alla data finale");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if ( anno != 0 && ( (app->_masc == "cg3100b") ||
|
if ( anno != 0 && ( (app._masc == "cg3100b") ||
|
||||||
((app->_masc == "cg3100a" ) && (decidi == 2)) ) )
|
((app._masc == "cg3100a" ) && (decidi == 2)) ) )
|
||||||
{
|
{
|
||||||
TDate fine = FineEsercizio(anno + 1);
|
TDate fine = FineEsercizio(anno + 1);
|
||||||
if (fine == botime)
|
if (fine == botime)
|
||||||
@ -233,16 +231,16 @@ void CG3100_application::compila_clifo()
|
|||||||
_clifo->read();
|
_clifo->read();
|
||||||
if (_clifo->bad())
|
if (_clifo->bad())
|
||||||
_clifo->zero();
|
_clifo->zero();
|
||||||
_alleg = _clifo->curr().get_int(CLI_ALLEG);
|
_alleg = _clifo->get_int(CLI_ALLEG);
|
||||||
_statocf = _clifo->curr().get(CLI_STATOCF);
|
_statocf = _clifo->get(CLI_STATOCF);
|
||||||
_comcf = _clifo->curr().get(CLI_COMCF);
|
_comcf = _clifo->get(CLI_COMCF);
|
||||||
_ragsoc = _clifo->curr().get(CLI_RAGSOC);
|
_ragsoc = _clifo->get(CLI_RAGSOC);
|
||||||
_indcf = _clifo->curr().get(CLI_INDCF);
|
_indcf = _clifo->get(CLI_INDCF);
|
||||||
_civcf = _clifo->curr().get(CLI_CIVCF);
|
_civcf = _clifo->get(CLI_CIVCF);
|
||||||
_paiv = _clifo->curr().get(CLI_PAIV);
|
_paiv = _clifo->get(CLI_PAIV);
|
||||||
_capcf = _clifo->curr().get(CLI_CAPCF);
|
_capcf = _clifo->get(CLI_CAPCF);
|
||||||
_cofi = _clifo->curr().get(CLI_COFI);
|
_cofi = _clifo->get(CLI_COFI);
|
||||||
_codalleg = _clifo->curr().get_long(CLI_CODALLEG);
|
_codalleg = _clifo->get_long(CLI_CODALLEG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG3100_application::compila_comuni()
|
void CG3100_application::compila_comuni()
|
||||||
@ -416,35 +414,35 @@ const int CodiceRegistro (const char* cod, int anno)
|
|||||||
|
|
||||||
bool filter_func_fatture (const TRelation * rel)
|
bool filter_func_fatture (const TRelation * rel)
|
||||||
{
|
{
|
||||||
CG3100_application * app = (CG3100_application*)MainApp();
|
CG3100_application & app = (CG3100_application&)main_app();
|
||||||
int tipo_reg;
|
int tipo_reg;
|
||||||
int ann_reg;
|
int ann_reg;
|
||||||
TString cod_reg;
|
TString cod_reg;
|
||||||
TLocalisamfile * mov = rel->lfile(LF_MOV);
|
TLocalisamfile & mov = rel->lfile(LF_MOV);
|
||||||
TRectype from (mov->curr());
|
TRectype from (mov.curr());
|
||||||
TRectype to (mov->curr());
|
TRectype to (mov.curr());
|
||||||
ann_reg = mov->get_int (MOV_ANNOIVA);
|
ann_reg = mov.get_int (MOV_ANNOIVA);
|
||||||
cod_reg = mov->get (MOV_REG);
|
cod_reg = mov.get (MOV_REG);
|
||||||
tipo_reg = CodiceRegistro (cod_reg, ann_reg);
|
tipo_reg = CodiceRegistro (cod_reg, ann_reg);
|
||||||
from.zero();
|
from.zero();
|
||||||
to.zero();
|
to.zero();
|
||||||
if (app->_annoes != 0) //anno esercizio specificato nella maschera
|
if (app._annoes != 0) //anno esercizio specificato nella maschera
|
||||||
{
|
{
|
||||||
from.put(MOV_ANNOES, app->_annoes);
|
from.put(MOV_ANNOES, app._annoes);
|
||||||
to.put(MOV_ANNOES, app->_annoes);
|
to.put(MOV_ANNOES, app._annoes);
|
||||||
}
|
}
|
||||||
//if (app->_data_ini.ok())
|
//if (app._data_ini.ok())
|
||||||
// from.put(MOV_DATAREG, app->_data_ini);
|
// from.put(MOV_DATAREG, app._data_ini);
|
||||||
from.put(MOV_TIPO, app->_tipo_ini);
|
from.put(MOV_TIPO, app._tipo_ini);
|
||||||
if (app->_codice_ini != 0)
|
if (app._codice_ini != 0)
|
||||||
from.put(MOV_CODCF, app->_codice_ini);
|
from.put(MOV_CODCF, app._codice_ini);
|
||||||
//if (app->_data_fin.ok())
|
//if (app._data_fin.ok())
|
||||||
// to.put(MOV_DATAREG, app->_data_fin);
|
// to.put(MOV_DATAREG, app._data_fin);
|
||||||
to.put(MOV_TIPO, app->_tipo_fin);
|
to.put(MOV_TIPO, app._tipo_fin);
|
||||||
if (app->_codice_fin != 0)
|
if (app._codice_fin != 0)
|
||||||
to.put(MOV_CODCF, app->_codice_fin);
|
to.put(MOV_CODCF, app._codice_fin);
|
||||||
|
|
||||||
if (((mov->curr() >= from) && (mov->curr() <= to)) &&
|
if (((mov.curr() >= from) && (mov.curr() <= to)) &&
|
||||||
((tipo_reg == 1) || (tipo_reg == 2)))
|
((tipo_reg == 1) || (tipo_reg == 2)))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
@ -453,47 +451,47 @@ bool filter_func_fatture (const TRelation * rel)
|
|||||||
|
|
||||||
bool filter_func (const TRelation * rel)
|
bool filter_func (const TRelation * rel)
|
||||||
{
|
{
|
||||||
CG3100_application * app = (CG3100_application*)MainApp();
|
CG3100_application & app = (CG3100_application&)main_app();
|
||||||
int tipo_reg, ann_reg;
|
int tipo_reg, ann_reg;
|
||||||
TString cod_reg, causale;
|
TString cod_reg, causale;
|
||||||
TLocalisamfile * mov = rel->lfile(LF_MOV);
|
TLocalisamfile & mov = rel->lfile(LF_MOV);
|
||||||
TRectype from (mov->curr());
|
TRectype from (mov.curr());
|
||||||
TRectype to (mov->curr());
|
TRectype to (mov.curr());
|
||||||
switch (app->_scelta_stampa)
|
switch (app._scelta_stampa)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
ann_reg = mov->get_int(MOV_ANNOIVA);
|
ann_reg = mov.get_int(MOV_ANNOIVA);
|
||||||
causale = mov->get (MOV_CODCAUS);
|
causale = mov.get (MOV_CODCAUS);
|
||||||
from.zero();
|
from.zero();
|
||||||
to.zero();
|
to.zero();
|
||||||
if ( (app->_decidi == 2) && (app->_annoes != 0) )
|
if ( (app._decidi == 2) && (app._annoes != 0) )
|
||||||
{
|
{
|
||||||
from.put(MOV_ANNOES, app->_annoes);
|
from.put(MOV_ANNOES, app._annoes);
|
||||||
to.put(MOV_ANNOES, app->_annoes);
|
to.put(MOV_ANNOES, app._annoes);
|
||||||
}
|
}
|
||||||
from.put(MOV_CODCAUS, app->_causale_ini);
|
from.put(MOV_CODCAUS, app._causale_ini);
|
||||||
to.put(MOV_CODCAUS, app->_causale_fin);
|
to.put(MOV_CODCAUS, app._causale_fin);
|
||||||
from.put(MOV_REG, app->_registro_ini);
|
from.put(MOV_REG, app._registro_ini);
|
||||||
to.put(MOV_REG, app->_registro_fin);
|
to.put(MOV_REG, app._registro_fin);
|
||||||
if ((mov->curr() >= from) && (mov->curr() <= to))
|
if ((mov.curr() >= from) && (mov.curr() <= to))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
cod_reg = mov->get (MOV_REG);
|
cod_reg = mov.get (MOV_REG);
|
||||||
ann_reg = mov->get_int (MOV_ANNOIVA);
|
ann_reg = mov.get_int (MOV_ANNOIVA);
|
||||||
tipo_reg = CodiceRegistro(cod_reg, ann_reg);
|
tipo_reg = CodiceRegistro(cod_reg, ann_reg);
|
||||||
causale = mov->get (MOV_CODCAUS);
|
causale = mov.get (MOV_CODCAUS);
|
||||||
from.zero();
|
from.zero();
|
||||||
to.zero();
|
to.zero();
|
||||||
if ( (app->_decidi == 2) && (app->_annoes != 0) )
|
if ( (app._decidi == 2) && (app._annoes != 0) )
|
||||||
{
|
{
|
||||||
from.put(MOV_ANNOES, app->_annoes);
|
from.put(MOV_ANNOES, app._annoes);
|
||||||
to.put(MOV_ANNOES, app->_annoes);
|
to.put(MOV_ANNOES, app._annoes);
|
||||||
}
|
}
|
||||||
from.put(MOV_CODCAUS, app->_causale_ini);
|
from.put(MOV_CODCAUS, app._causale_ini);
|
||||||
to.put(MOV_CODCAUS, app->_causale_fin);
|
to.put(MOV_CODCAUS, app._causale_fin);
|
||||||
|
|
||||||
if (((mov->curr() >= from) && (mov->curr() <= to)) &&
|
if (((mov.curr() >= from) && (mov.curr() <= to)) &&
|
||||||
((tipo_reg != 1) && (tipo_reg != 2)))
|
((tipo_reg != 1) && (tipo_reg != 2)))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
@ -689,15 +687,15 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
_registro = current_cursor()->curr(LF_MOV).get(MOV_REG);
|
_registro = current_cursor()->curr(LF_MOV).get(MOV_REG);
|
||||||
_anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
_anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
||||||
_tipodoc = current_cursor()->curr(LF_MOV).get(MOV_TIPODOC);
|
_tipodoc = current_cursor()->curr(LF_MOV).get(MOV_TIPODOC);
|
||||||
_datareg = current_cursor()->file(LF_MOV)->get_date(MOV_DATAREG);
|
_datareg = current_cursor()->file(LF_MOV).get_date(MOV_DATAREG);
|
||||||
_causale_gia_stampata = FALSE;
|
_causale_gia_stampata = FALSE;
|
||||||
|
|
||||||
//TDate data_corrente (current_cursor()->file(LF_MOV)->get_date(MOV_DATAREG));
|
//TDate data_corrente (current_cursor()->file(LF_MOV)->get_date(MOV_DATAREG));
|
||||||
_tiporegistro = CodiceRegistro(_registro, _anno);
|
_tiporegistro = CodiceRegistro(_registro, _anno);
|
||||||
|
|
||||||
TLocalisamfile* fl = current_cursor()->file(LF_MOV);
|
TLocalisamfile& fl = current_cursor()->file(LF_MOV);
|
||||||
TRectype da (fl->curr());
|
TRectype da (fl.curr());
|
||||||
TRectype a (fl->curr());
|
TRectype a (fl.curr());
|
||||||
da.zero();
|
da.zero();
|
||||||
a.zero();
|
a.zero();
|
||||||
if (_annoes != 0)
|
if (_annoes != 0)
|
||||||
@ -710,7 +708,7 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
a.put(MOV_CODCAUS, _causale_fin);
|
a.put(MOV_CODCAUS, _causale_fin);
|
||||||
a.put(MOV_REG, _registro_fin);
|
a.put(MOV_REG, _registro_fin);
|
||||||
|
|
||||||
if ((fl->curr() >= da) && (fl->curr() <= a))
|
if ((fl.curr() >= da) && (fl.curr() <= a))
|
||||||
//&&((_tiporegistro == 1)||(_tiporegistro == 2)))
|
//&&((_tiporegistro == 1)||(_tiporegistro == 2)))
|
||||||
{
|
{
|
||||||
_caus->setkey(1);
|
_caus->setkey(1);
|
||||||
@ -751,7 +749,7 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
TString tipoc = current_cursor()->curr(LF_RMOV).get(RMV_TIPOC);
|
TString tipoc = current_cursor()->curr(LF_RMOV).get(RMV_TIPOC);
|
||||||
_descr = DescrConto(gruppo, conto, sottoconto, tipoc);
|
_descr = DescrConto(gruppo, conto, sottoconto, tipoc);
|
||||||
_alleg = AllegClifo(gruppo, conto, sottoconto);
|
_alleg = AllegClifo(gruppo, conto, sottoconto);
|
||||||
_importo = current_cursor()->file(LF_RMOV)->get_real(RMV_IMPORTO);
|
_importo = current_cursor()->file(LF_RMOV).get_real(RMV_IMPORTO);
|
||||||
_appoggio = current_cursor()->curr(LF_RMOV).get(RMV_SEZIONE);
|
_appoggio = current_cursor()->curr(LF_RMOV).get(RMV_SEZIONE);
|
||||||
if (!_no_preprocess_page)
|
if (!_no_preprocess_page)
|
||||||
{
|
{
|
||||||
@ -772,7 +770,7 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
}
|
}
|
||||||
else if ((_stampa_parte_iva)&&(file == LF_RMOVIVA))
|
else if ((_stampa_parte_iva)&&(file == LF_RMOVIVA))
|
||||||
{
|
{
|
||||||
TRectype iva(current_cursor()->file(LF_RMOVIVA)->curr());
|
const TRectype iva(current_cursor()->file(LF_RMOVIVA).curr());
|
||||||
_impo = iva.get_real(RMI_IMPONIBILE);
|
_impo = iva.get_real(RMI_IMPONIBILE);
|
||||||
_impos = iva.get_real(RMI_IMPOSTA);
|
_impos = iva.get_real(RMI_IMPOSTA);
|
||||||
_tipocr = iva.get_int(RMI_TIPOCR);
|
_tipocr = iva.get_int(RMI_TIPOCR);
|
||||||
@ -796,9 +794,9 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
_anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOES);
|
_anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOES);
|
||||||
_tipodoc = current_cursor()->curr(LF_MOV).get(MOV_TIPODOC);
|
_tipodoc = current_cursor()->curr(LF_MOV).get(MOV_TIPODOC);
|
||||||
|
|
||||||
TLocalisamfile* fl = current_cursor()->file(LF_MOV);
|
TLocalisamfile& fl = current_cursor()->file(LF_MOV);
|
||||||
TRectype da (fl->curr());
|
TRectype da (fl.curr());
|
||||||
TRectype a (fl->curr());
|
TRectype a (fl.curr());
|
||||||
da.zero();
|
da.zero();
|
||||||
a.zero();
|
a.zero();
|
||||||
if (_annoes != 0)
|
if (_annoes != 0)
|
||||||
@ -809,7 +807,7 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
da.put(MOV_CODCAUS, _causale_ini);
|
da.put(MOV_CODCAUS, _causale_ini);
|
||||||
a.put(MOV_CODCAUS, _causale_fin);
|
a.put(MOV_CODCAUS, _causale_fin);
|
||||||
|
|
||||||
if ((fl->curr() >= da) && (fl->curr() <= a))
|
if ((fl.curr() >= da) && (fl.curr() <= a))
|
||||||
/*
|
/*
|
||||||
if ((_annoes == _anno) || (_annoes == 0))
|
if ((_annoes == _anno) || (_annoes == 0))
|
||||||
if ((_causale >= _causale_ini) && (_causale <= _causale_fin))
|
if ((_causale >= _causale_ini) && (_causale <= _causale_fin))
|
||||||
@ -835,7 +833,7 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
long sottoconto = atol(current_cursor()->curr(LF_RMOV).get(RMV_SOTTOCONTO));
|
long sottoconto = atol(current_cursor()->curr(LF_RMOV).get(RMV_SOTTOCONTO));
|
||||||
TString tipoc = current_cursor()->curr(LF_RMOV).get(RMV_TIPOC);
|
TString tipoc = current_cursor()->curr(LF_RMOV).get(RMV_TIPOC);
|
||||||
_descr = DescrConto(gruppo, conto, sottoconto, tipoc);
|
_descr = DescrConto(gruppo, conto, sottoconto, tipoc);
|
||||||
_importo = current_cursor()->file(LF_RMOV)->get_real(RMV_IMPORTO);
|
_importo = current_cursor()->file(LF_RMOV).get_real(RMV_IMPORTO);
|
||||||
_appoggio = current_cursor()->curr(LF_RMOV).get(RMV_SEZIONE);
|
_appoggio = current_cursor()->curr(LF_RMOV).get(RMV_SEZIONE);
|
||||||
if (!_no_preprocess_page)
|
if (!_no_preprocess_page)
|
||||||
{
|
{
|
||||||
@ -885,9 +883,9 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
(_tipo_clifo_prec != "") && _salto_pagina)
|
(_tipo_clifo_prec != "") && _salto_pagina)
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
|
|
||||||
TLocalisamfile* file = cur->file(LF_MOV);
|
TLocalisamfile& file = cur->file(LF_MOV);
|
||||||
TRectype da (file->curr());
|
TRectype da (file.curr());
|
||||||
TRectype a (file->curr());
|
TRectype a (file.curr());
|
||||||
da.zero();
|
da.zero();
|
||||||
a.zero();
|
a.zero();
|
||||||
|
|
||||||
@ -907,7 +905,7 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
if (_codice_fin != 0)
|
if (_codice_fin != 0)
|
||||||
a.put(MOV_CODCF, _codice_fin);
|
a.put(MOV_CODCF, _codice_fin);
|
||||||
|
|
||||||
if ((file->curr() >= da) && (file->curr() <= a))
|
if ((file.curr() >= da) && (file.curr() <= a))
|
||||||
{
|
{
|
||||||
compila_clifo();
|
compila_clifo();
|
||||||
compila_comuni();
|
compila_comuni();
|
||||||
@ -1079,13 +1077,10 @@ print_action CG3100_application::postprocess_page(int file,int count)
|
|||||||
case fatture:
|
case fatture:
|
||||||
if (file == LF_MOV)
|
if (file == LF_MOV)
|
||||||
{
|
{
|
||||||
long numreg;
|
|
||||||
_totdocumenti += _totdoc;
|
_totdocumenti += _totdoc;
|
||||||
TRecnotype pos, items;
|
TRecnotype pos, items;
|
||||||
bool FINITO = FALSE;
|
bool FINITO = FALSE;
|
||||||
TLocalisamfile* mov;
|
TLocalisamfile& mov = current_cursor()->file(LF_MOV);
|
||||||
|
|
||||||
mov = current_cursor()->file(LF_MOV);
|
|
||||||
TCursor * cur = current_cursor();
|
TCursor * cur = current_cursor();
|
||||||
|
|
||||||
pos = current_cursor()->pos();
|
pos = current_cursor()->pos();
|
||||||
@ -1097,9 +1092,9 @@ print_action CG3100_application::postprocess_page(int file,int count)
|
|||||||
{
|
{
|
||||||
cur->save_status();
|
cur->save_status();
|
||||||
++(*cur);
|
++(*cur);
|
||||||
long numrsucc = cur->file(LF_MOV)->get_long(MOV_NUMREG);
|
long numrsucc = cur->file(LF_MOV).get_long(MOV_NUMREG);
|
||||||
_tipoelsucc = cur->file(LF_MOV)->get(MOV_TIPO);
|
_tipoelsucc = cur->file(LF_MOV).get(MOV_TIPO);
|
||||||
_codclifosucc = cur->file(LF_MOV)->get_long(MOV_CODCF);
|
_codclifosucc = cur->file(LF_MOV).get_long(MOV_CODCF);
|
||||||
--(*cur);
|
--(*cur);
|
||||||
cur->restore_status();
|
cur->restore_status();
|
||||||
}
|
}
|
||||||
@ -1139,10 +1134,10 @@ print_action CG3100_application::postprocess_page(int file,int count)
|
|||||||
|
|
||||||
_numreg = current_cursor()->file(LF_RMOVIVA)->get_long(MOV_NUMREG);
|
_numreg = current_cursor()->file(LF_RMOVIVA)->get_long(MOV_NUMREG);
|
||||||
|
|
||||||
TRecnotype recno = rmoviva->recno();
|
TRecnotype recno = rmoviva.recno();
|
||||||
rmoviva->next();
|
rmoviva.next();
|
||||||
numrec = rmoviva->get_long(RMI_NUMREG);
|
numrec = rmoviva.get_long(RMI_NUMREG);
|
||||||
rmoviva->readat(recno);
|
rmoviva.readat(recno);
|
||||||
|
|
||||||
if ( (_numreg != numrec) && (
|
if ( (_numreg != numrec) && (
|
||||||
_settata_prima_riga = FALSE;
|
_settata_prima_riga = FALSE;
|
||||||
@ -1164,39 +1159,39 @@ print_action CG3100_application::postprocess_page(int file,int count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int CG3100_application::my_next(TLocalisamfile * mov)
|
int CG3100_application::my_next(TLocalisamfile & mov)
|
||||||
{
|
{
|
||||||
int esito;
|
int esito;
|
||||||
TString cod_reg, causale;
|
TString cod_reg, causale;
|
||||||
int tipo_reg;
|
int tipo_reg;
|
||||||
int ann_reg;
|
int ann_reg;
|
||||||
|
|
||||||
esito = mov->next();
|
esito = mov.next();
|
||||||
|
|
||||||
switch (_scelta_stampa)
|
switch (_scelta_stampa)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
return esito;
|
return esito;
|
||||||
case 1:
|
case 1:
|
||||||
while (!mov->eof())
|
while (!mov.eof())
|
||||||
{
|
{
|
||||||
cod_reg = mov->get (MOV_REG);
|
cod_reg = mov.get (MOV_REG);
|
||||||
ann_reg = mov->get_int (MOV_ANNOIVA);
|
ann_reg = mov.get_int (MOV_ANNOIVA);
|
||||||
causale = mov->get (MOV_CODCAUS);
|
causale = mov.get (MOV_CODCAUS);
|
||||||
|
|
||||||
//if ( ( ( _annoes != 0l) && (ann_reg != _annoes) )
|
//if ( ( ( _annoes != 0l) && (ann_reg != _annoes) )
|
||||||
// || ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) )
|
// || ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) )
|
||||||
if ( ( _annoes != 0l)
|
if ( ( _annoes != 0l)
|
||||||
|| ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) )
|
|| ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) )
|
||||||
{
|
{
|
||||||
esito=mov->next();
|
esito=mov.next();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
tipo_reg = CodiceRegistro (cod_reg, ann_reg);
|
tipo_reg = CodiceRegistro (cod_reg, ann_reg);
|
||||||
if ( (tipo_reg != 1) && (tipo_reg != 2) )
|
if ( (tipo_reg != 1) && (tipo_reg != 2) )
|
||||||
return esito;
|
return esito;
|
||||||
|
|
||||||
esito=mov->next();
|
esito=mov.next();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1227,17 +1222,16 @@ print_action CG3100_application::postprocess_print(int file,int count)
|
|||||||
if ((_scelta_stampa == 0)&&(_controllo_mov_errati != 3)&&(_tot_dare != _tot_avere))
|
if ((_scelta_stampa == 0)&&(_controllo_mov_errati != 3)&&(_tot_dare != _tot_avere))
|
||||||
set_row(n++, "@11g%s", ERR_77);
|
set_row(n++, "@11g%s", ERR_77);
|
||||||
|
|
||||||
TLocalisamfile* mov;
|
TLocalisamfile& mov =current_cursor()->file(LF_MOV);
|
||||||
mov=current_cursor()->file(LF_MOV);
|
// nrec = mov.recno();
|
||||||
// nrec = mov->recno();
|
|
||||||
|
|
||||||
pos = current_cursor()->pos();
|
pos = current_cursor()->pos();
|
||||||
items = current_cursor()->items();
|
items = current_cursor()->items();
|
||||||
|
|
||||||
FINITO = (pos == items-1);
|
FINITO = (pos == items-1);
|
||||||
|
|
||||||
_datareg = current_cursor()->file(LF_MOV)->get_date(MOV_DATAREG);
|
_datareg = current_cursor()->file(LF_MOV).get_date(MOV_DATAREG);
|
||||||
_numreg = current_cursor()->file(LF_MOV)->get_long(MOV_NUMREG);
|
_numreg = current_cursor()->file(LF_MOV).get_long(MOV_NUMREG);
|
||||||
|
|
||||||
TDate datarec (_datareg);
|
TDate datarec (_datareg);
|
||||||
if (!FINITO)
|
if (!FINITO)
|
||||||
@ -1245,7 +1239,7 @@ print_action CG3100_application::postprocess_print(int file,int count)
|
|||||||
TCursor * cur = current_cursor();
|
TCursor * cur = current_cursor();
|
||||||
cur->save_status();
|
cur->save_status();
|
||||||
++(*cur);
|
++(*cur);
|
||||||
datarec = cur->file(LF_MOV)->get_date(MOV_DATAREG);
|
datarec = cur->file(LF_MOV).get_date(MOV_DATAREG);
|
||||||
--(*cur);
|
--(*cur);
|
||||||
cur->restore_status();
|
cur->restore_status();
|
||||||
}
|
}
|
||||||
@ -1253,11 +1247,11 @@ print_action CG3100_application::postprocess_print(int file,int count)
|
|||||||
esito = my_next(mov);
|
esito = my_next(mov);
|
||||||
if (esito == NOERR)
|
if (esito == NOERR)
|
||||||
{
|
{
|
||||||
long numrec = mov->get_long(MOV_NUMREG);
|
long numrec = mov.get_long(MOV_NUMREG);
|
||||||
datarec = mov->get_date(MOV_DATAREG);
|
datarec = mov.get_date(MOV_DATAREG);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// mov->readat(nrec);
|
// mov.readat(nrec);
|
||||||
|
|
||||||
_tot_avere_giornaliero += _tot_avere;
|
_tot_avere_giornaliero += _tot_avere;
|
||||||
_tot_dare_giornaliero += _tot_dare;
|
_tot_dare_giornaliero += _tot_dare;
|
||||||
@ -1342,23 +1336,21 @@ bool CG3100_application::segnala_errori_ogniriga()
|
|||||||
if ((_tiporegistro == 1)||(_tiporegistro == 2)) //movimento iva
|
if ((_tiporegistro == 1)||(_tiporegistro == 2)) //movimento iva
|
||||||
{
|
{
|
||||||
long record, numreg;
|
long record, numreg;
|
||||||
TLocalisamfile* rmoviva;
|
TLocalisamfile& rmoviva = current_cursor()->file(LF_RMOVIVA);
|
||||||
|
_numreg = current_cursor()->file(LF_MOV).get_long(MOV_NUMREG);
|
||||||
rmoviva = current_cursor()->file(LF_RMOVIVA);
|
|
||||||
_numreg = current_cursor()->file(LF_MOV)->get_long(MOV_NUMREG);
|
|
||||||
if (current_cursor()->is_first_match(LF_RMOVIVA))
|
if (current_cursor()->is_first_match(LF_RMOVIVA))
|
||||||
{
|
{
|
||||||
record = rmoviva->recno();
|
record = rmoviva.recno();
|
||||||
rmoviva->zero();
|
rmoviva.zero();
|
||||||
rmoviva->put(RMI_NUMREG, _numreg);
|
rmoviva.put(RMI_NUMREG, _numreg);
|
||||||
for (rmoviva->read(); !rmoviva->eof() ;rmoviva->next())
|
for (rmoviva.read(); !rmoviva.eof() ;rmoviva.next())
|
||||||
{
|
{
|
||||||
_cod = rmoviva->get(RMI_CODIVA);
|
_cod = rmoviva.get(RMI_CODIVA);
|
||||||
_tipod = rmoviva->get_int(RMI_TIPODET);
|
_tipod = rmoviva.get_int(RMI_TIPODET);
|
||||||
_impo = rmoviva->get_real(RMI_IMPONIBILE);
|
_impo = rmoviva.get_real(RMI_IMPONIBILE);
|
||||||
_impos = rmoviva->get_real(RMI_IMPOSTA);
|
_impos = rmoviva.get_real(RMI_IMPOSTA);
|
||||||
_tipocr = rmoviva->get_int(RMI_TIPOCR);
|
_tipocr = rmoviva.get_int(RMI_TIPOCR);
|
||||||
numreg = rmoviva->get_long(RMI_NUMREG);
|
numreg = rmoviva.get_long(RMI_NUMREG);
|
||||||
if (numreg != _numreg)
|
if (numreg != _numreg)
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
@ -1413,7 +1405,7 @@ bool CG3100_application::segnala_errori_ogniriga()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //for
|
} //for
|
||||||
rmoviva->readat (record);
|
rmoviva.readat (record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return trovato;
|
return trovato;
|
||||||
@ -1424,9 +1416,9 @@ void CG3100_application::incrementa_totali()
|
|||||||
TString dep1;
|
TString dep1;
|
||||||
real imponibile, imposta;
|
real imponibile, imposta;
|
||||||
|
|
||||||
imponibile = current_cursor()->file(LF_RMOVIVA)->get_real(RMI_IMPONIBILE);
|
imponibile = current_cursor()->file(LF_RMOVIVA).get_real(RMI_IMPONIBILE);
|
||||||
imposta = current_cursor()->file(LF_RMOVIVA)->get_real(RMI_IMPOSTA);
|
imposta = current_cursor()->file(LF_RMOVIVA).get_real(RMI_IMPOSTA);
|
||||||
TString codiva = current_cursor()->file(LF_RMOVIVA)->get(RMI_CODIVA);
|
TString codiva = current_cursor()->file(LF_RMOVIVA).get(RMI_CODIVA);
|
||||||
_tabiva->zero();
|
_tabiva->zero();
|
||||||
dep1.format("%-4s",(const char*) codiva);
|
dep1.format("%-4s",(const char*) codiva);
|
||||||
_tabiva->put("CODTAB", (const char*)dep1);
|
_tabiva->put("CODTAB", (const char*)dep1);
|
||||||
@ -1490,7 +1482,6 @@ bool CG3100_application::set_print(int m)
|
|||||||
if (msk.run() != K_ENTER) return FALSE;
|
if (msk.run() != K_ENTER) return FALSE;
|
||||||
|
|
||||||
reset_files();
|
reset_files();
|
||||||
TLocalisamfile* fl;
|
|
||||||
//_curr1->set_filterfunction (0);
|
//_curr1->set_filterfunction (0);
|
||||||
_curr1->set_filterfunction (filter_func);
|
_curr1->set_filterfunction (filter_func);
|
||||||
_curr2->set_filterfunction (filter_func);
|
_curr2->set_filterfunction (filter_func);
|
||||||
@ -1520,9 +1511,9 @@ bool CG3100_application::set_print(int m)
|
|||||||
if (!provvis)
|
if (!provvis)
|
||||||
_curr1->setfilter("(PROVVIS=\"\")");
|
_curr1->setfilter("(PROVVIS=\"\")");
|
||||||
else _curr1->setfilter("");
|
else _curr1->setfilter("");
|
||||||
fl = current_cursor()->file(LF_MOV);
|
TLocalisamfile& fl = current_cursor()->file(LF_MOV);
|
||||||
TRectype da (fl->curr());
|
TRectype da (fl.curr());
|
||||||
TRectype a (fl->curr());
|
TRectype a (fl.curr());
|
||||||
da.zero();
|
da.zero();
|
||||||
a.zero();
|
a.zero();
|
||||||
da.put(MOV_NUMREG, _numreg_ini);
|
da.put(MOV_NUMREG, _numreg_ini);
|
||||||
@ -1539,9 +1530,9 @@ bool CG3100_application::set_print(int m)
|
|||||||
_curr2->setfilter("(PROVVIS=\"\")");
|
_curr2->setfilter("(PROVVIS=\"\")");
|
||||||
else
|
else
|
||||||
_curr2->setfilter("");
|
_curr2->setfilter("");
|
||||||
fl = current_cursor()->file(LF_MOV);
|
TLocalisamfile& fl = current_cursor()->file(LF_MOV);
|
||||||
TRectype da (fl->curr());
|
TRectype da (fl.curr());
|
||||||
TRectype a (fl->curr());
|
TRectype a (fl.curr());
|
||||||
da.zero();
|
da.zero();
|
||||||
a.zero();
|
a.zero();
|
||||||
if (_data_ini.ok())
|
if (_data_ini.ok())
|
||||||
@ -1558,7 +1549,7 @@ bool CG3100_application::set_print(int m)
|
|||||||
|
|
||||||
case fatture:
|
case fatture:
|
||||||
{
|
{
|
||||||
fl = current_cursor()->file(LF_MOV);
|
TLocalisamfile& fl = current_cursor()->file(LF_MOV);
|
||||||
TString tipo = msk.get(F_TIPOELENCO);
|
TString tipo = msk.get(F_TIPOELENCO);
|
||||||
bool movprov = msk.get_bool(F_STAMPAMOVP);
|
bool movprov = msk.get_bool(F_STAMPAMOVP);
|
||||||
if (tipo=="C" || tipo=="F")
|
if (tipo=="C" || tipo=="F")
|
||||||
@ -1572,7 +1563,7 @@ bool CG3100_application::set_print(int m)
|
|||||||
_codice_fin = atol(msk.get(F_CODICEFIN1));
|
_codice_fin = atol(msk.get(F_CODICEFIN1));
|
||||||
}
|
}
|
||||||
|
|
||||||
// _relmov->add(LF_MOV, "NUMREG=NUMREG",1, LF_RMOVIVA,100); //creo un alias per il file LF_MOV
|
// _relmov.add(LF_MOV, "NUMREG=NUMREG",1, LF_RMOVIVA,100); //creo un alias per il file LF_MOV
|
||||||
if (tipo == "E")
|
if (tipo == "E")
|
||||||
{
|
{
|
||||||
_tipo_ini = "C";
|
_tipo_ini = "C";
|
||||||
@ -1587,8 +1578,8 @@ bool CG3100_application::set_print(int m)
|
|||||||
if (!movprov)
|
if (!movprov)
|
||||||
_curr3->setfilter("(PROVVIS=\"\")");
|
_curr3->setfilter("(PROVVIS=\"\")");
|
||||||
else _curr3->setfilter("");
|
else _curr3->setfilter("");
|
||||||
TRectype da (fl->curr());
|
TRectype da (fl.curr());
|
||||||
TRectype a (fl->curr());
|
TRectype a (fl.curr());
|
||||||
da.zero();
|
da.zero();
|
||||||
a.zero();
|
a.zero();
|
||||||
if (_codice_ini != 0)
|
if (_codice_ini != 0)
|
||||||
|
217
cg/cg3200.cpp
217
cg/cg3200.cpp
@ -5,7 +5,6 @@
|
|||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <sort.h>
|
#include <sort.h>
|
||||||
|
|
||||||
#include <lffiles.h>
|
|
||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
#include <pconti.h>
|
#include <pconti.h>
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
@ -165,21 +164,19 @@ bool CG3200_application::almeno_un_record()
|
|||||||
long record,sottoc;
|
long record,sottoc;
|
||||||
int gruppo,conto;
|
int gruppo,conto;
|
||||||
TDate datareg, datacomp;
|
TDate datareg, datacomp;
|
||||||
TLocalisamfile* rmov;
|
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||||
|
|
||||||
rmov = current_cursor()->file(LF_RMOV);
|
|
||||||
|
|
||||||
if (current_cursor()->is_first_match(LF_RMOV))
|
if (current_cursor()->is_first_match(LF_RMOV))
|
||||||
{
|
{
|
||||||
record = rmov->recno();
|
record = rmov.recno();
|
||||||
rmov->zero();
|
rmov.zero();
|
||||||
rmov->put(RMV_GRUPPO,_gruppo);
|
rmov.put(RMV_GRUPPO,_gruppo);
|
||||||
rmov->put(RMV_CONTO,_conto);
|
rmov.put(RMV_CONTO,_conto);
|
||||||
rmov->put(RMV_SOTTOCONTO,_sottoc);
|
rmov.put(RMV_SOTTOCONTO,_sottoc);
|
||||||
for (rmov->read(); !rmov->eof() ;rmov->next())
|
for (rmov.read(); !rmov.eof() ;rmov.next())
|
||||||
{
|
{
|
||||||
int annoes = rmov->get_int (RMV_ANNOES);
|
int annoes = rmov.get_int (RMV_ANNOES);
|
||||||
long numreg = rmov->get_long(RMV_NUMREG);
|
long numreg = rmov.get_long(RMV_NUMREG);
|
||||||
|
|
||||||
_mov->setkey(1);
|
_mov->setkey(1);
|
||||||
_mov->curr().zero();
|
_mov->curr().zero();
|
||||||
@ -190,14 +187,14 @@ bool CG3200_application::almeno_un_record()
|
|||||||
datacomp = (_mov->curr().get(MOV_DATACOMP));
|
datacomp = (_mov->curr().get(MOV_DATACOMP));
|
||||||
|
|
||||||
if (_annomsk == 0)
|
if (_annomsk == 0)
|
||||||
datareg = rmov->get_date(RMV_DATAREG);
|
datareg = rmov.get_date(RMV_DATAREG);
|
||||||
else
|
else
|
||||||
if (_annomsk != 0)
|
if (_annomsk != 0)
|
||||||
datareg = datacomp;
|
datareg = datacomp;
|
||||||
|
|
||||||
gruppo = rmov->get_int(RMV_GRUPPO);
|
gruppo = rmov.get_int(RMV_GRUPPO);
|
||||||
conto = rmov->get_int(RMV_CONTO);
|
conto = rmov.get_int(RMV_CONTO);
|
||||||
sottoc = rmov->get_long(RMV_SOTTOCONTO);
|
sottoc = rmov.get_long(RMV_SOTTOCONTO);
|
||||||
if ((gruppo != _gruppo)&&(conto != _conto)&&(sottoc != _sottoc))
|
if ((gruppo != _gruppo)&&(conto != _conto)&&(sottoc != _sottoc))
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
@ -207,7 +204,7 @@ bool CG3200_application::almeno_un_record()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rmov->readat(record);
|
rmov.readat(record);
|
||||||
}
|
}
|
||||||
return trovato;
|
return trovato;
|
||||||
}
|
}
|
||||||
@ -315,35 +312,34 @@ bool CG3200_application::data_fine(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
void CG3200_application::saldi_zero()
|
void CG3200_application::saldi_zero()
|
||||||
{
|
{
|
||||||
TLocalisamfile* rmov;
|
|
||||||
real saldo_dare, saldo_avere;
|
real saldo_dare, saldo_avere;
|
||||||
long record;
|
long record;
|
||||||
|
|
||||||
saldo_dare = saldo_avere = 0;
|
saldo_dare = saldo_avere = 0;
|
||||||
|
|
||||||
rmov = current_cursor()->file(LF_RMOV);
|
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||||
if (current_cursor()->is_first_match(LF_RMOV))
|
if (current_cursor()->is_first_match(LF_RMOV))
|
||||||
{
|
{
|
||||||
record = rmov->recno();
|
record = rmov.recno();
|
||||||
|
|
||||||
while (!rmov->eof())
|
while (!rmov.eof())
|
||||||
{
|
{
|
||||||
rmov->read();
|
rmov.read();
|
||||||
// char sezione = *(_rmov->curr().get(RMV_SEZIONE));
|
// char sezione = *(_rmov.curr().get(RMV_SEZIONE));
|
||||||
TString sezione = rmov->curr().get(RMV_SEZIONE);
|
TString sezione = rmov.curr().get(RMV_SEZIONE);
|
||||||
real importo = rmov->curr().get_real(RMV_IMPORTO);
|
real importo = rmov.curr().get_real(RMV_IMPORTO);
|
||||||
int gruppo = atoi(rmov->get(RMV_GRUPPO));
|
int gruppo = atoi(rmov.get(RMV_GRUPPO));
|
||||||
int conto = atoi(rmov->get(RMV_CONTO));
|
int conto = atoi(rmov.get(RMV_CONTO));
|
||||||
long sottoc = atol(rmov->get(RMV_SOTTOCONTO));
|
long sottoc = atol(rmov.get(RMV_SOTTOCONTO));
|
||||||
|
|
||||||
if ((gruppo == _gruppo)&&(conto == _conto)&&(sottoc == _sottoc))
|
if ((gruppo == _gruppo)&&(conto == _conto)&&(sottoc == _sottoc))
|
||||||
if (sezione == "D")
|
if (sezione == "D")
|
||||||
saldo_dare += importo;
|
saldo_dare += importo;
|
||||||
else if (sezione == "A")
|
else if (sezione == "A")
|
||||||
saldo_avere += importo;
|
saldo_avere += importo;
|
||||||
rmov->next();
|
rmov.next();
|
||||||
}
|
}
|
||||||
rmov->readat(record);
|
rmov.readat(record);
|
||||||
}
|
}
|
||||||
_totale_saldo = saldo_dare - saldo_avere;
|
_totale_saldo = saldo_dare - saldo_avere;
|
||||||
}
|
}
|
||||||
@ -368,7 +364,6 @@ void CG3200_application::fai_stampa132()
|
|||||||
|
|
||||||
void CG3200_application::fai_stampa198()
|
void CG3200_application::fai_stampa198()
|
||||||
{
|
{
|
||||||
TLocalisamfile* rmov;
|
|
||||||
long rec;
|
long rec;
|
||||||
TDate datasucc;
|
TDate datasucc;
|
||||||
TString datasuccstring,dataregrmovstring;
|
TString datasuccstring,dataregrmovstring;
|
||||||
@ -400,19 +395,19 @@ void CG3200_application::fai_stampa198()
|
|||||||
|
|
||||||
//Gestire la stampa di saldo_progressivi nella postprocess_page di RMOV
|
//Gestire la stampa di saldo_progressivi nella postprocess_page di RMOV
|
||||||
|
|
||||||
rmov = current_cursor()->file(LF_RMOV);
|
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||||
rec = rmov->recno();
|
rec = rmov.recno();
|
||||||
rmov->next();
|
rmov.next();
|
||||||
gruppof = rmov->get_int(RMV_GRUPPO);
|
gruppof = rmov.get_int(RMV_GRUPPO);
|
||||||
contof = rmov->get_int(RMV_CONTO);
|
contof = rmov.get_int(RMV_CONTO);
|
||||||
sottocf = rmov->get_int(RMV_SOTTOCONTO);
|
sottocf = rmov.get_int(RMV_SOTTOCONTO);
|
||||||
datasucc = rmov->get_date(RMV_DATAREG);
|
datasucc = rmov.get_date(RMV_DATAREG);
|
||||||
datasuccstring=datasucc.string();
|
datasuccstring=datasucc.string();
|
||||||
if (((gruppof!=_gruppo)||(contof!=_conto)||(sottocf!=_sottoc))||(rmov->eof()))
|
if (((gruppof!=_gruppo)||(contof!=_conto)||(sottocf!=_sottoc))||(rmov.eof()))
|
||||||
datasucc = ("");
|
datasucc = ("");
|
||||||
if (datasucc != _dataregrmov)
|
if (datasucc != _dataregrmov)
|
||||||
set_row (1,"@136g#t", &_saldo_progressivi_str);
|
set_row (1,"@136g#t", &_saldo_progressivi_str);
|
||||||
rmov->readat(rec);
|
rmov.readat(rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG3200_application::stampa_totali132()
|
void CG3200_application::stampa_totali132()
|
||||||
@ -468,7 +463,6 @@ void CG3200_application::stampa_totali198()
|
|||||||
|
|
||||||
bool CG3200_application::preprocess_pconti(int file, int counter)
|
bool CG3200_application::preprocess_pconti(int file, int counter)
|
||||||
{
|
{
|
||||||
TLocalisamfile* rmov;
|
|
||||||
long record;
|
long record;
|
||||||
TString provvis = "";
|
TString provvis = "";
|
||||||
|
|
||||||
@ -521,20 +515,20 @@ bool CG3200_application::preprocess_pconti(int file, int counter)
|
|||||||
_numreg = atol (current_cursor()->curr(LF_RMOV).get(RMV_NUMREG));
|
_numreg = atol (current_cursor()->curr(LF_RMOV).get(RMV_NUMREG));
|
||||||
|
|
||||||
int rcontr = atoi(current_cursor()->curr(LF_RMOV).get(RMV_RCONTR));
|
int rcontr = atoi(current_cursor()->curr(LF_RMOV).get(RMV_RCONTR));
|
||||||
rmov = current_cursor()->file(LF_RMOV);
|
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||||
record = rmov->recno();
|
record = rmov.recno();
|
||||||
rmov->setkey(1);
|
rmov.setkey(1);
|
||||||
rmov->curr().zero();
|
rmov.curr().zero();
|
||||||
rmov->curr().put(RMV_NUMREG,_numreg);
|
rmov.curr().put(RMV_NUMREG,_numreg);
|
||||||
rmov->curr().put(RMV_NUMRIG,rcontr);
|
rmov.curr().put(RMV_NUMRIG,rcontr);
|
||||||
rmov->read();
|
rmov.read();
|
||||||
if (rmov->bad())
|
if (rmov.bad())
|
||||||
rmov->curr().zero();
|
rmov.curr().zero();
|
||||||
_gruppocontr = rmov->curr().get(RMV_GRUPPO);
|
_gruppocontr = rmov.curr().get(RMV_GRUPPO);
|
||||||
_contocontr = rmov->curr().get(RMV_CONTO);
|
_contocontr = rmov.curr().get(RMV_CONTO);
|
||||||
_sottocontocontr = rmov->curr().get(RMV_SOTTOCONTO);
|
_sottocontocontr = rmov.curr().get(RMV_SOTTOCONTO);
|
||||||
rmov->setkey(2);
|
rmov.setkey(2);
|
||||||
rmov->readat(record);
|
rmov.readat(record);
|
||||||
|
|
||||||
// Stampa solo quelli che hanno anno esercizio uguale a quello specificato
|
// Stampa solo quelli che hanno anno esercizio uguale a quello specificato
|
||||||
// nella maschera. Se non viene specificato li stampa tutti
|
// nella maschera. Se non viene specificato li stampa tutti
|
||||||
@ -692,7 +686,6 @@ bool CG3200_application::preprocess_pconti(int file, int counter)
|
|||||||
|
|
||||||
bool CG3200_application::preprocess_clifo(int file, int counter)
|
bool CG3200_application::preprocess_clifo(int file, int counter)
|
||||||
{
|
{
|
||||||
TLocalisamfile* rmov;
|
|
||||||
long record;
|
long record;
|
||||||
TString provvis = "";
|
TString provvis = "";
|
||||||
|
|
||||||
@ -745,20 +738,20 @@ bool CG3200_application::preprocess_clifo(int file, int counter)
|
|||||||
_numreg = atol (current_cursor()->curr(LF_RMOV).get(RMV_NUMREG));
|
_numreg = atol (current_cursor()->curr(LF_RMOV).get(RMV_NUMREG));
|
||||||
|
|
||||||
int rcontr = atoi(current_cursor()->curr(LF_RMOV).get(RMV_RCONTR));
|
int rcontr = atoi(current_cursor()->curr(LF_RMOV).get(RMV_RCONTR));
|
||||||
rmov = current_cursor()->file(LF_RMOV);
|
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||||
record = rmov->recno();
|
record = rmov.recno();
|
||||||
rmov->setkey(1);
|
rmov.setkey(1);
|
||||||
rmov->curr().zero();
|
rmov.curr().zero();
|
||||||
rmov->curr().put(RMV_NUMREG,_numreg);
|
rmov.curr().put(RMV_NUMREG,_numreg);
|
||||||
rmov->curr().put(RMV_NUMRIG,rcontr);
|
rmov.curr().put(RMV_NUMRIG,rcontr);
|
||||||
rmov->read();
|
rmov.read();
|
||||||
if (rmov->bad())
|
if (rmov.bad())
|
||||||
rmov->curr().zero();
|
rmov.curr().zero();
|
||||||
_gruppocontr = rmov->curr().get(RMV_GRUPPO);
|
_gruppocontr = rmov.curr().get(RMV_GRUPPO);
|
||||||
_contocontr = rmov->curr().get(RMV_CONTO);
|
_contocontr = rmov.curr().get(RMV_CONTO);
|
||||||
_sottocontocontr = rmov->curr().get(RMV_SOTTOCONTO);
|
_sottocontocontr = rmov.curr().get(RMV_SOTTOCONTO);
|
||||||
rmov->setkey(2);
|
rmov.setkey(2);
|
||||||
rmov->readat(record);
|
rmov.readat(record);
|
||||||
|
|
||||||
|
|
||||||
// Stampa solo quelli che hanno anno esercizio uguale a quello specificato
|
// Stampa solo quelli che hanno anno esercizio uguale a quello specificato
|
||||||
@ -1167,7 +1160,6 @@ bool CG3200_application::set_print(int)
|
|||||||
{
|
{
|
||||||
KEY tasto;
|
KEY tasto;
|
||||||
int crt;
|
int crt;
|
||||||
TLocalisamfile* fl;
|
|
||||||
TString data1,data2;
|
TString data1,data2;
|
||||||
|
|
||||||
_puoi_stampare = TRUE;
|
_puoi_stampare = TRUE;
|
||||||
@ -1180,7 +1172,7 @@ bool CG3200_application::set_print(int)
|
|||||||
|
|
||||||
if (tasto == K_ENTER)
|
if (tasto == K_ENTER)
|
||||||
{
|
{
|
||||||
_annomsk = atoi(_msk->get(F_ANNO));
|
_annomsk = _msk->get_int(F_ANNO);
|
||||||
|
|
||||||
_stampaprogre = (bool)(_msk->get(F_STAMPAPROGRE) == "X");
|
_stampaprogre = (bool)(_msk->get(F_STAMPAPROGRE) == "X");
|
||||||
_stampatotiva = (bool)(_msk->get(F_STAMPATOTIVA) == "X");
|
_stampatotiva = (bool)(_msk->get(F_STAMPATOTIVA) == "X");
|
||||||
@ -1218,9 +1210,9 @@ bool CG3200_application::set_print(int)
|
|||||||
add_file(LF_RMOV,LF_PCON);
|
add_file(LF_RMOV,LF_PCON);
|
||||||
|
|
||||||
select_cursor(_cur1);
|
select_cursor(_cur1);
|
||||||
fl = current_cursor()->file(LF_PCON);
|
TLocalisamfile& fl = current_cursor()->file(LF_PCON);
|
||||||
TRectype da (fl->curr());
|
TRectype da (fl.curr());
|
||||||
TRectype a (fl->curr());
|
TRectype a (fl.curr());
|
||||||
|
|
||||||
da.zero();
|
da.zero();
|
||||||
a.zero();
|
a.zero();
|
||||||
@ -1246,9 +1238,9 @@ bool CG3200_application::set_print(int)
|
|||||||
add_file(LF_CLIFO);
|
add_file(LF_CLIFO);
|
||||||
add_file(LF_RMOV,LF_CLIFO);
|
add_file(LF_RMOV,LF_CLIFO);
|
||||||
|
|
||||||
fl = current_cursor()->file(LF_CLIFO);
|
TLocalisamfile& fl = current_cursor()->file(LF_CLIFO);
|
||||||
TRectype da (fl->curr());
|
TRectype da (fl.curr());
|
||||||
TRectype a (fl->curr());
|
TRectype a (fl.curr());
|
||||||
|
|
||||||
da.zero();
|
da.zero();
|
||||||
a.zero();
|
a.zero();
|
||||||
@ -1482,25 +1474,24 @@ void CG3200_application::calcola_progressivi_al()
|
|||||||
long record,sottoc,annoes;
|
long record,sottoc,annoes;
|
||||||
int gruppo,conto;
|
int gruppo,conto;
|
||||||
TDate datareg, datacomp;
|
TDate datareg, datacomp;
|
||||||
TLocalisamfile* rmov;
|
|
||||||
char sezione;
|
char sezione;
|
||||||
real importo;
|
real importo;
|
||||||
TDate data;
|
TDate data;
|
||||||
|
|
||||||
rmov = current_cursor()->file(LF_RMOV);
|
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||||
|
|
||||||
record = rmov->recno();
|
record = rmov.recno();
|
||||||
rmov->zero();
|
rmov.zero();
|
||||||
rmov->put(RMV_GRUPPO, _gruppo);
|
rmov.put(RMV_GRUPPO, _gruppo);
|
||||||
rmov->put(RMV_CONTO, _conto);
|
rmov.put(RMV_CONTO, _conto);
|
||||||
rmov->put(RMV_SOTTOCONTO, _sottoc);
|
rmov.put(RMV_SOTTOCONTO, _sottoc);
|
||||||
for (rmov->read();!rmov->eof() ;rmov->next())
|
for (rmov.read();!rmov.eof() ;rmov.next())
|
||||||
{
|
{
|
||||||
annoes = rmov->get_int (RMV_ANNOES);
|
annoes = rmov.get_int (RMV_ANNOES);
|
||||||
datareg = rmov->get_date(RMV_DATAREG);
|
datareg = rmov.get_date(RMV_DATAREG);
|
||||||
sezione = rmov->get (RMV_SEZIONE)[0];
|
sezione = rmov.get (RMV_SEZIONE)[0];
|
||||||
importo = rmov->get_real(RMV_IMPORTO);
|
importo = rmov.get_real(RMV_IMPORTO);
|
||||||
long numreg = rmov->get_long(RMV_NUMREG);
|
long numreg = rmov.get_long(RMV_NUMREG);
|
||||||
|
|
||||||
_mov->setkey(1);
|
_mov->setkey(1);
|
||||||
_mov->curr().zero();
|
_mov->curr().zero();
|
||||||
@ -1512,7 +1503,7 @@ void CG3200_application::calcola_progressivi_al()
|
|||||||
|
|
||||||
if (_annomsk == 0)
|
if (_annomsk == 0)
|
||||||
{
|
{
|
||||||
datareg = rmov->get_date(RMV_DATAREG);
|
datareg = rmov.get_date(RMV_DATAREG);
|
||||||
data = _inizioEs;
|
data = _inizioEs;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1525,9 +1516,9 @@ void CG3200_application::calcola_progressivi_al()
|
|||||||
TString data2 = _data_ini.string();
|
TString data2 = _data_ini.string();
|
||||||
TString data3 = data.string();
|
TString data3 = data.string();
|
||||||
|
|
||||||
gruppo = rmov->get_int(RMV_GRUPPO);
|
gruppo = rmov.get_int(RMV_GRUPPO);
|
||||||
conto = rmov->get_int(RMV_CONTO);
|
conto = rmov.get_int(RMV_CONTO);
|
||||||
sottoc = rmov->get_long(RMV_SOTTOCONTO);
|
sottoc = rmov.get_long(RMV_SOTTOCONTO);
|
||||||
if ((gruppo != _gruppo)||(conto != _conto)||(sottoc != _sottoc))
|
if ((gruppo != _gruppo)||(conto != _conto)||(sottoc != _sottoc))
|
||||||
break;
|
break;
|
||||||
else if (((annoes==_annomsk)||(_annomsk == 0))&&(datareg >= data)&&(datareg < _data_ini)) //Legge movimenti con data < data iniziale
|
else if (((annoes==_annomsk)||(_annomsk == 0))&&(datareg >= data)&&(datareg < _data_ini)) //Legge movimenti con data < data iniziale
|
||||||
@ -1536,7 +1527,7 @@ void CG3200_application::calcola_progressivi_al()
|
|||||||
else if (sezione == 'A')
|
else if (sezione == 'A')
|
||||||
_totale_prima_avere += importo;
|
_totale_prima_avere += importo;
|
||||||
}
|
}
|
||||||
rmov->readat(record);
|
rmov.readat(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG3200_application::calcola_progressivi()
|
void CG3200_application::calcola_progressivi()
|
||||||
@ -1576,7 +1567,7 @@ void CG3200_application::calcola_progressivi()
|
|||||||
record.put(SLD_SOTTOCONTO, _sottoc);
|
record.put(SLD_SOTTOCONTO, _sottoc);
|
||||||
|
|
||||||
if (_ricerca == 'P')
|
if (_ricerca == 'P')
|
||||||
indbil = atoi (current_cursor()->file(LF_PCON)->get(PCN_INDBIL));
|
indbil = atoi (current_cursor()->file(LF_PCON).get(PCN_INDBIL));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((_ricerca == 'C') || (_ricerca == 'F'))
|
if ((_ricerca == 'C') || (_ricerca == 'F'))
|
||||||
@ -1891,16 +1882,15 @@ void CG3200_application::ricerca_gruppo()
|
|||||||
|
|
||||||
const char* CG3200_application::descrizione_gruppo()
|
const char* CG3200_application::descrizione_gruppo()
|
||||||
{
|
{
|
||||||
TLocalisamfile* pconti;
|
|
||||||
long record;
|
long record;
|
||||||
|
|
||||||
pconti = current_cursor()->file(LF_PCON);
|
TLocalisamfile& pconti = current_cursor()->file(LF_PCON);
|
||||||
record = pconti->recno();
|
record = pconti.recno();
|
||||||
pconti->curr().zero();
|
pconti.zero();
|
||||||
pconti->curr().put(PCN_GRUPPO,_gruppo);
|
pconti.put(PCN_GRUPPO,_gruppo);
|
||||||
pconti->read();
|
pconti.read();
|
||||||
tmp = pconti->curr().get(PCN_DESCR);
|
tmp = pconti.get(PCN_DESCR);
|
||||||
pconti->readat(record);
|
pconti.readat(record);
|
||||||
return (tmp);
|
return (tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1908,17 +1898,16 @@ const char* CG3200_application::descrizione_gruppo()
|
|||||||
|
|
||||||
const char* CG3200_application::descrizione_conto()
|
const char* CG3200_application::descrizione_conto()
|
||||||
{
|
{
|
||||||
TLocalisamfile* pconti;
|
|
||||||
long record;
|
long record;
|
||||||
|
|
||||||
pconti = current_cursor()->file(LF_PCON);
|
TLocalisamfile& pconti = current_cursor()->file(LF_PCON);
|
||||||
record = pconti->recno();
|
record = pconti.recno();
|
||||||
pconti->curr().zero();
|
pconti.curr().zero();
|
||||||
pconti->curr().put(PCN_GRUPPO,_gruppo);
|
pconti.curr().put(PCN_GRUPPO,_gruppo);
|
||||||
pconti->curr().put(PCN_CONTO,_conto);
|
pconti.curr().put(PCN_CONTO,_conto);
|
||||||
pconti->read();
|
pconti.read();
|
||||||
tmp = pconti->curr().get(PCN_DESCR);
|
tmp = pconti.curr().get(PCN_DESCR);
|
||||||
pconti->readat(record);
|
pconti.readat(record);
|
||||||
return (tmp);
|
return (tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4538
cg/cg3300.cpp
4538
cg/cg3300.cpp
File diff suppressed because it is too large
Load Diff
1168
cg/cg3301.cpp
1168
cg/cg3301.cpp
File diff suppressed because it is too large
Load Diff
@ -331,8 +331,8 @@ void CG3400_application::user_create()
|
|||||||
_rel->add (LF_RMOVIVA, "NUMREG=NUMREG");
|
_rel->add (LF_RMOVIVA, "NUMREG=NUMREG");
|
||||||
|
|
||||||
_cur = new TCursor (_rel, "", 2); // usa la chiave 2 su MOV
|
_cur = new TCursor (_rel, "", 2); // usa la chiave 2 su MOV
|
||||||
_RecPartoDa = new TRectype(_cur->file(LF_MOV));
|
_RecPartoDa = new TRectype(_cur->file(LF_MOV).curr());
|
||||||
_RecArrivoA = new TRectype(_cur->file(LF_MOV));
|
_RecArrivoA = new TRectype(_cur->file(LF_MOV).curr());
|
||||||
|
|
||||||
add_cursor (_cur);
|
add_cursor (_cur);
|
||||||
|
|
||||||
@ -388,11 +388,10 @@ void CG3400_application::aggiorna_mov()
|
|||||||
|
|
||||||
void CG3400_application::scrivi_numgio(long nprog)
|
void CG3400_application::scrivi_numgio(long nprog)
|
||||||
{
|
{
|
||||||
TLocalisamfile *mov = current_cursor()->file(LF_MOV);
|
TLocalisamfile &mov = current_cursor()->file(LF_MOV);
|
||||||
|
mov.reread(_lock);
|
||||||
mov->reread(_lock);
|
mov.put (MOV_NUMGIO, nprog);
|
||||||
mov->put (MOV_NUMGIO, nprog);
|
mov.rewrite();
|
||||||
mov->rewrite();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG3400_application::stampa_totali_giorno(TDate data, bool ff)
|
void CG3400_application::stampa_totali_giorno(TDate data, bool ff)
|
||||||
@ -581,7 +580,7 @@ print_action CG3400_application::postprocess_print(int file, int counter)
|
|||||||
case LF_MOV:
|
case LF_MOV:
|
||||||
{
|
{
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
*_RecArrivoA = _cur->file(LF_MOV)->curr();
|
*_RecArrivoA = _cur->file(LF_MOV).curr();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -811,7 +810,7 @@ bool CG3400_application::preprocess_print(int file, int counter)
|
|||||||
|
|
||||||
_nprog_mov = _nprog_da;
|
_nprog_mov = _nprog_da;
|
||||||
|
|
||||||
*_RecPartoDa = _cur->file(LF_MOV)->curr();
|
*_RecPartoDa = _cur->file(LF_MOV).curr();
|
||||||
|
|
||||||
for (i=1; i<RIGHE_FOOTER; i++)
|
for (i=1; i<RIGHE_FOOTER; i++)
|
||||||
set_footer(i, "%s", " ");
|
set_footer(i, "%s", " ");
|
||||||
@ -880,7 +879,7 @@ print_action CG3400_application::postprocess_page(int file, int counter)
|
|||||||
}
|
}
|
||||||
_cur->save_status();
|
_cur->save_status();
|
||||||
++(*_cur);
|
++(*_cur);
|
||||||
_data_succ = _cur->file(LF_MOV)->get_date(MOV_DATAREG);
|
_data_succ = _cur->file(LF_MOV).get_date(MOV_DATAREG);
|
||||||
_mese_succ = _data_succ.month();
|
_mese_succ = _data_succ.month();
|
||||||
--(*_cur);
|
--(*_cur);
|
||||||
_cur->restore_status();
|
_cur->restore_status();
|
||||||
@ -936,7 +935,7 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
|
|
||||||
if (!current_cursor()->is_first_match(LF_RMOV)) return FALSE;
|
if (!current_cursor()->is_first_match(LF_RMOV)) return FALSE;
|
||||||
|
|
||||||
gia_stampato = current_cursor()->file(LF_MOV)->get_bool(MOV_STAMPATO);
|
gia_stampato = current_cursor()->file(LF_MOV).get_bool(MOV_STAMPATO);
|
||||||
if (gia_stampato)
|
if (gia_stampato)
|
||||||
if (_stampa_definitiva)
|
if (_stampa_definitiva)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -945,10 +944,10 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
|
|
||||||
if (_libro_giornale_iva_unico) _nprog_mov++;
|
if (_libro_giornale_iva_unico) _nprog_mov++;
|
||||||
|
|
||||||
_data_corr = _cur->file(LF_MOV)->get_date(MOV_DATAREG);
|
_data_corr = _cur->file(LF_MOV).get_date(MOV_DATAREG);
|
||||||
_mese_corr = _data_corr.month();
|
_mese_corr = _data_corr.month();
|
||||||
_annoEsMov = _cur->file(LF_MOV)->get_int(MOV_ANNOES);
|
_annoEsMov = _cur->file(LF_MOV).get_int(MOV_ANNOES);
|
||||||
caus = _cur->file(LF_MOV)->get(MOV_CODCAUS);
|
caus = _cur->file(LF_MOV).get(MOV_CODCAUS);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -969,7 +968,7 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
_descr_causale->set_width(198);
|
_descr_causale->set_width(198);
|
||||||
}
|
}
|
||||||
setta_righe_descr(_descr_causale, causale);
|
setta_righe_descr(_descr_causale, causale);
|
||||||
rmv_descr = current_cursor()->file(LF_RMOV)->get(RMV_DESCR);
|
rmv_descr = current_cursor()->file(LF_RMOV).get(RMV_DESCR);
|
||||||
if (_stampa_width == 132)
|
if (_stampa_width == 132)
|
||||||
{
|
{
|
||||||
*_descr_operazione = (const char *)rmv_descr;
|
*_descr_operazione = (const char *)rmv_descr;
|
||||||
@ -1026,8 +1025,8 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sezione = _cur->file(LF_RMOV)->get (RMV_SEZIONE);
|
sezione = _cur->file(LF_RMOV).get (RMV_SEZIONE);
|
||||||
importo = _cur->file(LF_RMOV)->get_real (RMV_IMPORTO);
|
importo = _cur->file(LF_RMOV).get_real (RMV_IMPORTO);
|
||||||
|
|
||||||
// imp = importo.string ("######");
|
// imp = importo.string ("######");
|
||||||
if (sezione == "D")
|
if (sezione == "D")
|
||||||
@ -1080,7 +1079,7 @@ void CG3400_application::calcola_iva()
|
|||||||
TString codiva;
|
TString codiva;
|
||||||
int tipocr, tipodet;
|
int tipocr, tipodet;
|
||||||
real impo, impos;
|
real impo, impos;
|
||||||
TRectype iva (_cur->file(LF_RMOVIVA)->curr());
|
TRectype iva (_cur->file(LF_RMOVIVA).curr());
|
||||||
|
|
||||||
if (!iva.empty())
|
if (!iva.empty())
|
||||||
{
|
{
|
||||||
@ -1168,7 +1167,7 @@ void CG3400_application::setta_righe_valuta()
|
|||||||
TString simbolo, codval;
|
TString simbolo, codval;
|
||||||
bool intracom;
|
bool intracom;
|
||||||
|
|
||||||
codval = current_cursor()->file(LF_MOV)->get(MOV_CODVAL);
|
codval = current_cursor()->file(LF_MOV).get(MOV_CODVAL);
|
||||||
intracom = current_cursor()->curr(LF_RMOVIVA).get_bool(RMI_INTRA);
|
intracom = current_cursor()->curr(LF_RMOVIVA).get_bool(RMI_INTRA);
|
||||||
simbolo = SimboloValuta(codval);
|
simbolo = SimboloValuta(codval);
|
||||||
|
|
||||||
@ -1201,12 +1200,12 @@ void CG3400_application::setta_righe_indirizzo()
|
|||||||
if (_occas)
|
if (_occas)
|
||||||
{
|
{
|
||||||
TCursor * cur = current_cursor();
|
TCursor * cur = current_cursor();
|
||||||
TLocalisamfile * occ = cur->file(LF_OCCAS);
|
TLocalisamfile & occ = cur->file(LF_OCCAS);
|
||||||
|
|
||||||
_viacf = occ->get (OCC_INDIR);
|
_viacf = occ.get (OCC_INDIR);
|
||||||
_civcf = occ->get (OCC_CIV);
|
_civcf = occ.get (OCC_CIV);
|
||||||
_capcf = occ->get (OCC_CAP);
|
_capcf = occ.get (OCC_CAP);
|
||||||
_comcf = occ->get (OCC_COM);
|
_comcf = occ.get (OCC_COM);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRectype dep = look_com (_comcf, _com);
|
TRectype dep = look_com (_comcf, _com);
|
||||||
@ -1425,8 +1424,8 @@ bool CG3400_application::set_print(int)
|
|||||||
if (_stampa_width == 1) _stampa_width = 132;
|
if (_stampa_width == 1) _stampa_width = 132;
|
||||||
else _stampa_width = 198;
|
else _stampa_width = 198;
|
||||||
|
|
||||||
TRectype da (_cur->file(LF_MOV));
|
TRectype da (_cur->file(LF_MOV).curr());
|
||||||
TRectype a (_cur->file(LF_MOV));
|
TRectype a (_cur->file(LF_MOV).curr());
|
||||||
|
|
||||||
da.zero();
|
da.zero();
|
||||||
a.zero();
|
a.zero();
|
||||||
|
@ -57,8 +57,8 @@ void CG4300_App::user_create()
|
|||||||
_del = new TTable("%DEL");
|
_del = new TTable("%DEL");
|
||||||
_lia = new TTable("LIA");
|
_lia = new TTable("LIA");
|
||||||
|
|
||||||
_mov = _cur->file(LF_MOV);
|
_mov = &_cur->file(LF_MOV);
|
||||||
_rmoviva = _cur->file(LF_RMOVIVA);
|
_rmoviva = &_cur->file(LF_RMOVIVA);
|
||||||
|
|
||||||
_pim_r = &(_pim->curr());
|
_pim_r = &(_pim->curr());
|
||||||
_plm_r = &(_plm->curr());
|
_plm_r = &(_plm->curr());
|
||||||
|
252
cg/cg4303.cpp
252
cg/cg4303.cpp
@ -7,7 +7,7 @@
|
|||||||
#include "cg4300.h"
|
#include "cg4300.h"
|
||||||
|
|
||||||
void CG4300_App::add_plafond(int month, const char* codatt, int type,
|
void CG4300_App::add_plafond(int month, const char* codatt, int type,
|
||||||
real& howmuch, bool intra)
|
real& howmuch, bool intra)
|
||||||
{
|
{
|
||||||
look_ppa(month,codatt,type);
|
look_ppa(month,codatt,type);
|
||||||
|
|
||||||
@ -19,10 +19,10 @@ void CG4300_App::add_plafond(int month, const char* codatt, int type,
|
|||||||
|
|
||||||
if (r2 < (r0+r1))
|
if (r2 < (r0+r1))
|
||||||
describe_error("Acquisti in eccesso rispetto al plafond disponibile",
|
describe_error("Acquisti in eccesso rispetto al plafond disponibile",
|
||||||
codatt);
|
codatt);
|
||||||
|
|
||||||
r2 -= (r0+r1);
|
r2 -= (r0+r1);
|
||||||
if (r2.sign() < 0) r2 = 0.0;
|
if (r2.sign() < 0) r2 = 0.0;
|
||||||
|
|
||||||
_ppa_r->put("R0",r0);
|
_ppa_r->put("R0",r0);
|
||||||
_ppa_r->put("R1",r1);
|
_ppa_r->put("R1",r1);
|
||||||
@ -34,36 +34,36 @@ void CG4300_App::add_plafond(int month, const char* codatt, int type,
|
|||||||
void CG4300_App::zero_plafond (int month, const char* codatt)
|
void CG4300_App::zero_plafond (int month, const char* codatt)
|
||||||
{
|
{
|
||||||
for (int jj = 1; jj <= 3; jj++) // three types of plafond
|
for (int jj = 1; jj <= 3; jj++) // three types of plafond
|
||||||
|
{
|
||||||
|
real r;
|
||||||
|
look_ppa(month,codatt,jj,TRUE);
|
||||||
|
if (is_first_month(month))
|
||||||
{
|
{
|
||||||
real r;
|
r = (jj == 1 ? _p8 : (jj == 2 ? _p8b : _p9));
|
||||||
look_ppa(month,codatt,jj,TRUE);
|
}
|
||||||
if (is_first_month(month))
|
else
|
||||||
{
|
{
|
||||||
r = (jj == 1 ? _p8 : (jj == 2 ? _p8b : _p9));
|
long rn = _ppa->recno();
|
||||||
}
|
|
||||||
else
|
// se non c'e' quello del mese prima c'e' poco da fare,
|
||||||
{
|
// si ricalcola tutto
|
||||||
long rn = _ppa->recno();
|
if (!look_ppa(previous_month(month),codatt,jj))
|
||||||
|
// mazza che bella chiamata ricorsiva
|
||||||
// se non c'e' quello del mese prima c'e' poco da fare,
|
{
|
||||||
// si ricalcola tutto
|
if (!update_att(previous_month(month),codatt, FALSE))
|
||||||
if (!look_ppa(previous_month(month),codatt,jj))
|
describe_error("Progressivi plafond non ricalcolati per "
|
||||||
// mazza che bella chiamata ricorsiva
|
"i mesi precedenti: possibili errori",
|
||||||
{
|
codatt);
|
||||||
if (!update_att(previous_month(month),codatt, FALSE))
|
look_ppa(previous_month(month),codatt,jj);
|
||||||
describe_error("Progressivi plafond non ricalcolati per "
|
}
|
||||||
"i mesi precedenti: possibili errori",
|
r = _ppa_r->get_real("R2");
|
||||||
codatt);
|
_ppa->readat(rn);
|
||||||
look_ppa(previous_month(month),codatt,jj);
|
}
|
||||||
}
|
_ppa_r->put("R2",r);
|
||||||
r = _ppa_r->get_real("R2");
|
_ppa_r->put("R0","");
|
||||||
_ppa->readat(rn);
|
_ppa_r->put("R1","");
|
||||||
}
|
_ppa->rewrite();
|
||||||
_ppa_r->put("R2",r);
|
} // for tipo esenzione plafond
|
||||||
_ppa_r->put("R0","");
|
|
||||||
_ppa_r->put("R1","");
|
|
||||||
_ppa->rewrite();
|
|
||||||
} // for tipo esenzione plafond
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG4300_App::describe_plafond(int month, const char* codatt)
|
void CG4300_App::describe_plafond(int month, const char* codatt)
|
||||||
@ -74,24 +74,24 @@ void CG4300_App::describe_plafond(int month, const char* codatt)
|
|||||||
_DescrItem* d = new _DescrItem(PLAFOND);
|
_DescrItem* d = new _DescrItem(PLAFOND);
|
||||||
|
|
||||||
for (int jj = 1; jj <= 3; jj++) // three types of plafond
|
for (int jj = 1; jj <= 3; jj++) // three types of plafond
|
||||||
|
{
|
||||||
|
t1 = 0.0; t2 = 0.0; t3 = 0.0;
|
||||||
|
for (int m = 1; m <= month; m++)
|
||||||
{
|
{
|
||||||
t1 = 0.0; t2 = 0.0; t3 = 0.0;
|
if (look_ppa(m,codatt,jj))
|
||||||
for (int m = 1; m <= month; m++)
|
{
|
||||||
{
|
t1 = _ppa->get_real("R0");
|
||||||
if (look_ppa(m,codatt,jj))
|
t2 = _ppa->get_real("R1");
|
||||||
{
|
t3 = _ppa->get_real("R2");
|
||||||
t1 = _ppa->get_real("R0");
|
}
|
||||||
t2 = _ppa->get_real("R1");
|
}
|
||||||
t3 = _ppa->get_real("R2");
|
switch (jj)
|
||||||
}
|
{
|
||||||
}
|
case 1: d->_r0 = t1; d->_r1 = t2; d->_r2 = t3; break;
|
||||||
switch (jj)
|
case 2: d->_r3 = t1; d->_r4 = t2; d->_r5 = t3; break;
|
||||||
{
|
case 3: d->_r6 = t1; d->_r7 = t2; d->_r8 = t3; break;
|
||||||
case 1: d->_r0 = t1; d->_r1 = t2; d->_r2 = t3; break;
|
}
|
||||||
case 2: d->_r3 = t1; d->_r4 = t2; d->_r5 = t3; break;
|
} // for tipo esenzione plafond
|
||||||
case 3: d->_r6 = t1; d->_r7 = t2; d->_r8 = t3; break;
|
|
||||||
}
|
|
||||||
} // for tipo esenzione plafond
|
|
||||||
|
|
||||||
_descr_arr.add(d);
|
_descr_arr.add(d);
|
||||||
}
|
}
|
||||||
@ -115,98 +115,98 @@ void CG4300_App::recalc_ventilation(int month, const char* codatt)
|
|||||||
_vent_arr.destroy();
|
_vent_arr.destroy();
|
||||||
|
|
||||||
for (m = 1; m <= month; m++)
|
for (m = 1; m <= month; m++)
|
||||||
|
{
|
||||||
|
if (is_month_ok(m))
|
||||||
{
|
{
|
||||||
if (is_month_ok(m))
|
// aggiunge gli acquisti del mese m operando sui pim
|
||||||
{
|
for (_pim->first(); !_pim->eof(); _pim->next())
|
||||||
// aggiunge gli acquisti del mese m operando sui pim
|
{
|
||||||
for (_pim->first(); !_pim->eof(); _pim->next())
|
// se e' acquisto beni per rivendita
|
||||||
{
|
int tipocr = atoi(*_pim_tipocr);
|
||||||
// se e' acquisto beni per rivendita
|
int mese = atoi(*_pim_mese);
|
||||||
int tipocr = atoi(*_pim_tipocr);
|
TString att(codatt);
|
||||||
int mese = atoi(*_pim_mese);
|
if (tipocr == 1 && mese == m &&
|
||||||
TString att(codatt);
|
att == (const char*)(*_pim_codatt))
|
||||||
if (tipocr == 1 && mese == m &&
|
|
||||||
att == (const char*)(*_pim_codatt))
|
{
|
||||||
|
look_iva(*_pim_codiva);
|
||||||
{
|
|
||||||
look_iva(*_pim_codiva);
|
|
||||||
|
|
||||||
// soltanto normali ed esenti IVA sono base di riparto
|
// soltanto normali ed esenti IVA sono base di riparto
|
||||||
if (_iva->get("S1").empty() ||
|
if (_iva->get("S1").empty() ||
|
||||||
_iva->get("S1") == "ES")
|
_iva->get("S1") == "ES")
|
||||||
{
|
{
|
||||||
real lurd = _pim->get_real("R0");
|
real lurd = _pim->get_real("R0");
|
||||||
lurd += _pim->get_real("R1");
|
lurd += _pim->get_real("R1");
|
||||||
real perc = _iva->get_real("R0");
|
real perc = _iva->get_real("R0");
|
||||||
TString other = _iva->get("S6");
|
TString other = _iva->get("S6");
|
||||||
if (!other.empty())
|
if (!other.empty())
|
||||||
{
|
{
|
||||||
// ventila a un altro codice
|
// ventila a un altro codice
|
||||||
look_iva(other);
|
look_iva(other);
|
||||||
perc = _iva->get_real("R0");
|
perc = _iva->get_real("R0");
|
||||||
}
|
}
|
||||||
add_ventilation(perc/100.0, lurd, *_pim_codiva);
|
add_ventilation(perc/100.0, lurd, *_pim_codiva);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 2) calcola totale acquisti su tutte le aliquote
|
// 2) calcola totale acquisti su tutte le aliquote
|
||||||
real totacq = 0.0;
|
real totacq = 0.0;
|
||||||
real totven = 0.0;
|
real totven = 0.0;
|
||||||
|
|
||||||
for (int j = 0; j < _vent_arr.items(); j++)
|
for (int j = 0; j < _vent_arr.items(); j++)
|
||||||
{
|
{
|
||||||
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
||||||
totacq += vv->_totale;
|
totacq += vv->_totale;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3) ricalcola (solo per il mese in corso!) operando sull'array
|
// 3) ricalcola (solo per il mese in corso!) operando sull'array
|
||||||
for (int i = 0; i < _vend_arr.items(); i++)
|
for (int i = 0; i < _vend_arr.items(); i++)
|
||||||
|
{
|
||||||
|
_VendItem* vi = (_VendItem*)&_vend_arr[i];
|
||||||
|
if (vi->_month != month)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// questo serve solo per il prospettino di m.
|
||||||
|
totven += vi->_totale;
|
||||||
|
|
||||||
|
// 3.2) calcola percentuali di ripartizione e prepara l'affettatrice
|
||||||
|
TDistrib dst(vi->_totale,ROUND_LIRA);
|
||||||
|
for (j = 0; j < _vent_arr.items(); j++)
|
||||||
{
|
{
|
||||||
_VendItem* vi = (_VendItem*)&_vend_arr[i];
|
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
||||||
if (vi->_month != month)
|
dst.add(vv->_totale/totacq);
|
||||||
continue;
|
}
|
||||||
|
|
||||||
// questo serve solo per il prospettino di m.
|
// 3.3) affetta l'importo
|
||||||
totven += vi->_totale;
|
for (j = 0; j < _vent_arr.items(); j++)
|
||||||
|
{
|
||||||
|
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
||||||
|
real imponibile = dst.get();
|
||||||
|
real imposta = imponibile*vv->_aliquota;
|
||||||
|
imposta.round(ROUND_LIRA);
|
||||||
|
|
||||||
// 3.2) calcola percentuali di ripartizione e prepara l'affettatrice
|
// aggiusto l'IVA vendite nei plm
|
||||||
TDistrib dst(vi->_totale,ROUND_LIRA);
|
look_plm(month, codatt);
|
||||||
for (j = 0; j < _vent_arr.items(); j++)
|
real ive = _plm->get_real("R0");
|
||||||
{
|
ive += imposta;
|
||||||
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
_plm->put("R0",ive);
|
||||||
dst.add(vv->_totale/totacq);
|
_plm->rewrite();
|
||||||
}
|
|
||||||
|
// Aggiorno i luridi pim
|
||||||
|
look_pim(month, codatt, vi->_codreg, "0", vv->_codiva, TRUE);
|
||||||
|
|
||||||
// 3.3) affetta l'importo
|
imponibile += _pim->get_real("R0");
|
||||||
for (j = 0; j < _vent_arr.items(); j++)
|
imposta += _pim->get_real("R1");
|
||||||
{
|
_pim->put("R0", imponibile);
|
||||||
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
_pim->put("R1", imposta);
|
||||||
real imponibile = dst.get();
|
// segnale per comodita'
|
||||||
real imposta = imponibile*vv->_aliquota;
|
_pim->put("B1","X");
|
||||||
imposta.round(ROUND_LIRA);
|
_pim->rewrite();
|
||||||
|
}
|
||||||
// aggiusto l'IVA vendite nei plm
|
}
|
||||||
look_plm(month, codatt);
|
|
||||||
real ive = _plm->get_real("R0");
|
|
||||||
ive += imposta;
|
|
||||||
_plm->put("R0",ive);
|
|
||||||
_plm->rewrite();
|
|
||||||
|
|
||||||
// Aggiorno i luridi pim
|
|
||||||
look_pim(month, codatt, vi->_codreg, "0", vv->_codiva, TRUE);
|
|
||||||
|
|
||||||
imponibile += _pim->get_real("R0");
|
|
||||||
imposta += _pim->get_real("R1");
|
|
||||||
_pim->put("R0", imponibile);
|
|
||||||
_pim->put("R1", imposta);
|
|
||||||
// segnale per comodita'
|
|
||||||
_pim->put("B1","X");
|
|
||||||
_pim->rewrite();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// memorizza totali per il prospettino di m.
|
// memorizza totali per il prospettino di m.
|
||||||
look_ptm(month, codatt);
|
look_ptm(month, codatt);
|
||||||
_ptm->put("S4",totacq.string());
|
_ptm->put("S4",totacq.string());
|
||||||
|
2548
cg/cg4304.cpp
2548
cg/cg4304.cpp
File diff suppressed because it is too large
Load Diff
660
cg/cg4305.cpp
660
cg/cg4305.cpp
@ -1,330 +1,330 @@
|
|||||||
// cg4306: liquidazione IVA
|
// cg4306: liquidazione IVA
|
||||||
// funzionalita' accessorie (calcolo acconto, estrazione deleghe)
|
// funzionalita' accessorie (calcolo acconto, estrazione deleghe)
|
||||||
|
|
||||||
#include "cg4300.h"
|
#include "cg4300.h"
|
||||||
#include "cg4300b.h"
|
#include "cg4300b.h"
|
||||||
#include "cg4300c.h"
|
#include "cg4300c.h"
|
||||||
|
|
||||||
static char buf[256];
|
static char buf[256];
|
||||||
|
|
||||||
// -------------------------------------------------- estrazione deleghe
|
// -------------------------------------------------- estrazione deleghe
|
||||||
bool CG4300_App::set_deleghe()
|
bool CG4300_App::set_deleghe()
|
||||||
{
|
{
|
||||||
TMask m("cg4300b.msk");
|
TMask m("cg4300b.msk");
|
||||||
int k = 0;
|
int k = 0;
|
||||||
long l, j;
|
long l, j;
|
||||||
_calcall = FALSE;
|
_calcall = FALSE;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (k == K_ESC)
|
if (k == K_ESC)
|
||||||
break;
|
break;
|
||||||
if (k == K_ENTER && (_calcall || _selected.ones() > 0l))
|
if (k == K_ENTER && (_calcall || _selected.ones() > 0l))
|
||||||
break;
|
break;
|
||||||
k = m.run();
|
k = m.run();
|
||||||
|
|
||||||
// _isprint = m.get_bool(CHK_CGB_PRINT);
|
// _isprint = m.get_bool(CHK_CGB_PRINT);
|
||||||
// _isbase = m.get_bool(CHK_CGB_BASE);
|
// _isbase = m.get_bool(CHK_CGB_BASE);
|
||||||
// _basecalc = (tbc)m.get_long(RDB_CGB_BASE);
|
// _basecalc = (tbc)m.get_long(RDB_CGB_BASE);
|
||||||
|
|
||||||
switch (k)
|
switch (k)
|
||||||
{
|
{
|
||||||
case DLG_SELECT:
|
case DLG_SELECT:
|
||||||
_selected.reset();
|
_selected.reset();
|
||||||
_ditte->destroy();
|
_ditte->destroy();
|
||||||
|
|
||||||
// build sheet
|
// build sheet
|
||||||
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
|
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
|
||||||
{
|
{
|
||||||
TString cod = _nditte_r->get("CODDITTA");
|
TString cod = _nditte_r->get("CODDITTA");
|
||||||
TString vers = _nditte_r->get("FREQVIVA");
|
TString vers = _nditte_r->get("FREQVIVA");
|
||||||
|
|
||||||
TToken_string d(" ");
|
TToken_string d(" ");
|
||||||
|
|
||||||
// add record
|
// add record
|
||||||
d.add(cod);
|
d.add(cod);
|
||||||
d.add(_nditte_r->get("RAGSOC"));
|
d.add(_nditte_r->get("RAGSOC"));
|
||||||
d.add(vers);
|
d.add(vers);
|
||||||
|
|
||||||
_ditte->add(d);
|
_ditte->add(d);
|
||||||
if (_selected[l]) _ditte->check(l);
|
if (_selected[l]) _ditte->check(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
// scegli ditte
|
// scegli ditte
|
||||||
_ditte->run();
|
_ditte->run();
|
||||||
|
|
||||||
for (j = 0l; j < _ditte->items(); j++)
|
for (j = 0l; j < _ditte->items(); j++)
|
||||||
if (_ditte->checked(j)) _selected.set(j);
|
if (_ditte->checked(j)) _selected.set(j);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case BUT_CGB_ALL:
|
case BUT_CGB_ALL:
|
||||||
_calcall = TRUE;
|
_calcall = TRUE;
|
||||||
k = K_ENTER;
|
k = K_ENTER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
_year = m.get(FLD_CGB_YEAR);
|
_year = m.get(FLD_CGB_YEAR);
|
||||||
_month = atoi(m.get(FLD_CGB_MONTH));
|
_month = atoi(m.get(FLD_CGB_MONTH));
|
||||||
}
|
}
|
||||||
|
|
||||||
return k == K_ENTER;
|
return k == K_ENTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG4300_App::extract_deleghe()
|
bool CG4300_App::extract_deleghe()
|
||||||
{
|
{
|
||||||
long firm = TApplication::get_firm();
|
long firm = TApplication::get_firm();
|
||||||
_prind = new TProgind(_n_ditte,
|
_prind = new TProgind(_n_ditte,
|
||||||
" Estrazione deleghe "
|
" Estrazione deleghe "
|
||||||
"\n Preparazione archivi ",
|
"\n Preparazione archivi ",
|
||||||
TRUE,TRUE,40);
|
TRUE,TRUE,40);
|
||||||
|
|
||||||
long l;
|
long l;
|
||||||
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
|
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
|
||||||
{
|
{
|
||||||
if (_prind->iscancelled())
|
if (_prind->iscancelled())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!(_calcall || _selected[l])) continue;
|
if (!(_calcall || _selected[l])) continue;
|
||||||
|
|
||||||
TApplication::set_firm(_nditte->curr().get_long("CODDITTA"));
|
TApplication::set_firm(_nditte->curr().get_long("CODDITTA"));
|
||||||
sprintf (buf,"Estrazione deleghe (%d):\nditta %s",
|
sprintf (buf,"Estrazione deleghe (%d):\nditta %s",
|
||||||
_month,
|
_month,
|
||||||
(const char*)_nditte_r->get("RAGSOC"));
|
(const char*)_nditte_r->get("RAGSOC"));
|
||||||
_prind->set_text(buf);
|
_prind->set_text(buf);
|
||||||
if (is_month_ok(_month))
|
if (is_month_ok(_month))
|
||||||
{
|
{
|
||||||
_isbenzinaro = _nditte->curr(LF_ATTIV).get_bool("ART74/4");
|
_isbenzinaro = _nditte->curr(LF_ATTIV).get_bool("ART74/4");
|
||||||
_freqviva = _nditte->curr().get("FREQVIVA");
|
_freqviva = _nditte->curr().get("FREQVIVA");
|
||||||
bool mens = _freqviva == "M";
|
bool mens = _freqviva == "M";
|
||||||
_isannual = (_month == 12 && !mens && !_isbenzinaro) ||
|
_isannual = (_month == 12 && !mens && !_isbenzinaro) ||
|
||||||
(_month == 13 && (mens || _isbenzinaro));
|
(_month == 13 && (mens || _isbenzinaro));
|
||||||
_isriepilogo = _month == 13;
|
_isriepilogo = _month == 13;
|
||||||
|
|
||||||
extract_delega(_month);
|
extract_delega(_month);
|
||||||
}
|
}
|
||||||
_prind->addstatus(1);
|
_prind->addstatus(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
TApplication::set_firm(firm);
|
TApplication::set_firm(firm);
|
||||||
delete _prind;
|
delete _prind;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG4300_App::extract_delega(int month)
|
bool CG4300_App::extract_delega(int month)
|
||||||
{
|
{
|
||||||
if (_isriepilogo && !_isannual)
|
if (_isriepilogo && !_isannual)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (look_lim(month))
|
if (look_lim(month))
|
||||||
{
|
{
|
||||||
real topay = _lim->get_real("R0");
|
real topay = _lim->get_real("R0");
|
||||||
if (topay.sign() <= 0) return TRUE;
|
if (topay.sign() <= 0) return TRUE;
|
||||||
if (_isannual)
|
if (_isannual)
|
||||||
{
|
{
|
||||||
if (look_del(12,7))
|
if (look_del(12,7))
|
||||||
{
|
{
|
||||||
topay -= _del->get_real("R0");
|
topay -= _del->get_real("R0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// importo rettifiche solo se non e' annuale
|
// importo rettifiche solo se non e' annuale
|
||||||
topay += _lim->get_real("R5");
|
topay += _lim->get_real("R5");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (topay.sign() > 0)
|
if (topay.sign() > 0)
|
||||||
{
|
{
|
||||||
look_del(month, _isannual ? 2 : 1, TRUE);
|
look_del(month, _isannual ? 2 : 1, TRUE);
|
||||||
_del->put("R0",topay);
|
_del->put("R0",topay);
|
||||||
_del->rewrite();
|
_del->rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- calcolo acconto dicembre
|
// -------------------------------------------- calcolo acconto dicembre
|
||||||
bool CG4300_App::set_acconto()
|
bool CG4300_App::set_acconto()
|
||||||
{
|
{
|
||||||
TMask m("cg4300c.msk");
|
TMask m("cg4300c.msk");
|
||||||
m.set(CHK_CGC_PRINT,"X");
|
m.set(CHK_CGC_PRINT,"X");
|
||||||
|
|
||||||
int k = 0;
|
int k = 0;
|
||||||
_calcall = FALSE;
|
_calcall = FALSE;
|
||||||
_selected.reset();
|
_selected.reset();
|
||||||
long j;
|
long j;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (k == K_ESC)
|
if (k == K_ESC)
|
||||||
break;
|
break;
|
||||||
if (k == K_ENTER && (_calcall || _selected.ones() > 0l))
|
if (k == K_ENTER && (_calcall || _selected.ones() > 0l))
|
||||||
break;
|
break;
|
||||||
k = m.run();
|
k = m.run();
|
||||||
|
|
||||||
_year = m.get(FLD_CGC_YEAR);
|
_year = m.get(FLD_CGC_YEAR);
|
||||||
_isprint = m.get_bool(CHK_CGC_PRINT);
|
_isprint = m.get_bool(CHK_CGC_PRINT);
|
||||||
_isbase = m.get_bool(CHK_CGC_BASE);
|
_isbase = m.get_bool(CHK_CGC_BASE);
|
||||||
_basecalc = (tbc)m.get_long(RDB_CGC_BASE);
|
_basecalc = (tbc)m.get_long(RDB_CGC_BASE);
|
||||||
|
|
||||||
switch (k)
|
switch (k)
|
||||||
{
|
{
|
||||||
case DLG_SELECT:
|
case DLG_SELECT:
|
||||||
_selected.reset();
|
_selected.reset();
|
||||||
_ditte->destroy();
|
_ditte->destroy();
|
||||||
|
|
||||||
// build sheet
|
// build sheet
|
||||||
long l;
|
long l;
|
||||||
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
|
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
|
||||||
{
|
{
|
||||||
TString cod = _nditte_r->get("CODDITTA");
|
TString cod = _nditte_r->get("CODDITTA");
|
||||||
TString vers = _nditte_r->get("FREQVIVA");
|
TString vers = _nditte_r->get("FREQVIVA");
|
||||||
|
|
||||||
TToken_string d(" ");
|
TToken_string d(" ");
|
||||||
|
|
||||||
// add record
|
// add record
|
||||||
d.add(cod);
|
d.add(cod);
|
||||||
d.add(_nditte_r->get("RAGSOC"));
|
d.add(_nditte_r->get("RAGSOC"));
|
||||||
d.add(vers);
|
d.add(vers);
|
||||||
|
|
||||||
_ditte->add(d);
|
_ditte->add(d);
|
||||||
if (_selected[l]) _ditte->check(l);
|
if (_selected[l]) _ditte->check(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
// scegli ditte
|
// scegli ditte
|
||||||
_ditte->run();
|
_ditte->run();
|
||||||
|
|
||||||
for (j = 0l; j < _ditte->items(); j++)
|
for (j = 0l; j < _ditte->items(); j++)
|
||||||
if (_ditte->checked(j)) _selected.set(j);
|
if (_ditte->checked(j)) _selected.set(j);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case BUT_CGC_ALL:
|
case BUT_CGC_ALL:
|
||||||
_calcall = TRUE;
|
_calcall = TRUE;
|
||||||
k = K_ENTER;
|
k = K_ENTER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return k == K_ENTER;
|
return k == K_ENTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CG4300_App::recalc_acconti()
|
bool CG4300_App::recalc_acconti()
|
||||||
{
|
{
|
||||||
long l; bool onemade = FALSE;
|
long l; bool onemade = FALSE;
|
||||||
|
|
||||||
long firm = TApplication::get_firm();
|
long firm = TApplication::get_firm();
|
||||||
_prind = new TProgind(_n_ditte,
|
_prind = new TProgind(_n_ditte,
|
||||||
" Calcolo acconto "
|
" Calcolo acconto "
|
||||||
"\n Preparazione archivi ",
|
"\n Preparazione archivi ",
|
||||||
TRUE,TRUE,40);
|
TRUE,TRUE,40);
|
||||||
|
|
||||||
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
|
for (l = 0l, _nditte->first(); !_nditte->eof(); l++, _nditte->next())
|
||||||
{
|
{
|
||||||
if (_prind->iscancelled())
|
if (_prind->iscancelled())
|
||||||
break;
|
break;
|
||||||
if (_calcall || _selected[l])
|
if (_calcall || _selected[l])
|
||||||
{
|
{
|
||||||
if (onemade == FALSE && _isprint)
|
if (onemade == FALSE && _isprint)
|
||||||
{
|
{
|
||||||
_DescrItem* d = new _DescrItem(ACCHEAD);
|
_DescrItem* d = new _DescrItem(ACCHEAD);
|
||||||
d->_f0 = _basecalc == incorso;
|
d->_f0 = _basecalc == incorso;
|
||||||
d->_f1 = _isbase;
|
d->_f1 = _isbase;
|
||||||
_descr_arr.add(d);
|
_descr_arr.add(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
TApplication::set_firm(_nditte->curr().get_long("CODDITTA"));
|
TApplication::set_firm(_nditte->curr().get_long("CODDITTA"));
|
||||||
sprintf (buf,"Calcolo acconto:\nditta %s",
|
sprintf (buf,"Calcolo acconto:\nditta %s",
|
||||||
(const char*)_nditte_r->get("RAGSOC"));
|
(const char*)_nditte_r->get("RAGSOC"));
|
||||||
_prind->set_text(buf);
|
_prind->set_text(buf);
|
||||||
recalc_acconto();
|
recalc_acconto();
|
||||||
onemade = TRUE;
|
onemade = TRUE;
|
||||||
}
|
}
|
||||||
_prind->addstatus(1);
|
_prind->addstatus(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
TApplication::set_firm(firm);
|
TApplication::set_firm(firm);
|
||||||
delete _prind;
|
delete _prind;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG4300_App::recalc_acconto()
|
bool CG4300_App::recalc_acconto()
|
||||||
{
|
{
|
||||||
real basecalcolo, acconto;
|
real basecalcolo, acconto;
|
||||||
bool isdifferita = FALSE;
|
bool isdifferita = FALSE;
|
||||||
bool error = FALSE;
|
bool error = FALSE;
|
||||||
|
|
||||||
// this is absolutely fundamental
|
// this is absolutely fundamental
|
||||||
|
|
||||||
if (_basecalc == incorso)
|
if (_basecalc == incorso)
|
||||||
{
|
{
|
||||||
// that's pazzesc but it turns out there's no better way
|
// that's pazzesc but it turns out there's no better way
|
||||||
_comp_acconto = TRUE;
|
_comp_acconto = TRUE;
|
||||||
// force recalc of current month
|
// force recalc of current month
|
||||||
_recalc = one;
|
_recalc = one;
|
||||||
update_firm(12);
|
update_firm(12);
|
||||||
|
|
||||||
// TBI calcola l'acconto!!!
|
// TBI calcola l'acconto!!!
|
||||||
if (look_lim(12))
|
if (look_lim(12))
|
||||||
{
|
{
|
||||||
basecalcolo = _lim->get_real("R0");
|
basecalcolo = _lim->get_real("R0");
|
||||||
if (basecalcolo.sign() > 0)
|
if (basecalcolo.sign() > 0)
|
||||||
acconto = basecalcolo * ACCONTO_DICEMBRE;
|
acconto = basecalcolo * ACCONTO_DICEMBRE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
acconto = real(-1);
|
acconto = real(-1);
|
||||||
}
|
}
|
||||||
// riaggiustati le palle
|
// riaggiustati le palle
|
||||||
_comp_acconto = FALSE;
|
_comp_acconto = FALSE;
|
||||||
update_firm(12);
|
update_firm(12);
|
||||||
}
|
}
|
||||||
else if (_basecalc == precedente)
|
else if (_basecalc == precedente)
|
||||||
{
|
{
|
||||||
int yr = atoi(_year) - 1;
|
int yr = atoi(_year) - 1;
|
||||||
_lim->zero();
|
_lim->zero();
|
||||||
*_lim_anno = yr;
|
*_lim_anno = yr;
|
||||||
*_lim_mese = 12;
|
*_lim_mese = 12;
|
||||||
if (_lim->read() == NOERR)
|
if (_lim->read() == NOERR)
|
||||||
{
|
{
|
||||||
basecalcolo = _lim->get_real("R0");
|
basecalcolo = _lim->get_real("R0");
|
||||||
if (basecalcolo.sign() > 0)
|
if (basecalcolo.sign() > 0)
|
||||||
acconto = basecalcolo * ACCONTO_DICEMBRE;
|
acconto = basecalcolo * ACCONTO_DICEMBRE;
|
||||||
}
|
}
|
||||||
else error = TRUE;
|
else error = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sbatti l'acconto in LIA
|
// sbatti l'acconto in LIA
|
||||||
if (look_lia())
|
if (look_lia())
|
||||||
{
|
{
|
||||||
_lia->put("R4",acconto);
|
_lia->put("R4",acconto);
|
||||||
isdifferita = _lia->get_bool("B1");
|
isdifferita = _lia->get_bool("B1");
|
||||||
_lia->rewrite();
|
_lia->rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (acconto.sign() > 0)
|
if (acconto.sign() > 0)
|
||||||
{
|
{
|
||||||
// crea o aggiorna delega
|
// crea o aggiorna delega
|
||||||
look_del(12,7,TRUE);
|
look_del(12,7,TRUE);
|
||||||
_del->put("R0", acconto);
|
_del->put("R0", acconto);
|
||||||
_del->rewrite();
|
_del->rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
// per questa volta lasciamo perdere la describe_acconto
|
// per questa volta lasciamo perdere la describe_acconto
|
||||||
if (_isprint)
|
if (_isprint)
|
||||||
{
|
{
|
||||||
_DescrItem* d = new _DescrItem(ACCONTO);
|
_DescrItem* d = new _DescrItem(ACCONTO);
|
||||||
d->_r0 = basecalcolo;
|
d->_r0 = basecalcolo;
|
||||||
d->_r1 = acconto;
|
d->_r1 = acconto;
|
||||||
d->_f0 = _basecalc == incorso;
|
d->_f0 = _basecalc == incorso;
|
||||||
d->_f1 = _isbase;
|
d->_f1 = _isbase;
|
||||||
d->_f2 = error;
|
d->_f2 = error;
|
||||||
d->_f3 = isdifferita;
|
d->_f3 = isdifferita;
|
||||||
d->_s0 = _nditte->curr().get("CODDITTA");
|
d->_s0 = _nditte->curr().get("CODDITTA");
|
||||||
d->_s1 = _nditte->curr().get("RAGSOC");
|
d->_s1 = _nditte->curr().get("RAGSOC");
|
||||||
_descr_arr.add(d);
|
_descr_arr.add(d);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3216
cg/cg4400.cpp
3216
cg/cg4400.cpp
File diff suppressed because it is too large
Load Diff
258
cg/cglib.h
258
cg/cglib.h
@ -1,133 +1,125 @@
|
|||||||
#ifndef __CGLIB_H
|
#ifndef __CGLIB_H
|
||||||
#define __CGLIB_H
|
#define __CGLIB_H
|
||||||
|
|
||||||
#ifndef __ISAM_H
|
#ifndef __ISAM_H
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef __REAL_H
|
|
||||||
#include <real.h>
|
#ifndef __ASSOC_H
|
||||||
#endif
|
#include <assoc.h>
|
||||||
#ifndef __DATE_H
|
#endif
|
||||||
#include <date.h>
|
|
||||||
#endif
|
#include "conto.h"
|
||||||
|
|
||||||
#include <assoc.h>
|
TLocalisamfile * get_descr_cf(TLocalisamfile * pconti,
|
||||||
//#include <utility.h>
|
TLocalisamfile * clifo , int g, int c, long s);
|
||||||
//#include <config.h>
|
|
||||||
//#include <applicat.h>
|
class TClifo_list : public TArray
|
||||||
|
{
|
||||||
#include "conto.h"
|
public:
|
||||||
|
TClifo_list(int g, int c, char tipocf);
|
||||||
TLocalisamfile * get_descr_cf(TLocalisamfile * pconti,
|
TRectype& clifo(int i)const { return(TRectype&)this->operator[](i); }
|
||||||
TLocalisamfile * clifo , int g, int c, long s);
|
};
|
||||||
|
|
||||||
class TClifo_list : public TArray
|
//typedef enum {scalare = 1, verifica} bilancio;
|
||||||
{
|
|
||||||
public:
|
class Saldo
|
||||||
TClifo_list(int g, int c, char tipocf);
|
{
|
||||||
TRectype& clifo(int i)const { return(TRectype&)this->operator[](i); }
|
real _saldo, _saldo_iniziale, _prg_dare, _prg_avere;
|
||||||
};
|
int _indbil;
|
||||||
|
TRectype* _rec;
|
||||||
//typedef enum {scalare = 1, verifica} bilancio;
|
//bilancio _bilancio;
|
||||||
|
int _annoes;
|
||||||
class Saldo
|
TDate _inizioEs, _fineEs;
|
||||||
{
|
TString16 _codcaus;
|
||||||
real _saldo, _saldo_iniziale, _prg_dare, _prg_avere;
|
TDate _datareg;
|
||||||
int _indbil;
|
TDate _datacomp;
|
||||||
TRectype* _rec;
|
TString _provv;
|
||||||
//bilancio _bilancio;
|
|
||||||
int _annoes;
|
protected:
|
||||||
TDate _inizioEs, _fineEs;
|
void InFinEs(int);
|
||||||
TString16 _codcaus;
|
|
||||||
TDate _datareg;
|
public:
|
||||||
TDate _datacomp;
|
int annoes () const { return _annoes; }
|
||||||
TString _provv;
|
//bilancio bil () const { return _bilancio; }
|
||||||
|
void set_annoes (int anno) { _annoes = anno; }
|
||||||
protected:
|
//void set_bil (bilancio bil) { _bilancio = bil; }
|
||||||
void InFinEs(int);
|
void leggi_mov(long);
|
||||||
|
bool causale_mov(long, const TDate&, const TDate&, TString&);
|
||||||
public:
|
const char* causale_chiusura_es();
|
||||||
int annoes () const { return _annoes; }
|
const char* causale_apertura_es();
|
||||||
//bilancio bil () const { return _bilancio; }
|
bool calcola_data_limite(int,int,int,long,const TDate&,const TDate&,int,bool,
|
||||||
void set_annoes (int anno) { _annoes = anno; }
|
const TDate&,const TDate&,const TDate&,bool);
|
||||||
//void set_bil (bilancio bil) { _bilancio = bil; }
|
bool calcola_ultima_immissione(int, int, int, int, long, int);
|
||||||
void leggi_mov(long);
|
bool ultima_immissione_bilancio(int anno,int g,int c,long s,int indbil);
|
||||||
bool causale_mov(long, const TDate&, const TDate&, TString&);
|
bool data_limite_bilancio(int,int,int,long,const TDate&,const TDate&,int,bool);
|
||||||
const char* causale_chiusura_es();
|
real calcola_saldo_iniziale(int, int, int, long, int);
|
||||||
const char* causale_apertura_es();
|
bool calcola_clifo(int, int, int, int, int);
|
||||||
bool calcola_data_limite(int,int,int,long,const TDate&,const TDate&,int,bool,
|
TRectype& ricerca_progr_prec(int, int, int, long);
|
||||||
const TDate&,const TDate&,const TDate&,bool);
|
real saldofin_esprec(int,int,int,long);
|
||||||
bool calcola_ultima_immissione(int, int, int, int, long, int);
|
real saldo() {return _saldo;}
|
||||||
bool ultima_immissione_bilancio(int anno,int g,int c,long s,int indbil);
|
real saldoini() {return _saldo_iniziale;}
|
||||||
bool data_limite_bilancio(int,int,int,long,const TDate&,const TDate&,int,bool);
|
real prgdare() {return _prg_dare;}
|
||||||
real calcola_saldo_iniziale(int, int, int, long, int);
|
real prgavere() {return _prg_avere;}
|
||||||
bool calcola_clifo(int, int, int, int, int);
|
bool calcola(int,int,int,int,long,const TDate&,const TDate&,int,bool,
|
||||||
TRectype& ricerca_progr_prec(int, int, int, long);
|
const TDate&,const TDate&,const TDate&,bool);
|
||||||
real saldofin_esprec(int,int,int,long);
|
bool prg_attuali(int,TConto&,int,real&,real&);
|
||||||
real saldo() {return _saldo;}
|
bool prg_mov_eliminati(int,TConto&,int,real&,real&);
|
||||||
real saldoini() {return _saldo_iniziale;}
|
Saldo();
|
||||||
real prgdare() {return _prg_dare;}
|
~Saldo();
|
||||||
real prgavere() {return _prg_avere;}
|
};
|
||||||
bool calcola(int,int,int,int,long,const TDate&,const TDate&,int,bool,
|
|
||||||
const TDate&,const TDate&,const TDate&,bool);
|
class TTab_conti : public TAssoc_array
|
||||||
bool prg_attuali(int,TConto&,int,real&,real&);
|
{
|
||||||
bool prg_mov_eliminati(int,TConto&,int,real&,real&);
|
void do_agg(TConto* tc, int anno_es, const real& importo, char sezione,
|
||||||
Saldo();
|
bool movap, bool provv, bool somma, const char* key);
|
||||||
~Saldo();
|
public:
|
||||||
};
|
void aggiorna_conto(const TConto& tc, int anno_es, const real& importo,
|
||||||
|
char sezione, bool movap, bool provv, bool somma);
|
||||||
class TTab_conti : public TAssoc_array
|
void aggiorna_conto (int gruppo, int conto, long sottoconto, int anno_es,
|
||||||
{
|
const real& importo, char sezione, bool movap,
|
||||||
void do_agg(TConto* tc, int anno_es, const real& importo, char sezione,
|
bool provv, bool somma);
|
||||||
bool movap, bool provv, bool somma, const char* key);
|
};
|
||||||
public:
|
|
||||||
void aggiorna_conto(const TConto& tc, int anno_es, const real& importo,
|
class TSaldo_agg : public TObject
|
||||||
char sezione, bool movap, bool provv, bool somma);
|
{
|
||||||
void aggiorna_conto (int gruppo, int conto, long sottoconto, int anno_es,
|
TTab_conti _tab_conti;
|
||||||
const real& importo, char sezione, bool movap,
|
bool _movap; // se e' mov. d'apertura (aggiorno SALDO e FLAGSALINI in saldi)
|
||||||
bool provv, bool somma);
|
bool _provv;
|
||||||
};
|
int _anno_es; // anno esercizio
|
||||||
|
TDate _data_ulmov; // data ultimo movimento
|
||||||
class TSaldo_agg : public TObject
|
long _num_ulmov; // numero ultimo movimento
|
||||||
{
|
TRectype * _rec; // record corrente sui saldi
|
||||||
TTab_conti _tab_conti;
|
TConto& tconti() { return *(TConto*)_tab_conti.get(); }
|
||||||
bool _movap; // se e' mov. d'apertura (aggiorno SALDO e FLAGSALINI in
|
|
||||||
// saldi)
|
public:
|
||||||
bool _provv;
|
void clear_saldi(int year);
|
||||||
int _anno_es; // anno esercizio
|
void registra();
|
||||||
TDate _data_ulmov; // data ultimo movimento
|
void aggiorna (const TConto& tc, const real& importo, char sezione,
|
||||||
long _num_ulmov; // numero ultimo movimento
|
bool somma=TRUE);
|
||||||
TRectype * _rec; // record corrente sui saldi
|
void aggiorna (int gruppo, int conto, long sottoconto, const real& importo,
|
||||||
TConto& tconti() { return *(TConto*)_tab_conti.get(); }
|
char sezione, bool somma=TRUE);
|
||||||
|
|
||||||
public:
|
void set_anno_es(int anno) { _anno_es = anno; }
|
||||||
void clear_saldi(int year);
|
int anno_es() const { return _anno_es; }
|
||||||
void registra();
|
|
||||||
void aggiorna (const TConto& tc, const real& importo, char sezione,
|
void set_movap (bool movap) { _movap = movap; }
|
||||||
bool somma=TRUE);
|
bool movap() const { return _movap; }
|
||||||
void aggiorna (int gruppo, int conto, long sottoconto, const real& importo,
|
|
||||||
char sezione, bool somma=TRUE);
|
void set_movprovv (bool p) { _provv = p; }
|
||||||
|
bool movprovv() const { return _provv; }
|
||||||
void set_anno_es(int anno) { _anno_es = anno; }
|
|
||||||
int anno_es() { return _anno_es; }
|
void set_data_ulmov (const TDate& data) { _data_ulmov = data; }
|
||||||
|
const TDate& data_ulmov() const { return _data_ulmov; }
|
||||||
void set_movap (bool movap) { _movap = movap; }
|
|
||||||
bool movap() { return _movap; }
|
void set_num_ulmov (long num) { _num_ulmov = num; }
|
||||||
|
long num_ulmov() const { return _num_ulmov; }
|
||||||
void set_movprovv (bool p) { _provv = p; }
|
|
||||||
bool movprovv() { return _provv; }
|
void reset(); // pulisce l'array dei conti
|
||||||
|
TSaldo_agg();
|
||||||
void set_data_ulmov (TDate& data) { _data_ulmov = data; }
|
int items() const { return _tab_conti.items();}
|
||||||
TDate& data_ulmov() { return _data_ulmov; }
|
};
|
||||||
|
|
||||||
void set_num_ulmov (long num) { _num_ulmov = num; }
|
|
||||||
long num_ulmov() { return _num_ulmov; }
|
#endif
|
||||||
|
|
||||||
void reset(); // pulisce l'array dei conti
|
|
||||||
TSaldo_agg();
|
|
||||||
int items() const { return _tab_conti.items();}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
33
cg/conto.cpp
33
cg/conto.cpp
@ -3,20 +3,11 @@
|
|||||||
|
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <lffiles.h>
|
|
||||||
|
|
||||||
#include "conto.h"
|
#include "conto.h"
|
||||||
|
|
||||||
|
|
||||||
// Certified 100%
|
|
||||||
TConto::TConto(int g, int c, long s, char t, const char* d)
|
|
||||||
: _tipo(toupper(t)), _gruppo(g), _conto(c), _sottoconto(s),
|
|
||||||
_descrizione(d), _tipo_cr(-1)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Certified 90%
|
// Certified 90%
|
||||||
TConto::TConto(TToken_string& s, int from, int mode)
|
TBill::TBill(TToken_string& s, int from, int mode)
|
||||||
: _tipo_cr(-1)
|
: _tipo_cr(-1)
|
||||||
{
|
{
|
||||||
const char* first = s.get(from);
|
const char* first = s.get(from);
|
||||||
@ -43,7 +34,7 @@ TConto::TConto(TToken_string& s, int from, int mode)
|
|||||||
|
|
||||||
|
|
||||||
// Certified 100%
|
// Certified 100%
|
||||||
TConto& TConto::set(int g, int c, long s, char t, const char* d)
|
const TBill& TBill::set(int g, int c, long s, char t, const char* d)
|
||||||
{
|
{
|
||||||
_tipo = (t > ' ') ? toupper(t) : ' ';
|
_tipo = (t > ' ') ? toupper(t) : ' ';
|
||||||
_gruppo = g;
|
_gruppo = g;
|
||||||
@ -53,7 +44,7 @@ TConto& TConto::set(int g, int c, long s, char t, const char* d)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TConto& TConto::add_to(TToken_string& ts, int from, int mode)
|
const TBill& TBill::add_to(TToken_string& ts, int from, int mode)
|
||||||
{
|
{
|
||||||
if (mode & 0x4)
|
if (mode & 0x4)
|
||||||
{
|
{
|
||||||
@ -72,16 +63,16 @@ const TConto& TConto::add_to(TToken_string& ts, int from, int mode)
|
|||||||
|
|
||||||
|
|
||||||
// Certified 100%
|
// Certified 100%
|
||||||
bool TConto::ok() const
|
bool TBill::ok() const
|
||||||
{
|
{
|
||||||
return _gruppo != 0 && _conto != 0 && _sottoconto != 0L;
|
return _gruppo != 0 && _conto != 0 && _sottoconto != 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Certified 99%
|
// Certified 99%
|
||||||
int TConto::compare(const TSortable& s) const
|
int TBill::compare(const TSortable& s) const
|
||||||
{
|
{
|
||||||
CHECK(class_name()==s.class_name(), "Can't compare TConto with TObject");
|
CHECK(class_name()==s.class_name(), "Can't compare TBill with TObject");
|
||||||
const TConto& c = (const TConto&)s;
|
const TBill& c = (const TBill&)s;
|
||||||
|
|
||||||
int res = _gruppo - c._gruppo;
|
int res = _gruppo - c._gruppo;
|
||||||
if (res) return res;
|
if (res) return res;
|
||||||
@ -98,7 +89,7 @@ int TConto::compare(const TSortable& s) const
|
|||||||
|
|
||||||
|
|
||||||
// Certified 90% (uses __tmp_string && isam)
|
// Certified 90% (uses __tmp_string && isam)
|
||||||
const char* TConto::describe()
|
const char* TBill::describe()
|
||||||
{
|
{
|
||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
const char* desc = NULL;
|
const char* desc = NULL;
|
||||||
@ -142,7 +133,7 @@ const char* TConto::describe()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TConto::read(TRectype &r)
|
bool TBill::read(TRectype &r)
|
||||||
{
|
{
|
||||||
TLocalisamfile pcon(LF_PCON, FALSE);
|
TLocalisamfile pcon(LF_PCON, FALSE);
|
||||||
pcon.setkey(1);
|
pcon.setkey(1);
|
||||||
@ -165,7 +156,7 @@ bool TConto::read(TRectype &r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Certified 99% (describe uses __tmp_string)
|
// Certified 99% (describe uses __tmp_string)
|
||||||
const TString& TConto::descrizione()
|
const TString& TBill::descrizione()
|
||||||
{
|
{
|
||||||
if (_descrizione.empty())
|
if (_descrizione.empty())
|
||||||
{
|
{
|
||||||
@ -178,7 +169,7 @@ const TString& TConto::descrizione()
|
|||||||
return _descrizione;
|
return _descrizione;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TConto::tipo_cr()
|
int TBill::tipo_cr()
|
||||||
{
|
{
|
||||||
if (_tipo_cr < 0)
|
if (_tipo_cr < 0)
|
||||||
{
|
{
|
||||||
@ -190,7 +181,7 @@ int TConto::tipo_cr()
|
|||||||
|
|
||||||
|
|
||||||
// Certified 99% (uses __tmp_string)
|
// Certified 99% (uses __tmp_string)
|
||||||
const char* TConto::string(int mode)
|
const char* TBill::string(int mode)
|
||||||
{
|
{
|
||||||
TFixed_string s(&__tmp_string[256], 80);
|
TFixed_string s(&__tmp_string[256], 80);
|
||||||
s.cut(0);
|
s.cut(0);
|
||||||
|
56
cg/conto.h
56
cg/conto.h
@ -9,53 +9,63 @@
|
|||||||
#include <real.h>
|
#include <real.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
|
class TBill : public TSortable
|
||||||
|
|
||||||
class TConto : public TSortable
|
|
||||||
{
|
{
|
||||||
char _tipo; // ' ' = Conto, 'C' = Cliente, 'F' = 'Fornitore'
|
char _tipo; // ' ' = Conto, 'C' = Cliente, 'F' = 'Fornitore'
|
||||||
int _gruppo, _conto;
|
int _gruppo, _conto;
|
||||||
long _sottoconto; // Sottoconto, codice cliente o fornitore
|
long _sottoconto; // Sottoconto, codice cliente o fornitore
|
||||||
TString80 _descrizione; // Vuota fino alla chiamata di describe
|
TString80 _descrizione; // Vuota fino alla chiamata di describe
|
||||||
int _tipo_cr;
|
int _tipo_cr; // Tipo costo/ricavo
|
||||||
real _dare, _avere;
|
|
||||||
real _darepro, _averepro;
|
|
||||||
real _saldo;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int compare(const TSortable& s) const;
|
virtual int compare(const TSortable& s) const;
|
||||||
virtual const char* class_name() const { return "Conto"; }
|
virtual const char* class_name() const { return "Conto"; }
|
||||||
|
|
||||||
const char* describe();
|
const char* describe();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TConto(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL);
|
TBill(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL)
|
||||||
TConto(TToken_string& tgcsd, int from, int mode = 0);
|
: _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(d), _tipo_cr(-1) {}
|
||||||
virtual ~TConto() {}
|
|
||||||
|
|
||||||
TConto& set(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL);
|
TBill(TToken_string& tgcsd, int from, int mode = 0);
|
||||||
const TConto& add_to(TToken_string& ts, int from, int mode = 0);
|
virtual ~TBill() {}
|
||||||
|
|
||||||
|
const TBill& set(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL);
|
||||||
|
const TBill& add_to(TToken_string& ts, int from, int mode = 0);
|
||||||
|
|
||||||
virtual bool ok() const; // Gruppo, Conto e Sottoconto non nulli
|
virtual bool ok() const; // Gruppo, Conto e Sottoconto non nulli
|
||||||
|
|
||||||
real& dare() { return _dare; }
|
|
||||||
real& avere() { return _avere; }
|
|
||||||
real& darepro() { return _darepro; }
|
|
||||||
real& averepro() { return _averepro; }
|
|
||||||
real& saldo() { return _saldo; }
|
|
||||||
|
|
||||||
char tipo() const { return _tipo; }
|
char tipo() const { return _tipo; }
|
||||||
int gruppo() const { return _gruppo; }
|
int gruppo() const { return _gruppo; }
|
||||||
int conto() const { return _conto; }
|
int conto() const { return _conto; }
|
||||||
long sottoconto() const { return _sottoconto; }
|
long sottoconto() const { return _sottoconto; }
|
||||||
|
|
||||||
const TString& descrizione();
|
const TString& descrizione();
|
||||||
int TConto::tipo_cr();
|
int tipo_cr();
|
||||||
bool read(TRectype& r);
|
bool read(TRectype& r);
|
||||||
|
|
||||||
const char* string(int mode = 0);
|
const char* string(int mode = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
|
||||||
|
|
||||||
|
class TConto : public TBill
|
||||||
|
{
|
||||||
|
real _dare, _avere, _darepro, _averepro, _saldo;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TConto(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL)
|
||||||
|
: TBill(g, c, s, t, d) {}
|
||||||
|
TConto (TToken_string& tgcsd, int from, int mode = 0)
|
||||||
|
: TBill(tgcsd, from, mode) {};
|
||||||
|
|
||||||
|
real& dare() { return _dare; }
|
||||||
|
real& avere() { return _avere; }
|
||||||
|
real& darepro() { return _darepro; }
|
||||||
|
real& averepro() { return _averepro; }
|
||||||
|
real& saldo() { return _saldo; }
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user