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);
|
||||
delega.put("CODTAB", chiave);
|
||||
|
||||
f.cursor()->file()->read();
|
||||
f.cursor()->file().read();
|
||||
const bool cera = atoi(delega.get("S7")) != 0;
|
||||
if (!cera)
|
||||
{
|
||||
delega.put("S7", _azienda);
|
||||
delega.put("S8", _dipendenza);
|
||||
f.cursor()->file()->rewrite();
|
||||
f.cursor()->file().rewrite();
|
||||
}
|
||||
f.cursor()->read(); // Posiziona il cursore
|
||||
|
||||
@ -303,7 +303,7 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
||||
scrivi = TRUE;
|
||||
}
|
||||
if (scrivi)
|
||||
f.cursor()->file()->rewrite();
|
||||
f.cursor()->file().rewrite();
|
||||
}
|
||||
printer().close();
|
||||
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
bool CG0100_application::protected_record(TRectype &rec)
|
||||
{
|
||||
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 conto = atoi(m->get(FLD_CM1_CONTO));
|
||||
const long sottoc = atol(m->get(FLD_CM1_SOTTOCONTO));
|
||||
@ -138,7 +138,7 @@ void CG0100_application::init_insert_mode(TMask& m)
|
||||
else
|
||||
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);
|
||||
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 TFixed_string descrizione(m.get(FLD_CM1_DESC));
|
||||
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())
|
||||
return TRUE;
|
||||
|
@ -91,7 +91,7 @@ bool CG0200_application::protected_record(TRectype &rec)
|
||||
const char* CG0200_application::get_next_key()
|
||||
|
||||
{
|
||||
TLocalisamfile& clifo = *_rel->lfile() ;
|
||||
TLocalisamfile& clifo = _rel->lfile() ;
|
||||
long codcf = 1L ;
|
||||
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;
|
||||
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() )
|
||||
{
|
||||
@ -157,7 +157,7 @@ HIDDEN bool no_dup_iva(TMask_field& f, KEY key)
|
||||
if (msk.query_mode() || !f.to_check(key)) return TRUE;
|
||||
|
||||
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() )
|
||||
{
|
||||
@ -482,7 +482,7 @@ void CG0200_application::common_f(const TMask& m)
|
||||
{
|
||||
char tipocf = m.get(F_TIPOCF)[0];
|
||||
long codcf = m.get_long(F_CODCF);
|
||||
_rel->lfile()->zero();
|
||||
_rel->lfile().zero();
|
||||
m.autosave(_rel);
|
||||
_rel->destroy_rows();
|
||||
indsp_pack();
|
||||
|
@ -1,11 +1,7 @@
|
||||
#include "cg0201.h"
|
||||
<<<<<<< cg0201.cpp
|
||||
=======
|
||||
#include <lffiles.h>
|
||||
|
||||
#include <clifo.h>
|
||||
#include <indsp.h>
|
||||
>>>>>>> 1.4
|
||||
|
||||
|
||||
extern bool gest_vend();
|
||||
// Definizione dei metodi relativi alla classe TClifoVI
|
||||
@ -36,7 +32,7 @@ TRectype& TClifoVI::indirizzo(int i)
|
||||
|
||||
int TClifoVI::read_indirizzi()
|
||||
{
|
||||
const TLocalisamfile* rind = lfile(LF_INDSP);
|
||||
const TLocalisamfile& rind = lfile(LF_INDSP);
|
||||
// Put here gest_vend() discrimination
|
||||
if (gest_vend())
|
||||
{
|
||||
@ -44,8 +40,8 @@ int TClifoVI::read_indirizzi()
|
||||
destroy_rows();
|
||||
for (bool ok=is_first_match(LF_INDSP); ok; ok=next_match(LF_INDSP))
|
||||
{
|
||||
const int nriga=rind->get_int(IND_CODIND) -1;
|
||||
indirizzo(nriga)=rind->curr();
|
||||
const int nriga=rind.get_int(IND_CODIND) -1;
|
||||
indirizzo(nriga)=rind.curr();
|
||||
}
|
||||
}
|
||||
_oldindirizzi=indirizzi_items();
|
||||
@ -54,55 +50,55 @@ int TClifoVI::read_indirizzi()
|
||||
|
||||
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();
|
||||
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)
|
||||
{
|
||||
const bool scrivi= (f->rewrite(rec)!=NOERR);
|
||||
if (scrivi) f->write(rec);
|
||||
const bool scrivi= (f.rewrite(rec)!=NOERR);
|
||||
if (scrivi) f.write(rec);
|
||||
} else
|
||||
f->write(rec);
|
||||
return f->status();
|
||||
f.write(rec);
|
||||
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 long codcf=lfile()->get_long(IND_CODCF);
|
||||
const char tipocf=lfile().get(IND_TIPOCF)[0];
|
||||
const long codcf=lfile().get_long(IND_CODCF);
|
||||
|
||||
for (int i=da; i<=a;i++)
|
||||
{
|
||||
f->zero();
|
||||
f->put(IND_TIPOCF,tipocf);
|
||||
f->put(IND_CODCF,codcf);
|
||||
f->put(IND_CODIND,i);
|
||||
if (f->read(_isequal,_lock)==NOERR)
|
||||
f->remove();
|
||||
f.zero();
|
||||
f.put(IND_TIPOCF,tipocf);
|
||||
f.put(IND_CODCF,codcf);
|
||||
f.put(IND_CODIND,i);
|
||||
if (f.read(_isequal,_lock)==NOERR)
|
||||
f.remove();
|
||||
}
|
||||
return f->status();
|
||||
return f.status();
|
||||
}
|
||||
|
||||
int TClifoVI::registra(bool re, bool force)
|
||||
{
|
||||
TLocalisamfile* c=lfile(LF_CLIFO);
|
||||
int err=write_rec(re,c->curr(),c);
|
||||
TLocalisamfile& c=lfile(LF_CLIFO);
|
||||
int err=write_rec(re,c.curr(),c);
|
||||
if (err!=NOERR) return err;
|
||||
|
||||
// Put here gest_vend() discrimination
|
||||
if (gest_vend())
|
||||
{
|
||||
TLocalisamfile* v=lfile(LF_CFVEN);
|
||||
err=write_rec(TRUE,v->curr(),v);
|
||||
TLocalisamfile& v=lfile(LF_CFVEN);
|
||||
err=write_rec(TRUE,v.curr(),v);
|
||||
if (err!=NOERR) return err;
|
||||
|
||||
TLocalisamfile* rind=lfile(LF_INDSP);
|
||||
const char tipocf=c->get(CLI_TIPOCF)[0];
|
||||
const long codcf=c->get_long(CLI_CODCF);
|
||||
TLocalisamfile& rind=lfile(LF_INDSP);
|
||||
const char tipocf=c.get(CLI_TIPOCF)[0];
|
||||
const long codcf=c.get_long(CLI_CODCF);
|
||||
|
||||
for (int i=0; i<indirizzi_items(); i++)
|
||||
{
|
||||
@ -134,19 +130,19 @@ int TClifoVI::rewrite(bool force, TDate&)
|
||||
|
||||
int TClifoVI::remove(TDate&)
|
||||
{
|
||||
TLocalisamfile* c=lfile(LF_CLIFO);
|
||||
TLocalisamfile& c=lfile(LF_CLIFO);
|
||||
|
||||
c->remove();
|
||||
c.remove();
|
||||
|
||||
// Put here gest_vend() discrimination
|
||||
if (gest_vend())
|
||||
{
|
||||
TLocalisamfile* v=lfile(LF_CFVEN);
|
||||
TLocalisamfile* rind=lfile(LF_INDSP);
|
||||
TLocalisamfile& v=lfile(LF_CFVEN);
|
||||
TLocalisamfile& rind=lfile(LF_INDSP);
|
||||
cancella(rind,1,_oldindirizzi);
|
||||
v->remove();
|
||||
v.remove();
|
||||
}
|
||||
_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
|
||||
protected:
|
||||
// @FPROT
|
||||
int write_rec(bool re, const TRectype& r, TLocalisamfile* f);
|
||||
int cancella(TLocalisamfile* f, int da, int a);
|
||||
int write_rec(bool re, const TRectype& r, TLocalisamfile& f);
|
||||
int cancella(TLocalisamfile& f, int da, int a);
|
||||
int registra(bool re, bool force);
|
||||
int read_indirizzi();
|
||||
// @END
|
||||
public:
|
||||
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 first(TReclock lockop=_nolock) {return (lfile()->first(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 next(TReclock lockop=_nolock) {return (lfile().next(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 last(TReclock lockop=_nolock) {return (lfile().last(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 write(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)
|
||||
{
|
||||
TFixed_string codtab(r->lfile()->get("CODTAB"));
|
||||
TFixed_string codtab(r->lfile().get("CODTAB"));
|
||||
const int anno = atoi(codtab.cut(4));
|
||||
if (anno == anno_iva())
|
||||
{
|
||||
const int tiporeg = r->lfile()->get_int("I0");
|
||||
const bool corrisp = r->lfile()->get_bool("B0");
|
||||
const int tiporeg = r->lfile().get_int("I0");
|
||||
const bool corrisp = r->lfile().get_bool("B0");
|
||||
|
||||
switch (app()->_filtro)
|
||||
{
|
||||
@ -430,7 +430,7 @@ bool CG0500_application::codcausim_hndl (TMask_field& f, KEY k)
|
||||
if (f.to_check(k))
|
||||
{
|
||||
const TString16 causim(f.get());
|
||||
TLocalisamfile& caus = *app()->_rel->lfile(LF_CAUSALI);
|
||||
TLocalisamfile& caus = app()->_rel->lfile(LF_CAUSALI);
|
||||
caus.zero();
|
||||
caus.put(CAU_CODCAUS, causim);
|
||||
if (caus.read() == NOERR)
|
||||
@ -847,7 +847,7 @@ void CG0500_application::read_rcaus(TMask& m)
|
||||
TString d(50), da(3), civa(3);
|
||||
char sz, cf;
|
||||
bool riva;
|
||||
TLocalisamfile * rcaus = _rel->lfile(LF_RCAUSALI);
|
||||
TLocalisamfile& rcaus = _rel->lfile(LF_RCAUSALI);
|
||||
|
||||
_rel->update(); // chiamo position_rels()
|
||||
|
||||
@ -857,18 +857,18 @@ void CG0500_application::read_rcaus(TMask& m)
|
||||
bool ok = _rel->is_first_match(LF_RCAUSALI);
|
||||
while (ok)
|
||||
{
|
||||
numrig = rcaus->get_int(RCA_NRIGA);
|
||||
numrig = rcaus.get_int(RCA_NRIGA);
|
||||
CHECK(numrig > 0, "Causale con numero riga nullo");
|
||||
g = rcaus->get_int(RCA_GRUPPO);
|
||||
c = rcaus->get_int(RCA_CONTO);
|
||||
s = rcaus->get_long(RCA_SOTTOCONTO);
|
||||
sz = rcaus->get_char(RCA_SEZIONE);
|
||||
d = rcaus->get(RCA_DESC);
|
||||
da = rcaus->get(RCA_CODDESC);
|
||||
// cf = rcaus->get(RCA_TIPOCF)[0];
|
||||
cf = rcaus->get_char(RCA_TIPOCF);
|
||||
riva = rcaus->get_bool(RCA_RIGAIVA);
|
||||
civa = rcaus->get(RCA_CODIVA);
|
||||
g = rcaus.get_int(RCA_GRUPPO);
|
||||
c = rcaus.get_int(RCA_CONTO);
|
||||
s = rcaus.get_long(RCA_SOTTOCONTO);
|
||||
sz = rcaus.get_char(RCA_SEZIONE);
|
||||
d = rcaus.get(RCA_DESC);
|
||||
da = rcaus.get(RCA_CODDESC);
|
||||
// cf = rcaus.get(RCA_TIPOCF)[0];
|
||||
cf = rcaus.get_char(RCA_TIPOCF);
|
||||
riva = rcaus.get_bool(RCA_RIGAIVA);
|
||||
civa = rcaus.get(RCA_CODIVA);
|
||||
TConto tc(g,c,s,cf);
|
||||
|
||||
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)
|
||||
{
|
||||
TLocalisamfile& caus = *_rel->lfile();
|
||||
TLocalisamfile& caus = _rel->lfile();
|
||||
TString16 tpd, codreg;
|
||||
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)
|
||||
{
|
||||
long i;
|
||||
TLocalisamfile *rcaus = _rel->lfile(LF_RCAUSALI);
|
||||
TLocalisamfile &rcaus = _rel->lfile(LF_RCAUSALI);
|
||||
long last = _righe_gia_presenti.last_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])
|
||||
{
|
||||
rcaus->zero();
|
||||
rcaus->put(RCA_CODCAUS,cau);
|
||||
rcaus->put(RCA_NRIGA, i);
|
||||
// if (rcaus->read() == NOERR)
|
||||
rcaus->remove();
|
||||
rcaus.zero();
|
||||
rcaus.put(RCA_CODCAUS,cau);
|
||||
rcaus.put(RCA_NRIGA, i);
|
||||
// if (rcaus.read() == NOERR)
|
||||
rcaus.remove();
|
||||
_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));
|
||||
TString80 desc;
|
||||
TString16 coddesc;
|
||||
TLocalisamfile *caus = _rel->lfile(LF_CAUSALI);
|
||||
TLocalisamfile *rcaus = _rel->lfile(LF_RCAUSALI);
|
||||
TLocalisamfile &caus = _rel->lfile(LF_CAUSALI);
|
||||
TLocalisamfile &rcaus = _rel->lfile(LF_RCAUSALI);
|
||||
|
||||
m.autosave(_rel);
|
||||
|
||||
@ -1015,36 +1015,36 @@ int CG0500_application::re_write(const TMask& m,bool rewrite)
|
||||
|
||||
if (g > 0 || c > 0 || s > 0L)
|
||||
{
|
||||
rcaus->zero();
|
||||
rcaus->put (RCA_CODCAUS, (const char *)cau);
|
||||
rcaus->put (RCA_NRIGA, i+1); // Numerare da uno!
|
||||
rcaus->put (RCA_GRUPPO , g);
|
||||
rcaus->put (RCA_CONTO , c);
|
||||
rcaus->put (RCA_SOTTOCONTO, s);
|
||||
rcaus->put (RCA_SEZIONE, sezione);
|
||||
rcaus->put (RCA_DESC , (const char *)desc);
|
||||
rcaus->put (RCA_CODDESC, (const char *)coddesc);
|
||||
rcaus->put (RCA_TIPOCF, tipo_cf);
|
||||
rcaus.zero();
|
||||
rcaus.put (RCA_CODCAUS, (const char *)cau);
|
||||
rcaus.put (RCA_NRIGA, i+1); // Numerare da uno!
|
||||
rcaus.put (RCA_GRUPPO , g);
|
||||
rcaus.put (RCA_CONTO , c);
|
||||
rcaus.put (RCA_SOTTOCONTO, s);
|
||||
rcaus.put (RCA_SEZIONE, sezione);
|
||||
rcaus.put (RCA_DESC , (const char *)desc);
|
||||
rcaus.put (RCA_CODDESC, (const char *)coddesc);
|
||||
rcaus.put (RCA_TIPOCF, tipo_cf);
|
||||
if (rewrite) {
|
||||
if (_righe_gia_presenti[i+1]) {
|
||||
rcaus->rewrite();
|
||||
rcaus.rewrite();
|
||||
_righe_gia_presenti.reset(i+1);
|
||||
}
|
||||
else
|
||||
rcaus->write();
|
||||
rcaus.write();
|
||||
}
|
||||
else
|
||||
rcaus->write();
|
||||
rcaus.write();
|
||||
}
|
||||
}
|
||||
|
||||
if (rewrite)
|
||||
{
|
||||
togli_dal_file(cau); // Elimina dal file le righe rimaste nel bitarray
|
||||
return caus->rewrite();
|
||||
return caus.rewrite();
|
||||
}
|
||||
else
|
||||
return caus->write();
|
||||
return caus.write();
|
||||
}
|
||||
|
||||
|
||||
@ -1053,8 +1053,8 @@ bool CG0500_application::remove()
|
||||
const bool ok = TRelation_application::remove();
|
||||
if (ok)
|
||||
{
|
||||
const TString cod(_rel->lfile()->get(RCA_CODCAUS));
|
||||
TLocalisamfile& rcaus = *_rel->lfile(LF_RCAUSALI);
|
||||
const TString cod(_rel->lfile().get(RCA_CODCAUS));
|
||||
TLocalisamfile& rcaus = _rel->lfile(LF_RCAUSALI);
|
||||
rcaus.zero();
|
||||
rcaus.put(RCA_CODCAUS, cod);
|
||||
int e = rcaus.read(_isgteq);
|
||||
|
@ -83,7 +83,7 @@ BEGIN
|
||||
OUTPUT F_CORRISP B0
|
||||
HELP "Codice registro"
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "D"
|
||||
FLAGS "DU"
|
||||
END
|
||||
|
||||
// Questo rimane sempre nascosto
|
||||
@ -201,6 +201,7 @@ END
|
||||
STRING F_COD_CAUS_IM 3
|
||||
BEGIN
|
||||
PROMPT 34 6 "Codice causale per l'incasso immediato "
|
||||
FLAGS "U"
|
||||
FIELD LF_CAUSALI->CODCAUSIM
|
||||
COPY USE F_COD_CAUS
|
||||
INPUT CODCAUS F_COD_CAUS_IM
|
||||
|
@ -276,13 +276,13 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
||||
chiave = d; chiave << format("%04d%02d%d", _anno, _mese, _tipo);
|
||||
delega.put("CODTAB", chiave);
|
||||
|
||||
f.cursor()->file()->read();
|
||||
f.cursor()->file().read();
|
||||
const bool cera = atoi(delega.get("S7")) != 0;
|
||||
if (!cera)
|
||||
{
|
||||
delega.put("S7", _azienda);
|
||||
delega.put("S8", _dipendenza);
|
||||
f.cursor()->file()->rewrite();
|
||||
f.cursor()->file().rewrite();
|
||||
}
|
||||
f.cursor()->read(); // Posiziona il cursore
|
||||
|
||||
@ -303,7 +303,7 @@ bool TStampa_deleghe_IVA::print_deleghe()
|
||||
scrivi = TRUE;
|
||||
}
|
||||
if (scrivi)
|
||||
f.cursor()->file()->rewrite();
|
||||
f.cursor()->file().rewrite();
|
||||
}
|
||||
printer().close();
|
||||
|
||||
|
@ -178,7 +178,7 @@ bool CG1700_application::preprocess_page(int file,int count)
|
||||
switch (file)
|
||||
{
|
||||
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;
|
||||
setta_righe_descr(_descr_causale,causale);
|
||||
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));
|
||||
break;
|
||||
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;
|
||||
setta_righe_descr(_descr_conto,conto);
|
||||
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)
|
||||
{
|
||||
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
|
||||
|
||||
int cg2100(int argc, char** argv);
|
||||
int cg2200(int argc, char** argv);
|
||||
|
||||
#endif // __CG2_H
|
||||
|
||||
|
@ -2,3 +2,9 @@
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
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);
|
||||
|
||||
_rel = new TMovimentoPN;
|
||||
_rel->lfile()->last();
|
||||
_lastreg = _rel->lfile()->get_long(MOV_NUMREG); // Init last registration number
|
||||
_rel->lfile().last();
|
||||
_lastreg = _rel->lfile().get_long(MOV_NUMREG); // Init last registration number
|
||||
|
||||
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);
|
||||
break;
|
||||
case MODE_MOD:
|
||||
annoes = _rel->lfile()->get_int("ANNOES");
|
||||
annoiva = _rel->lfile()->get_int("ANNOIVA");
|
||||
causale = _rel->lfile()->get("CODCAUS");
|
||||
annoes = _rel->lfile().get_int("ANNOES");
|
||||
annoiva = _rel->lfile().get_int("ANNOIVA");
|
||||
causale = _rel->lfile().get("CODCAUS");
|
||||
giornale().read(annoes);
|
||||
read_caus(causale, annoiva);
|
||||
break;
|
||||
@ -304,7 +304,7 @@ void TPrimanota_application::init_insert_mode(TMask& m)
|
||||
|
||||
init_mask(m);
|
||||
_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_anno_es(m.get_int(F_ANNOES));
|
||||
_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);
|
||||
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
|
||||
|
||||
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"),
|
||||
r.get_long("SOTTOCONTO"), r.get_char("TIPOC"));
|
||||
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("GRUPPO", c.gruppo());
|
||||
@ -413,7 +413,7 @@ int TPrimanota_application::read(TMask& m)
|
||||
|
||||
if (_iva != nessuna_iva)
|
||||
{
|
||||
const TString16 occode(_rel->lfile()->get("OCFPI"));
|
||||
const TString16 occode(_rel->lfile().get("OCFPI"));
|
||||
occas_mask().set(O_CODICE, occode);
|
||||
|
||||
const char clifo = toupper(m.get(F_CLIFO)[0]);
|
||||
@ -434,7 +434,7 @@ int TPrimanota_application::read(TMask& m)
|
||||
cgs.reset();
|
||||
|
||||
_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_anno_es(m.get_int(F_ANNOES));
|
||||
_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("IMPOSTA")); // Imposta 104
|
||||
|
||||
TConto c; get_conto(r, c);
|
||||
TBill c; get_conto(r, c);
|
||||
if (c.ok())
|
||||
c.add_to(riga, 4, 0x7); // 105-110
|
||||
else
|
||||
@ -525,7 +525,7 @@ int TPrimanota_application::read(TMask& m)
|
||||
|
||||
void TPrimanota_application::mask2rel(const TMask& m)
|
||||
{
|
||||
_rel->lfile()->zero();
|
||||
_rel->lfile().zero();
|
||||
m.autosave(_rel);
|
||||
|
||||
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
|
||||
|
||||
int rcontr = 0; // Riga contropartita
|
||||
const TConto contro(row, -1, 0x3); // Conto contropartita
|
||||
const TBill contro(row, -1, 0x3); // Conto contropartita
|
||||
if (contro.ok())
|
||||
{
|
||||
rcontr = bill2contr(contro, n.sezione())+1;
|
||||
@ -593,7 +593,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
||||
|
||||
if (causale().corrispettivi())
|
||||
{
|
||||
TRectype& rec = _rel->lfile()->curr();
|
||||
TRectype& rec = _rel->lfile().curr();
|
||||
rec.put("TIPO", "");
|
||||
rec.put("CODCF", ""); // Azzera il cliente nei movimenti dei corrispettivi
|
||||
}
|
||||
@ -611,11 +611,11 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
||||
err = occas.rewrite();
|
||||
|
||||
if (err == NOERR)
|
||||
_rel->lfile()->put("OCFPI", occas_mask().get(O_CODICE));
|
||||
_rel->lfile().put("OCFPI", occas_mask().get(O_CODICE));
|
||||
else
|
||||
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);
|
||||
@ -642,7 +642,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
||||
r.put("IMPOSTA", 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;
|
||||
r.put("RIGAIMP", rimp);
|
||||
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
|
||||
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 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');
|
||||
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("GRUPPO", conto.gruppo());
|
||||
@ -753,7 +753,7 @@ void TPrimanota_application::genera_incasso(const char* causimm)
|
||||
inc.cg(1) = r;
|
||||
|
||||
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
|
||||
PROMPT 1 5 "Data del documento "
|
||||
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
|
||||
END
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <xvtmacro.h>
|
||||
|
||||
#include <xvtmacro.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
#include "cg2101.h"
|
||||
@ -73,22 +73,22 @@ TRectype& TMovimentoPN::iva(int i)
|
||||
|
||||
int TMovimentoPN::read_mov_rows()
|
||||
{
|
||||
const TLocalisamfile* rm = lfile(LF_RMOV);
|
||||
const TLocalisamfile* ri = lfile(LF_RMOVIVA);
|
||||
const TLocalisamfile& rm = lfile(LF_RMOV);
|
||||
const TLocalisamfile& ri = lfile(LF_RMOVIVA);
|
||||
position_rels();
|
||||
|
||||
destroy_rows();
|
||||
for(bool ok = is_first_match(LF_RMOV); ok; ok = next_match(LF_RMOV))
|
||||
{
|
||||
const int row = rm->get_int(RMV_NUMRIG) - 1;
|
||||
cg(row) = rm->curr();
|
||||
const int row = rm.get_int(RMV_NUMRIG) - 1;
|
||||
cg(row) = rm.curr();
|
||||
}
|
||||
_oldcg = cg_items();
|
||||
|
||||
for(ok = is_first_match(LF_RMOVIVA); ok; ok = next_match(LF_RMOVIVA))
|
||||
{
|
||||
const int row = ri->get_int(RMI_NUMRIG) - 1;
|
||||
iva(row) = ri->curr();
|
||||
const int row = ri.get_int(RMI_NUMRIG) - 1;
|
||||
iva(row) = ri.curr();
|
||||
}
|
||||
_oldiva = iva_items();
|
||||
|
||||
@ -98,54 +98,54 @@ int TMovimentoPN::read_mov_rows()
|
||||
|
||||
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();
|
||||
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)
|
||||
{
|
||||
const bool scrivi = f->rewrite(rec) != NOERR;
|
||||
if (scrivi) f->write(rec);
|
||||
const bool scrivi = f.rewrite(rec) != NOERR;
|
||||
if (scrivi) f.write(rec);
|
||||
}
|
||||
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++)
|
||||
{
|
||||
f->zero();
|
||||
f->put("NUMREG", numreg);
|
||||
f->put("NUMRIG", i);
|
||||
if (f->read(_isequal, _lock) == NOERR)
|
||||
f->remove();
|
||||
f.zero();
|
||||
f.put(MOV_NUMREG, numreg);
|
||||
f.put(RMV_NUMRIG, i);
|
||||
if (f.read(_isequal, _lock) == NOERR)
|
||||
f.remove();
|
||||
}
|
||||
return f->status();
|
||||
return f.status();
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
|
||||
TLocalisamfile* rm = lfile(LF_RMOV);
|
||||
TLocalisamfile* ri = lfile(LF_RMOVIVA);
|
||||
TLocalisamfile& rm = lfile(LF_RMOV);
|
||||
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++)
|
||||
{
|
||||
@ -174,7 +174,7 @@ int TMovimentoPN::registra(bool re, bool force)
|
||||
|
||||
int TMovimentoPN::write(bool force, TDate&)
|
||||
{
|
||||
const TLocalisamfile& r = *lfile();
|
||||
const TLocalisamfile& r = lfile();
|
||||
const int annoiva = r.get_int("ANNOIVA");
|
||||
const TString16 reg(r.get("REG"));
|
||||
TRegistro registro(reg, annoiva);
|
||||
@ -194,7 +194,7 @@ int TMovimentoPN::write(bool force, TDate&)
|
||||
const char tipo = r.get_char("TIPOC");
|
||||
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);
|
||||
const TIndbil ib = (TIndbil)conto.get_int("INDBIL");
|
||||
if (ib == ib_passivita || ib == ib_ricavi)
|
||||
@ -238,14 +238,14 @@ int TMovimentoPN::rewrite(bool force, TDate&)
|
||||
|
||||
int TMovimentoPN::remove(TDate&)
|
||||
{
|
||||
TLocalisamfile* m = lfile();
|
||||
TLocalisamfile* rm = lfile(LF_RMOV);
|
||||
TLocalisamfile* ri = lfile(LF_RMOVIVA);
|
||||
TLocalisamfile& m = lfile();
|
||||
TLocalisamfile& rm = lfile(LF_RMOV);
|
||||
TLocalisamfile& ri = lfile(LF_RMOVIVA);
|
||||
|
||||
cancella(rm, 1, _oldcg);
|
||||
cancella(ri, 1, _oldiva);
|
||||
m->remove();
|
||||
m.remove();
|
||||
_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:
|
||||
// @FPROT
|
||||
int write_rec(bool re, const TRectype&r, TLocalisamfile* f);
|
||||
int cancella(TLocalisamfile* f, int da, int a);
|
||||
int write_rec(bool re, const TRectype&r, TLocalisamfile& f);
|
||||
int cancella(TLocalisamfile& f, int da, int a);
|
||||
int registra(bool re, bool force);
|
||||
int read_mov_rows();
|
||||
// @END
|
||||
|
||||
public:
|
||||
// @FPUB
|
||||
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 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 skip(TRecnotype nrec, TReclock lockop = _nolock) { return (file()->skip(nrec, 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 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 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 write (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 TBrowse* b = c.browse();
|
||||
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 bool suspended = i->get_bool(sf);
|
||||
const char* sf = i.tab() ? "B2" : "SOSPESO";
|
||||
const bool suspended = i.get_bool(sf);
|
||||
if (suspended)
|
||||
{
|
||||
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();
|
||||
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);
|
||||
if (s[s.len()-1] == tipo)
|
||||
{
|
||||
const TConto c(s, 3, 0x0);
|
||||
const TBill c(s, 3, 0x0);
|
||||
if (c == conto)
|
||||
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();
|
||||
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';
|
||||
if (sez == sezione) // Devo cercare sezione contraria
|
||||
continue;
|
||||
const TConto c(row, 3, 0x0);
|
||||
const TBill c(row, 3, 0x0);
|
||||
if (conto == c)
|
||||
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
|
||||
int TPrimanota_application::bill_used(const TConto& conto) const
|
||||
int TPrimanota_application::bill_used(const TBill& conto) const
|
||||
{
|
||||
int users = 0;
|
||||
|
||||
@ -186,7 +186,7 @@ int TPrimanota_application::bill_used(const TConto& conto) const
|
||||
TToken_string& row = (TToken_string&)rows[i];
|
||||
if (!row.empty_items())
|
||||
{
|
||||
const TConto c(row, 6, 0x0);
|
||||
const TBill c(row, 6, 0x0);
|
||||
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,
|
||||
TConto& conto, const char* desc,
|
||||
TBill& conto, const char* desc,
|
||||
char tipo)
|
||||
{
|
||||
TSheet_field& cg = cgs();
|
||||
@ -333,7 +333,7 @@ int TPrimanota_application::set_cgs_row(int n, const TImporto& imp,
|
||||
int pos = 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));
|
||||
}
|
||||
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())
|
||||
{
|
||||
TImporto i; i = row; i.swap_section();
|
||||
TConto contro(row, 9, 0x3);
|
||||
TBill contro(row, 9, 0x3);
|
||||
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);
|
||||
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)
|
||||
{
|
||||
TToken_string& riga = ivas().row(nriga);
|
||||
@ -638,11 +638,11 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
|
||||
oldposiva = type2pos(tipod); // Tipodet 4
|
||||
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);
|
||||
}
|
||||
|
||||
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');
|
||||
if (oldpos < 0 && oldconto.ok())
|
||||
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
|
||||
real imp(row.get(0)); // Imponibile
|
||||
TConto conto(row, 5, 0x3);
|
||||
TBill conto(row, 5, 0x3);
|
||||
const int newpos = bill2pos(conto, 'I');
|
||||
|
||||
if (newpos < 0)
|
||||
@ -952,7 +952,7 @@ bool TPrimanota_application::occas_code_handler(TMask_field& f, KEY key)
|
||||
if (*code)
|
||||
{
|
||||
TRelation occas(LF_OCCAS);
|
||||
occas.lfile()->put("CFPI", code);
|
||||
occas.lfile().put("CFPI", code);
|
||||
if (occas.read() == NOERR)
|
||||
{
|
||||
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
|
||||
if (conto == 0)
|
||||
{
|
||||
TConto bill; _causale.bill(1, bill);
|
||||
TBill bill; _causale.bill(1, bill);
|
||||
gruppo = bill.gruppo(); m.set(F_GRUPPOCLIFO, gruppo);
|
||||
conto = bill.conto(); m.set(F_CONTOCLIFO, conto);
|
||||
}
|
||||
|
||||
if (tipo == 'C' && causale().corrispettivi())
|
||||
tipo = ' ';
|
||||
TConto c(gruppo, conto, codice, tipo);
|
||||
TBill c(gruppo, conto, codice, tipo);
|
||||
real tot(m.get(F_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(imposta.string(), 3); // imposta
|
||||
|
||||
TConto bill; // Conto della prima riga IVA
|
||||
TBill bill; // Conto della prima riga IVA
|
||||
const TString& tipo = iva.tipo();
|
||||
if (tipo.not_empty())
|
||||
{
|
||||
@ -1106,7 +1106,7 @@ void TPrimanota_application::add_cgs_rit(bool fiscali)
|
||||
if (pos < 0)
|
||||
{
|
||||
const int riga = fiscali ? 8 : 9;
|
||||
TConto conto; _causale.bill(riga, conto);
|
||||
TBill conto; _causale.bill(riga, conto);
|
||||
|
||||
TString80 desc("Ritenute ");
|
||||
desc << (fiscali ? "fiscali" : "sociali");
|
||||
|
14
cg/cg2102.h
14
cg/cg2102.h
@ -96,8 +96,8 @@ protected:
|
||||
TMask* load_mask(int n);
|
||||
TMask& occas_mask() { return *load_mask(3); }
|
||||
|
||||
bool get_conto(const TRectype& r, TConto& c) const;
|
||||
void put_conto(TRectype& r, const TConto& c) const;
|
||||
bool get_conto(const TRectype& r, TBill& c) const;
|
||||
void put_conto(TRectype& r, const TBill& c) const;
|
||||
|
||||
void mask2rel(const TMask& m);
|
||||
|
||||
@ -110,7 +110,7 @@ protected:
|
||||
TSheet_field& cgs() 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 cau2IVA(const char* causale, int anno);
|
||||
static int type2pos(char tipo);
|
||||
@ -118,8 +118,8 @@ protected:
|
||||
static real scorpora(real& imponibile, const real& percentuale);
|
||||
static bool detraibile(int tipodet);
|
||||
|
||||
int bill2contr(const TConto& c, char sezione) const;
|
||||
int bill_used(const TConto& conto) const;
|
||||
int bill2contr(const TBill& c, char sezione) const;
|
||||
int bill_used(const TBill& conto) const;
|
||||
int det_used(char detraib) const;
|
||||
|
||||
bool read_caus(const char* cod, int year);
|
||||
@ -139,8 +139,8 @@ protected:
|
||||
real calcola_saldo() const;
|
||||
real calcola_imp() const;
|
||||
|
||||
void set_ivas_row(int n, const char* codiva, TConto& tc, const char* desc);
|
||||
int set_cgs_row(int n, const TImporto& importo, TConto& conto, const char* desc, char tipo);
|
||||
void set_ivas_row(int n, const char* codiva, TBill& tc, const char* desc);
|
||||
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 add_cgs_tot(TMask& m);
|
||||
void add_cgs_rit(bool fisc);
|
||||
|
@ -57,6 +57,7 @@ bool TRegistro::read(const char* cod, int year)
|
||||
_att.zero();
|
||||
if (err != NOERR)
|
||||
_rec.zero();
|
||||
|
||||
return err == NOERR;
|
||||
}
|
||||
|
||||
@ -200,7 +201,7 @@ bool TLibro_giornale::read(int y)
|
||||
return found;
|
||||
}
|
||||
|
||||
/*
|
||||
/* Now obsolete
|
||||
TDate TLibro_giornale::global_last_print() const
|
||||
{
|
||||
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);
|
||||
conto.set(rec.get_int("GRUPPO"), rec.get_int("CONTO"),
|
||||
|
@ -78,7 +78,7 @@ protected:
|
||||
const TRectype& row(int num) const;
|
||||
|
||||
public:
|
||||
TConto& bill(int num, TConto& c) const;
|
||||
TBill& bill(int num, TBill& c) const;
|
||||
|
||||
bool data_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 <urldefid.h>
|
||||
|
||||
#include <lffiles.h>
|
||||
|
||||
#include <mov.h>
|
||||
#include <rmov.h>
|
||||
#include <rmoviva.h>
|
||||
@ -102,7 +100,7 @@ public:
|
||||
void incrementa_totali();
|
||||
void compila_clifo();
|
||||
void compila_comuni();
|
||||
int my_next (TLocalisamfile*);
|
||||
int my_next (TLocalisamfile&);
|
||||
|
||||
CG3100_application() {}
|
||||
};
|
||||
@ -160,17 +158,17 @@ bool annoes(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)
|
||||
{
|
||||
int decidi;
|
||||
int anno = f.mask().get_int (F_ANNO);
|
||||
TDate data = f.mask().get(F_DATAINI);
|
||||
if (app->_masc == "cg3100a")
|
||||
if (app._masc == "cg3100a")
|
||||
decidi = f.mask().get_int (F_DECIDI);
|
||||
if ( anno != 0 && ( (app->_masc == "cg3100b") ||
|
||||
((app->_masc == "cg3100a" ) && (decidi == 2)) ) )
|
||||
if ( anno != 0 && ( (app._masc == "cg3100b") ||
|
||||
((app._masc == "cg3100a" ) && (decidi == 2)) ) )
|
||||
{
|
||||
if (!data.ok()) //se la data e' vuota
|
||||
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)
|
||||
{
|
||||
CG3100_application * app = (CG3100_application*)MainApp();
|
||||
CG3100_application & app = (CG3100_application&)main_app();
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
@ -195,18 +193,18 @@ bool data_fine(TMask_field& f, KEY k)
|
||||
int anno = f.mask().get_int (F_ANNO);
|
||||
TDate dataini = f.mask().get(F_DATAINI);
|
||||
TDate datafin = f.mask().get(F_DATAFIN);
|
||||
if (app->_masc == "cg3100a")
|
||||
if (app._masc == "cg3100a")
|
||||
decidi = f.mask().get_int (F_DECIDI);
|
||||
if ( (app->_masc == "cg3100b") ||
|
||||
((app->_masc == "cg3100a" ) && (decidi == 2)) )
|
||||
if ( (app._masc == "cg3100b") ||
|
||||
((app._masc == "cg3100a" ) && (decidi == 2)) )
|
||||
if ( dataini.ok() && datafin.ok() )
|
||||
if (dataini > datafin)
|
||||
{
|
||||
f.error_box("La data iniziale non deve essere superiore alla data finale");
|
||||
return FALSE;
|
||||
}
|
||||
if ( anno != 0 && ( (app->_masc == "cg3100b") ||
|
||||
((app->_masc == "cg3100a" ) && (decidi == 2)) ) )
|
||||
if ( anno != 0 && ( (app._masc == "cg3100b") ||
|
||||
((app._masc == "cg3100a" ) && (decidi == 2)) ) )
|
||||
{
|
||||
TDate fine = FineEsercizio(anno + 1);
|
||||
if (fine == botime)
|
||||
@ -233,16 +231,16 @@ void CG3100_application::compila_clifo()
|
||||
_clifo->read();
|
||||
if (_clifo->bad())
|
||||
_clifo->zero();
|
||||
_alleg = _clifo->curr().get_int(CLI_ALLEG);
|
||||
_statocf = _clifo->curr().get(CLI_STATOCF);
|
||||
_comcf = _clifo->curr().get(CLI_COMCF);
|
||||
_ragsoc = _clifo->curr().get(CLI_RAGSOC);
|
||||
_indcf = _clifo->curr().get(CLI_INDCF);
|
||||
_civcf = _clifo->curr().get(CLI_CIVCF);
|
||||
_paiv = _clifo->curr().get(CLI_PAIV);
|
||||
_capcf = _clifo->curr().get(CLI_CAPCF);
|
||||
_cofi = _clifo->curr().get(CLI_COFI);
|
||||
_codalleg = _clifo->curr().get_long(CLI_CODALLEG);
|
||||
_alleg = _clifo->get_int(CLI_ALLEG);
|
||||
_statocf = _clifo->get(CLI_STATOCF);
|
||||
_comcf = _clifo->get(CLI_COMCF);
|
||||
_ragsoc = _clifo->get(CLI_RAGSOC);
|
||||
_indcf = _clifo->get(CLI_INDCF);
|
||||
_civcf = _clifo->get(CLI_CIVCF);
|
||||
_paiv = _clifo->get(CLI_PAIV);
|
||||
_capcf = _clifo->get(CLI_CAPCF);
|
||||
_cofi = _clifo->get(CLI_COFI);
|
||||
_codalleg = _clifo->get_long(CLI_CODALLEG);
|
||||
}
|
||||
|
||||
void CG3100_application::compila_comuni()
|
||||
@ -416,35 +414,35 @@ const int CodiceRegistro (const char* cod, int anno)
|
||||
|
||||
bool filter_func_fatture (const TRelation * rel)
|
||||
{
|
||||
CG3100_application * app = (CG3100_application*)MainApp();
|
||||
CG3100_application & app = (CG3100_application&)main_app();
|
||||
int tipo_reg;
|
||||
int ann_reg;
|
||||
TString cod_reg;
|
||||
TLocalisamfile * mov = rel->lfile(LF_MOV);
|
||||
TRectype from (mov->curr());
|
||||
TRectype to (mov->curr());
|
||||
ann_reg = mov->get_int (MOV_ANNOIVA);
|
||||
cod_reg = mov->get (MOV_REG);
|
||||
TLocalisamfile & mov = rel->lfile(LF_MOV);
|
||||
TRectype from (mov.curr());
|
||||
TRectype to (mov.curr());
|
||||
ann_reg = mov.get_int (MOV_ANNOIVA);
|
||||
cod_reg = mov.get (MOV_REG);
|
||||
tipo_reg = CodiceRegistro (cod_reg, ann_reg);
|
||||
from.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);
|
||||
to.put(MOV_ANNOES, app->_annoes);
|
||||
from.put(MOV_ANNOES, app._annoes);
|
||||
to.put(MOV_ANNOES, app._annoes);
|
||||
}
|
||||
//if (app->_data_ini.ok())
|
||||
// from.put(MOV_DATAREG, app->_data_ini);
|
||||
from.put(MOV_TIPO, app->_tipo_ini);
|
||||
if (app->_codice_ini != 0)
|
||||
from.put(MOV_CODCF, app->_codice_ini);
|
||||
//if (app->_data_fin.ok())
|
||||
// to.put(MOV_DATAREG, app->_data_fin);
|
||||
to.put(MOV_TIPO, app->_tipo_fin);
|
||||
if (app->_codice_fin != 0)
|
||||
to.put(MOV_CODCF, app->_codice_fin);
|
||||
//if (app._data_ini.ok())
|
||||
// from.put(MOV_DATAREG, app._data_ini);
|
||||
from.put(MOV_TIPO, app._tipo_ini);
|
||||
if (app._codice_ini != 0)
|
||||
from.put(MOV_CODCF, app._codice_ini);
|
||||
//if (app._data_fin.ok())
|
||||
// to.put(MOV_DATAREG, app._data_fin);
|
||||
to.put(MOV_TIPO, app._tipo_fin);
|
||||
if (app._codice_fin != 0)
|
||||
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)))
|
||||
return TRUE;
|
||||
|
||||
@ -453,47 +451,47 @@ bool filter_func_fatture (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;
|
||||
TString cod_reg, causale;
|
||||
TLocalisamfile * mov = rel->lfile(LF_MOV);
|
||||
TRectype from (mov->curr());
|
||||
TRectype to (mov->curr());
|
||||
switch (app->_scelta_stampa)
|
||||
TLocalisamfile & mov = rel->lfile(LF_MOV);
|
||||
TRectype from (mov.curr());
|
||||
TRectype to (mov.curr());
|
||||
switch (app._scelta_stampa)
|
||||
{
|
||||
case 0:
|
||||
ann_reg = mov->get_int(MOV_ANNOIVA);
|
||||
causale = mov->get (MOV_CODCAUS);
|
||||
ann_reg = mov.get_int(MOV_ANNOIVA);
|
||||
causale = mov.get (MOV_CODCAUS);
|
||||
from.zero();
|
||||
to.zero();
|
||||
if ( (app->_decidi == 2) && (app->_annoes != 0) )
|
||||
if ( (app._decidi == 2) && (app._annoes != 0) )
|
||||
{
|
||||
from.put(MOV_ANNOES, app->_annoes);
|
||||
to.put(MOV_ANNOES, app->_annoes);
|
||||
from.put(MOV_ANNOES, app._annoes);
|
||||
to.put(MOV_ANNOES, app._annoes);
|
||||
}
|
||||
from.put(MOV_CODCAUS, app->_causale_ini);
|
||||
to.put(MOV_CODCAUS, app->_causale_fin);
|
||||
from.put(MOV_REG, app->_registro_ini);
|
||||
to.put(MOV_REG, app->_registro_fin);
|
||||
if ((mov->curr() >= from) && (mov->curr() <= to))
|
||||
from.put(MOV_CODCAUS, app._causale_ini);
|
||||
to.put(MOV_CODCAUS, app._causale_fin);
|
||||
from.put(MOV_REG, app._registro_ini);
|
||||
to.put(MOV_REG, app._registro_fin);
|
||||
if ((mov.curr() >= from) && (mov.curr() <= to))
|
||||
return TRUE;
|
||||
break;
|
||||
case 1:
|
||||
cod_reg = mov->get (MOV_REG);
|
||||
ann_reg = mov->get_int (MOV_ANNOIVA);
|
||||
cod_reg = mov.get (MOV_REG);
|
||||
ann_reg = mov.get_int (MOV_ANNOIVA);
|
||||
tipo_reg = CodiceRegistro(cod_reg, ann_reg);
|
||||
causale = mov->get (MOV_CODCAUS);
|
||||
causale = mov.get (MOV_CODCAUS);
|
||||
from.zero();
|
||||
to.zero();
|
||||
if ( (app->_decidi == 2) && (app->_annoes != 0) )
|
||||
if ( (app._decidi == 2) && (app._annoes != 0) )
|
||||
{
|
||||
from.put(MOV_ANNOES, app->_annoes);
|
||||
to.put(MOV_ANNOES, app->_annoes);
|
||||
from.put(MOV_ANNOES, app._annoes);
|
||||
to.put(MOV_ANNOES, app._annoes);
|
||||
}
|
||||
from.put(MOV_CODCAUS, app->_causale_ini);
|
||||
to.put(MOV_CODCAUS, app->_causale_fin);
|
||||
from.put(MOV_CODCAUS, app._causale_ini);
|
||||
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)))
|
||||
return TRUE;
|
||||
|
||||
@ -689,15 +687,15 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
||||
_registro = current_cursor()->curr(LF_MOV).get(MOV_REG);
|
||||
_anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
||||
_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;
|
||||
|
||||
//TDate data_corrente (current_cursor()->file(LF_MOV)->get_date(MOV_DATAREG));
|
||||
_tiporegistro = CodiceRegistro(_registro, _anno);
|
||||
|
||||
TLocalisamfile* fl = current_cursor()->file(LF_MOV);
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_MOV);
|
||||
TRectype da (fl.curr());
|
||||
TRectype a (fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
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_REG, _registro_fin);
|
||||
|
||||
if ((fl->curr() >= da) && (fl->curr() <= a))
|
||||
if ((fl.curr() >= da) && (fl.curr() <= a))
|
||||
//&&((_tiporegistro == 1)||(_tiporegistro == 2)))
|
||||
{
|
||||
_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);
|
||||
_descr = DescrConto(gruppo, conto, sottoconto, tipoc);
|
||||
_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);
|
||||
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))
|
||||
{
|
||||
TRectype iva(current_cursor()->file(LF_RMOVIVA)->curr());
|
||||
const TRectype iva(current_cursor()->file(LF_RMOVIVA).curr());
|
||||
_impo = iva.get_real(RMI_IMPONIBILE);
|
||||
_impos = iva.get_real(RMI_IMPOSTA);
|
||||
_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);
|
||||
_tipodoc = current_cursor()->curr(LF_MOV).get(MOV_TIPODOC);
|
||||
|
||||
TLocalisamfile* fl = current_cursor()->file(LF_MOV);
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_MOV);
|
||||
TRectype da (fl.curr());
|
||||
TRectype a (fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if (_annoes != 0)
|
||||
@ -809,7 +807,7 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
||||
da.put(MOV_CODCAUS, _causale_ini);
|
||||
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 ((_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));
|
||||
TString tipoc = current_cursor()->curr(LF_RMOV).get(RMV_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);
|
||||
if (!_no_preprocess_page)
|
||||
{
|
||||
@ -885,9 +883,9 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
||||
(_tipo_clifo_prec != "") && _salto_pagina)
|
||||
printer().formfeed();
|
||||
|
||||
TLocalisamfile* file = cur->file(LF_MOV);
|
||||
TRectype da (file->curr());
|
||||
TRectype a (file->curr());
|
||||
TLocalisamfile& file = cur->file(LF_MOV);
|
||||
TRectype da (file.curr());
|
||||
TRectype a (file.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
|
||||
@ -907,7 +905,7 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
||||
if (_codice_fin != 0)
|
||||
a.put(MOV_CODCF, _codice_fin);
|
||||
|
||||
if ((file->curr() >= da) && (file->curr() <= a))
|
||||
if ((file.curr() >= da) && (file.curr() <= a))
|
||||
{
|
||||
compila_clifo();
|
||||
compila_comuni();
|
||||
@ -1079,13 +1077,10 @@ print_action CG3100_application::postprocess_page(int file,int count)
|
||||
case fatture:
|
||||
if (file == LF_MOV)
|
||||
{
|
||||
long numreg;
|
||||
_totdocumenti += _totdoc;
|
||||
TRecnotype pos, items;
|
||||
bool FINITO = FALSE;
|
||||
TLocalisamfile* mov;
|
||||
|
||||
mov = current_cursor()->file(LF_MOV);
|
||||
TLocalisamfile& mov = current_cursor()->file(LF_MOV);
|
||||
TCursor * cur = current_cursor();
|
||||
|
||||
pos = current_cursor()->pos();
|
||||
@ -1097,9 +1092,9 @@ print_action CG3100_application::postprocess_page(int file,int count)
|
||||
{
|
||||
cur->save_status();
|
||||
++(*cur);
|
||||
long numrsucc = cur->file(LF_MOV)->get_long(MOV_NUMREG);
|
||||
_tipoelsucc = cur->file(LF_MOV)->get(MOV_TIPO);
|
||||
_codclifosucc = cur->file(LF_MOV)->get_long(MOV_CODCF);
|
||||
long numrsucc = cur->file(LF_MOV).get_long(MOV_NUMREG);
|
||||
_tipoelsucc = cur->file(LF_MOV).get(MOV_TIPO);
|
||||
_codclifosucc = cur->file(LF_MOV).get_long(MOV_CODCF);
|
||||
--(*cur);
|
||||
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);
|
||||
|
||||
TRecnotype recno = rmoviva->recno();
|
||||
rmoviva->next();
|
||||
numrec = rmoviva->get_long(RMI_NUMREG);
|
||||
rmoviva->readat(recno);
|
||||
TRecnotype recno = rmoviva.recno();
|
||||
rmoviva.next();
|
||||
numrec = rmoviva.get_long(RMI_NUMREG);
|
||||
rmoviva.readat(recno);
|
||||
|
||||
if ( (_numreg != numrec) && (
|
||||
_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;
|
||||
TString cod_reg, causale;
|
||||
int tipo_reg;
|
||||
int ann_reg;
|
||||
|
||||
esito = mov->next();
|
||||
esito = mov.next();
|
||||
|
||||
switch (_scelta_stampa)
|
||||
{
|
||||
case 0:
|
||||
return esito;
|
||||
case 1:
|
||||
while (!mov->eof())
|
||||
while (!mov.eof())
|
||||
{
|
||||
cod_reg = mov->get (MOV_REG);
|
||||
ann_reg = mov->get_int (MOV_ANNOIVA);
|
||||
causale = mov->get (MOV_CODCAUS);
|
||||
cod_reg = mov.get (MOV_REG);
|
||||
ann_reg = mov.get_int (MOV_ANNOIVA);
|
||||
causale = mov.get (MOV_CODCAUS);
|
||||
|
||||
//if ( ( ( _annoes != 0l) && (ann_reg != _annoes) )
|
||||
// || ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) )
|
||||
if ( ( _annoes != 0l)
|
||||
|| ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) )
|
||||
{
|
||||
esito=mov->next();
|
||||
esito=mov.next();
|
||||
continue;
|
||||
}
|
||||
tipo_reg = CodiceRegistro (cod_reg, ann_reg);
|
||||
if ( (tipo_reg != 1) && (tipo_reg != 2) )
|
||||
return esito;
|
||||
|
||||
esito=mov->next();
|
||||
esito=mov.next();
|
||||
}
|
||||
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))
|
||||
set_row(n++, "@11g%s", ERR_77);
|
||||
|
||||
TLocalisamfile* mov;
|
||||
mov=current_cursor()->file(LF_MOV);
|
||||
// nrec = mov->recno();
|
||||
TLocalisamfile& mov =current_cursor()->file(LF_MOV);
|
||||
// nrec = mov.recno();
|
||||
|
||||
pos = current_cursor()->pos();
|
||||
items = current_cursor()->items();
|
||||
|
||||
FINITO = (pos == items-1);
|
||||
|
||||
_datareg = current_cursor()->file(LF_MOV)->get_date(MOV_DATAREG);
|
||||
_numreg = current_cursor()->file(LF_MOV)->get_long(MOV_NUMREG);
|
||||
_datareg = current_cursor()->file(LF_MOV).get_date(MOV_DATAREG);
|
||||
_numreg = current_cursor()->file(LF_MOV).get_long(MOV_NUMREG);
|
||||
|
||||
TDate datarec (_datareg);
|
||||
if (!FINITO)
|
||||
@ -1245,7 +1239,7 @@ print_action CG3100_application::postprocess_print(int file,int count)
|
||||
TCursor * cur = current_cursor();
|
||||
cur->save_status();
|
||||
++(*cur);
|
||||
datarec = cur->file(LF_MOV)->get_date(MOV_DATAREG);
|
||||
datarec = cur->file(LF_MOV).get_date(MOV_DATAREG);
|
||||
--(*cur);
|
||||
cur->restore_status();
|
||||
}
|
||||
@ -1253,11 +1247,11 @@ print_action CG3100_application::postprocess_print(int file,int count)
|
||||
esito = my_next(mov);
|
||||
if (esito == NOERR)
|
||||
{
|
||||
long numrec = mov->get_long(MOV_NUMREG);
|
||||
datarec = mov->get_date(MOV_DATAREG);
|
||||
long numrec = mov.get_long(MOV_NUMREG);
|
||||
datarec = mov.get_date(MOV_DATAREG);
|
||||
}
|
||||
*/
|
||||
// mov->readat(nrec);
|
||||
// mov.readat(nrec);
|
||||
|
||||
_tot_avere_giornaliero += _tot_avere;
|
||||
_tot_dare_giornaliero += _tot_dare;
|
||||
@ -1342,23 +1336,21 @@ bool CG3100_application::segnala_errori_ogniriga()
|
||||
if ((_tiporegistro == 1)||(_tiporegistro == 2)) //movimento iva
|
||||
{
|
||||
long record, numreg;
|
||||
TLocalisamfile* rmoviva;
|
||||
|
||||
rmoviva = current_cursor()->file(LF_RMOVIVA);
|
||||
_numreg = current_cursor()->file(LF_MOV)->get_long(MOV_NUMREG);
|
||||
TLocalisamfile& rmoviva = current_cursor()->file(LF_RMOVIVA);
|
||||
_numreg = current_cursor()->file(LF_MOV).get_long(MOV_NUMREG);
|
||||
if (current_cursor()->is_first_match(LF_RMOVIVA))
|
||||
{
|
||||
record = rmoviva->recno();
|
||||
rmoviva->zero();
|
||||
rmoviva->put(RMI_NUMREG, _numreg);
|
||||
for (rmoviva->read(); !rmoviva->eof() ;rmoviva->next())
|
||||
record = rmoviva.recno();
|
||||
rmoviva.zero();
|
||||
rmoviva.put(RMI_NUMREG, _numreg);
|
||||
for (rmoviva.read(); !rmoviva.eof() ;rmoviva.next())
|
||||
{
|
||||
_cod = rmoviva->get(RMI_CODIVA);
|
||||
_tipod = rmoviva->get_int(RMI_TIPODET);
|
||||
_impo = rmoviva->get_real(RMI_IMPONIBILE);
|
||||
_impos = rmoviva->get_real(RMI_IMPOSTA);
|
||||
_tipocr = rmoviva->get_int(RMI_TIPOCR);
|
||||
numreg = rmoviva->get_long(RMI_NUMREG);
|
||||
_cod = rmoviva.get(RMI_CODIVA);
|
||||
_tipod = rmoviva.get_int(RMI_TIPODET);
|
||||
_impo = rmoviva.get_real(RMI_IMPONIBILE);
|
||||
_impos = rmoviva.get_real(RMI_IMPOSTA);
|
||||
_tipocr = rmoviva.get_int(RMI_TIPOCR);
|
||||
numreg = rmoviva.get_long(RMI_NUMREG);
|
||||
if (numreg != _numreg)
|
||||
break;
|
||||
else
|
||||
@ -1413,7 +1405,7 @@ bool CG3100_application::segnala_errori_ogniriga()
|
||||
}
|
||||
}
|
||||
} //for
|
||||
rmoviva->readat (record);
|
||||
rmoviva.readat (record);
|
||||
}
|
||||
}
|
||||
return trovato;
|
||||
@ -1424,9 +1416,9 @@ void CG3100_application::incrementa_totali()
|
||||
TString dep1;
|
||||
real imponibile, imposta;
|
||||
|
||||
imponibile = current_cursor()->file(LF_RMOVIVA)->get_real(RMI_IMPONIBILE);
|
||||
imposta = current_cursor()->file(LF_RMOVIVA)->get_real(RMI_IMPOSTA);
|
||||
TString codiva = current_cursor()->file(LF_RMOVIVA)->get(RMI_CODIVA);
|
||||
imponibile = current_cursor()->file(LF_RMOVIVA).get_real(RMI_IMPONIBILE);
|
||||
imposta = current_cursor()->file(LF_RMOVIVA).get_real(RMI_IMPOSTA);
|
||||
TString codiva = current_cursor()->file(LF_RMOVIVA).get(RMI_CODIVA);
|
||||
_tabiva->zero();
|
||||
dep1.format("%-4s",(const char*) codiva);
|
||||
_tabiva->put("CODTAB", (const char*)dep1);
|
||||
@ -1490,7 +1482,6 @@ bool CG3100_application::set_print(int m)
|
||||
if (msk.run() != K_ENTER) return FALSE;
|
||||
|
||||
reset_files();
|
||||
TLocalisamfile* fl;
|
||||
//_curr1->set_filterfunction (0);
|
||||
_curr1->set_filterfunction (filter_func);
|
||||
_curr2->set_filterfunction (filter_func);
|
||||
@ -1520,9 +1511,9 @@ bool CG3100_application::set_print(int m)
|
||||
if (!provvis)
|
||||
_curr1->setfilter("(PROVVIS=\"\")");
|
||||
else _curr1->setfilter("");
|
||||
fl = current_cursor()->file(LF_MOV);
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_MOV);
|
||||
TRectype da (fl.curr());
|
||||
TRectype a (fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
da.put(MOV_NUMREG, _numreg_ini);
|
||||
@ -1539,9 +1530,9 @@ bool CG3100_application::set_print(int m)
|
||||
_curr2->setfilter("(PROVVIS=\"\")");
|
||||
else
|
||||
_curr2->setfilter("");
|
||||
fl = current_cursor()->file(LF_MOV);
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_MOV);
|
||||
TRectype da (fl.curr());
|
||||
TRectype a (fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if (_data_ini.ok())
|
||||
@ -1558,7 +1549,7 @@ bool CG3100_application::set_print(int m)
|
||||
|
||||
case fatture:
|
||||
{
|
||||
fl = current_cursor()->file(LF_MOV);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_MOV);
|
||||
TString tipo = msk.get(F_TIPOELENCO);
|
||||
bool movprov = msk.get_bool(F_STAMPAMOVP);
|
||||
if (tipo=="C" || tipo=="F")
|
||||
@ -1572,7 +1563,7 @@ bool CG3100_application::set_print(int m)
|
||||
_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")
|
||||
{
|
||||
_tipo_ini = "C";
|
||||
@ -1587,8 +1578,8 @@ bool CG3100_application::set_print(int m)
|
||||
if (!movprov)
|
||||
_curr3->setfilter("(PROVVIS=\"\")");
|
||||
else _curr3->setfilter("");
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
TRectype da (fl.curr());
|
||||
TRectype a (fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if (_codice_ini != 0)
|
||||
|
217
cg/cg3200.cpp
217
cg/cg3200.cpp
@ -5,7 +5,6 @@
|
||||
#include <utility.h>
|
||||
#include <sort.h>
|
||||
|
||||
#include <lffiles.h>
|
||||
#include <clifo.h>
|
||||
#include <pconti.h>
|
||||
#include <mov.h>
|
||||
@ -165,21 +164,19 @@ bool CG3200_application::almeno_un_record()
|
||||
long record,sottoc;
|
||||
int gruppo,conto;
|
||||
TDate datareg, datacomp;
|
||||
TLocalisamfile* rmov;
|
||||
|
||||
rmov = current_cursor()->file(LF_RMOV);
|
||||
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||
|
||||
if (current_cursor()->is_first_match(LF_RMOV))
|
||||
{
|
||||
record = rmov->recno();
|
||||
rmov->zero();
|
||||
rmov->put(RMV_GRUPPO,_gruppo);
|
||||
rmov->put(RMV_CONTO,_conto);
|
||||
rmov->put(RMV_SOTTOCONTO,_sottoc);
|
||||
for (rmov->read(); !rmov->eof() ;rmov->next())
|
||||
record = rmov.recno();
|
||||
rmov.zero();
|
||||
rmov.put(RMV_GRUPPO,_gruppo);
|
||||
rmov.put(RMV_CONTO,_conto);
|
||||
rmov.put(RMV_SOTTOCONTO,_sottoc);
|
||||
for (rmov.read(); !rmov.eof() ;rmov.next())
|
||||
{
|
||||
int annoes = rmov->get_int (RMV_ANNOES);
|
||||
long numreg = rmov->get_long(RMV_NUMREG);
|
||||
int annoes = rmov.get_int (RMV_ANNOES);
|
||||
long numreg = rmov.get_long(RMV_NUMREG);
|
||||
|
||||
_mov->setkey(1);
|
||||
_mov->curr().zero();
|
||||
@ -190,14 +187,14 @@ bool CG3200_application::almeno_un_record()
|
||||
datacomp = (_mov->curr().get(MOV_DATACOMP));
|
||||
|
||||
if (_annomsk == 0)
|
||||
datareg = rmov->get_date(RMV_DATAREG);
|
||||
datareg = rmov.get_date(RMV_DATAREG);
|
||||
else
|
||||
if (_annomsk != 0)
|
||||
datareg = datacomp;
|
||||
|
||||
gruppo = rmov->get_int(RMV_GRUPPO);
|
||||
conto = rmov->get_int(RMV_CONTO);
|
||||
sottoc = rmov->get_long(RMV_SOTTOCONTO);
|
||||
gruppo = rmov.get_int(RMV_GRUPPO);
|
||||
conto = rmov.get_int(RMV_CONTO);
|
||||
sottoc = rmov.get_long(RMV_SOTTOCONTO);
|
||||
if ((gruppo != _gruppo)&&(conto != _conto)&&(sottoc != _sottoc))
|
||||
break;
|
||||
else
|
||||
@ -207,7 +204,7 @@ bool CG3200_application::almeno_un_record()
|
||||
break;
|
||||
}
|
||||
}
|
||||
rmov->readat(record);
|
||||
rmov.readat(record);
|
||||
}
|
||||
return trovato;
|
||||
}
|
||||
@ -315,35 +312,34 @@ bool CG3200_application::data_fine(TMask_field& f, KEY k)
|
||||
|
||||
void CG3200_application::saldi_zero()
|
||||
{
|
||||
TLocalisamfile* rmov;
|
||||
real saldo_dare, saldo_avere;
|
||||
long record;
|
||||
|
||||
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))
|
||||
{
|
||||
record = rmov->recno();
|
||||
record = rmov.recno();
|
||||
|
||||
while (!rmov->eof())
|
||||
while (!rmov.eof())
|
||||
{
|
||||
rmov->read();
|
||||
// char sezione = *(_rmov->curr().get(RMV_SEZIONE));
|
||||
TString sezione = rmov->curr().get(RMV_SEZIONE);
|
||||
real importo = rmov->curr().get_real(RMV_IMPORTO);
|
||||
int gruppo = atoi(rmov->get(RMV_GRUPPO));
|
||||
int conto = atoi(rmov->get(RMV_CONTO));
|
||||
long sottoc = atol(rmov->get(RMV_SOTTOCONTO));
|
||||
rmov.read();
|
||||
// char sezione = *(_rmov.curr().get(RMV_SEZIONE));
|
||||
TString sezione = rmov.curr().get(RMV_SEZIONE);
|
||||
real importo = rmov.curr().get_real(RMV_IMPORTO);
|
||||
int gruppo = atoi(rmov.get(RMV_GRUPPO));
|
||||
int conto = atoi(rmov.get(RMV_CONTO));
|
||||
long sottoc = atol(rmov.get(RMV_SOTTOCONTO));
|
||||
|
||||
if ((gruppo == _gruppo)&&(conto == _conto)&&(sottoc == _sottoc))
|
||||
if (sezione == "D")
|
||||
saldo_dare += importo;
|
||||
else if (sezione == "A")
|
||||
saldo_avere += importo;
|
||||
rmov->next();
|
||||
rmov.next();
|
||||
}
|
||||
rmov->readat(record);
|
||||
rmov.readat(record);
|
||||
}
|
||||
_totale_saldo = saldo_dare - saldo_avere;
|
||||
}
|
||||
@ -368,7 +364,6 @@ void CG3200_application::fai_stampa132()
|
||||
|
||||
void CG3200_application::fai_stampa198()
|
||||
{
|
||||
TLocalisamfile* rmov;
|
||||
long rec;
|
||||
TDate datasucc;
|
||||
TString datasuccstring,dataregrmovstring;
|
||||
@ -400,19 +395,19 @@ void CG3200_application::fai_stampa198()
|
||||
|
||||
//Gestire la stampa di saldo_progressivi nella postprocess_page di RMOV
|
||||
|
||||
rmov = current_cursor()->file(LF_RMOV);
|
||||
rec = rmov->recno();
|
||||
rmov->next();
|
||||
gruppof = rmov->get_int(RMV_GRUPPO);
|
||||
contof = rmov->get_int(RMV_CONTO);
|
||||
sottocf = rmov->get_int(RMV_SOTTOCONTO);
|
||||
datasucc = rmov->get_date(RMV_DATAREG);
|
||||
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||
rec = rmov.recno();
|
||||
rmov.next();
|
||||
gruppof = rmov.get_int(RMV_GRUPPO);
|
||||
contof = rmov.get_int(RMV_CONTO);
|
||||
sottocf = rmov.get_int(RMV_SOTTOCONTO);
|
||||
datasucc = rmov.get_date(RMV_DATAREG);
|
||||
datasuccstring=datasucc.string();
|
||||
if (((gruppof!=_gruppo)||(contof!=_conto)||(sottocf!=_sottoc))||(rmov->eof()))
|
||||
if (((gruppof!=_gruppo)||(contof!=_conto)||(sottocf!=_sottoc))||(rmov.eof()))
|
||||
datasucc = ("");
|
||||
if (datasucc != _dataregrmov)
|
||||
set_row (1,"@136g#t", &_saldo_progressivi_str);
|
||||
rmov->readat(rec);
|
||||
rmov.readat(rec);
|
||||
}
|
||||
|
||||
void CG3200_application::stampa_totali132()
|
||||
@ -468,7 +463,6 @@ void CG3200_application::stampa_totali198()
|
||||
|
||||
bool CG3200_application::preprocess_pconti(int file, int counter)
|
||||
{
|
||||
TLocalisamfile* rmov;
|
||||
long record;
|
||||
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));
|
||||
|
||||
int rcontr = atoi(current_cursor()->curr(LF_RMOV).get(RMV_RCONTR));
|
||||
rmov = current_cursor()->file(LF_RMOV);
|
||||
record = rmov->recno();
|
||||
rmov->setkey(1);
|
||||
rmov->curr().zero();
|
||||
rmov->curr().put(RMV_NUMREG,_numreg);
|
||||
rmov->curr().put(RMV_NUMRIG,rcontr);
|
||||
rmov->read();
|
||||
if (rmov->bad())
|
||||
rmov->curr().zero();
|
||||
_gruppocontr = rmov->curr().get(RMV_GRUPPO);
|
||||
_contocontr = rmov->curr().get(RMV_CONTO);
|
||||
_sottocontocontr = rmov->curr().get(RMV_SOTTOCONTO);
|
||||
rmov->setkey(2);
|
||||
rmov->readat(record);
|
||||
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||
record = rmov.recno();
|
||||
rmov.setkey(1);
|
||||
rmov.curr().zero();
|
||||
rmov.curr().put(RMV_NUMREG,_numreg);
|
||||
rmov.curr().put(RMV_NUMRIG,rcontr);
|
||||
rmov.read();
|
||||
if (rmov.bad())
|
||||
rmov.curr().zero();
|
||||
_gruppocontr = rmov.curr().get(RMV_GRUPPO);
|
||||
_contocontr = rmov.curr().get(RMV_CONTO);
|
||||
_sottocontocontr = rmov.curr().get(RMV_SOTTOCONTO);
|
||||
rmov.setkey(2);
|
||||
rmov.readat(record);
|
||||
|
||||
// Stampa solo quelli che hanno anno esercizio uguale a quello specificato
|
||||
// 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)
|
||||
{
|
||||
TLocalisamfile* rmov;
|
||||
long record;
|
||||
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));
|
||||
|
||||
int rcontr = atoi(current_cursor()->curr(LF_RMOV).get(RMV_RCONTR));
|
||||
rmov = current_cursor()->file(LF_RMOV);
|
||||
record = rmov->recno();
|
||||
rmov->setkey(1);
|
||||
rmov->curr().zero();
|
||||
rmov->curr().put(RMV_NUMREG,_numreg);
|
||||
rmov->curr().put(RMV_NUMRIG,rcontr);
|
||||
rmov->read();
|
||||
if (rmov->bad())
|
||||
rmov->curr().zero();
|
||||
_gruppocontr = rmov->curr().get(RMV_GRUPPO);
|
||||
_contocontr = rmov->curr().get(RMV_CONTO);
|
||||
_sottocontocontr = rmov->curr().get(RMV_SOTTOCONTO);
|
||||
rmov->setkey(2);
|
||||
rmov->readat(record);
|
||||
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||
record = rmov.recno();
|
||||
rmov.setkey(1);
|
||||
rmov.curr().zero();
|
||||
rmov.curr().put(RMV_NUMREG,_numreg);
|
||||
rmov.curr().put(RMV_NUMRIG,rcontr);
|
||||
rmov.read();
|
||||
if (rmov.bad())
|
||||
rmov.curr().zero();
|
||||
_gruppocontr = rmov.curr().get(RMV_GRUPPO);
|
||||
_contocontr = rmov.curr().get(RMV_CONTO);
|
||||
_sottocontocontr = rmov.curr().get(RMV_SOTTOCONTO);
|
||||
rmov.setkey(2);
|
||||
rmov.readat(record);
|
||||
|
||||
|
||||
// Stampa solo quelli che hanno anno esercizio uguale a quello specificato
|
||||
@ -1167,7 +1160,6 @@ bool CG3200_application::set_print(int)
|
||||
{
|
||||
KEY tasto;
|
||||
int crt;
|
||||
TLocalisamfile* fl;
|
||||
TString data1,data2;
|
||||
|
||||
_puoi_stampare = TRUE;
|
||||
@ -1180,7 +1172,7 @@ bool CG3200_application::set_print(int)
|
||||
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
_annomsk = atoi(_msk->get(F_ANNO));
|
||||
_annomsk = _msk->get_int(F_ANNO);
|
||||
|
||||
_stampaprogre = (bool)(_msk->get(F_STAMPAPROGRE) == "X");
|
||||
_stampatotiva = (bool)(_msk->get(F_STAMPATOTIVA) == "X");
|
||||
@ -1218,9 +1210,9 @@ bool CG3200_application::set_print(int)
|
||||
add_file(LF_RMOV,LF_PCON);
|
||||
|
||||
select_cursor(_cur1);
|
||||
fl = current_cursor()->file(LF_PCON);
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_PCON);
|
||||
TRectype da (fl.curr());
|
||||
TRectype a (fl.curr());
|
||||
|
||||
da.zero();
|
||||
a.zero();
|
||||
@ -1246,9 +1238,9 @@ bool CG3200_application::set_print(int)
|
||||
add_file(LF_CLIFO);
|
||||
add_file(LF_RMOV,LF_CLIFO);
|
||||
|
||||
fl = current_cursor()->file(LF_CLIFO);
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_CLIFO);
|
||||
TRectype da (fl.curr());
|
||||
TRectype a (fl.curr());
|
||||
|
||||
da.zero();
|
||||
a.zero();
|
||||
@ -1482,25 +1474,24 @@ void CG3200_application::calcola_progressivi_al()
|
||||
long record,sottoc,annoes;
|
||||
int gruppo,conto;
|
||||
TDate datareg, datacomp;
|
||||
TLocalisamfile* rmov;
|
||||
char sezione;
|
||||
real importo;
|
||||
TDate data;
|
||||
|
||||
rmov = current_cursor()->file(LF_RMOV);
|
||||
TLocalisamfile& rmov = current_cursor()->file(LF_RMOV);
|
||||
|
||||
record = rmov->recno();
|
||||
rmov->zero();
|
||||
rmov->put(RMV_GRUPPO, _gruppo);
|
||||
rmov->put(RMV_CONTO, _conto);
|
||||
rmov->put(RMV_SOTTOCONTO, _sottoc);
|
||||
for (rmov->read();!rmov->eof() ;rmov->next())
|
||||
record = rmov.recno();
|
||||
rmov.zero();
|
||||
rmov.put(RMV_GRUPPO, _gruppo);
|
||||
rmov.put(RMV_CONTO, _conto);
|
||||
rmov.put(RMV_SOTTOCONTO, _sottoc);
|
||||
for (rmov.read();!rmov.eof() ;rmov.next())
|
||||
{
|
||||
annoes = rmov->get_int (RMV_ANNOES);
|
||||
datareg = rmov->get_date(RMV_DATAREG);
|
||||
sezione = rmov->get (RMV_SEZIONE)[0];
|
||||
importo = rmov->get_real(RMV_IMPORTO);
|
||||
long numreg = rmov->get_long(RMV_NUMREG);
|
||||
annoes = rmov.get_int (RMV_ANNOES);
|
||||
datareg = rmov.get_date(RMV_DATAREG);
|
||||
sezione = rmov.get (RMV_SEZIONE)[0];
|
||||
importo = rmov.get_real(RMV_IMPORTO);
|
||||
long numreg = rmov.get_long(RMV_NUMREG);
|
||||
|
||||
_mov->setkey(1);
|
||||
_mov->curr().zero();
|
||||
@ -1512,7 +1503,7 @@ void CG3200_application::calcola_progressivi_al()
|
||||
|
||||
if (_annomsk == 0)
|
||||
{
|
||||
datareg = rmov->get_date(RMV_DATAREG);
|
||||
datareg = rmov.get_date(RMV_DATAREG);
|
||||
data = _inizioEs;
|
||||
}
|
||||
else
|
||||
@ -1525,9 +1516,9 @@ void CG3200_application::calcola_progressivi_al()
|
||||
TString data2 = _data_ini.string();
|
||||
TString data3 = data.string();
|
||||
|
||||
gruppo = rmov->get_int(RMV_GRUPPO);
|
||||
conto = rmov->get_int(RMV_CONTO);
|
||||
sottoc = rmov->get_long(RMV_SOTTOCONTO);
|
||||
gruppo = rmov.get_int(RMV_GRUPPO);
|
||||
conto = rmov.get_int(RMV_CONTO);
|
||||
sottoc = rmov.get_long(RMV_SOTTOCONTO);
|
||||
if ((gruppo != _gruppo)||(conto != _conto)||(sottoc != _sottoc))
|
||||
break;
|
||||
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')
|
||||
_totale_prima_avere += importo;
|
||||
}
|
||||
rmov->readat(record);
|
||||
rmov.readat(record);
|
||||
}
|
||||
|
||||
void CG3200_application::calcola_progressivi()
|
||||
@ -1576,7 +1567,7 @@ void CG3200_application::calcola_progressivi()
|
||||
record.put(SLD_SOTTOCONTO, _sottoc);
|
||||
|
||||
if (_ricerca == 'P')
|
||||
indbil = atoi (current_cursor()->file(LF_PCON)->get(PCN_INDBIL));
|
||||
indbil = atoi (current_cursor()->file(LF_PCON).get(PCN_INDBIL));
|
||||
else
|
||||
{
|
||||
if ((_ricerca == 'C') || (_ricerca == 'F'))
|
||||
@ -1891,16 +1882,15 @@ void CG3200_application::ricerca_gruppo()
|
||||
|
||||
const char* CG3200_application::descrizione_gruppo()
|
||||
{
|
||||
TLocalisamfile* pconti;
|
||||
long record;
|
||||
|
||||
pconti = current_cursor()->file(LF_PCON);
|
||||
record = pconti->recno();
|
||||
pconti->curr().zero();
|
||||
pconti->curr().put(PCN_GRUPPO,_gruppo);
|
||||
pconti->read();
|
||||
tmp = pconti->curr().get(PCN_DESCR);
|
||||
pconti->readat(record);
|
||||
TLocalisamfile& pconti = current_cursor()->file(LF_PCON);
|
||||
record = pconti.recno();
|
||||
pconti.zero();
|
||||
pconti.put(PCN_GRUPPO,_gruppo);
|
||||
pconti.read();
|
||||
tmp = pconti.get(PCN_DESCR);
|
||||
pconti.readat(record);
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
@ -1908,17 +1898,16 @@ const char* CG3200_application::descrizione_gruppo()
|
||||
|
||||
const char* CG3200_application::descrizione_conto()
|
||||
{
|
||||
TLocalisamfile* pconti;
|
||||
long record;
|
||||
|
||||
pconti = current_cursor()->file(LF_PCON);
|
||||
record = pconti->recno();
|
||||
pconti->curr().zero();
|
||||
pconti->curr().put(PCN_GRUPPO,_gruppo);
|
||||
pconti->curr().put(PCN_CONTO,_conto);
|
||||
pconti->read();
|
||||
tmp = pconti->curr().get(PCN_DESCR);
|
||||
pconti->readat(record);
|
||||
TLocalisamfile& pconti = current_cursor()->file(LF_PCON);
|
||||
record = pconti.recno();
|
||||
pconti.curr().zero();
|
||||
pconti.curr().put(PCN_GRUPPO,_gruppo);
|
||||
pconti.curr().put(PCN_CONTO,_conto);
|
||||
pconti.read();
|
||||
tmp = pconti.curr().get(PCN_DESCR);
|
||||
pconti.readat(record);
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
|
@ -510,13 +510,13 @@ void CG3300_application::ricalcola (const char * anno)
|
||||
|
||||
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 reg (cur->file("REG")->curr());
|
||||
TRectype cau (cur->file(LF_CAUSALI)->curr());
|
||||
TRectype iva_rec (cur->file("%IVA")->curr());
|
||||
TRectype reg (cur->file("REG").curr());
|
||||
TRectype cau (cur->file(LF_CAUSALI).curr());
|
||||
TRectype iva_rec (cur->file("%IVA").curr());
|
||||
|
||||
TString tiporeg = reg.get ("I0");
|
||||
|
||||
@ -588,7 +588,7 @@ void CG3300_application::ricalcola (const char * anno)
|
||||
|
||||
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);
|
||||
imposta = rmi.get_real (RMI_IMPOSTA);
|
||||
|
@ -331,8 +331,8 @@ void CG3400_application::user_create()
|
||||
_rel->add (LF_RMOVIVA, "NUMREG=NUMREG");
|
||||
|
||||
_cur = new TCursor (_rel, "", 2); // usa la chiave 2 su MOV
|
||||
_RecPartoDa = new TRectype(_cur->file(LF_MOV));
|
||||
_RecArrivoA = new TRectype(_cur->file(LF_MOV));
|
||||
_RecPartoDa = new TRectype(_cur->file(LF_MOV).curr());
|
||||
_RecArrivoA = new TRectype(_cur->file(LF_MOV).curr());
|
||||
|
||||
add_cursor (_cur);
|
||||
|
||||
@ -388,11 +388,10 @@ void CG3400_application::aggiorna_mov()
|
||||
|
||||
void CG3400_application::scrivi_numgio(long nprog)
|
||||
{
|
||||
TLocalisamfile *mov = current_cursor()->file(LF_MOV);
|
||||
|
||||
mov->reread(_lock);
|
||||
mov->put (MOV_NUMGIO, nprog);
|
||||
mov->rewrite();
|
||||
TLocalisamfile &mov = current_cursor()->file(LF_MOV);
|
||||
mov.reread(_lock);
|
||||
mov.put (MOV_NUMGIO, nprog);
|
||||
mov.rewrite();
|
||||
}
|
||||
|
||||
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:
|
||||
{
|
||||
printer().formfeed();
|
||||
*_RecArrivoA = _cur->file(LF_MOV)->curr();
|
||||
*_RecArrivoA = _cur->file(LF_MOV).curr();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -811,7 +810,7 @@ bool CG3400_application::preprocess_print(int file, int counter)
|
||||
|
||||
_nprog_mov = _nprog_da;
|
||||
|
||||
*_RecPartoDa = _cur->file(LF_MOV)->curr();
|
||||
*_RecPartoDa = _cur->file(LF_MOV).curr();
|
||||
|
||||
for (i=1; i<RIGHE_FOOTER; i++)
|
||||
set_footer(i, "%s", " ");
|
||||
@ -880,7 +879,7 @@ print_action CG3400_application::postprocess_page(int file, int counter)
|
||||
}
|
||||
_cur->save_status();
|
||||
++(*_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();
|
||||
--(*_cur);
|
||||
_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;
|
||||
|
||||
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 (_stampa_definitiva)
|
||||
return FALSE;
|
||||
@ -945,10 +944,10 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
||||
|
||||
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();
|
||||
_annoEsMov = _cur->file(LF_MOV)->get_int(MOV_ANNOES);
|
||||
caus = _cur->file(LF_MOV)->get(MOV_CODCAUS);
|
||||
_annoEsMov = _cur->file(LF_MOV).get_int(MOV_ANNOES);
|
||||
caus = _cur->file(LF_MOV).get(MOV_CODCAUS);
|
||||
|
||||
break;
|
||||
|
||||
@ -969,7 +968,7 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
||||
_descr_causale->set_width(198);
|
||||
}
|
||||
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)
|
||||
{
|
||||
*_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);
|
||||
importo = _cur->file(LF_RMOV)->get_real (RMV_IMPORTO);
|
||||
sezione = _cur->file(LF_RMOV).get (RMV_SEZIONE);
|
||||
importo = _cur->file(LF_RMOV).get_real (RMV_IMPORTO);
|
||||
|
||||
// imp = importo.string ("######");
|
||||
if (sezione == "D")
|
||||
@ -1080,7 +1079,7 @@ void CG3400_application::calcola_iva()
|
||||
TString codiva;
|
||||
int tipocr, tipodet;
|
||||
real impo, impos;
|
||||
TRectype iva (_cur->file(LF_RMOVIVA)->curr());
|
||||
TRectype iva (_cur->file(LF_RMOVIVA).curr());
|
||||
|
||||
if (!iva.empty())
|
||||
{
|
||||
@ -1168,7 +1167,7 @@ void CG3400_application::setta_righe_valuta()
|
||||
TString simbolo, codval;
|
||||
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);
|
||||
simbolo = SimboloValuta(codval);
|
||||
|
||||
@ -1201,12 +1200,12 @@ void CG3400_application::setta_righe_indirizzo()
|
||||
if (_occas)
|
||||
{
|
||||
TCursor * cur = current_cursor();
|
||||
TLocalisamfile * occ = cur->file(LF_OCCAS);
|
||||
TLocalisamfile & occ = cur->file(LF_OCCAS);
|
||||
|
||||
_viacf = occ->get (OCC_INDIR);
|
||||
_civcf = occ->get (OCC_CIV);
|
||||
_capcf = occ->get (OCC_CAP);
|
||||
_comcf = occ->get (OCC_COM);
|
||||
_viacf = occ.get (OCC_INDIR);
|
||||
_civcf = occ.get (OCC_CIV);
|
||||
_capcf = occ.get (OCC_CAP);
|
||||
_comcf = occ.get (OCC_COM);
|
||||
}
|
||||
|
||||
TRectype dep = look_com (_comcf, _com);
|
||||
@ -1425,8 +1424,8 @@ bool CG3400_application::set_print(int)
|
||||
if (_stampa_width == 1) _stampa_width = 132;
|
||||
else _stampa_width = 198;
|
||||
|
||||
TRectype da (_cur->file(LF_MOV));
|
||||
TRectype a (_cur->file(LF_MOV));
|
||||
TRectype da (_cur->file(LF_MOV).curr());
|
||||
TRectype a (_cur->file(LF_MOV).curr());
|
||||
|
||||
da.zero();
|
||||
a.zero();
|
||||
|
@ -57,8 +57,8 @@ void CG4300_App::user_create()
|
||||
_del = new TTable("%DEL");
|
||||
_lia = new TTable("LIA");
|
||||
|
||||
_mov = _cur->file(LF_MOV);
|
||||
_rmoviva = _cur->file(LF_RMOVIVA);
|
||||
_mov = &_cur->file(LF_MOV);
|
||||
_rmoviva = &_cur->file(LF_RMOVIVA);
|
||||
|
||||
_pim_r = &(_pim->curr());
|
||||
_plm_r = &(_plm->curr());
|
||||
|
114
cg/cg4400.cpp
114
cg/cg4400.cpp
@ -6,20 +6,20 @@
|
||||
|
||||
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)
|
||||
{
|
||||
TLocalisamfile * mov = r->lfile(LF_MOV);
|
||||
TString codreg = mov->get(MOV_REG);
|
||||
TDate datareg = mov->get_date(MOV_DATAREG);
|
||||
int annoiva = mov->get_int(MOV_ANNOIVA);
|
||||
TLocalisamfile & mov = r->lfile(LF_MOV);
|
||||
TString codreg = mov.get(MOV_REG);
|
||||
TDate datareg = mov.get_date(MOV_DATAREG);
|
||||
int annoiva = mov.get_int(MOV_ANNOIVA);
|
||||
|
||||
if (codreg != (app()->_codreg) || annoiva != (app()->_annoes))
|
||||
if (codreg != (app()._codreg) || annoiva != (app()._annoes))
|
||||
return FALSE;
|
||||
|
||||
if (app()->_data_da.string() != "" && app()->_data_a.string() != "")
|
||||
if ( (datareg < app()->_data_da || datareg > app()->_data_a ) || (!datareg.ok()) )
|
||||
if (app()._data_da.string() != "" && app()._data_a.string() != "")
|
||||
if ( (datareg < app()._data_da || datareg > app()._data_a ) || (!datareg.ok()) )
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
@ -59,20 +59,20 @@ bool mask_select (TMask_field& f, KEY k)
|
||||
long j, cnt, chk; int i;
|
||||
TString from = f.mask().get(DA_CODICE);
|
||||
TString to = f.mask().get(A_CODICE);
|
||||
TBit_array selected = app()->_selected;
|
||||
TBit_array selected = app()._selected;
|
||||
|
||||
// build sheet
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
f.mask().field(DA_CODICE).set("");
|
||||
f.mask().field(A_CODICE).set("");
|
||||
app()->_ditte->destroy(); chk = 0l;
|
||||
for (i = 0; i < app()->_nomiditte.items(); i++)
|
||||
app()._ditte->destroy(); chk = 0l;
|
||||
for (i = 0; i < app()._nomiditte.items(); i++)
|
||||
{
|
||||
if (app()->_selected[i]) continue;
|
||||
TToken_string d = (const char*)((TToken_string&)app()->_nomiditte[i]);
|
||||
if (app()._selected[i]) continue;
|
||||
TToken_string d = (const char*)((TToken_string&)app()._nomiditte[i]);
|
||||
TString cod = d.get(1);
|
||||
app()->_ditte->add(d);
|
||||
app()._ditte->add(d);
|
||||
|
||||
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))
|
||||
{
|
||||
selected.set(chk++);
|
||||
app()->_ditte->check(chk++);
|
||||
app()._ditte->check(chk++);
|
||||
}
|
||||
}
|
||||
}
|
||||
// seleziona e aggiungi alle gia' selezionate
|
||||
if (app()->_ditte->run() == K_ENTER)
|
||||
if (app()._ditte->run() == K_ENTER)
|
||||
{
|
||||
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()->_ditte->checked(cnt++))
|
||||
if (app()._selected[j]) continue;
|
||||
if (app()._ditte->checked(cnt++))
|
||||
selected.set(j);
|
||||
}
|
||||
app()->_selected |= selected;
|
||||
app()._selected |= selected;
|
||||
selected.reset();
|
||||
}
|
||||
long numd = app()->_selected.ones();
|
||||
long numd = app()._selected.ones();
|
||||
f.mask().set(F_SELECT,numd);
|
||||
}
|
||||
return TRUE;
|
||||
@ -110,16 +110,16 @@ bool mask_verifica (TMask_field& f, KEY k)
|
||||
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
app()->_ditte->destroy();
|
||||
for (i = 0; i < app()->_nomiditte.items(); i++)
|
||||
app()._ditte->destroy();
|
||||
for (i = 0; i < app()._nomiditte.items(); i++)
|
||||
{
|
||||
TToken_string d = (const char*)((TToken_string&)app()->_nomiditte[i]);
|
||||
app()->_ditte->add(d);
|
||||
if (app()->_selected[i]) app()->_ditte->check(i);
|
||||
TToken_string d = (const char*)((TToken_string&)app()._nomiditte[i]);
|
||||
app()._ditte->add(d);
|
||||
if (app()._selected[i]) app()._ditte->check(i);
|
||||
}
|
||||
app()->_ditte->disable_check();
|
||||
app()->_ditte->run();
|
||||
app()->_ditte->enable_check();
|
||||
app()._ditte->disable_check();
|
||||
app()._ditte->run();
|
||||
app()._ditte->enable_check();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -128,7 +128,7 @@ bool mask_annulla (TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
app()->_selected.reset();
|
||||
app()._selected.reset();
|
||||
f.mask().set(F_SELECT, "0");
|
||||
}
|
||||
return TRUE;
|
||||
@ -138,7 +138,7 @@ bool mask_from_to (TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_TAB)
|
||||
{
|
||||
app()->_selected.reset();
|
||||
app()._selected.reset();
|
||||
TString from, to;
|
||||
const short id = f.dlg();
|
||||
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 (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);
|
||||
|
||||
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)
|
||||
{
|
||||
nrec++;
|
||||
TRectype iva (_cur->file(LF_RMOVIVA)->curr());
|
||||
TRectype iva (_cur->file(LF_RMOVIVA).curr());
|
||||
tipodet = iva.get_int (RMI_TIPODET);
|
||||
tipocr = iva.get_int (RMI_TIPOCR);
|
||||
impo = iva.get_real(RMI_IMPONIBILE);
|
||||
@ -1041,12 +1041,12 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
||||
TString ragsoc;
|
||||
TString tipo_op = "";
|
||||
|
||||
TLocalisamfile* mov = _cur->file(LF_MOV);
|
||||
TLocalisamfile* caus = _cur->file(LF_CAUSALI);
|
||||
TLocalisamfile& mov = _cur->file(LF_MOV);
|
||||
TLocalisamfile& caus = _cur->file(LF_CAUSALI);
|
||||
|
||||
//long annoes = mov->get_long(MOV_ANNOES);
|
||||
//TString16 codreg = mov->get(MOV_REG);
|
||||
_datareg = mov->get_date(MOV_DATAREG);
|
||||
_datareg = mov.get_date(MOV_DATAREG);
|
||||
|
||||
//if (codreg != _codreg || annoes != _annoes)
|
||||
// return FALSE;
|
||||
@ -1067,26 +1067,26 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
||||
|
||||
_dataregp = _datareg;
|
||||
|
||||
TDate datadoc = mov->get_date(MOV_DATADOC);
|
||||
long numreg = mov->get_long(MOV_NUMREG);
|
||||
long protiva = mov->get_long(MOV_PROTIVA);
|
||||
real totdoc = mov->get_real(MOV_TOTDOC);
|
||||
TString numdoc = mov->get(MOV_NUMDOC);
|
||||
char tipocf = mov->get(MOV_TIPO)[0];
|
||||
TString ocfpi = mov->get(MOV_OCFPI);
|
||||
long codcf = mov->get_long(MOV_CODCF);
|
||||
long numgio = mov->get_long(MOV_NUMGIO);
|
||||
bool stampato = mov->get_bool(MOV_STAMPATO);
|
||||
bool intra = caus->get_bool(CAU_INTRACOM);
|
||||
bool autof = caus->get_bool(CAU_AUTOFATT);
|
||||
TString descrcau = caus->get(CAU_DESCR);
|
||||
TDate datadoc = mov.get_date(MOV_DATADOC);
|
||||
long numreg = mov.get_long(MOV_NUMREG);
|
||||
long protiva = mov.get_long(MOV_PROTIVA);
|
||||
real totdoc = mov.get_real(MOV_TOTDOC);
|
||||
TString numdoc = mov.get(MOV_NUMDOC);
|
||||
char tipocf = mov.get(MOV_TIPO)[0];
|
||||
TString ocfpi = mov.get(MOV_OCFPI);
|
||||
long codcf = mov.get_long(MOV_CODCF);
|
||||
long numgio = mov.get_long(MOV_NUMGIO);
|
||||
bool stampato = mov.get_bool(MOV_STAMPATO);
|
||||
bool intra = caus.get_bool(CAU_INTRACOM);
|
||||
bool autof = caus.get_bool(CAU_AUTOFATT);
|
||||
TString descrcau = caus.get(CAU_DESCR);
|
||||
|
||||
//aggiornamento di mov
|
||||
if (_tipo_stampa != 3)
|
||||
if (!stampato)
|
||||
{
|
||||
mov->put(MOV_STAMPATO,TRUE);
|
||||
mov->rewrite();
|
||||
mov.put(MOV_STAMPATO,TRUE);
|
||||
mov.rewrite();
|
||||
}
|
||||
|
||||
if ( intra && autof)
|
||||
@ -1105,7 +1105,7 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
||||
}
|
||||
else ragsoc = descrcau;
|
||||
|
||||
_tipodoc = mov->get(MOV_TIPODOC);
|
||||
_tipodoc = mov.get(MOV_TIPODOC);
|
||||
_descr_doc = descr_doc(_tipodoc);
|
||||
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);
|
||||
}
|
||||
_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);
|
||||
}
|
||||
//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) )
|
||||
{
|
||||
TLocalisamfile* mov = _cur->file(LF_MOV);
|
||||
TLocalisamfile& mov = _cur->file(LF_MOV);
|
||||
_cur->save_status();
|
||||
++(*_cur);
|
||||
_dataregs = mov->get_date(MOV_DATAREG);
|
||||
_dataregs = mov.get_date(MOV_DATAREG);
|
||||
--(*_cur);
|
||||
_cur->restore_status();
|
||||
|
||||
|
26
cg/cglib.h
26
cg/cglib.h
@ -4,17 +4,10 @@
|
||||
#ifndef __ISAM_H
|
||||
#include <isam.h>
|
||||
#endif
|
||||
#ifndef __REAL_H
|
||||
#include <real.h>
|
||||
#endif
|
||||
#ifndef __DATE_H
|
||||
#include <date.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ASSOC_H
|
||||
#include <assoc.h>
|
||||
//#include <utility.h>
|
||||
//#include <config.h>
|
||||
//#include <applicat.h>
|
||||
#endif
|
||||
|
||||
#include "conto.h"
|
||||
|
||||
@ -91,8 +84,7 @@ public:
|
||||
class TSaldo_agg : public TObject
|
||||
{
|
||||
TTab_conti _tab_conti;
|
||||
bool _movap; // se e' mov. d'apertura (aggiorno SALDO e FLAGSALINI in
|
||||
// saldi)
|
||||
bool _movap; // se e' mov. d'apertura (aggiorno SALDO e FLAGSALINI in saldi)
|
||||
bool _provv;
|
||||
int _anno_es; // anno esercizio
|
||||
TDate _data_ulmov; // data ultimo movimento
|
||||
@ -109,19 +101,19 @@ public:
|
||||
char sezione, bool somma=TRUE);
|
||||
|
||||
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; }
|
||||
bool movap() { return _movap; }
|
||||
bool movap() const { return _movap; }
|
||||
|
||||
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; }
|
||||
TDate& data_ulmov() { return _data_ulmov; }
|
||||
void set_data_ulmov (const TDate& data) { _data_ulmov = data; }
|
||||
const TDate& data_ulmov() const { return _data_ulmov; }
|
||||
|
||||
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
|
||||
TSaldo_agg();
|
||||
|
33
cg/conto.cpp
33
cg/conto.cpp
@ -3,20 +3,11 @@
|
||||
|
||||
#include <isam.h>
|
||||
#include <utility.h>
|
||||
#include <lffiles.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%
|
||||
TConto::TConto(TToken_string& s, int from, int mode)
|
||||
TBill::TBill(TToken_string& s, int from, int mode)
|
||||
: _tipo_cr(-1)
|
||||
{
|
||||
const char* first = s.get(from);
|
||||
@ -43,7 +34,7 @@ TConto::TConto(TToken_string& s, int from, int mode)
|
||||
|
||||
|
||||
// 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) : ' ';
|
||||
_gruppo = g;
|
||||
@ -53,7 +44,7 @@ TConto& TConto::set(int g, int c, long s, char t, const char* d)
|
||||
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)
|
||||
{
|
||||
@ -72,16 +63,16 @@ const TConto& TConto::add_to(TToken_string& ts, int from, int mode)
|
||||
|
||||
|
||||
// Certified 100%
|
||||
bool TConto::ok() const
|
||||
bool TBill::ok() const
|
||||
{
|
||||
return _gruppo != 0 && _conto != 0 && _sottoconto != 0L;
|
||||
}
|
||||
|
||||
// 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");
|
||||
const TConto& c = (const TConto&)s;
|
||||
CHECK(class_name()==s.class_name(), "Can't compare TBill with TObject");
|
||||
const TBill& c = (const TBill&)s;
|
||||
|
||||
int res = _gruppo - c._gruppo;
|
||||
if (res) return res;
|
||||
@ -98,7 +89,7 @@ int TConto::compare(const TSortable& s) const
|
||||
|
||||
|
||||
// Certified 90% (uses __tmp_string && isam)
|
||||
const char* TConto::describe()
|
||||
const char* TBill::describe()
|
||||
{
|
||||
int err = NOERR;
|
||||
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);
|
||||
pcon.setkey(1);
|
||||
@ -165,7 +156,7 @@ bool TConto::read(TRectype &r)
|
||||
}
|
||||
|
||||
// Certified 99% (describe uses __tmp_string)
|
||||
const TString& TConto::descrizione()
|
||||
const TString& TBill::descrizione()
|
||||
{
|
||||
if (_descrizione.empty())
|
||||
{
|
||||
@ -178,7 +169,7 @@ const TString& TConto::descrizione()
|
||||
return _descrizione;
|
||||
}
|
||||
|
||||
int TConto::tipo_cr()
|
||||
int TBill::tipo_cr()
|
||||
{
|
||||
if (_tipo_cr < 0)
|
||||
{
|
||||
@ -190,7 +181,7 @@ int TConto::tipo_cr()
|
||||
|
||||
|
||||
// Certified 99% (uses __tmp_string)
|
||||
const char* TConto::string(int mode)
|
||||
const char* TBill::string(int mode)
|
||||
{
|
||||
TFixed_string s(&__tmp_string[256], 80);
|
||||
s.cut(0);
|
||||
|
50
cg/conto.h
50
cg/conto.h
@ -9,53 +9,63 @@
|
||||
#include <real.h>
|
||||
#endif
|
||||
|
||||
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
|
||||
|
||||
class TConto : public TSortable
|
||||
class TBill : public TSortable
|
||||
{
|
||||
char _tipo; // ' ' = Conto, 'C' = Cliente, 'F' = 'Fornitore'
|
||||
int _gruppo, _conto;
|
||||
long _sottoconto; // Sottoconto, codice cliente o fornitore
|
||||
TString80 _descrizione; // Vuota fino alla chiamata di describe
|
||||
int _tipo_cr;
|
||||
real _dare, _avere;
|
||||
real _darepro, _averepro;
|
||||
real _saldo;
|
||||
int _tipo_cr; // Tipo costo/ricavo
|
||||
|
||||
protected:
|
||||
virtual int compare(const TSortable& s) const;
|
||||
virtual const char* class_name() const { return "Conto"; }
|
||||
|
||||
const char* describe();
|
||||
|
||||
public:
|
||||
TConto(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL);
|
||||
TConto(TToken_string& tgcsd, int from, int mode = 0);
|
||||
virtual ~TConto() {}
|
||||
TBill(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL)
|
||||
: _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(d), _tipo_cr(-1) {}
|
||||
|
||||
TConto& set(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL);
|
||||
const TConto& add_to(TToken_string& ts, int from, int mode = 0);
|
||||
TBill(TToken_string& tgcsd, 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
|
||||
|
||||
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; }
|
||||
int gruppo() const { return _gruppo; }
|
||||
int conto() const { return _conto; }
|
||||
long sottoconto() const { return _sottoconto; }
|
||||
|
||||
const TString& descrizione();
|
||||
int TConto::tipo_cr();
|
||||
int tipo_cr();
|
||||
bool read(TRectype& r);
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user