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();
|
||||||
|
|
||||||
|
@ -17,11 +17,11 @@ int main(int argc, char** argv)
|
|||||||
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;
|
||||||
|
@ -91,7 +91,7 @@ bool CG0200_application::protected_record(TRectype &rec)
|
|||||||
const char* CG0200_application::get_next_key()
|
const char* CG0200_application::get_next_key()
|
||||||
|
|
||||||
{
|
{
|
||||||
TLocalisamfile& clifo = *_rel->lfile() ;
|
TLocalisamfile& clifo = _rel->lfile() ;
|
||||||
long codcf = 1L ;
|
long codcf = 1L ;
|
||||||
const TString tipo(_msk->get(F_TIPOCF)) ;
|
const TString tipo(_msk->get(F_TIPOCF)) ;
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ HIDDEN bool no_dup_fis(TMask_field& f, KEY key)
|
|||||||
|
|
||||||
if (msk.query_mode() || !f.to_check(key)) return TRUE;
|
if (msk.query_mode() || !f.to_check(key)) return TRUE;
|
||||||
CG0200_application* app = (CG0200_application*) MainApp();
|
CG0200_application* app = (CG0200_application*) MainApp();
|
||||||
TLocalisamfile& clifo = *app->get_relation()->lfile(LF_CLIFO) ;
|
TLocalisamfile& clifo = app->get_relation()->lfile(LF_CLIFO) ;
|
||||||
|
|
||||||
if ( f.get().not_empty() && !clifo.empty() )
|
if ( f.get().not_empty() && !clifo.empty() )
|
||||||
{
|
{
|
||||||
@ -157,7 +157,7 @@ HIDDEN bool no_dup_iva(TMask_field& f, KEY key)
|
|||||||
if (msk.query_mode() || !f.to_check(key)) return TRUE;
|
if (msk.query_mode() || !f.to_check(key)) return TRUE;
|
||||||
|
|
||||||
CG0200_application* app = (CG0200_application*) MainApp();
|
CG0200_application* app = (CG0200_application*) MainApp();
|
||||||
TLocalisamfile& clifo = *app->get_relation()->lfile(LF_CLIFO) ;
|
TLocalisamfile& clifo = app->get_relation()->lfile(LF_CLIFO) ;
|
||||||
|
|
||||||
if ( f.get().not_empty() && !clifo.empty() )
|
if ( f.get().not_empty() && !clifo.empty() )
|
||||||
{
|
{
|
||||||
@ -482,7 +482,7 @@ void CG0200_application::common_f(const TMask& m)
|
|||||||
{
|
{
|
||||||
char tipocf = m.get(F_TIPOCF)[0];
|
char tipocf = m.get(F_TIPOCF)[0];
|
||||||
long codcf = m.get_long(F_CODCF);
|
long codcf = m.get_long(F_CODCF);
|
||||||
_rel->lfile()->zero();
|
_rel->lfile().zero();
|
||||||
m.autosave(_rel);
|
m.autosave(_rel);
|
||||||
_rel->destroy_rows();
|
_rel->destroy_rows();
|
||||||
indsp_pack();
|
indsp_pack();
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
14
cg/cg0201.h
14
cg/cg0201.h
@ -10,17 +10,17 @@ class TClifoVI:public TRelation
|
|||||||
// @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);
|
||||||
|
@ -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
|
||||||
|
@ -22,7 +22,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
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)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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));
|
||||||
|
10
cg/cg2.cpp
10
cg/cg2.cpp
@ -4,7 +4,15 @@
|
|||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
@ -2,3 +2,9 @@
|
|||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ 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
|
||||||
|
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
cg/cg2101.h
14
cg/cg2101.h
@ -20,19 +20,19 @@ class TMovimentoPN : public TRelation
|
|||||||
|
|
||||||
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);
|
||||||
|
@ -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");
|
||||||
|
14
cg/cg2102.h
14
cg/cg2102.h
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
210
cg/cg3300.cpp
210
cg/cg3300.cpp
@ -134,9 +134,9 @@ public:
|
|||||||
void scrivi_coda_elenco_fornitori();
|
void scrivi_coda_elenco_fornitori();
|
||||||
|
|
||||||
TPrintrow * get_record_inizio_volume (int) ;
|
TPrintrow * get_record_inizio_volume (int) ;
|
||||||
// bool get_clienti (bool *, bool *) ;
|
// bool get_clienti (bool *, bool *) ;
|
||||||
bool get_clienti () ;
|
bool get_clienti () ;
|
||||||
// virtual TPrintrow * get_fornitori (bool *, bool *) ;
|
// virtual TPrintrow * get_fornitori (bool *, bool *) ;
|
||||||
TPrintrow * get_fornitori () ;
|
TPrintrow * get_fornitori () ;
|
||||||
TPrintrow * get_record_fine_volume (bool) ;
|
TPrintrow * get_record_fine_volume (bool) ;
|
||||||
|
|
||||||
@ -282,7 +282,7 @@ void CG3300_application::user_destroy()
|
|||||||
delete _nditte;
|
delete _nditte;
|
||||||
delete _tpd; delete _attiv;
|
delete _tpd; delete _attiv;
|
||||||
|
|
||||||
// delete _sort; // Adesso e' nella postprocess_print()
|
// delete _sort; // Adesso e' nella postprocess_print()
|
||||||
delete _RecordSort;
|
delete _RecordSort;
|
||||||
delete _recb;
|
delete _recb;
|
||||||
delete _frm;
|
delete _frm;
|
||||||
@ -331,10 +331,10 @@ bool CG3300_application::set_dischetti()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (_destinazione_stampa == dischetto)
|
// if (_destinazione_stampa == dischetto)
|
||||||
|
|
||||||
// Adesso la scelta 3, che prima era "Modulo101", si chiama "Entrambi"
|
// Adesso la scelta 3, che prima era "Modulo101", si chiama "Entrambi"
|
||||||
// (vedi cg3300a.uml)
|
// (vedi cg3300a.uml)
|
||||||
if (_tipo_stampa == modulo101) _tipo_stampa = entrambi;
|
if (_tipo_stampa == modulo101) _tipo_stampa = entrambi;
|
||||||
|
|
||||||
_my_file_printer = new TFile_printer ("IVAECF", "IVAE", 128, 1, 1);
|
_my_file_printer = new TFile_printer ("IVAECF", "IVAE", 128, 1, 1);
|
||||||
@ -466,7 +466,7 @@ void CG3300_application::pulisci_alleg (TLocalisamfile * all)
|
|||||||
|
|
||||||
void CG3300_application::ricalcola (const char * anno)
|
void CG3300_application::ricalcola (const char * anno)
|
||||||
{
|
{
|
||||||
// TProgind prn;
|
// TProgind prn;
|
||||||
KEY tasto;
|
KEY tasto;
|
||||||
TString anno_dic;
|
TString anno_dic;
|
||||||
TString tipo;
|
TString tipo;
|
||||||
@ -510,13 +510,13 @@ void CG3300_application::ricalcola (const char * anno)
|
|||||||
|
|
||||||
pulisci_alleg(&all);
|
pulisci_alleg(&all);
|
||||||
|
|
||||||
for (*cur = 0; !cur->file(LF_MOV)->eof(); ++*cur )
|
for (*cur = 0; !cur->file(LF_MOV).eof(); ++*cur )
|
||||||
{
|
{
|
||||||
TRectype mov_curr (cur->file(LF_MOV)->curr());
|
TRectype mov_curr (cur->file(LF_MOV).curr());
|
||||||
TRectype all_curr (all.curr());
|
TRectype all_curr (all.curr());
|
||||||
TRectype reg (cur->file("REG")->curr());
|
TRectype reg (cur->file("REG").curr());
|
||||||
TRectype cau (cur->file(LF_CAUSALI)->curr());
|
TRectype cau (cur->file(LF_CAUSALI).curr());
|
||||||
TRectype iva_rec (cur->file("%IVA")->curr());
|
TRectype iva_rec (cur->file("%IVA").curr());
|
||||||
|
|
||||||
TString tiporeg = reg.get ("I0");
|
TString tiporeg = reg.get ("I0");
|
||||||
|
|
||||||
@ -588,7 +588,7 @@ void CG3300_application::ricalcola (const char * anno)
|
|||||||
|
|
||||||
while (cur->next_match (LF_RMOVIVA))
|
while (cur->next_match (LF_RMOVIVA))
|
||||||
{
|
{
|
||||||
TRectype rmi (cur->file(LF_RMOVIVA)->curr());
|
TRectype rmi (cur->file(LF_RMOVIVA).curr());
|
||||||
|
|
||||||
imponibile = rmi.get_real (RMI_IMPONIBILE);
|
imponibile = rmi.get_real (RMI_IMPONIBILE);
|
||||||
imposta = rmi.get_real (RMI_IMPOSTA);
|
imposta = rmi.get_real (RMI_IMPOSTA);
|
||||||
@ -699,8 +699,8 @@ bool CG3300_application::da_sommare()
|
|||||||
|
|
||||||
comodo = _RecordSort->Strutt()->tipopers_dett;
|
comodo = _RecordSort->Strutt()->tipopers_dett;
|
||||||
|
|
||||||
// Se l'anno e' compilato prendo solo i record di quell'anno altrimenti
|
// Se l'anno e' compilato prendo solo i record di quell'anno altrimenti
|
||||||
// se e' lasciato in bianco li considero tutti
|
// se e' lasciato in bianco li considero tutti
|
||||||
|
|
||||||
if (_anno_stampa != "")
|
if (_anno_stampa != "")
|
||||||
if (_anno_stampa != anno2)
|
if (_anno_stampa != anno2)
|
||||||
@ -737,15 +737,15 @@ bool CG3300_application::buono()
|
|||||||
tipo = _alleg->curr().get (ALL_TIPOCF);
|
tipo = _alleg->curr().get (ALL_TIPOCF);
|
||||||
codcf = _alleg->curr().get_long (ALL_CODCF);
|
codcf = _alleg->curr().get_long (ALL_CODCF);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Se stampo i clienti scarto chi non ha codcf = "C"
|
// Se stampo i clienti scarto chi non ha codcf = "C"
|
||||||
//
|
//
|
||||||
if (_tipoa_richiesto != tipo)
|
if (_tipoa_richiesto != tipo)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
// GESTIONE RECORD B
|
// GESTIONE RECORD B
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
if ((_tipo_stampa == fornitori) || (_tipo_stampa == modulo102))
|
if ((_tipo_stampa == fornitori) || (_tipo_stampa == modulo102))
|
||||||
if (tipo == "B")
|
if (tipo == "B")
|
||||||
{
|
{
|
||||||
@ -755,7 +755,7 @@ bool CG3300_application::buono()
|
|||||||
|
|
||||||
if (_ricerca_att != "")
|
if (_ricerca_att != "")
|
||||||
{
|
{
|
||||||
// strcpy (_RecordSort->Strutt()->codatt_dett, _alleg->curr().get (ALL_CODATT));
|
// strcpy (_RecordSort->Strutt()->codatt_dett, _alleg->curr().get (ALL_CODATT));
|
||||||
dep = _alleg->curr().get (ALL_CODATT);
|
dep = _alleg->curr().get (ALL_CODATT);
|
||||||
|
|
||||||
if (_ricerca_att != dep)
|
if (_ricerca_att != dep)
|
||||||
@ -770,7 +770,7 @@ bool CG3300_application::buono()
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// se la stampa e' di controllo e voglio tutti i clienti mov. stampo tutti
|
// se la stampa e' di controllo e voglio tutti i clienti mov. stampo tutti
|
||||||
if ((_destinazione_stampa == controllo) && _stampa_tutti)
|
if ((_destinazione_stampa == controllo) && _stampa_tutti)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
@ -816,10 +816,10 @@ void CG3300_application::calcola ()
|
|||||||
_nditte->curr().put (NDT_CODDITTA, ditta_da);
|
_nditte->curr().put (NDT_CODDITTA, ditta_da);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Se e' stata cambiata la ditta con set_firm mi posiziono
|
// Se e' stata cambiata la ditta con set_firm mi posiziono
|
||||||
// sulla successiva in nditte
|
// sulla successiva in nditte
|
||||||
//
|
//
|
||||||
_nditte->curr().put (NDT_CODDITTA, nuova_ditta);
|
_nditte->curr().put (NDT_CODDITTA, nuova_ditta);
|
||||||
_nditte->read();
|
_nditte->read();
|
||||||
_nditte->next();
|
_nditte->next();
|
||||||
@ -839,12 +839,12 @@ void CG3300_application::calcola ()
|
|||||||
|
|
||||||
if (_ricalcola) ricalcola (_anno_stampa);
|
if (_ricalcola) ricalcola (_anno_stampa);
|
||||||
|
|
||||||
// Legge i dati anagrafici del dichiarante
|
// Legge i dati anagrafici del dichiarante
|
||||||
_RecordSort->fill_dati_anag_dic(_nditte);
|
_RecordSort->fill_dati_anag_dic(_nditte);
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
// ELABORAZIONE ALLEGATI
|
// ELABORAZIONE ALLEGATI
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
_alleg->zero();
|
_alleg->zero();
|
||||||
_alleg->put (ALL_ANNO, _anno_stampa);
|
_alleg->put (ALL_ANNO, _anno_stampa);
|
||||||
_alleg->put (ALL_CODCF, _tipoa_richiesto);
|
_alleg->put (ALL_CODCF, _tipoa_richiesto);
|
||||||
@ -862,7 +862,7 @@ void CG3300_application::calcola ()
|
|||||||
else
|
else
|
||||||
_alleg->setkey (2); // non distinguo le attivita
|
_alleg->setkey (2); // non distinguo le attivita
|
||||||
|
|
||||||
// for (_alleg->read(); !_alleg->eof(); _alleg->next())
|
// for (_alleg->read(); !_alleg->eof(); _alleg->next())
|
||||||
|
|
||||||
_alleg->read();
|
_alleg->read();
|
||||||
do
|
do
|
||||||
@ -888,24 +888,24 @@ void CG3300_application::calcola ()
|
|||||||
_alleg->next();
|
_alleg->next();
|
||||||
} while (!_alleg->eof()); // for !eof su _alleg
|
} while (!_alleg->eof()); // for !eof su _alleg
|
||||||
|
|
||||||
// rimetto all'inizio il puntatore di _alleg dopo averlo scorso tutto una volta
|
// rimetto all'inizio il puntatore di _alleg dopo averlo scorso tutto una volta
|
||||||
_alleg->first();
|
_alleg->first();
|
||||||
|
|
||||||
if (_nditte->eof()) break;
|
if (_nditte->eof()) break;
|
||||||
|
|
||||||
} // for su nditte
|
} // for su nditte
|
||||||
|
|
||||||
//
|
//
|
||||||
// Riazzero nuova_ditta dopo il for altrimenti non riesco a fare due stampe
|
// Riazzero nuova_ditta dopo il for altrimenti non riesco a fare due stampe
|
||||||
// prima di una ditta e poi di un'altra (si posiziona sulla successiva
|
// prima di una ditta e poi di un'altra (si posiziona sulla successiva
|
||||||
// in nditte)
|
// in nditte)
|
||||||
//
|
//
|
||||||
nuova_ditta = 0;
|
nuova_ditta = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Se la stampa e' su disco non chiamo subito endsort() perche'
|
// Se la stampa e' su disco non chiamo subito endsort() perche'
|
||||||
// potrei richiamare calcola() per mettere nel sort l'elenco fornitori
|
// potrei richiamare calcola() per mettere nel sort l'elenco fornitori
|
||||||
//
|
//
|
||||||
if (_destinazione_stampa == dischetto)
|
if (_destinazione_stampa == dischetto)
|
||||||
{
|
{
|
||||||
if (_tipoa_richiesto == "C")
|
if (_tipoa_richiesto == "C")
|
||||||
@ -936,11 +936,11 @@ void CG3300_application::calcola ()
|
|||||||
else // stampa NON su disco
|
else // stampa NON su disco
|
||||||
_sort->endsort();
|
_sort->endsort();
|
||||||
|
|
||||||
//
|
//
|
||||||
// CALCOLO IL NUMERO DI PAGINE CHE STAMPO FACENDO:
|
// CALCOLO IL NUMERO DI PAGINE CHE STAMPO FACENDO:
|
||||||
//
|
//
|
||||||
// NUMERO DI C/F / NUMERO DI RIGHE PER MODULO (letto dal .frm)
|
// NUMERO DI C/F / NUMERO DI RIGHE PER MODULO (letto dal .frm)
|
||||||
//
|
//
|
||||||
|
|
||||||
int righe_mod = _frm->righe_modulo();
|
int righe_mod = _frm->righe_modulo();
|
||||||
|
|
||||||
@ -975,9 +975,9 @@ print_action CG3300_application::postprocess_page(int file, int counter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
//
|
//
|
||||||
// Se sono in una pagina dispari devo fare 2 formfeed
|
// Se sono in una pagina dispari devo fare 2 formfeed
|
||||||
//
|
//
|
||||||
if (ODD(pagina_corrente)) printer().formfeed();
|
if (ODD(pagina_corrente)) printer().formfeed();
|
||||||
|
|
||||||
return NEXT_PAGE;
|
return NEXT_PAGE;
|
||||||
@ -988,24 +988,24 @@ bool CG3300_application::preprocess_print (int file, int counter)
|
|||||||
printer().footerlen (LUNGHEZZA_FOOTER);
|
printer().footerlen (LUNGHEZZA_FOOTER);
|
||||||
reset_print();
|
reset_print();
|
||||||
|
|
||||||
// init_sort();
|
// init_sort();
|
||||||
// _RecordSort->azzera_struttura();
|
// _RecordSort->azzera_struttura();
|
||||||
// set_auto_ff (TRUE);
|
// set_auto_ff (TRUE);
|
||||||
|
|
||||||
select_cursor (_cur_null);
|
select_cursor (_cur_null);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Crea e inizializza il sort.
|
// Crea e inizializza il sort.
|
||||||
// Scorre _nditte
|
// Scorre _nditte
|
||||||
// Fa le somme su _alleg per ogni ditta
|
// Fa le somme su _alleg per ogni ditta
|
||||||
//
|
//
|
||||||
|
|
||||||
// calcola();
|
// calcola();
|
||||||
|
|
||||||
|
|
||||||
// Leggo il primo record dal sort.
|
// Leggo il primo record dal sort.
|
||||||
// Le successive letture avvengono nella postprocess_page()
|
// Le successive letture avvengono nella postprocess_page()
|
||||||
//
|
//
|
||||||
if ((_buff = _sort->retrieve()) == NULL)
|
if ((_buff = _sort->retrieve()) == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@ -1111,15 +1111,15 @@ void CG3300_application::set_rows(int counter)
|
|||||||
if (_tronc)
|
if (_tronc)
|
||||||
tronca();
|
tronca();
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
// RIGA DETTAGLIO
|
// RIGA DETTAGLIO
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
set_row ( riga(COG_DETT), formato(COG_DETT), _rec->cognome_dett);
|
set_row ( riga(COG_DETT), formato(COG_DETT), _rec->cognome_dett);
|
||||||
set_row ( riga(NOM_DETT), formato(NOM_DETT), _rec->nome_dett);
|
set_row ( riga(NOM_DETT), formato(NOM_DETT), _rec->nome_dett);
|
||||||
set_row ( riga(VIA_DETT), formato(VIA_DETT), _rec->via_dett);
|
set_row ( riga(VIA_DETT), formato(VIA_DETT), _rec->via_dett);
|
||||||
set_row ( riga(COM_DETT), formato(COM_DETT), _rec->comune_dett);
|
set_row ( riga(COM_DETT), formato(COM_DETT), _rec->comune_dett);
|
||||||
|
|
||||||
// numero progressivo
|
// numero progressivo
|
||||||
set_row (riga(PRO_DETT), formato(PRO_DETT), counter);
|
set_row (riga(PRO_DETT), formato(PRO_DETT), counter);
|
||||||
|
|
||||||
if (tipo == "F")
|
if (tipo == "F")
|
||||||
@ -1195,7 +1195,7 @@ bool CG3300_application::preprocess_page(int file,int counter)
|
|||||||
struct alleg_sort * buff = (struct alleg_sort *) _buff;
|
struct alleg_sort * buff = (struct alleg_sort *) _buff;
|
||||||
int pagina_corrente = printer().getcurrentpage();
|
int pagina_corrente = printer().getcurrentpage();
|
||||||
|
|
||||||
// Stampo intestazione se cambia la ditta...
|
// Stampo intestazione se cambia la ditta...
|
||||||
if (pagina_corrente > 1)
|
if (pagina_corrente > 1)
|
||||||
{
|
{
|
||||||
if ( buff->codditta_dic != codditta_curr )
|
if ( buff->codditta_dic != codditta_curr )
|
||||||
@ -1207,7 +1207,7 @@ bool CG3300_application::preprocess_page(int file,int counter)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// .. e se cambia l'attivita'
|
// .. e se cambia l'attivita'
|
||||||
if (_distingui_att)
|
if (_distingui_att)
|
||||||
if (codatt_curr != buff->codatt_dic)
|
if (codatt_curr != buff->codatt_dic)
|
||||||
{
|
{
|
||||||
@ -1227,7 +1227,7 @@ void CG3300_application::preprocess_header()
|
|||||||
{
|
{
|
||||||
word pagina_corrente;
|
word pagina_corrente;
|
||||||
|
|
||||||
// printer().footerlen (LUNGHEZZA_FOOTER);
|
// printer().footerlen (LUNGHEZZA_FOOTER);
|
||||||
pagina_corrente = printer().getcurrentpage();
|
pagina_corrente = printer().getcurrentpage();
|
||||||
|
|
||||||
if (ODD (pagina_corrente))
|
if (ODD (pagina_corrente))
|
||||||
@ -1243,7 +1243,7 @@ void CG3300_application::preprocess_footer()
|
|||||||
|
|
||||||
pagina_corrente = printer().getcurrentpage();
|
pagina_corrente = printer().getcurrentpage();
|
||||||
|
|
||||||
// Per sapere se deve stampare il record B
|
// Per sapere se deve stampare il record B
|
||||||
if (pagina_corrente >= _num_pag)
|
if (pagina_corrente >= _num_pag)
|
||||||
ultima = TRUE;
|
ultima = TRUE;
|
||||||
|
|
||||||
@ -1276,9 +1276,9 @@ void CG3300_application::stampa_totali(bool ultima)
|
|||||||
tot_nies = _t->RipTotNies() + _t->TotNiesc() + _t->TotNiesp() ;
|
tot_nies = _t->RipTotNies() + _t->TotNiesc() + _t->TotNiesp() ;
|
||||||
tot_e8es = _t->RipTotE8es() + _t->TotE8esc() + _t->TotE8esp() ;
|
tot_e8es = _t->RipTotE8es() + _t->TotE8esc() + _t->TotE8esp() ;
|
||||||
|
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
// Record B (dati relativi alle importazioni
|
// Record B (dati relativi alle importazioni
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
|
|
||||||
if (_tipo_stampa == fornitori)
|
if (_tipo_stampa == fornitori)
|
||||||
if (ultima)
|
if (ultima)
|
||||||
@ -1293,9 +1293,9 @@ void CG3300_application::stampa_totali(bool ultima)
|
|||||||
set_footer (riga(RECB_TOT), formato(RECB_TOT), _recb->tot_str() );
|
set_footer (riga(RECB_TOT), formato(RECB_TOT), _recb->tot_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
// Riporti dalla pagina precedente
|
// Riporti dalla pagina precedente
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
|
|
||||||
set_footer (riga(RIP_ESC), formato(RIP_ESC), _t->RipTotEs());
|
set_footer (riga(RIP_ESC), formato(RIP_ESC), _t->RipTotEs());
|
||||||
|
|
||||||
@ -1319,9 +1319,9 @@ void CG3300_application::stampa_totali(bool ultima)
|
|||||||
set_footer (riga(RIP_E8ESP), formato(RIP_E8ESP),
|
set_footer (riga(RIP_E8ESP), formato(RIP_E8ESP),
|
||||||
_t->RipTotE8es().string(12,0));
|
_t->RipTotE8es().string(12,0));
|
||||||
|
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
// Totali
|
// Totali
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
|
|
||||||
set_footer (riga(TOT_ESC), formato(TOT_ESC), tot_es);
|
set_footer (riga(TOT_ESC), formato(TOT_ESC), tot_es);
|
||||||
|
|
||||||
@ -1349,13 +1349,13 @@ bool CG3300_application::intesta()
|
|||||||
{
|
{
|
||||||
TString tipoa;
|
TString tipoa;
|
||||||
struct alleg_sort * buff = (struct alleg_sort *) _buff;
|
struct alleg_sort * buff = (struct alleg_sort *) _buff;
|
||||||
// struct dati_dic * buff = _dati_dic;
|
// struct dati_dic * buff = _dati_dic;
|
||||||
word num_pagina;
|
word num_pagina;
|
||||||
|
|
||||||
num_pagina = printer().getcurrentpage();
|
num_pagina = printer().getcurrentpage();
|
||||||
|
|
||||||
// my_formfeed();
|
// my_formfeed();
|
||||||
// reset_header();
|
// reset_header();
|
||||||
|
|
||||||
set_header (riga(PAIVA_DIC), formato(PAIVA_DIC), buff->paiva_dic);
|
set_header (riga(PAIVA_DIC), formato(PAIVA_DIC), buff->paiva_dic);
|
||||||
set_header (riga(PAG_NUM), formato(PAG_NUM), num_pagina);
|
set_header (riga(PAG_NUM), formato(PAG_NUM), num_pagina);
|
||||||
@ -1408,9 +1408,9 @@ bool CG3300_application::intesta()
|
|||||||
(const char *)buff->codatt_dic);
|
(const char *)buff->codatt_dic);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
//
|
//
|
||||||
// Persona giuridica
|
// Persona giuridica
|
||||||
//
|
//
|
||||||
{
|
{
|
||||||
set_header (riga(RAGSOC_DIC), formato(RAGSOC_DIC),
|
set_header (riga(RAGSOC_DIC), formato(RAGSOC_DIC),
|
||||||
(const char*)buff->ragsoc_dic);
|
(const char*)buff->ragsoc_dic);
|
||||||
@ -1444,8 +1444,8 @@ bool CG3300_application::intesta()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/******************
|
/******************
|
||||||
const char * CG3300_application::get_paiva_cf (const char * tipoa, long codcf)
|
const char * CG3300_application::get_paiva_cf (const char * tipoa, long codcf)
|
||||||
{
|
{
|
||||||
TString dep;
|
TString dep;
|
||||||
|
|
||||||
_clifo->setkey(1);
|
_clifo->setkey(1);
|
||||||
@ -1459,8 +1459,8 @@ const char * CG3300_application::get_paiva_cf (const char * tipoa, long codcf)
|
|||||||
else
|
else
|
||||||
dep = "";
|
dep = "";
|
||||||
return dep;
|
return dep;
|
||||||
}
|
}
|
||||||
******************/
|
******************/
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
@ -1522,12 +1522,12 @@ bool CG3300_application::scrivi_volume(int volume)
|
|||||||
bool inizio_elenco_fornitori = TRUE;
|
bool inizio_elenco_fornitori = TRUE;
|
||||||
bool finito_clienti = FALSE;
|
bool finito_clienti = FALSE;
|
||||||
bool finito_fornitori = FALSE;
|
bool finito_fornitori = FALSE;
|
||||||
// static bool fclienti = TRUE;
|
// static bool fclienti = TRUE;
|
||||||
// static bool ffornitori = FALSE;
|
// static bool ffornitori = FALSE;
|
||||||
|
|
||||||
dep.temp("TMP$$");
|
dep.temp("TMP$$");
|
||||||
_my_file_printer->add_file(dep);
|
_my_file_printer->add_file(dep);
|
||||||
// _tmp_files.add(dep.temp("TMP$$"));
|
// _tmp_files.add(dep.temp("TMP$$"));
|
||||||
|
|
||||||
_my_file_printer->set_printerfile (dep);
|
_my_file_printer->set_printerfile (dep);
|
||||||
|
|
||||||
@ -1545,7 +1545,7 @@ bool CG3300_application::scrivi_volume(int volume)
|
|||||||
scrivi_inizio_elenco_clienti();
|
scrivi_inizio_elenco_clienti();
|
||||||
inizio_elenco_clienti = FALSE;
|
inizio_elenco_clienti = FALSE;
|
||||||
}
|
}
|
||||||
// res = get_clienti(&fclienti, &ffornitori);
|
// res = get_clienti(&fclienti, &ffornitori);
|
||||||
res = get_clienti();
|
res = get_clienti();
|
||||||
|
|
||||||
if (res == FALSE) {
|
if (res == FALSE) {
|
||||||
@ -1559,7 +1559,7 @@ bool CG3300_application::scrivi_volume(int volume)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************
|
/*******************
|
||||||
if ((_tipo_stampa == entrambi) || (_tipo_stampa == clienti))
|
if ((_tipo_stampa == entrambi) || (_tipo_stampa == clienti))
|
||||||
{
|
{
|
||||||
if (!finito_clienti)
|
if (!finito_clienti)
|
||||||
@ -1585,7 +1585,7 @@ bool CG3300_application::scrivi_volume(int volume)
|
|||||||
scrivi_inizio_elenco_fornitori();
|
scrivi_inizio_elenco_fornitori();
|
||||||
inizio_elenco_fornitori = FALSE; }
|
inizio_elenco_fornitori = FALSE; }
|
||||||
|
|
||||||
// riga = get_fornitori(&fclienti, &ffornitori);
|
// riga = get_fornitori(&fclienti, &ffornitori);
|
||||||
riga = get_fornitori();
|
riga = get_fornitori();
|
||||||
|
|
||||||
if (riga == NULL) {
|
if (riga == NULL) {
|
||||||
@ -1596,7 +1596,7 @@ bool CG3300_application::scrivi_volume(int volume)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // else
|
} // else
|
||||||
*******************/
|
*******************/
|
||||||
|
|
||||||
} // for
|
} // for
|
||||||
|
|
||||||
@ -1817,8 +1817,8 @@ TPrintrow * CG3300_application::get_fornitori ()
|
|||||||
|
|
||||||
if (_buff == NULL)
|
if (_buff == NULL)
|
||||||
{
|
{
|
||||||
// *clienti = TRUE;
|
// *clienti = TRUE;
|
||||||
// *fornitori = FALSE;
|
// *fornitori = FALSE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1831,9 +1831,9 @@ TPrintrow * CG3300_application::get_fornitori ()
|
|||||||
|
|
||||||
if (tipoa != "F") return FALSE;
|
if (tipoa != "F") return FALSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// METTEERE CONTROLLO VALIDITA PAIVA!!!! QUI !!!!
|
// METTEERE CONTROLLO VALIDITA PAIVA!!!! QUI !!!!
|
||||||
//
|
//
|
||||||
paiva = _rec->paiva_dett;
|
paiva = _rec->paiva_dett;
|
||||||
stato = _rec->statopaiva_dett;
|
stato = _rec->statopaiva_dett;
|
||||||
|
|
||||||
@ -2087,7 +2087,7 @@ bool CG3300_application::get_clienti ()
|
|||||||
|
|
||||||
if (_buff == NULL)
|
if (_buff == NULL)
|
||||||
{
|
{
|
||||||
// *clienti = FALSE;
|
// *clienti = FALSE;
|
||||||
// *fornitori = TRUE;
|
// *fornitori = TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -2101,9 +2101,9 @@ bool CG3300_application::get_clienti ()
|
|||||||
|
|
||||||
if (tipoa != "C") return FALSE;
|
if (tipoa != "C") return FALSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// METTEERE CONTROLLO VALIDITA PAIVA!!!! QUI !!!!
|
// METTEERE CONTROLLO VALIDITA PAIVA!!!! QUI !!!!
|
||||||
//
|
//
|
||||||
paiva = _rec->paiva_dett;
|
paiva = _rec->paiva_dett;
|
||||||
stato = _rec->statopaiva_dett;
|
stato = _rec->statopaiva_dett;
|
||||||
|
|
||||||
|
@ -174,10 +174,10 @@ const char * SortRecord::fill_dati_dettaglio (const char * tipocf, long codcf)
|
|||||||
nom = rag.mid (pos+1);
|
nom = rag.mid (pos+1);
|
||||||
strcpy (_all->cognome_dett , cog.trim());
|
strcpy (_all->cognome_dett , cog.trim());
|
||||||
strcpy (_all->nome_dett , nom.trim());
|
strcpy (_all->nome_dett , nom.trim());
|
||||||
//
|
//
|
||||||
// N.B.
|
// N.B.
|
||||||
// Azzero la ragione sociale se persona fisica.
|
// Azzero la ragione sociale se persona fisica.
|
||||||
//
|
//
|
||||||
strcpy (_all->ragsoc_dett , "\0");
|
strcpy (_all->ragsoc_dett , "\0");
|
||||||
}
|
}
|
||||||
strcpy (_rag, (const char*) rag);
|
strcpy (_rag, (const char*) rag);
|
||||||
@ -212,7 +212,7 @@ void SortRecord::somma (TLocalisamfile * alleg, stampe tipo_stampa)
|
|||||||
_all->e8esp += alleg->curr().get_real (ALL_E8ESP);
|
_all->e8esp += alleg->curr().get_real (ALL_E8ESP);
|
||||||
_all->ndocesp += alleg->curr().get_int (ALL_NDOCESP);
|
_all->ndocesp += alleg->curr().get_int (ALL_NDOCESP);
|
||||||
|
|
||||||
// Incremento totali di riga
|
// Incremento totali di riga
|
||||||
_all->tot_rigac += _all->impesc + _all->ivaesc + _all->niesc + _all->e8esc;
|
_all->tot_rigac += _all->impesc + _all->ivaesc + _all->niesc + _all->e8esc;
|
||||||
_all->tot_rigap += _all->impesp + _all->ivaesp + _all->niesp + _all->e8esp;
|
_all->tot_rigap += _all->impesp + _all->ivaesp + _all->niesp + _all->e8esp;
|
||||||
|
|
||||||
@ -297,23 +297,23 @@ void SortRecord::compila(TLocalisamfile * _alleg)
|
|||||||
TString tipoa;
|
TString tipoa;
|
||||||
long codcf;
|
long codcf;
|
||||||
|
|
||||||
// azzera_struttura();
|
// azzera_struttura();
|
||||||
|
|
||||||
tipoa = _alleg->curr().get (ALL_TIPOCF);
|
tipoa = _alleg->curr().get (ALL_TIPOCF);
|
||||||
strcpy (_all->tipopers_dett, tipoa);
|
strcpy (_all->tipopers_dett, tipoa);
|
||||||
|
|
||||||
// strcpy (_all->tipopers_dett, _alleg->curr().get (ALL_TIPOCF));
|
// strcpy (_all->tipopers_dett, _alleg->curr().get (ALL_TIPOCF));
|
||||||
|
|
||||||
codcf = _alleg->curr().get_long (ALL_CODCF);
|
codcf = _alleg->curr().get_long (ALL_CODCF);
|
||||||
_all->codcf_dett = codcf;
|
_all->codcf_dett = codcf;
|
||||||
|
|
||||||
// _RecordSort->Strutt()->codcf_dett = _alleg->curr().get_long (ALL_CODCF);
|
// _RecordSort->Strutt()->codcf_dett = _alleg->curr().get_long (ALL_CODCF);
|
||||||
|
|
||||||
// strcpy (_RecordSort->Strutt()->paiva_dett, get_paiva_cf (tipoa, codcf));
|
// strcpy (_RecordSort->Strutt()->paiva_dett, get_paiva_cf (tipoa, codcf));
|
||||||
|
|
||||||
//
|
//
|
||||||
// QUI CAMBIA IL CODICE ATTIVITA
|
// QUI CAMBIA IL CODICE ATTIVITA
|
||||||
//
|
//
|
||||||
strcpy (_all->codatt_dett, _alleg->curr().get (ALL_CODATT));
|
strcpy (_all->codatt_dett, _alleg->curr().get (ALL_CODATT));
|
||||||
|
|
||||||
_all->immesso = _alleg->curr().get_bool (ALL_IMMESSO);
|
_all->immesso = _alleg->curr().get_bool (ALL_IMMESSO);
|
||||||
@ -433,7 +433,7 @@ bool SortRecord::fill_dati_anag_dic (TLocalisamfile * nditte)
|
|||||||
else
|
else
|
||||||
if (tipoa[0] == 'G')
|
if (tipoa[0] == 'G')
|
||||||
{
|
{
|
||||||
// Leggo natura giuridica dal anagrafe giuridiche
|
// Leggo natura giuridica dal anagrafe giuridiche
|
||||||
anaggiu.setkey(1);
|
anaggiu.setkey(1);
|
||||||
anaggiu.curr().zero();
|
anaggiu.curr().zero();
|
||||||
anaggiu.curr().put (ANG_CODANAGR, codanagr);
|
anaggiu.curr().put (ANG_CODANAGR, codanagr);
|
||||||
|
@ -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());
|
||||||
|
@ -22,8 +22,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
static char sep[] =
|
static char sep[] =
|
||||||
"------------------------------------------------------------------"
|
"------------------------------------------------------------------"
|
||||||
"------------------------------------------------------------------";
|
"------------------------------------------------------------------";
|
||||||
|
|
||||||
void CG4300_App::set_page(int file, int cnt)
|
void CG4300_App::set_page(int file, int cnt)
|
||||||
{
|
{
|
||||||
@ -261,10 +261,10 @@ void CG4300_App::describe_viaggio(int month, const char* codatt)
|
|||||||
|
|
||||||
|
|
||||||
void CG4300_App::describe_pims(int month, const char* codatt)
|
void CG4300_App::describe_pims(int month, const char* codatt)
|
||||||
// le si passa una tokenstring (o un codatt) e lei, da brava, calcola
|
// le si passa una tokenstring (o un codatt) e lei, da brava, calcola
|
||||||
// cumulando per tutte le attivita' nominatele
|
// cumulando per tutte le attivita' nominatele
|
||||||
// ogni riga riguarda un codiva ma tutti i registri
|
// ogni riga riguarda un codiva ma tutti i registri
|
||||||
// se il mese e' 13 si guarda tutto l'anno
|
// se il mese e' 13 si guarda tutto l'anno
|
||||||
{
|
{
|
||||||
TToken_string atts(codatt);
|
TToken_string atts(codatt);
|
||||||
TString ref(atts.items() == 1 ? codatt : "ALL");
|
TString ref(atts.items() == 1 ? codatt : "ALL");
|
||||||
|
@ -23,9 +23,9 @@ bool CG4300_App::set_deleghe()
|
|||||||
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)
|
||||||
{
|
{
|
||||||
@ -280,8 +280,8 @@ bool CG4300_App::recalc_acconto()
|
|||||||
_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;
|
||||||
@ -293,27 +293,27 @@ bool CG4300_App::recalc_acconto()
|
|||||||
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;
|
||||||
@ -324,7 +324,7 @@ bool CG4300_App::recalc_acconto()
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
114
cg/cg4400.cpp
114
cg/cg4400.cpp
@ -6,20 +6,20 @@
|
|||||||
|
|
||||||
static TString256 TMP;
|
static TString256 TMP;
|
||||||
|
|
||||||
HIDDEN CG4400_application * app() { return (CG4400_application*) MainApp(); }
|
inline CG4400_application& app() { return (CG4400_application&)main_app(); }
|
||||||
|
|
||||||
bool filter_func (const TRelation * r)
|
bool filter_func (const TRelation * r)
|
||||||
{
|
{
|
||||||
TLocalisamfile * mov = r->lfile(LF_MOV);
|
TLocalisamfile & mov = r->lfile(LF_MOV);
|
||||||
TString codreg = mov->get(MOV_REG);
|
TString codreg = mov.get(MOV_REG);
|
||||||
TDate datareg = mov->get_date(MOV_DATAREG);
|
TDate datareg = mov.get_date(MOV_DATAREG);
|
||||||
int annoiva = mov->get_int(MOV_ANNOIVA);
|
int annoiva = mov.get_int(MOV_ANNOIVA);
|
||||||
|
|
||||||
if (codreg != (app()->_codreg) || annoiva != (app()->_annoes))
|
if (codreg != (app()._codreg) || annoiva != (app()._annoes))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (app()->_data_da.string() != "" && app()->_data_a.string() != "")
|
if (app()._data_da.string() != "" && app()._data_a.string() != "")
|
||||||
if ( (datareg < app()->_data_da || datareg > app()->_data_a ) || (!datareg.ok()) )
|
if ( (datareg < app()._data_da || datareg > app()._data_a ) || (!datareg.ok()) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -59,20 +59,20 @@ bool mask_select (TMask_field& f, KEY k)
|
|||||||
long j, cnt, chk; int i;
|
long j, cnt, chk; int i;
|
||||||
TString from = f.mask().get(DA_CODICE);
|
TString from = f.mask().get(DA_CODICE);
|
||||||
TString to = f.mask().get(A_CODICE);
|
TString to = f.mask().get(A_CODICE);
|
||||||
TBit_array selected = app()->_selected;
|
TBit_array selected = app()._selected;
|
||||||
|
|
||||||
// build sheet
|
// build sheet
|
||||||
if (k == K_SPACE)
|
if (k == K_SPACE)
|
||||||
{
|
{
|
||||||
f.mask().field(DA_CODICE).set("");
|
f.mask().field(DA_CODICE).set("");
|
||||||
f.mask().field(A_CODICE).set("");
|
f.mask().field(A_CODICE).set("");
|
||||||
app()->_ditte->destroy(); chk = 0l;
|
app()._ditte->destroy(); chk = 0l;
|
||||||
for (i = 0; i < app()->_nomiditte.items(); i++)
|
for (i = 0; i < app()._nomiditte.items(); i++)
|
||||||
{
|
{
|
||||||
if (app()->_selected[i]) continue;
|
if (app()._selected[i]) continue;
|
||||||
TToken_string d = (const char*)((TToken_string&)app()->_nomiditte[i]);
|
TToken_string d = (const char*)((TToken_string&)app()._nomiditte[i]);
|
||||||
TString cod = d.get(1);
|
TString cod = d.get(1);
|
||||||
app()->_ditte->add(d);
|
app()._ditte->add(d);
|
||||||
|
|
||||||
if (!from.empty() || !to.empty())
|
if (!from.empty() || !to.empty())
|
||||||
{
|
{
|
||||||
@ -81,24 +81,24 @@ bool mask_select (TMask_field& f, KEY k)
|
|||||||
if (atol(cod) >= atol(from) && atol(cod) <= atol(to))
|
if (atol(cod) >= atol(from) && atol(cod) <= atol(to))
|
||||||
{
|
{
|
||||||
selected.set(chk++);
|
selected.set(chk++);
|
||||||
app()->_ditte->check(chk++);
|
app()._ditte->check(chk++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// seleziona e aggiungi alle gia' selezionate
|
// seleziona e aggiungi alle gia' selezionate
|
||||||
if (app()->_ditte->run() == K_ENTER)
|
if (app()._ditte->run() == K_ENTER)
|
||||||
{
|
{
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
for (j = 0l; j < app()->_n_ditte; j++)
|
for (j = 0l; j < app()._n_ditte; j++)
|
||||||
{
|
{
|
||||||
if (app()->_selected[j]) continue;
|
if (app()._selected[j]) continue;
|
||||||
if (app()->_ditte->checked(cnt++))
|
if (app()._ditte->checked(cnt++))
|
||||||
selected.set(j);
|
selected.set(j);
|
||||||
}
|
}
|
||||||
app()->_selected |= selected;
|
app()._selected |= selected;
|
||||||
selected.reset();
|
selected.reset();
|
||||||
}
|
}
|
||||||
long numd = app()->_selected.ones();
|
long numd = app()._selected.ones();
|
||||||
f.mask().set(F_SELECT,numd);
|
f.mask().set(F_SELECT,numd);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -110,16 +110,16 @@ bool mask_verifica (TMask_field& f, KEY k)
|
|||||||
|
|
||||||
if (k == K_SPACE)
|
if (k == K_SPACE)
|
||||||
{
|
{
|
||||||
app()->_ditte->destroy();
|
app()._ditte->destroy();
|
||||||
for (i = 0; i < app()->_nomiditte.items(); i++)
|
for (i = 0; i < app()._nomiditte.items(); i++)
|
||||||
{
|
{
|
||||||
TToken_string d = (const char*)((TToken_string&)app()->_nomiditte[i]);
|
TToken_string d = (const char*)((TToken_string&)app()._nomiditte[i]);
|
||||||
app()->_ditte->add(d);
|
app()._ditte->add(d);
|
||||||
if (app()->_selected[i]) app()->_ditte->check(i);
|
if (app()._selected[i]) app()._ditte->check(i);
|
||||||
}
|
}
|
||||||
app()->_ditte->disable_check();
|
app()._ditte->disable_check();
|
||||||
app()->_ditte->run();
|
app()._ditte->run();
|
||||||
app()->_ditte->enable_check();
|
app()._ditte->enable_check();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ bool mask_annulla (TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (k == K_SPACE)
|
if (k == K_SPACE)
|
||||||
{
|
{
|
||||||
app()->_selected.reset();
|
app()._selected.reset();
|
||||||
f.mask().set(F_SELECT, "0");
|
f.mask().set(F_SELECT, "0");
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -138,7 +138,7 @@ bool mask_from_to (TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (k == K_TAB)
|
if (k == K_TAB)
|
||||||
{
|
{
|
||||||
app()->_selected.reset();
|
app()._selected.reset();
|
||||||
TString from, to;
|
TString from, to;
|
||||||
const short id = f.dlg();
|
const short id = f.dlg();
|
||||||
from = f.mask().get(id-1);
|
from = f.mask().get(id-1);
|
||||||
@ -150,13 +150,13 @@ bool mask_from_to (TMask_field& f, KEY k)
|
|||||||
if (from.empty()) from = "0";
|
if (from.empty()) from = "0";
|
||||||
if (to.empty()) to = "999999";
|
if (to.empty()) to = "999999";
|
||||||
|
|
||||||
for (i = 0; i < app()->_nomiditte.items(); i++)
|
for (i = 0; i < app()._nomiditte.items(); i++)
|
||||||
{
|
{
|
||||||
TToken_string d = (const char*)((TToken_string&)app()->_nomiditte[i]);
|
TToken_string d = (const char*)((TToken_string&)app()._nomiditte[i]);
|
||||||
TString cod = d.get(1);
|
TString cod = d.get(1);
|
||||||
|
|
||||||
if (atol(cod) >= atol(from) && atol(cod)<= atol(to))
|
if (atol(cod) >= atol(from) && atol(cod)<= atol(to))
|
||||||
app()->_selected.set(chk++);
|
app()._selected.set(chk++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -515,7 +515,7 @@ int CG4400_application::riga_rmoviva()
|
|||||||
while (ok)
|
while (ok)
|
||||||
{
|
{
|
||||||
nrec++;
|
nrec++;
|
||||||
TRectype iva (_cur->file(LF_RMOVIVA)->curr());
|
TRectype iva (_cur->file(LF_RMOVIVA).curr());
|
||||||
tipodet = iva.get_int (RMI_TIPODET);
|
tipodet = iva.get_int (RMI_TIPODET);
|
||||||
tipocr = iva.get_int (RMI_TIPOCR);
|
tipocr = iva.get_int (RMI_TIPOCR);
|
||||||
impo = iva.get_real(RMI_IMPONIBILE);
|
impo = iva.get_real(RMI_IMPONIBILE);
|
||||||
@ -1041,12 +1041,12 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
|||||||
TString ragsoc;
|
TString ragsoc;
|
||||||
TString tipo_op = "";
|
TString tipo_op = "";
|
||||||
|
|
||||||
TLocalisamfile* mov = _cur->file(LF_MOV);
|
TLocalisamfile& mov = _cur->file(LF_MOV);
|
||||||
TLocalisamfile* caus = _cur->file(LF_CAUSALI);
|
TLocalisamfile& caus = _cur->file(LF_CAUSALI);
|
||||||
|
|
||||||
//long annoes = mov->get_long(MOV_ANNOES);
|
//long annoes = mov->get_long(MOV_ANNOES);
|
||||||
//TString16 codreg = mov->get(MOV_REG);
|
//TString16 codreg = mov->get(MOV_REG);
|
||||||
_datareg = mov->get_date(MOV_DATAREG);
|
_datareg = mov.get_date(MOV_DATAREG);
|
||||||
|
|
||||||
//if (codreg != _codreg || annoes != _annoes)
|
//if (codreg != _codreg || annoes != _annoes)
|
||||||
// return FALSE;
|
// return FALSE;
|
||||||
@ -1067,26 +1067,26 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
|||||||
|
|
||||||
_dataregp = _datareg;
|
_dataregp = _datareg;
|
||||||
|
|
||||||
TDate datadoc = mov->get_date(MOV_DATADOC);
|
TDate datadoc = mov.get_date(MOV_DATADOC);
|
||||||
long numreg = mov->get_long(MOV_NUMREG);
|
long numreg = mov.get_long(MOV_NUMREG);
|
||||||
long protiva = mov->get_long(MOV_PROTIVA);
|
long protiva = mov.get_long(MOV_PROTIVA);
|
||||||
real totdoc = mov->get_real(MOV_TOTDOC);
|
real totdoc = mov.get_real(MOV_TOTDOC);
|
||||||
TString numdoc = mov->get(MOV_NUMDOC);
|
TString numdoc = mov.get(MOV_NUMDOC);
|
||||||
char tipocf = mov->get(MOV_TIPO)[0];
|
char tipocf = mov.get(MOV_TIPO)[0];
|
||||||
TString ocfpi = mov->get(MOV_OCFPI);
|
TString ocfpi = mov.get(MOV_OCFPI);
|
||||||
long codcf = mov->get_long(MOV_CODCF);
|
long codcf = mov.get_long(MOV_CODCF);
|
||||||
long numgio = mov->get_long(MOV_NUMGIO);
|
long numgio = mov.get_long(MOV_NUMGIO);
|
||||||
bool stampato = mov->get_bool(MOV_STAMPATO);
|
bool stampato = mov.get_bool(MOV_STAMPATO);
|
||||||
bool intra = caus->get_bool(CAU_INTRACOM);
|
bool intra = caus.get_bool(CAU_INTRACOM);
|
||||||
bool autof = caus->get_bool(CAU_AUTOFATT);
|
bool autof = caus.get_bool(CAU_AUTOFATT);
|
||||||
TString descrcau = caus->get(CAU_DESCR);
|
TString descrcau = caus.get(CAU_DESCR);
|
||||||
|
|
||||||
//aggiornamento di mov
|
//aggiornamento di mov
|
||||||
if (_tipo_stampa != 3)
|
if (_tipo_stampa != 3)
|
||||||
if (!stampato)
|
if (!stampato)
|
||||||
{
|
{
|
||||||
mov->put(MOV_STAMPATO,TRUE);
|
mov.put(MOV_STAMPATO,TRUE);
|
||||||
mov->rewrite();
|
mov.rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( intra && autof)
|
if ( intra && autof)
|
||||||
@ -1105,7 +1105,7 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
|||||||
}
|
}
|
||||||
else ragsoc = descrcau;
|
else ragsoc = descrcau;
|
||||||
|
|
||||||
_tipodoc = mov->get(MOV_TIPODOC);
|
_tipodoc = mov.get(MOV_TIPODOC);
|
||||||
_descr_doc = descr_doc(_tipodoc);
|
_descr_doc = descr_doc(_tipodoc);
|
||||||
TString app = datadoc.string(2, '/');
|
TString app = datadoc.string(2, '/');
|
||||||
|
|
||||||
@ -1137,7 +1137,7 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
|||||||
set_row(rr, "@108g%r", &riga._imposta);
|
set_row(rr, "@108g%r", &riga._imposta);
|
||||||
}
|
}
|
||||||
_riga_rmi.destroy();
|
_riga_rmi.destroy();
|
||||||
int tipocr = _cur->file(LF_RMOVIVA)->get_int(RMI_TIPOCR);
|
int tipocr = _cur->file(LF_RMOVIVA).get_int(RMI_TIPOCR);
|
||||||
set_row(_r, "@124g%d", tipocr);
|
set_row(_r, "@124g%d", tipocr);
|
||||||
}
|
}
|
||||||
//int tipocr = _cur->file(LF_RMOVIVA)->get_int(RMI_TIPOCR);
|
//int tipocr = _cur->file(LF_RMOVIVA)->get_int(RMI_TIPOCR);
|
||||||
@ -1272,10 +1272,10 @@ print_action CG4400_application::postprocess_page (int file, int counter)
|
|||||||
}
|
}
|
||||||
else //if ( (_tipo_stampa == 1) || (_tipo_stampa == 4) )
|
else //if ( (_tipo_stampa == 1) || (_tipo_stampa == 4) )
|
||||||
{
|
{
|
||||||
TLocalisamfile* mov = _cur->file(LF_MOV);
|
TLocalisamfile& mov = _cur->file(LF_MOV);
|
||||||
_cur->save_status();
|
_cur->save_status();
|
||||||
++(*_cur);
|
++(*_cur);
|
||||||
_dataregs = mov->get_date(MOV_DATAREG);
|
_dataregs = mov.get_date(MOV_DATAREG);
|
||||||
--(*_cur);
|
--(*_cur);
|
||||||
_cur->restore_status();
|
_cur->restore_status();
|
||||||
|
|
||||||
|
26
cg/cglib.h
26
cg/cglib.h
@ -4,17 +4,10 @@
|
|||||||
#ifndef __ISAM_H
|
#ifndef __ISAM_H
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef __REAL_H
|
|
||||||
#include <real.h>
|
|
||||||
#endif
|
|
||||||
#ifndef __DATE_H
|
|
||||||
#include <date.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#ifndef __ASSOC_H
|
||||||
#include <assoc.h>
|
#include <assoc.h>
|
||||||
//#include <utility.h>
|
#endif
|
||||||
//#include <config.h>
|
|
||||||
//#include <applicat.h>
|
|
||||||
|
|
||||||
#include "conto.h"
|
#include "conto.h"
|
||||||
|
|
||||||
@ -91,8 +84,7 @@ public:
|
|||||||
class TSaldo_agg : public TObject
|
class TSaldo_agg : public TObject
|
||||||
{
|
{
|
||||||
TTab_conti _tab_conti;
|
TTab_conti _tab_conti;
|
||||||
bool _movap; // se e' mov. d'apertura (aggiorno SALDO e FLAGSALINI in
|
bool _movap; // se e' mov. d'apertura (aggiorno SALDO e FLAGSALINI in saldi)
|
||||||
// saldi)
|
|
||||||
bool _provv;
|
bool _provv;
|
||||||
int _anno_es; // anno esercizio
|
int _anno_es; // anno esercizio
|
||||||
TDate _data_ulmov; // data ultimo movimento
|
TDate _data_ulmov; // data ultimo movimento
|
||||||
@ -109,19 +101,19 @@ public:
|
|||||||
char sezione, bool somma=TRUE);
|
char sezione, bool somma=TRUE);
|
||||||
|
|
||||||
void set_anno_es(int anno) { _anno_es = anno; }
|
void set_anno_es(int anno) { _anno_es = anno; }
|
||||||
int anno_es() { return _anno_es; }
|
int anno_es() const { return _anno_es; }
|
||||||
|
|
||||||
void set_movap (bool movap) { _movap = movap; }
|
void set_movap (bool movap) { _movap = movap; }
|
||||||
bool movap() { return _movap; }
|
bool movap() const { return _movap; }
|
||||||
|
|
||||||
void set_movprovv (bool p) { _provv = p; }
|
void set_movprovv (bool p) { _provv = p; }
|
||||||
bool movprovv() { return _provv; }
|
bool movprovv() const { return _provv; }
|
||||||
|
|
||||||
void set_data_ulmov (TDate& data) { _data_ulmov = data; }
|
void set_data_ulmov (const TDate& data) { _data_ulmov = data; }
|
||||||
TDate& data_ulmov() { return _data_ulmov; }
|
const TDate& data_ulmov() const { return _data_ulmov; }
|
||||||
|
|
||||||
void set_num_ulmov (long num) { _num_ulmov = num; }
|
void set_num_ulmov (long num) { _num_ulmov = num; }
|
||||||
long num_ulmov() { return _num_ulmov; }
|
long num_ulmov() const { return _num_ulmov; }
|
||||||
|
|
||||||
void reset(); // pulisce l'array dei conti
|
void reset(); // pulisce l'array dei conti
|
||||||
TSaldo_agg();
|
TSaldo_agg();
|
||||||
|
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);
|
||||||
|
50
cg/conto.h
50
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