Corretti errori neele stampe w
git-svn-id: svn://10.65.10.50/trunk@64 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
86bd8244c4
commit
b108a12dba
216
cg/cg0100.cpp
216
cg/cg0100.cpp
@ -11,23 +11,23 @@
|
|||||||
|
|
||||||
class CG0100_application : public TRelation_application
|
class CG0100_application : public TRelation_application
|
||||||
{
|
{
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
TRelation *_rel;
|
TRelation *_rel;
|
||||||
TLocalisamfile* _saldi;
|
TLocalisamfile* _saldi;
|
||||||
TLocalisamfile* _tabcom;
|
TLocalisamfile* _tabcom;
|
||||||
|
|
||||||
bool user_create();
|
bool user_create();
|
||||||
bool user_destroy();
|
bool user_destroy();
|
||||||
virtual TMask* get_mask(int mode) {return _msk;}
|
virtual TMask* get_mask(int mode) {return _msk;}
|
||||||
virtual bool changing_mask(int mode) {return FALSE;}
|
virtual bool changing_mask(int mode) {return FALSE;}
|
||||||
virtual bool protected_record(TRectype &rec);
|
virtual bool protected_record(TRectype &rec);
|
||||||
virtual void init_query_mode(TMask& m);
|
virtual void init_query_mode(TMask& m);
|
||||||
virtual void init_insert_mode(TMask& m);
|
virtual void init_insert_mode(TMask& m);
|
||||||
virtual void init_modify_mode(TMask& m) {init_insert_mode(m);}
|
virtual void init_modify_mode(TMask& m) {init_insert_mode(m);}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual TRelation* get_relation() const {return _rel;}
|
virtual TRelation* get_relation() const {return _rel;}
|
||||||
CG0100_application() {}
|
CG0100_application() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ bool CG0100_application::protected_record(TRectype &rec)
|
|||||||
const int conto = atoi(m->get(FLD_CM1_CONTO));
|
const int conto = atoi(m->get(FLD_CM1_CONTO));
|
||||||
const long sottoc = atol(m->get(FLD_CM1_SOTTOCONTO));
|
const long sottoc = atol(m->get(FLD_CM1_SOTTOCONTO));
|
||||||
|
|
||||||
// Se e' un sottoconto posso cancellarlo se non esistono saldi
|
// Se e' un sottoconto posso cancellarlo se non esistono saldi
|
||||||
if ((gruppo != 0) && (conto != 0) && (sottoc != 0))
|
if ((gruppo != 0) && (conto != 0) && (sottoc != 0))
|
||||||
{
|
{
|
||||||
_saldi->zero();
|
_saldi->zero();
|
||||||
@ -51,12 +51,12 @@ bool CG0100_application::protected_record(TRectype &rec)
|
|||||||
_saldi->read(_isgteq);
|
_saldi->read(_isgteq);
|
||||||
|
|
||||||
return _saldi->good() && gruppo ==_saldi->get_int(PCN_GRUPPO) &&
|
return _saldi->good() && gruppo ==_saldi->get_int(PCN_GRUPPO) &&
|
||||||
conto ==_saldi->get_int(PCN_CONTO) &&
|
conto ==_saldi->get_int(PCN_CONTO) &&
|
||||||
sottoc ==_saldi->get_long(PCN_SOTTOCONTO);
|
sottoc ==_saldi->get_long(PCN_SOTTOCONTO);
|
||||||
}
|
}
|
||||||
pconti.zero() ;
|
pconti.zero() ;
|
||||||
pconti.put(PCN_GRUPPO, gruppo);
|
pconti.put(PCN_GRUPPO, gruppo);
|
||||||
// Se e' un conto controllo se ha dei sottoconti
|
// Se e' un conto controllo se ha dei sottoconti
|
||||||
if (conto != 0)
|
if (conto != 0)
|
||||||
pconti.put(PCN_CONTO, conto);
|
pconti.put(PCN_CONTO, conto);
|
||||||
TRectype rec1(pconti.curr());
|
TRectype rec1(pconti.curr());
|
||||||
@ -66,45 +66,45 @@ bool CG0100_application::protected_record(TRectype &rec)
|
|||||||
pconti.next();
|
pconti.next();
|
||||||
|
|
||||||
return pconti.good() && (pconti.curr() == rec1);
|
return pconti.good() && (pconti.curr() == rec1);
|
||||||
//
|
//
|
||||||
// if (pconti.bad()) return FALSE;
|
// if (pconti.bad()) return FALSE;
|
||||||
|
|
||||||
// const int ngruppo = pconti.get_int(PCN_GRUPPO);
|
// const int ngruppo = pconti.get_int(PCN_GRUPPO);
|
||||||
// const int nconto = pconti.get_int(PCN_CONTO);
|
// const int nconto = pconti.get_int(PCN_CONTO);
|
||||||
|
|
||||||
// Cercavo di cancellare un gruppo e ho trovato un conto dello stesso gruppo
|
// Cercavo di cancellare un gruppo e ho trovato un conto dello stesso gruppo
|
||||||
// if (conto == 0 && gruppo == ngruppo)
|
// if (conto == 0 && gruppo == ngruppo)
|
||||||
// return TRUE;
|
// return TRUE;
|
||||||
|
|
||||||
// Cercavo di cancellare un conto e ho trovato un sottoconto
|
// Cercavo di cancellare un conto e ho trovato un sottoconto
|
||||||
// dello stesso gruppo e conto
|
// dello stesso gruppo e conto
|
||||||
|
|
||||||
// if (gruppo == ngruppo && conto == nconto)
|
// if (gruppo == ngruppo && conto == nconto)
|
||||||
// return TRUE;
|
// return TRUE;
|
||||||
// return FALSE;
|
// return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG0100_application::init_query_mode(TMask& m)
|
void CG0100_application::init_query_mode(TMask& m)
|
||||||
|
|
||||||
{
|
{
|
||||||
m.send_key(K_SHIFT + K_CTRL + 's', -1);
|
m.send_key(K_SHIFT + K_CTRL + 's', -1);
|
||||||
m.send_key(K_SHIFT + K_CTRL + 's', -2);
|
m.send_key(K_SHIFT + K_CTRL + 's', -2);
|
||||||
m.send_key(K_SHIFT + K_CTRL + 's', -3);
|
m.send_key(K_SHIFT + K_CTRL + 's', -3);
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDDEN bool tmcf_handler(TMask_field& f, KEY key)
|
HIDDEN bool tmcf_handler(TMask_field& f, KEY key)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (f.active() && key == K_SPACE)
|
if (f.active() && key == K_SPACE)
|
||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
const int conto = atoi(m.get(FLD_CM1_CONTO));
|
const int conto = atoi(m.get(FLD_CM1_CONTO));
|
||||||
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
||||||
const bool enable_sezsaldi = (sottoc != 0) || (sottoc == 0 && conto != 0 && m.get(FLD_CM1_TMCF).not_empty());
|
const bool enable_sezsaldi = (sottoc != 0) || (sottoc == 0 && conto != 0 && m.get(FLD_CM1_TMCF).not_empty());
|
||||||
|
|
||||||
m.show(FLD_CM2_SEZSALDI, enable_sezsaldi);
|
m.show(FLD_CM2_SEZSALDI, enable_sezsaldi);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDDEN bool ivd_enable = TRUE;
|
HIDDEN bool ivd_enable = TRUE;
|
||||||
@ -206,17 +206,17 @@ void CG0100_application::init_insert_mode(TMask& m)
|
|||||||
m.show(FLD_CM1_NUMIVDH, !ivd_enable);
|
m.show(FLD_CM1_NUMIVDH, !ivd_enable);
|
||||||
if (!ivd_enable)
|
if (!ivd_enable)
|
||||||
{
|
{
|
||||||
m.set(FLD_CM1_SEZIVD, s1);
|
m.set(FLD_CM1_SEZIVD, s1);
|
||||||
m.set(FLD_CM1_LETTIVDH, s2);
|
m.set(FLD_CM1_LETTIVDH, s2);
|
||||||
m.set(FLD_CM1_NUMRIVDH, s3);
|
m.set(FLD_CM1_NUMRIVDH, s3);
|
||||||
m.set(FLD_CM1_NUMIVDH, s4);
|
m.set(FLD_CM1_NUMIVDH, s4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pconti.zero();
|
pconti.zero();
|
||||||
pconti.put(PCN_GRUPPO, gruppo);
|
pconti.put(PCN_GRUPPO, gruppo);
|
||||||
pconti.read();
|
pconti.read();
|
||||||
if (pconti.good())
|
if (pconti.good())
|
||||||
if (s.empty()) s = pconti.get(PCN_CODCBL);
|
if (s.empty()) s = pconti.get(PCN_CODCBL);
|
||||||
}
|
}
|
||||||
if (s.not_empty())
|
if (s.not_empty())
|
||||||
{
|
{
|
||||||
@ -236,90 +236,90 @@ void CG0100_application::init_insert_mode(TMask& m)
|
|||||||
|
|
||||||
HIDDEN bool gruppo_handler(TMask_field& f, KEY key)
|
HIDDEN bool gruppo_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_ENTER)
|
if (key == K_ENTER)
|
||||||
{
|
{
|
||||||
const TMask& m = f.mask();
|
const TMask& m = f.mask();
|
||||||
const int gruppo = atoi(m.get(FLD_CM1_GRUPPO));
|
const int gruppo = atoi(m.get(FLD_CM1_GRUPPO));
|
||||||
const int conto = atoi(m.get(FLD_CM1_CONTO));
|
const int conto = atoi(m.get(FLD_CM1_CONTO));
|
||||||
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
const long sottoc = atol(m.get(FLD_CM1_SOTTOCONTO));
|
||||||
const TFixed_string descrizione(m.get(FLD_CM1_DESC));
|
const TFixed_string descrizione(m.get(FLD_CM1_DESC));
|
||||||
CG0100_application* app = (CG0100_application*) MainApp();
|
CG0100_application* app = (CG0100_application*) MainApp();
|
||||||
TLocalisamfile& pconti = *app->get_relation()->lfile();
|
TLocalisamfile& pconti = *app->get_relation()->lfile();
|
||||||
|
|
||||||
if (gruppo == 0 && conto == 0 && sottoc == 0 && descrizione.not_empty())
|
if (gruppo == 0 && conto == 0 && sottoc == 0 && descrizione.not_empty())
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (gruppo == 0)
|
if (gruppo == 0)
|
||||||
{
|
{
|
||||||
if (conto != 0 || sottoc != 0)
|
if (conto != 0 || sottoc != 0)
|
||||||
return f.warning_box("Codice conto impossibile!");
|
return f.warning_box("Codice conto impossibile!");
|
||||||
else
|
else
|
||||||
return f.error_box("E' obbligatorio l'inserimento del gruppo");
|
return f.error_box("E' obbligatorio l'inserimento del gruppo");
|
||||||
}
|
}
|
||||||
if (conto > 0 && sottoc == 0) // conto => ricerca gruppo
|
if (conto > 0 && sottoc == 0) // conto => ricerca gruppo
|
||||||
{
|
{
|
||||||
pconti.zero() ;
|
pconti.zero() ;
|
||||||
pconti.put(PCN_GRUPPO, gruppo) ;
|
pconti.put(PCN_GRUPPO, gruppo) ;
|
||||||
pconti.setkey(1) ;
|
pconti.setkey(1) ;
|
||||||
pconti.read(_isequal, _nolock );
|
pconti.read(_isequal, _nolock );
|
||||||
if (pconti.bad())
|
if (pconti.bad())
|
||||||
return f.warning_box ("Non esiste il gruppo relativo a questo conto");
|
return f.warning_box ("Non esiste il gruppo relativo a questo conto");
|
||||||
}
|
}
|
||||||
if (sottoc > 0) // sottoconto => ricerca conto
|
if (sottoc > 0) // sottoconto => ricerca conto
|
||||||
{
|
{
|
||||||
pconti.zero() ;
|
pconti.zero() ;
|
||||||
pconti.put(PCN_GRUPPO, gruppo) ;
|
pconti.put(PCN_GRUPPO, gruppo) ;
|
||||||
pconti.put(PCN_CONTO, conto) ;
|
pconti.put(PCN_CONTO, conto) ;
|
||||||
pconti.setkey(1) ;
|
pconti.setkey(1) ;
|
||||||
pconti.read(_isequal, _nolock );
|
pconti.read(_isequal, _nolock );
|
||||||
if (pconti.bad())
|
if (pconti.bad())
|
||||||
return f.warning_box ("Non esiste il conto relativo a questo sottoconto");
|
return f.warning_box ("Non esiste il conto relativo a questo sottoconto");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TString tmcf = pconti.get(PCN_TMCF);
|
TString tmcf = pconti.get(PCN_TMCF);
|
||||||
if (tmcf.not_empty())
|
if (tmcf.not_empty())
|
||||||
return f.warning_box ("Non puoi inserire un sottoconto di un conto relativo ad un cliente/fornitore");
|
return f.warning_box ("Non puoi inserire un sottoconto di un conto relativo ad un cliente/fornitore");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDDEN bool sottoc_handler(TMask_field& f, KEY key)
|
HIDDEN bool sottoc_handler(TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_TAB)
|
if (key == K_TAB)
|
||||||
{
|
{
|
||||||
TString gruppo(f.mask().get(FLD_CM1_GRUPPO));
|
TString gruppo(f.mask().get(FLD_CM1_GRUPPO));
|
||||||
if (gruppo.empty()) return TRUE;
|
if (gruppo.empty()) return TRUE;
|
||||||
TString conto(f.mask().get(FLD_CM1_CONTO));
|
TString conto(f.mask().get(FLD_CM1_CONTO));
|
||||||
TString sottoconto(f.mask().get(FLD_CM1_SOTTOCONTO));
|
TString sottoconto(f.mask().get(FLD_CM1_SOTTOCONTO));
|
||||||
if (sottoconto.not_empty() && conto.empty()) return f.error_box("Manca il CONTO");
|
if (sottoconto.not_empty() && conto.empty()) return f.error_box("Manca il CONTO");
|
||||||
dispatch_e_char(f.parent(), K_SHIFT_ENTER);
|
dispatch_e_char(f.parent(), K_AUTO_ENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG0100_application::user_create()
|
bool CG0100_application::user_create()
|
||||||
{
|
{
|
||||||
_msk = new TMask("cg0100a") ;
|
_msk = new TMask("cg0100a") ;
|
||||||
_msk->set_handler(FLD_CM1_GRUPPO, gruppo_handler);
|
_msk->set_handler(FLD_CM1_GRUPPO, gruppo_handler);
|
||||||
_msk->set_handler(FLD_CM1_SOTTOCONTO, sottoc_handler);
|
_msk->set_handler(FLD_CM1_SOTTOCONTO, sottoc_handler);
|
||||||
_msk->set_handler(FLD_CM1_INDBIL, indbil_handler);
|
_msk->set_handler(FLD_CM1_INDBIL, indbil_handler);
|
||||||
_msk->set_handler(FLD_CM1_TMCF, tmcf_handler);
|
_msk->set_handler(FLD_CM1_TMCF, tmcf_handler);
|
||||||
|
|
||||||
_rel = new TRelation(LF_PCON);
|
_rel = new TRelation(LF_PCON);
|
||||||
_saldi = new TLocalisamfile(LF_SALDI);
|
_saldi = new TLocalisamfile(LF_SALDI);
|
||||||
_saldi->setkey(2);
|
_saldi->setkey(2);
|
||||||
set_search_field(FLD_CM1_GRUPPO);
|
set_search_field(FLD_CM1_GRUPPO);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG0100_application::user_destroy()
|
bool CG0100_application::user_destroy()
|
||||||
{
|
{
|
||||||
delete _msk;
|
delete _msk;
|
||||||
delete _rel;
|
delete _rel;
|
||||||
delete _saldi;
|
delete _saldi;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,18 +7,18 @@
|
|||||||
class CG0300_application : public TRelation_application
|
class CG0300_application : public TRelation_application
|
||||||
{
|
{
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
TRelation *_rel;
|
TRelation *_rel;
|
||||||
TLocalisamfile* _ditte;
|
TLocalisamfile* _ditte;
|
||||||
TLocalisamfile* _attiv;
|
TLocalisamfile* _attiv;
|
||||||
TLocalisamfile* _clifo;
|
TLocalisamfile* _clifo;
|
||||||
|
|
||||||
bool user_create();
|
bool user_create();
|
||||||
bool user_destroy();
|
bool user_destroy();
|
||||||
virtual TMask* get_mask(int mode) {return _msk;}
|
virtual TMask* get_mask(int mode) {return _msk;}
|
||||||
virtual bool changing_mask(int mode) {return FALSE;}
|
virtual bool changing_mask(int mode) {return FALSE;}
|
||||||
virtual TRelation* get_relation() const {return _rel;}
|
virtual TRelation* get_relation() const {return _rel;}
|
||||||
virtual void init_query_mode(TMask& m);
|
virtual void init_query_mode(TMask& m);
|
||||||
virtual void init_query_insert_mode(TMask& m);
|
virtual void init_query_insert_mode(TMask& m);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CG0300_application() {}
|
CG0300_application() {}
|
||||||
@ -27,49 +27,49 @@ public:
|
|||||||
void CG0300_application::init_query_mode(TMask& m)
|
void CG0300_application::init_query_mode(TMask& m)
|
||||||
|
|
||||||
{
|
{
|
||||||
disable_menu_item(M_FILE_NEW);
|
disable_menu_item(M_FILE_NEW);
|
||||||
m.send_key(K_SHIFT + K_CTRL + 's', -1);
|
m.send_key(K_SHIFT + K_CTRL + 's', -1);
|
||||||
m.send_key(K_SHIFT + K_CTRL + 'h', -2);
|
m.send_key(K_SHIFT + K_CTRL + 'h', -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG0300_application::init_query_insert_mode(TMask& m)
|
void CG0300_application::init_query_insert_mode(TMask& m)
|
||||||
|
|
||||||
{
|
{
|
||||||
disable_menu_item(M_FILE_NEW);
|
disable_menu_item(M_FILE_NEW);
|
||||||
m.send_key(K_SHIFT + K_CTRL + 'h', -1);
|
m.send_key(K_SHIFT + K_CTRL + 'h', -1);
|
||||||
m.send_key(K_SHIFT + K_CTRL + 's', -2);
|
m.send_key(K_SHIFT + K_CTRL + 's', -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HIDDEN bool key_handler (TMask_field& f, KEY k)
|
HIDDEN bool key_handler (TMask_field& f, KEY k)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (k == K_TAB)
|
if (k == K_TAB)
|
||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
|
|
||||||
if (m.get(F_ANNO).not_empty() && m.get(F_CODATT).not_empty() &&
|
if (m.get(F_ANNO).not_empty() && m.get(F_CODATT).not_empty() &&
|
||||||
m.get(F_CODCF).not_empty())
|
m.get(F_CODCF).not_empty())
|
||||||
m.send_key(K_SHIFT_ENTER, 0);
|
m.send_key(K_AUTO_ENTER, 0);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG0300_application::user_create()
|
bool CG0300_application::user_create()
|
||||||
{
|
{
|
||||||
_msk = new TMask("cg0300a") ;
|
_msk = new TMask("cg0300a") ;
|
||||||
_msk->set_handler (F_IMMESSO, key_handler);
|
_msk->set_handler (F_IMMESSO, key_handler);
|
||||||
_rel = new TRelation(LF_ALLEG);
|
_rel = new TRelation(LF_ALLEG);
|
||||||
_ditte = new TLocalisamfile(LF_NDITTE);
|
_ditte = new TLocalisamfile(LF_NDITTE);
|
||||||
_attiv = new TLocalisamfile(LF_ATTIV);
|
_attiv = new TLocalisamfile(LF_ATTIV);
|
||||||
_clifo = new TLocalisamfile(LF_CLIFO);
|
_clifo = new TLocalisamfile(LF_CLIFO);
|
||||||
const long ditta = get_firm();
|
const long ditta = get_firm();
|
||||||
_msk->set(F_CODDITTA, format("%ld", ditta));
|
_msk->set(F_CODDITTA, format("%ld", ditta));
|
||||||
_ditte->zero();
|
_ditte->zero();
|
||||||
_ditte->put(N_CODDITTA, ditta);
|
_ditte->put(N_CODDITTA, ditta);
|
||||||
_ditte->read();
|
_ditte->read();
|
||||||
if (_ditte->good())
|
if (_ditte->good())
|
||||||
_msk->set(F_CODATT,_ditte->get(N_CODATTPREV));
|
_msk->set(F_CODATT,_ditte->get(N_CODATTPREV));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -396,12 +396,12 @@ void CG1600_application::set_bil_key(bil_ivd* b, char lettera, char sezione,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG1600_application::set_bil_val(bil_ivd* b, const real& saldo = ZERO,
|
void CG1600_application::set_bil_val(bil_ivd* b, const real& saldo,
|
||||||
const real& saldorafr = ZERO,
|
const real& saldorafr,
|
||||||
const real& sld_prg_dare = ZERO,
|
const real& sld_prg_dare,
|
||||||
const real& sld_prg_avere = ZERO,
|
const real& sld_prg_avere,
|
||||||
const real& mov_dare = ZERO,
|
const real& mov_dare,
|
||||||
const real& mov_avere = ZERO)
|
const real& mov_avere)
|
||||||
{
|
{
|
||||||
b->saldo = saldo;
|
b->saldo = saldo;
|
||||||
b->saldorafr = saldorafr;
|
b->saldorafr = saldorafr;
|
||||||
|
@ -627,7 +627,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
|||||||
int TPrimanota_application::write(const TMask& m)
|
int TPrimanota_application::write(const TMask& m)
|
||||||
{
|
{
|
||||||
const long numreg = m.get_long(F_NUMREG);
|
const long numreg = m.get_long(F_NUMREG);
|
||||||
if (numreg > _lastreg) _lastreg = numreg;
|
if (numreg > _lastreg) _lastreg = numreg; // Aggiorna ultima registrazione
|
||||||
|
|
||||||
mask2rel(m);
|
mask2rel(m);
|
||||||
const int err = _rel->write(TRUE);
|
const int err = _rel->write(TRUE);
|
||||||
|
980
cg/cg3200.cpp
980
cg/cg3200.cpp
File diff suppressed because it is too large
Load Diff
216
cg/cg3500.cpp
216
cg/cg3500.cpp
@ -3,9 +3,7 @@
|
|||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
#include <date.h>
|
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <scanner.h>
|
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -13,14 +11,14 @@
|
|||||||
#include <pconti.h>
|
#include <pconti.h>
|
||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
|
|
||||||
#include <saldi.h>
|
#include <saldi.h>
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <anagr.h>
|
#include <anagr.h>
|
||||||
|
|
||||||
#include <cglib.h>
|
#include "cglib.h"
|
||||||
|
#include "cg3.h"
|
||||||
#include <cg3.h>
|
#include "cg3500.h"
|
||||||
#include <cg3500.h>
|
|
||||||
|
|
||||||
typedef enum {stampagruppo, stampaconto, stampasottoconto, fine} tipo;
|
typedef enum {stampagruppo, stampaconto, stampasottoconto, fine} tipo;
|
||||||
|
|
||||||
@ -96,7 +94,7 @@ bool CG3500_application::riepilogo()
|
|||||||
|
|
||||||
//il conto e' cambiato anche se e' rimasto invariato il conto ma e' cambiato il gruppo
|
//il conto e' cambiato anche se e' rimasto invariato il conto ma e' cambiato il gruppo
|
||||||
if ( (((cp != -1) && (conto.conto() != cp)) || ((gp != -1) && (conto.gruppo() != gp)))
|
if ( (((cp != -1) && (conto.conto() != cp)) || ((gp != -1) && (conto.gruppo() != gp)))
|
||||||
&& esiste_sc )
|
&& esiste_sc )
|
||||||
{
|
{
|
||||||
saldo_conto = prg_conto_dare - prg_conto_avere;
|
saldo_conto = prg_conto_dare - prg_conto_avere;
|
||||||
prg_gruppo_dare += prg_conto_dare;
|
prg_gruppo_dare += prg_conto_dare;
|
||||||
@ -112,7 +110,7 @@ bool CG3500_application::riepilogo()
|
|||||||
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
||||||
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
||||||
if (saldo_conto > 0.00) //va stampato in Dare
|
if (saldo_conto > 0.00) //va stampato in Dare
|
||||||
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saldo_conto = saldo_conto * (-1.00);
|
saldo_conto = saldo_conto * (-1.00);
|
||||||
@ -137,7 +135,7 @@ bool CG3500_application::riepilogo()
|
|||||||
_tmp_saldi->put(SLD_PDARE,prg_gruppo_dare);
|
_tmp_saldi->put(SLD_PDARE,prg_gruppo_dare);
|
||||||
_tmp_saldi->put(SLD_PAVERE,prg_gruppo_avere);
|
_tmp_saldi->put(SLD_PAVERE,prg_gruppo_avere);
|
||||||
if (saldo_gruppo > 0.00) //va stampato in Dare
|
if (saldo_gruppo > 0.00) //va stampato in Dare
|
||||||
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saldo_gruppo = saldo_gruppo * (-1.00);
|
saldo_gruppo = saldo_gruppo * (-1.00);
|
||||||
@ -151,73 +149,73 @@ bool CG3500_application::riepilogo()
|
|||||||
}
|
}
|
||||||
if ( (conto.sottoconto() == 0) && (conto.conto() != 0) ) //si tratta di un conto
|
if ( (conto.sottoconto() == 0) && (conto.conto() != 0) ) //si tratta di un conto
|
||||||
{
|
{
|
||||||
if ( (tipo_conto == 'C') || (tipo_conto == 'F') ) //si tratta di un conto cliente/fornitore
|
if ( (tipo_conto == 'C') || (tipo_conto == 'F') ) //si tratta di un conto cliente/fornitore
|
||||||
{
|
{
|
||||||
_udata_max = 0l;
|
_udata_max = 0l;
|
||||||
indbil = _pcn->get_int(PCN_INDBIL);
|
indbil = _pcn->get_int(PCN_INDBIL);
|
||||||
esiste_sc = ricerca_cf(conto,indbil,prg_conto_dare,prg_conto_avere);
|
esiste_sc = ricerca_cf(conto,indbil,prg_conto_dare,prg_conto_avere);
|
||||||
if (esiste_sc)
|
if (esiste_sc)
|
||||||
{
|
{
|
||||||
gp = conto.gruppo();
|
gp = conto.gruppo();
|
||||||
cp = conto.conto();
|
cp = conto.conto();
|
||||||
}
|
}
|
||||||
TRecnotype recnum = _pcn->recno();
|
TRecnotype recnum = _pcn->recno();
|
||||||
_pcn->next();
|
_pcn->next();
|
||||||
if (_pcn->eof())
|
if (_pcn->eof())
|
||||||
{
|
{
|
||||||
saldo_conto = prg_conto_dare - prg_conto_avere;
|
saldo_conto = prg_conto_dare - prg_conto_avere;
|
||||||
prg_gruppo_dare += prg_conto_dare;
|
prg_gruppo_dare += prg_conto_dare;
|
||||||
prg_gruppo_avere += prg_conto_avere;
|
prg_gruppo_avere += prg_conto_avere;
|
||||||
if (esiste_sc)
|
if (esiste_sc)
|
||||||
{
|
{
|
||||||
//scrivo il record del conto;
|
//scrivo il record del conto;
|
||||||
_tmp_saldi->zero();
|
_tmp_saldi->zero();
|
||||||
_tmp_saldi->put(SLD_GRUPPO,gp);
|
_tmp_saldi->put(SLD_GRUPPO,gp);
|
||||||
_tmp_saldi->put(SLD_CONTO,cp);
|
_tmp_saldi->put(SLD_CONTO,cp);
|
||||||
_tmp_saldi->put(SLD_SOTTOCONTO,0L);
|
_tmp_saldi->put(SLD_SOTTOCONTO,0L);
|
||||||
_tmp_saldi->put(SLD_ANNOES,_annoese);
|
_tmp_saldi->put(SLD_ANNOES,_annoese);
|
||||||
_tmp_saldi->put(SLD_DATAULMOV,_udata_max);
|
_tmp_saldi->put(SLD_DATAULMOV,_udata_max);
|
||||||
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
||||||
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
||||||
if (saldo_conto > 0.00) //va stampato in Dare
|
if (saldo_conto > 0.00) //va stampato in Dare
|
||||||
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saldo_conto = saldo_conto * (-1.00);
|
saldo_conto = saldo_conto * (-1.00);
|
||||||
_tmp_saldi->put(SLD_PAVERESCA,saldo_conto);
|
_tmp_saldi->put(SLD_PAVERESCA,saldo_conto);
|
||||||
}
|
}
|
||||||
_tmp_saldi->write();
|
_tmp_saldi->write();
|
||||||
esiste_conto = TRUE;
|
esiste_conto = TRUE;
|
||||||
}
|
}
|
||||||
if (esiste_conto)
|
if (esiste_conto)
|
||||||
{
|
{
|
||||||
saldo_gruppo = prg_gruppo_dare - prg_gruppo_avere;
|
saldo_gruppo = prg_gruppo_dare - prg_gruppo_avere;
|
||||||
//scrivo il record del gruppo
|
//scrivo il record del gruppo
|
||||||
_tmp_saldi->zero();
|
_tmp_saldi->zero();
|
||||||
_tmp_saldi->put(SLD_GRUPPO,gp);
|
_tmp_saldi->put(SLD_GRUPPO,gp);
|
||||||
_tmp_saldi->put(SLD_CONTO,0);
|
_tmp_saldi->put(SLD_CONTO,0);
|
||||||
_tmp_saldi->put(SLD_SOTTOCONTO,0L);
|
_tmp_saldi->put(SLD_SOTTOCONTO,0L);
|
||||||
_tmp_saldi->put(SLD_ANNOES,_annoese);
|
_tmp_saldi->put(SLD_ANNOES,_annoese);
|
||||||
_tmp_saldi->put(SLD_PDARE,prg_gruppo_dare);
|
_tmp_saldi->put(SLD_PDARE,prg_gruppo_dare);
|
||||||
_tmp_saldi->put(SLD_PAVERE,prg_gruppo_avere);
|
_tmp_saldi->put(SLD_PAVERE,prg_gruppo_avere);
|
||||||
if (saldo_gruppo > 0.00) //va stampato in Dare
|
if (saldo_gruppo > 0.00) //va stampato in Dare
|
||||||
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saldo_gruppo = saldo_gruppo * (-1.00);
|
saldo_gruppo = saldo_gruppo * (-1.00);
|
||||||
_tmp_saldi->put(SLD_PAVERESCA,saldo_gruppo);
|
_tmp_saldi->put(SLD_PAVERESCA,saldo_gruppo);
|
||||||
}
|
}
|
||||||
_tmp_saldi->write();
|
_tmp_saldi->write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_pcn->readat(recnum);
|
_pcn->readat(recnum);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conto.conto() == 0)
|
if (conto.conto() == 0)
|
||||||
indbil = _pcn->get_int(PCN_INDBIL);
|
indbil = _pcn->get_int(PCN_INDBIL);
|
||||||
|
|
||||||
if ( (conto.conto() == 0) || (conto.sottoconto() == 0) ) //e' un gruppo o un conto
|
if ( (conto.conto() == 0) || (conto.sottoconto() == 0) ) //e' un gruppo o un conto
|
||||||
{
|
{
|
||||||
@ -230,7 +228,7 @@ bool CG3500_application::riepilogo()
|
|||||||
prg_dare = 0.00;
|
prg_dare = 0.00;
|
||||||
prg_avere = 0.00;
|
prg_avere = 0.00;
|
||||||
if (_richiesta == 1)
|
if (_richiesta == 1)
|
||||||
sld.prg_attuali(_annoese,conto,indbil,prg_dare,prg_avere);
|
sld.prg_attuali(_annoese,conto,indbil,prg_dare,prg_avere);
|
||||||
else sld.prg_mov_eliminati(_annoese,conto,indbil,prg_dare,prg_avere);
|
else sld.prg_mov_eliminati(_annoese,conto,indbil,prg_dare,prg_avere);
|
||||||
saldo = prg_dare - prg_avere;
|
saldo = prg_dare - prg_avere;
|
||||||
|
|
||||||
@ -248,7 +246,7 @@ bool CG3500_application::riepilogo()
|
|||||||
_tmp_saldi->put(SLD_PDARE,prg_dare);
|
_tmp_saldi->put(SLD_PDARE,prg_dare);
|
||||||
_tmp_saldi->put(SLD_PAVERE,prg_avere);
|
_tmp_saldi->put(SLD_PAVERE,prg_avere);
|
||||||
if (saldo > 0.00) //va stampato in Dare
|
if (saldo > 0.00) //va stampato in Dare
|
||||||
_tmp_saldi->put(SLD_PDARESCA,saldo);
|
_tmp_saldi->put(SLD_PDARESCA,saldo);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saldo = saldo * (-1.00);
|
saldo = saldo * (-1.00);
|
||||||
@ -282,7 +280,7 @@ bool CG3500_application::riepilogo()
|
|||||||
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
_tmp_saldi->put(SLD_PDARE,prg_conto_dare);
|
||||||
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
_tmp_saldi->put(SLD_PAVERE,prg_conto_avere);
|
||||||
if (saldo_conto > 0.00) //va stampato in Dare
|
if (saldo_conto > 0.00) //va stampato in Dare
|
||||||
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
_tmp_saldi->put(SLD_PDARESCA,saldo_conto);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saldo_conto = saldo_conto * (-1.00);
|
saldo_conto = saldo_conto * (-1.00);
|
||||||
@ -299,7 +297,7 @@ bool CG3500_application::riepilogo()
|
|||||||
_tmp_saldi->put(SLD_PDARE,prg_gruppo_dare);
|
_tmp_saldi->put(SLD_PDARE,prg_gruppo_dare);
|
||||||
_tmp_saldi->put(SLD_PAVERE,prg_gruppo_avere);
|
_tmp_saldi->put(SLD_PAVERE,prg_gruppo_avere);
|
||||||
if (saldo_gruppo > 0.00) //va stampato in Dare
|
if (saldo_gruppo > 0.00) //va stampato in Dare
|
||||||
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
_tmp_saldi->put(SLD_PDARESCA,saldo_gruppo);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saldo_gruppo = saldo_gruppo * (-1.00);
|
saldo_gruppo = saldo_gruppo * (-1.00);
|
||||||
@ -336,7 +334,7 @@ bool CG3500_application::ricerca_cf(TConto& conto,int indbil,real& prg_conto_dar
|
|||||||
prg_avere = 0.00;
|
prg_avere = 0.00;
|
||||||
conto.set(g, c, s, tipo); //aggiunge a conto s
|
conto.set(g, c, s, tipo); //aggiunge a conto s
|
||||||
if (_richiesta == 1)
|
if (_richiesta == 1)
|
||||||
sld.prg_attuali(_annoese,conto,indbil,prg_dare,prg_avere);
|
sld.prg_attuali(_annoese,conto,indbil,prg_dare,prg_avere);
|
||||||
else sld.prg_mov_eliminati(_annoese,conto,indbil,prg_dare,prg_avere);
|
else sld.prg_mov_eliminati(_annoese,conto,indbil,prg_dare,prg_avere);
|
||||||
saldo = prg_dare - prg_avere;
|
saldo = prg_dare - prg_avere;
|
||||||
prg_conto_dare += prg_dare;
|
prg_conto_dare += prg_dare;
|
||||||
@ -352,7 +350,7 @@ bool CG3500_application::ricerca_cf(TConto& conto,int indbil,real& prg_conto_dar
|
|||||||
_tmp_saldi->put(SLD_PDARE,prg_dare);
|
_tmp_saldi->put(SLD_PDARE,prg_dare);
|
||||||
_tmp_saldi->put(SLD_PAVERE,prg_avere);
|
_tmp_saldi->put(SLD_PAVERE,prg_avere);
|
||||||
if (saldo > 0.00) //va stampato in Dare
|
if (saldo > 0.00) //va stampato in Dare
|
||||||
_tmp_saldi->put(SLD_PDARESCA,saldo);
|
_tmp_saldi->put(SLD_PDARESCA,saldo);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saldo = saldo * (-1.00);
|
saldo = saldo * (-1.00);
|
||||||
@ -497,7 +495,7 @@ tipo CG3500_application::leggi_gruppi(int counter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_gprec == -1)
|
if (_gprec == -1)
|
||||||
_gprec = _gcorr;
|
_gprec = _gcorr;
|
||||||
|
|
||||||
_tmp_saldi->readat(pos);
|
_tmp_saldi->readat(pos);
|
||||||
_ultima_data = _tmp_saldi->get_date(SLD_DATAULMOV);
|
_ultima_data = _tmp_saldi->get_date(SLD_DATAULMOV);
|
||||||
@ -527,7 +525,7 @@ bool CG3500_application::CercaConto(int g, int c)
|
|||||||
_cconto = _tmp_saldi->get_int(SLD_CONTO);
|
_cconto = _tmp_saldi->get_int(SLD_CONTO);
|
||||||
_tipo = _tmp_saldi->get(SLD_FLAGSALINI)[0];
|
_tipo = _tmp_saldi->get(SLD_FLAGSALINI)[0];
|
||||||
if (_scelta == 2)
|
if (_scelta == 2)
|
||||||
_ultima_data = _tmp_saldi->get_date(SLD_DATAULMOV);
|
_ultima_data = _tmp_saldi->get_date(SLD_DATAULMOV);
|
||||||
TConto conto (_gconto,_cconto,0l,_tipo);
|
TConto conto (_gconto,_cconto,0l,_tipo);
|
||||||
_descrconto = conto.descrizione();
|
_descrconto = conto.descrizione();
|
||||||
_prg_dare_conto = _tmp_saldi->get_real(SLD_PDARE);
|
_prg_dare_conto = _tmp_saldi->get_real(SLD_PDARE);
|
||||||
@ -570,13 +568,13 @@ bool CG3500_application::preprocess_page(int file, int counter)
|
|||||||
reset_print();
|
reset_print();
|
||||||
|
|
||||||
if (_scelta == 1)
|
if (_scelta == 1)
|
||||||
_tp = leggi_conti(counter);
|
_tp = leggi_conti(counter);
|
||||||
if (_scelta == 2)
|
if (_scelta == 2)
|
||||||
_tp = leggi_gruppi(counter);
|
_tp = leggi_gruppi(counter);
|
||||||
if (_tp == fine)
|
if (_tp == fine)
|
||||||
{
|
{
|
||||||
if (_scelta == 1)
|
if (_scelta == 1)
|
||||||
setta_riga_sottoconto();
|
setta_riga_sottoconto();
|
||||||
setta_riga_conto();
|
setta_riga_conto();
|
||||||
setta_riga_gruppo();
|
setta_riga_gruppo();
|
||||||
setta_riga_totale();
|
setta_riga_totale();
|
||||||
@ -587,9 +585,9 @@ bool CG3500_application::preprocess_page(int file, int counter)
|
|||||||
setta_riga_gruppo();
|
setta_riga_gruppo();
|
||||||
}
|
}
|
||||||
if (_tp == stampaconto)
|
if (_tp == stampaconto)
|
||||||
setta_riga_conto();
|
setta_riga_conto();
|
||||||
if (_tp == stampasottoconto)
|
if (_tp == stampasottoconto)
|
||||||
setta_riga_sottoconto();
|
setta_riga_sottoconto();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -604,7 +602,7 @@ print_action CG3500_application::postprocess_print(int file, int counter)
|
|||||||
print_action CG3500_application::postprocess_page(int file, int counter)
|
print_action CG3500_application::postprocess_page(int file, int counter)
|
||||||
{
|
{
|
||||||
if (_tp == fine)
|
if (_tp == fine)
|
||||||
return NEXT_PAGE;
|
return NEXT_PAGE;
|
||||||
|
|
||||||
return REPEAT_PAGE;
|
return REPEAT_PAGE;
|
||||||
}
|
}
|
||||||
@ -627,22 +625,22 @@ void CG3500_application::setta_riga_conto()
|
|||||||
|
|
||||||
riga = "";
|
riga = "";
|
||||||
if ( (_tp == fine) && (_scelta == 1) ) r = 2;
|
if ( (_tp == fine) && (_scelta == 1) ) r = 2;
|
||||||
else r = 1;
|
else r = 1;
|
||||||
if (_scelta == 1)
|
if (_scelta == 1)
|
||||||
{
|
{
|
||||||
set_row(r++,"%s",(const char*)riga);
|
set_row(r++,"%s",(const char*)riga);
|
||||||
set_row(r,"**** Totali conto %03d.%03d",(const char*)_gconto,(const char*)_cconto);
|
set_row(r,"**** Totali conto %03d.%03d",(const char*)_gconto,(const char*)_cconto);
|
||||||
set_row(r," %.27s",(const char*)_descrconto);
|
set_row(r," %.27s",(const char*)_descrconto);
|
||||||
}
|
}
|
||||||
if (_scelta == 2)
|
if (_scelta == 2)
|
||||||
{
|
{
|
||||||
set_row(r,"%03d", (const char*)_ccorr);
|
set_row(r,"%03d", (const char*)_ccorr);
|
||||||
set_row(r," %.32s",(const char*)_descrconto);
|
set_row(r," %.32s",(const char*)_descrconto);
|
||||||
set_row(r,"@42g%s",(const char*)udata);
|
set_row(r,"@42g%s",(const char*)udata);
|
||||||
}
|
}
|
||||||
set_row(r++,"@57g%r@77g%r@97g%r@117g%r",&_prg_dare_conto,&_prg_avere_conto,&_saldo_dare_conto,&_saldo_avere_conto);
|
set_row(r++,"@57g%r@77g%r@97g%r@117g%r",&_prg_dare_conto,&_prg_avere_conto,&_saldo_dare_conto,&_saldo_avere_conto);
|
||||||
if ( (_scelta == 1) || ((_scelta == 2) && (_tp == fine)) )
|
if ( (_scelta == 1) || ((_scelta == 2) && (_tp == fine)) )
|
||||||
set_row(r,"%s",(const char*)riga);
|
set_row(r,"%s",(const char*)riga);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG3500_application::setta_riga_gruppo()
|
void CG3500_application::setta_riga_gruppo()
|
||||||
@ -652,11 +650,11 @@ void CG3500_application::setta_riga_gruppo()
|
|||||||
|
|
||||||
riga.fill('-');
|
riga.fill('-');
|
||||||
if (_scelta == 1)
|
if (_scelta == 1)
|
||||||
if (_tp == fine) r = 5;
|
if (_tp == fine) r = 5;
|
||||||
else r = 4;
|
else r = 4;
|
||||||
if (_scelta == 2)
|
if (_scelta == 2)
|
||||||
if (_tp == fine) r = 3;
|
if (_tp == fine) r = 3;
|
||||||
else r = 2;
|
else r = 2;
|
||||||
set_row(r,"**** TOTALI GRUPPO %03d-",(const char*)_ggruppo);
|
set_row(r,"**** TOTALI GRUPPO %03d-",(const char*)_ggruppo);
|
||||||
set_row(r," %.30s",(const char*)_descrgruppo);
|
set_row(r," %.30s",(const char*)_descrgruppo);
|
||||||
set_row(r++,"@57g%r@77g%r@97g%r@117g%r",&_prg_dare_gruppo,&_prg_avere_gruppo,&_saldo_dare_gruppo,&_saldo_avere_gruppo);
|
set_row(r++,"@57g%r@77g%r@97g%r@117g%r",&_prg_dare_gruppo,&_prg_avere_gruppo,&_saldo_dare_gruppo,&_saldo_avere_gruppo);
|
||||||
@ -674,7 +672,7 @@ void CG3500_application::setta_riga_totale()
|
|||||||
else r = 6;
|
else r = 6;
|
||||||
set_row(r,"**** TOTALE GENERALE @57g%r@77g%r",&_prg_dare_tot,&_prg_avere_tot);
|
set_row(r,"**** TOTALE GENERALE @57g%r@77g%r",&_prg_dare_tot,&_prg_avere_tot);
|
||||||
if (_saldo_tot > 0.00)
|
if (_saldo_tot > 0.00)
|
||||||
set_row(r,"@97g%r",&_saldo_tot);
|
set_row(r,"@97g%r",&_saldo_tot);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_saldo_tot = _saldo_tot * (-1.00);
|
_saldo_tot = _saldo_tot * (-1.00);
|
||||||
@ -689,15 +687,15 @@ TDate CG3500_application::UltimaData(int g, int c, long s, int anno)
|
|||||||
|
|
||||||
saldi.zero();
|
saldi.zero();
|
||||||
if (_annoese != 0)
|
if (_annoese != 0)
|
||||||
saldi.put(SLD_ANNOES, anno);
|
saldi.put(SLD_ANNOES, anno);
|
||||||
saldi.put(SLD_GRUPPO,g);
|
saldi.put(SLD_GRUPPO,g);
|
||||||
if (c != 0)
|
if (c != 0)
|
||||||
saldi.put(SLD_CONTO, c);
|
saldi.put(SLD_CONTO, c);
|
||||||
if (s != 0)
|
if (s != 0)
|
||||||
saldi.put(SLD_SOTTOCONTO, s);
|
saldi.put(SLD_SOTTOCONTO, s);
|
||||||
saldi.read();
|
saldi.read();
|
||||||
if (saldi.bad())
|
if (saldi.bad())
|
||||||
saldi.zero();
|
saldi.zero();
|
||||||
uldata = saldi.get(SLD_DATAULMOV);
|
uldata = saldi.get(SLD_DATAULMOV);
|
||||||
|
|
||||||
return uldata;
|
return uldata;
|
||||||
@ -818,9 +816,9 @@ int CG3500_application::stampa_intestazione_ditta()
|
|||||||
codice_ditta << get_firm();
|
codice_ditta << get_firm();
|
||||||
|
|
||||||
set_header (r, "Ditta %s %s Via %s %s %s %s", (const char*)codice_ditta,
|
set_header (r, "Ditta %s %s Via %s %s %s %s", (const char*)codice_ditta,
|
||||||
(const char*)_ragsoc, (const char*)_viafis,
|
(const char*)_ragsoc, (const char*)_viafis,
|
||||||
(const char*)_cap, (const char*)_comunefis,
|
(const char*)_cap, (const char*)_comunefis,
|
||||||
(const char*)_provfis);
|
(const char*)_provfis);
|
||||||
r++;
|
r++;
|
||||||
printer().setdate(_data);
|
printer().setdate(_data);
|
||||||
riga = "Data @< Pag. @#";
|
riga = "Data @< Pag. @#";
|
||||||
@ -841,17 +839,17 @@ void CG3500_application::preprocess_header()
|
|||||||
|
|
||||||
r++;
|
r++;
|
||||||
if (_scelta == 1) //stampa riepilogo conti
|
if (_scelta == 1) //stampa riepilogo conti
|
||||||
set_header(r,"*** MASTRO DI CONTO ***");
|
set_header(r,"*** MASTRO DI CONTO ***");
|
||||||
else set_header(r,"*** MASTRO DI GRUPPO ***");
|
else set_header(r,"*** MASTRO DI GRUPPO ***");
|
||||||
set_header(r,"@33gAnno esercizio %d", _annoese);
|
set_header(r,"@33gAnno esercizio %d", _annoese);
|
||||||
if (_richiesta == 1)
|
if (_richiesta == 1)
|
||||||
set_header(r,"@70gPROGRESSIVI ATTUALI@114gSALDO ATTUALE");
|
set_header(r,"@70gPROGRESSIVI ATTUALI@114gSALDO ATTUALE");
|
||||||
else set_header(r,"@70gPROG. MOV. ELIMINATI@110gSALDO MOV. ELIMINATI");
|
else set_header(r,"@70gPROG. MOV. ELIMINATI@110gSALDO MOV. ELIMINATI");
|
||||||
|
|
||||||
r++;
|
r++;
|
||||||
r++;
|
r++;
|
||||||
if (_scelta == 1)
|
if (_scelta == 1)
|
||||||
set_header(r,"SOTTOC DESCRIZIONE");
|
set_header(r,"SOTTOC DESCRIZIONE");
|
||||||
else set_header(r,"CONTO DESCRIZIONE");
|
else set_header(r,"CONTO DESCRIZIONE");
|
||||||
set_header(r++,"@40gDATA ULT.MOV@68gDARE@87gAVERE@108gDARE@127gAVERE");
|
set_header(r++,"@40gDATA ULT.MOV@68gDARE@87gAVERE@108gDARE@127gAVERE");
|
||||||
riga.fill('-');
|
riga.fill('-');
|
||||||
|
@ -4,10 +4,7 @@
|
|||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <date.h>
|
|
||||||
#include <scanner.h>
|
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <prefix.h>
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
@ -18,7 +15,6 @@
|
|||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
|
|
||||||
#include "cg4.h"
|
|
||||||
#include "cg4500a.h"
|
#include "cg4500a.h"
|
||||||
#include "cg4500b.h"
|
#include "cg4500b.h"
|
||||||
|
|
||||||
@ -576,3 +572,15 @@ int cg4500 (int argc, char* argv[])
|
|||||||
main_app.run(argc, argv, "");
|
main_app.run(argc, argv, "");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
<<<<<<< cg4500.cpp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> 1.4
|
||||||
|
@ -546,7 +546,8 @@ TPush_button::TPush_button(short left, short top, short right, short bottom,
|
|||||||
caption = format("#%d#%d", BMP_DELREC, BMP_DELRECDN);
|
caption = format("#%d#%d", BMP_DELREC, BMP_DELRECDN);
|
||||||
break;
|
break;
|
||||||
case DLG_NEWREC:
|
case DLG_NEWREC:
|
||||||
caption = format("#%d#%d", BMP_NEWREC, BMP_NEWRECDN);
|
if (height > ROWY && strcmp("~Nuovo", caption) == 0) // Puo' essere Gestione
|
||||||
|
caption = format("#%d#%d", BMP_NEWREC, BMP_NEWRECDN);
|
||||||
break;
|
break;
|
||||||
case DLG_FIRSTREC:
|
case DLG_FIRSTREC:
|
||||||
caption = format("#%d", BMP_FIRSTREC);
|
caption = format("#%d", BMP_FIRSTREC);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#define K_CTRL_ENTER K_CTRL+K_ENTER
|
#define K_CTRL_ENTER K_CTRL+K_ENTER
|
||||||
#define K_AUTO_ENTER K_SHIFT+K_ENTER
|
#define K_AUTO_ENTER K_SHIFT+K_ENTER
|
||||||
#define K_QUIT 10334
|
#define K_QUIT 10334
|
||||||
|
#define K_FORCE_CLOSE 11334
|
||||||
#define K_SAVE 10082
|
#define K_SAVE 10082
|
||||||
#define K_SHIFT_TAB K_SHIFT+K_TAB
|
#define K_SHIFT_TAB K_SHIFT+K_TAB
|
||||||
#define K_SHIFT_F2 K_SHIFT+K_F2
|
#define K_SHIFT_F2 K_SHIFT+K_F2
|
||||||
|
@ -98,10 +98,12 @@ void TMask::handler(WINDOW win, EVENT* ep)
|
|||||||
switch(ep->v.ctl.id)
|
switch(ep->v.ctl.id)
|
||||||
{
|
{
|
||||||
case DLG_OK :
|
case DLG_OK :
|
||||||
on_key(K_AUTO_ENTER); break;
|
stop_run(K_AUTO_ENTER); break;
|
||||||
case DLG_BAR :
|
case DLG_BAR :
|
||||||
case DLG_CANCEL :
|
case DLG_CANCEL :
|
||||||
on_key(K_ESC); break;
|
stop_run(K_ESC); break;
|
||||||
|
case DLG_QUIT :
|
||||||
|
stop_run(K_FORCE_CLOSE); break;
|
||||||
/*
|
/*
|
||||||
case DLG_PGDN :
|
case DLG_PGDN :
|
||||||
on_key(K_NEXT); break;
|
on_key(K_NEXT); break;
|
||||||
@ -123,8 +125,6 @@ void TMask::handler(WINDOW win, EVENT* ep)
|
|||||||
stop_run(K_DEL); break;
|
stop_run(K_DEL); break;
|
||||||
case DLG_SAVEREC :
|
case DLG_SAVEREC :
|
||||||
stop_run(K_SAVE); break;
|
stop_run(K_SAVE); break;
|
||||||
case DLG_QUIT :
|
|
||||||
stop_run(K_QUIT); break;
|
|
||||||
*/
|
*/
|
||||||
case DLG_F9:
|
case DLG_F9:
|
||||||
{
|
{
|
||||||
@ -557,18 +557,18 @@ int TMask::find_active_field(int first, int dir) const
|
|||||||
void TMask::set_focus()
|
void TMask::set_focus()
|
||||||
{
|
{
|
||||||
_focus = find_active_field(_focus, +1);
|
_focus = find_active_field(_focus, +1);
|
||||||
const int page = find_parent_page(fld(_focus));
|
const TMask_field& f = fld(_focus);
|
||||||
|
const int page = find_parent_page(f);
|
||||||
|
|
||||||
if (page != _page && page != MAX_PAGES)
|
if (page != _page && page != MAX_PAGES)
|
||||||
{
|
{
|
||||||
const WINDOW pw = win(); // previous window
|
const WINDOW pw = win(); // previous window
|
||||||
_page = page;
|
_page = page; // update page number
|
||||||
show_window(win(), TRUE); // show new page
|
show_window(win(), TRUE); // show new page
|
||||||
if (pw) show_window(pw, FALSE); // hide old page
|
if (pw) show_window(pw, FALSE); // hide old page
|
||||||
}
|
}
|
||||||
|
|
||||||
const WINDOW fw = fld(_focus).win();
|
set_front_window(f.win());
|
||||||
set_front_window(fw);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -577,9 +577,9 @@ void TMask::move_focus_field(int d)
|
|||||||
{
|
{
|
||||||
TMask_field& f = fld(_focus);
|
TMask_field& f = fld(_focus);
|
||||||
|
|
||||||
if (f.on_key(K_TAB) == FALSE) // New style
|
if (f.on_key(K_TAB) == FALSE) // Don't you agree to lose focus? ...
|
||||||
{
|
{
|
||||||
set_focus();
|
set_focus(); // ... Keep it
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,9 +601,7 @@ void TMask::move_focus_field(int d)
|
|||||||
|
|
||||||
bool TMask::stop_run(KEY key)
|
bool TMask::stop_run(KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_CTRL_ENTER) key = K_ENTER;
|
if (key != K_AUTO_ENTER && key != K_FORCE_CLOSE)
|
||||||
|
|
||||||
if (key != K_AUTO_ENTER)
|
|
||||||
{
|
{
|
||||||
const int last = fields();
|
const int last = fields();
|
||||||
bool found = FALSE;
|
bool found = FALSE;
|
||||||
@ -626,11 +624,13 @@ bool TMask::stop_run(KEY key)
|
|||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
return error_box("Non e' attivo il bottone associato a %d", key);
|
return error_box("Non e' attivo il bottone associato a %d", key);
|
||||||
#else
|
#else
|
||||||
beep();
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else key = K_ENTER;
|
}
|
||||||
|
|
||||||
|
if (key == K_CTRL_ENTER) key = K_ENTER; else
|
||||||
|
if (key == K_FORCE_CLOSE) key = K_QUIT;
|
||||||
|
|
||||||
if (key != K_ESC && key != K_QUIT && key != K_DEL)
|
if (key != K_ESC && key != K_QUIT && key != K_DEL)
|
||||||
{
|
{
|
||||||
@ -694,7 +694,7 @@ bool TMask::on_key(KEY key)
|
|||||||
if (key > K_CTRL)
|
if (key > K_CTRL)
|
||||||
{
|
{
|
||||||
key -= K_CTRL;
|
key -= K_CTRL;
|
||||||
if (key >= K_F1 && key <= K_F10)
|
if (key >= K_F1 && key <= K_F12)
|
||||||
next_page(1000 + key - K_F1);
|
next_page(1000 + key - K_F1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: maskfld.cpp,v 1.3 1994-08-23 13:52:21 guy Exp $
|
// $Id: maskfld.cpp,v 1.4 1994-08-26 13:07:14 guy Exp $
|
||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
@ -1721,13 +1721,13 @@ const char* TEdit_field::format(const char* d)
|
|||||||
|
|
||||||
if (fpark.not_empty())
|
if (fpark.not_empty())
|
||||||
{
|
{
|
||||||
#ifdef DBG
|
|
||||||
if (fpark.len() > _size)
|
if (fpark.len() > _size)
|
||||||
{
|
{
|
||||||
|
#ifdef DBG
|
||||||
error_box("Campo %d troppo lungo: %d > %d", dlg(), fpark.len(), _size);
|
error_box("Campo %d troppo lungo: %d > %d", dlg(), fpark.len(), _size);
|
||||||
|
#endif
|
||||||
fpark.cut(_size);
|
fpark.cut(_size);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (_flags.uppercase)
|
if (_flags.uppercase)
|
||||||
fpark.upper();
|
fpark.upper();
|
||||||
|
@ -32,6 +32,11 @@ class TSpreadsheet : public TWindow
|
|||||||
|
|
||||||
SPREADSHEET_NOTIFY _notify;
|
SPREADSHEET_NOTIFY _notify;
|
||||||
|
|
||||||
|
TMask_field* _edit_field; // Current edit field
|
||||||
|
int _cur_row, _cur_col; // Current cell
|
||||||
|
bool _row_dirty; // Current row changed
|
||||||
|
bool _check_enabled; // Perform OFF_ROW checks
|
||||||
|
|
||||||
static void xiev_handler(XI_OBJ *itf, XI_EVENT *xiev);
|
static void xiev_handler(XI_OBJ *itf, XI_EVENT *xiev);
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
@ -99,11 +104,12 @@ void TSpreadsheet::init()
|
|||||||
first = FALSE;
|
first = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
||||||
const char* maskname, int maskno,
|
const char* maskname, int maskno,
|
||||||
const char* head, WINDOW parent)
|
const char* head, WINDOW parent)
|
||||||
: _mask(maskname, NO_MODE, maskno), _notify(NULL)
|
: _mask(maskname, NO_MODE, maskno), _notify(NULL), _edit_field(NULL), _cur_row(0), _cur_col(0),
|
||||||
|
_row_dirty(FALSE), _check_enabled(TRUE)
|
||||||
{
|
{
|
||||||
const int NUMBER_WIDTH = 3;
|
const int NUMBER_WIDTH = 3;
|
||||||
const int MAX_COL = 32;
|
const int MAX_COL = 32;
|
||||||
@ -181,8 +187,8 @@ TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
|||||||
|
|
||||||
for (h = new_header.get(0), i = 0; h; h = new_header.get(), i++)
|
for (h = new_header.get(0), i = 0; h; h = new_header.get(), i++)
|
||||||
{
|
{
|
||||||
const int cid = FIRST_FIELD+i; // Column & Field ID
|
const int cid = FIRST_FIELD+i; // Column & Field ID
|
||||||
const TMask_field* f = field(cid); // Field on mask
|
const TMask_field* f = field(cid); // Field on mask
|
||||||
const int w = width[i] + (f->has_query() ? 2 : 0); // Column width
|
const int w = width[i] + (f->has_query() ? 2 : 0); // Column width
|
||||||
|
|
||||||
long flags = XI_ATR_EDITMENU | XI_ATR_AUTOSCROLL;
|
long flags = XI_ATR_EDITMENU | XI_ATR_AUTOSCROLL;
|
||||||
@ -259,8 +265,8 @@ TMask_field* TSpreadsheet::cell2field(const XI_OBJ* cell) const
|
|||||||
{
|
{
|
||||||
TMask_field* f = field(id);
|
TMask_field* f = field(id);
|
||||||
if (f == NULL) break;
|
if (f == NULL) break;
|
||||||
good = f;
|
good = f; // We've found a field with the proper ID ...
|
||||||
if (f->active()) break;
|
if (f->active()) break; // ... and it's active: end of search
|
||||||
}
|
}
|
||||||
|
|
||||||
return good;
|
return good;
|
||||||
@ -280,7 +286,7 @@ void TSpreadsheet::update_rec(int rec)
|
|||||||
|
|
||||||
void TSpreadsheet::set_focus_cell(int riga, int colonna)
|
void TSpreadsheet::set_focus_cell(int riga, int colonna)
|
||||||
{
|
{
|
||||||
set_front_window(win());
|
// set_front_window(win());
|
||||||
XI_OBJ cell;
|
XI_OBJ cell;
|
||||||
XI_MAKE_CELL(&cell, _list, rec2row(riga), colonna);
|
XI_MAKE_CELL(&cell, _list, rec2row(riga), colonna);
|
||||||
xi_set_focus(&cell);
|
xi_set_focus(&cell);
|
||||||
@ -331,7 +337,9 @@ void TSpreadsheet::update(int row)
|
|||||||
{
|
{
|
||||||
xi_cell_request(_list);
|
xi_cell_request(_list);
|
||||||
xi_scroll(_list, XI_SCROLL_FIRST);
|
xi_scroll(_list, XI_SCROLL_FIRST);
|
||||||
set_front_window(win());
|
XI_OBJ* itf = xi_get_itf(win());
|
||||||
|
xi_set_focus(itf);
|
||||||
|
// set_front_window(win());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
update_rec(row);
|
update_rec(row);
|
||||||
@ -349,11 +357,6 @@ void TSpreadsheet::xiev_handler(XI_OBJ *itf, XI_EVENT *xiev)
|
|||||||
// Certified 75%
|
// Certified 75%
|
||||||
void TSpreadsheet::list_handler(XI_EVENT *xiev)
|
void TSpreadsheet::list_handler(XI_EVENT *xiev)
|
||||||
{
|
{
|
||||||
static TMask_field* edit_field = NULL; // Current edit field
|
|
||||||
static int cur_row = 0, cur_col = 0; // Current cell
|
|
||||||
static bool row_dirty = FALSE; // Current row changed
|
|
||||||
static bool check_enabled = TRUE; // Perform OFF_ROW checks
|
|
||||||
|
|
||||||
switch (xiev->type)
|
switch (xiev->type)
|
||||||
{
|
{
|
||||||
case XIE_GET_FIRST:
|
case XIE_GET_FIRST:
|
||||||
@ -430,18 +433,18 @@ break;
|
|||||||
case XIE_BUTTON:
|
case XIE_BUTTON:
|
||||||
if (xiev->v.xi_obj->type == XIT_CELL)
|
if (xiev->v.xi_obj->type == XIT_CELL)
|
||||||
{
|
{
|
||||||
if (edit_field)
|
if (_edit_field)
|
||||||
{
|
{
|
||||||
const char* val = xi_get_text(xiev->v.xi_obj, NULL, -1);
|
const char* val = xi_get_text(xiev->v.xi_obj, NULL, -1);
|
||||||
edit_field->set(val); // Update current cell
|
_edit_field->set(val); // Update current cell
|
||||||
check_enabled = FALSE; // Disable checks
|
_check_enabled = FALSE; // Disable checks
|
||||||
if (!row_dirty) notify(cur_row, K_SPACE);
|
if (!_row_dirty) notify(_cur_row, K_SPACE);
|
||||||
if (edit_field->on_key(K_F9)) // Show search sheet
|
if (_edit_field->on_key(K_F9)) // Show search sheet
|
||||||
{
|
{
|
||||||
mask2str(cur_row); // Update row
|
mask2str(_cur_row); // Update row
|
||||||
row_dirty = TRUE;
|
_row_dirty = TRUE;
|
||||||
}
|
}
|
||||||
check_enabled = TRUE; // Enable checks
|
_check_enabled = TRUE; // Enable checks
|
||||||
xi_set_focus(xiev->v.xi_obj); // Restore focus to cell
|
xi_set_focus(xiev->v.xi_obj); // Restore focus to cell
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -450,17 +453,17 @@ if (xiev->v.xi_obj->type == XIT_LIST)
|
|||||||
break;
|
break;
|
||||||
case XIE_DBL_CELL:
|
case XIE_DBL_CELL:
|
||||||
{
|
{
|
||||||
check_enabled = FALSE;
|
_check_enabled = FALSE;
|
||||||
cur_row = row2rec(xiev->v.xi_obj->v.cell.row);
|
_cur_row = row2rec(xiev->v.xi_obj->v.cell.row);
|
||||||
cur_col = xiev->v.xi_obj->v.cell.column;
|
_cur_col = xiev->v.xi_obj->v.cell.column;
|
||||||
const KEY k = edit(cur_row);
|
const KEY k = edit(_cur_row);
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
update_rec(cur_row);
|
update_rec(_cur_row);
|
||||||
row_dirty = TRUE;
|
_row_dirty = TRUE;
|
||||||
}
|
}
|
||||||
xi_set_focus(xiev->v.xi_obj);
|
xi_set_focus(xiev->v.xi_obj);
|
||||||
check_enabled = TRUE;
|
_check_enabled = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIE_ON_ROW:
|
case XIE_ON_ROW:
|
||||||
@ -468,24 +471,24 @@ break;
|
|||||||
const int rec = row2rec(xiev->v.xi_obj->v.row);
|
const int rec = row2rec(xiev->v.xi_obj->v.row);
|
||||||
if (rec < items())
|
if (rec < items())
|
||||||
{
|
{
|
||||||
cur_row = rec;
|
_cur_row = rec;
|
||||||
str2mask(rec);
|
str2mask(rec);
|
||||||
row_dirty = FALSE;
|
_row_dirty = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
xiev->refused = TRUE;
|
xiev->refused = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIE_OFF_ROW:
|
case XIE_OFF_ROW:
|
||||||
if (row_dirty && check_enabled)
|
if (_row_dirty && _check_enabled)
|
||||||
{
|
{
|
||||||
check_enabled = FALSE; // Avoid recursion!
|
_check_enabled = FALSE; // Avoid recursion!
|
||||||
str2mask(cur_row); // It shouldn't have to be necessary
|
str2mask(_cur_row); // It shouldn't have to be necessary
|
||||||
bool ok = _mask.check_fields();
|
bool ok = _mask.check_fields();
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
mask2str(cur_row);
|
mask2str(_cur_row);
|
||||||
ok = notify(cur_row, K_ENTER); // Notify edit
|
ok = notify(_cur_row, K_ENTER); // Notify edit
|
||||||
}
|
}
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
@ -497,17 +500,17 @@ break;
|
|||||||
xvt_statbar_set("");
|
xvt_statbar_set("");
|
||||||
set_dirty();
|
set_dirty();
|
||||||
}
|
}
|
||||||
check_enabled = TRUE;
|
_check_enabled = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIE_ON_CELL:
|
case XIE_ON_CELL:
|
||||||
{
|
{
|
||||||
TMask_field* f = cell2field(xiev->v.xi_obj);
|
TMask_field* f = cell2field(xiev->v.xi_obj);
|
||||||
const int col = (f->dlg() - FIRST_FIELD) % 100;
|
const int col = (f->dlg() - FIRST_FIELD) % 100;
|
||||||
if (!cell_disabled(cur_row, col))
|
if (!cell_disabled(_cur_row, col))
|
||||||
{
|
{
|
||||||
edit_field = f;
|
_edit_field = f;
|
||||||
cur_col = xiev->v.xi_obj->v.cell.column;
|
_cur_col = xiev->v.xi_obj->v.cell.column;
|
||||||
xi_set_color(xiev->v.xi_obj, XIC_BACK, FOCUS_BACK_COLOR);
|
xi_set_color(xiev->v.xi_obj, XIC_BACK, FOCUS_BACK_COLOR);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -528,18 +531,18 @@ break;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIE_OFF_CELL:
|
case XIE_OFF_CELL:
|
||||||
if (edit_field && check_enabled)
|
if (_edit_field && _check_enabled)
|
||||||
{
|
{
|
||||||
TMask_field* c = edit_field; // Save field, it could turn out to be NULL on error
|
TMask_field* c = _edit_field; // Save field, it could turn out to be NULL on error
|
||||||
const TString80 old(c->get()); // Save old value on mask
|
const TString80 old(c->get()); // Save old value on mask
|
||||||
const TString80 nuo(c->picture_data(xi_get_text(xiev->v.xi_obj, NULL, -1), TRUE));
|
const TString80 nuo(c->picture_data(xi_get_text(xiev->v.xi_obj, NULL, -1), TRUE));
|
||||||
if (old != nuo)
|
if (old != nuo)
|
||||||
{
|
{
|
||||||
check_enabled = FALSE;
|
_check_enabled = FALSE;
|
||||||
if (!row_dirty)
|
if (!_row_dirty)
|
||||||
{
|
{
|
||||||
notify(cur_row, K_SPACE);
|
notify(_cur_row, K_SPACE);
|
||||||
row_dirty = TRUE;
|
_row_dirty = TRUE;
|
||||||
}
|
}
|
||||||
c->set(nuo); // Set new mask value
|
c->set(nuo); // Set new mask value
|
||||||
c->set_dirty(); // Get it dirty!
|
c->set_dirty(); // Get it dirty!
|
||||||
@ -550,10 +553,10 @@ break;
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mask2str(cur_row); // Update sheet row
|
mask2str(_cur_row); // Update sheet row
|
||||||
edit_field = NULL; // Reset current field
|
_edit_field = NULL; // Reset current field
|
||||||
}
|
}
|
||||||
check_enabled = TRUE;
|
_check_enabled = TRUE;
|
||||||
}
|
}
|
||||||
if (!xiev->refused)
|
if (!xiev->refused)
|
||||||
xi_set_color(xiev->v.xi_obj, XIC_BACK, NORMAL_BACK_COLOR);
|
xi_set_color(xiev->v.xi_obj, XIC_BACK, NORMAL_BACK_COLOR);
|
||||||
@ -580,35 +583,38 @@ break;
|
|||||||
XI_OBJ* itf = xi_get_itf(win());
|
XI_OBJ* itf = xi_get_itf(win());
|
||||||
const bool ok = (bool)xi_move_focus(itf);
|
const bool ok = (bool)xi_move_focus(itf);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
|
{
|
||||||
|
set_dirty(2);
|
||||||
xiev->refused = TRUE;
|
xiev->refused = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case E_CHAR:
|
case E_CHAR:
|
||||||
if (edit_field)
|
if (_edit_field)
|
||||||
{
|
{
|
||||||
const KEY k = e_char_to_key(ep);
|
const KEY k = e_char_to_key(ep);
|
||||||
switch(k)
|
switch(k)
|
||||||
{
|
{
|
||||||
case K_F1:
|
case K_F1:
|
||||||
check_enabled = FALSE; // Disable checks
|
_check_enabled = FALSE; // Disable checks
|
||||||
edit_field->on_key(K_F1);
|
_edit_field->on_key(K_F1);
|
||||||
set_focus_cell(cur_row, cur_col);
|
set_focus_cell(_cur_row, _cur_col);
|
||||||
check_enabled = TRUE; // Enable checks
|
_check_enabled = TRUE; // Enable checks
|
||||||
break;
|
break;
|
||||||
case K_F2:
|
case K_F2:
|
||||||
case K_F3:
|
case K_F3:
|
||||||
case K_F8:
|
case K_F8:
|
||||||
case K_F9:
|
case K_F9:
|
||||||
{
|
{
|
||||||
check_enabled = FALSE; // Disable checks
|
_check_enabled = FALSE; // Disable checks
|
||||||
if (!row_dirty) notify(cur_row, K_SPACE);
|
if (!_row_dirty) notify(_cur_row, K_SPACE);
|
||||||
if (edit_field->on_key(k))
|
if (_edit_field->on_key(k))
|
||||||
{
|
{
|
||||||
mask2str(cur_row);
|
mask2str(_cur_row);
|
||||||
row_dirty = TRUE;
|
_row_dirty = TRUE;
|
||||||
}
|
}
|
||||||
set_focus_cell(cur_row, cur_col);
|
set_focus_cell(_cur_row, _cur_col);
|
||||||
check_enabled = TRUE; // Enable checks
|
_check_enabled = TRUE; // Enable checks
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case K_PREV:
|
case K_PREV:
|
||||||
|
@ -1 +1 @@
|
|||||||
#define VERSION 1.8
|
#define VERSION 1.9
|
||||||
|
@ -76,13 +76,12 @@ TSheet::TSheet(short x, short y, short dx, short dy,
|
|||||||
|
|
||||||
void TSheet::add_button(short id, const char* caption, KEY key)
|
void TSheet::add_button(short id, const char* caption, KEY key)
|
||||||
{
|
{
|
||||||
const int BUT_HEIGHT =
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
2
|
const int BUT_HEIGHT = 2;
|
||||||
#else
|
#else
|
||||||
1
|
const int BUT_HEIGHT = 1;
|
||||||
#endif
|
#endif
|
||||||
;
|
|
||||||
WINDOW b = xvt_create_control(WC_PUSHBUTTON, 0, 0, 11, BUT_HEIGHT, caption, win(), 0, 0, id);
|
WINDOW b = xvt_create_control(WC_PUSHBUTTON, 0, 0, 11, BUT_HEIGHT, caption, win(), 0, 0, id);
|
||||||
for (int i = 0; i < MAX_BUT; i++)
|
for (int i = 0; i < MAX_BUT; i++)
|
||||||
if (_button[i] == NULL_WIN)
|
if (_button[i] == NULL_WIN)
|
||||||
@ -611,21 +610,25 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields,
|
|||||||
{
|
{
|
||||||
xvt_create_control(WC_EDIT, 1, -3, f->size()+1, 1, f->get(), win(),
|
xvt_create_control(WC_EDIT, 1, -3, f->size()+1, 1, f->get(), win(),
|
||||||
CTL_FLAG_DISABLED, 0L, 100);
|
CTL_FLAG_DISABLED, 0L, 100);
|
||||||
if (s)
|
|
||||||
{
|
|
||||||
WINDOW listbox = xvt_create_control(WC_LISTBUTTON, f->size()+3, -3, 18, 3,
|
|
||||||
"", win(), 0, 0L, 99);
|
|
||||||
|
|
||||||
|
if (s && s->items() > 2)
|
||||||
|
{
|
||||||
|
int maxlen = 0;
|
||||||
SLIST lst = slist_new();
|
SLIST lst = slist_new();
|
||||||
for (const char* item = s->get(0); item; item = s->get())
|
for (const char* item = s->get(0); item; item = s->get())
|
||||||
{
|
{
|
||||||
item = s->get();
|
item = s->get();
|
||||||
|
const int len = strlen(item);
|
||||||
|
if (len > maxlen) maxlen = len;
|
||||||
slist_add(lst, (SLIST_ELT)NULL, (char*)item, 0L);
|
slist_add(lst, (SLIST_ELT)NULL, (char*)item, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WINDOW listbox = xvt_create_control(WC_LISTBUTTON, f->size()+3, -3, maxlen+3, 3,
|
||||||
|
"", win(), 0, 0L, 99);
|
||||||
win_list_add(listbox, -1, (char*)lst);
|
win_list_add(listbox, -1, (char*)lst);
|
||||||
slist_dispose(lst);
|
slist_dispose(lst);
|
||||||
|
|
||||||
TString id(3); id << f->dlg();
|
TString16 id; id << f->dlg();
|
||||||
const int sel = s->get_pos(id) >> 1;
|
const int sel = s->get_pos(id) >> 1;
|
||||||
win_list_set_sel(listbox, sel, TRUE);
|
win_list_set_sel(listbox, sel, TRUE);
|
||||||
}
|
}
|
||||||
@ -649,7 +652,7 @@ void TBrowse_sheet::repos_buttons() const
|
|||||||
if (w != NULL_WIN)
|
if (w != NULL_WIN)
|
||||||
{
|
{
|
||||||
RCT r; get_client_rect(w, &r);
|
RCT r; get_client_rect(w, &r);
|
||||||
r.left = CHARX*(id == 99 ? 1 : 21);
|
r.left = CHARX*(id == 99 ? _field->size()+3 : 1);
|
||||||
r.top = wr.bottom - 4*CHARY + 4;
|
r.top = wr.bottom - 4*CHARY + 4;
|
||||||
r.right += r.left;
|
r.right += r.left;
|
||||||
r.bottom += r.top;
|
r.bottom += r.top;
|
||||||
@ -673,7 +676,12 @@ bool TBrowse_sheet::on_key(KEY k)
|
|||||||
const TString old(_field->get());
|
const TString old(_field->get());
|
||||||
|
|
||||||
TString val(old.size()+1); val = old;
|
TString val(old.size()+1); val = old;
|
||||||
if (alnum) val << char(k);
|
if (alnum)
|
||||||
|
{
|
||||||
|
if (val.len() > field().size())
|
||||||
|
val.cut(0);
|
||||||
|
val << char(k);
|
||||||
|
}
|
||||||
else val.rtrim(1);
|
else val.rtrim(1);
|
||||||
field().set(val);
|
field().set(val);
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ END
|
|||||||
|
|
||||||
BUTTON DLG_FINDREC 8 2
|
BUTTON DLG_FINDREC 8 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -46 -1 "Ricerca"
|
PROMPT -46 -1 "Ri~cerca"
|
||||||
MESSAGE EXIT,K_F9
|
MESSAGE EXIT,K_F9
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ HIDDEN bool _expr_val(TEdit_field& f, KEY)
|
|||||||
const char* s = e.varname(i);
|
const char* s = e.varname(i);
|
||||||
if (s[0] != '#')
|
if (s[0] != '#')
|
||||||
{
|
{
|
||||||
TString err(64); err << "Cannot load variable " << s << " in " << e;
|
TString80 err; err << "Cannot load variable " << s << " in " << e;
|
||||||
return f.error_box((const char*)err);
|
return f.error_box((const char*)err);
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
@ -100,7 +100,7 @@ bool pi_check(const char * st, const char * paiva)
|
|||||||
// Controlla la partita iva se e' non vuota ed italiana
|
// Controlla la partita iva se e' non vuota ed italiana
|
||||||
HIDDEN bool _pi_val(TEdit_field& f, KEY)
|
HIDDEN bool _pi_val(TEdit_field& f, KEY)
|
||||||
{
|
{
|
||||||
TString stato(f.mask().get(atoi(get_val_param(0)))), pi(f.get());
|
TString16 stato(f.mask().get(atoi(get_val_param(0)))), pi(f.get());
|
||||||
|
|
||||||
if (stato.not_empty() && stato != "IT") return TRUE;
|
if (stato.not_empty() && stato != "IT") return TRUE;
|
||||||
if (pi.empty()) return TRUE;
|
if (pi.empty()) return TRUE;
|
||||||
@ -220,10 +220,10 @@ HIDDEN bool _xt_pi_val(TEdit_field& f, KEY key)
|
|||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
if (m.query_mode()) return TRUE;
|
if (m.query_mode()) return TRUE;
|
||||||
|
|
||||||
TString value(f.get());
|
TString16 value(f.get());
|
||||||
if (value.empty()) return f.error_box("Partita IVA obbligatoria");
|
if (value.empty()) return f.error_box("Partita IVA obbligatoria");
|
||||||
|
|
||||||
const TString stato(m.get(atoi(get_val_param(0))));
|
const TString16 stato(m.get(atoi(get_val_param(0))));
|
||||||
if (stato.not_empty() && stato != "IT") return TRUE;
|
if (stato.not_empty() && stato != "IT") return TRUE;
|
||||||
|
|
||||||
if (!_pi_val(f, key)) return FALSE;
|
if (!_pi_val(f, key)) return FALSE;
|
||||||
@ -237,7 +237,7 @@ HIDDEN bool _xt_pi_val(TEdit_field& f, KEY key)
|
|||||||
const int comune = atoi(get_val_param(i));
|
const int comune = atoi(get_val_param(i));
|
||||||
if (comune)
|
if (comune)
|
||||||
{
|
{
|
||||||
const TString com(m.get(comune)); // Comune residenza fiscale e residenza
|
const TString16 com(m.get(comune)); // Comune residenza fiscale e residenza
|
||||||
if (com.not_empty())
|
if (com.not_empty())
|
||||||
{
|
{
|
||||||
c.zero();
|
c.zero();
|
||||||
@ -269,7 +269,7 @@ HIDDEN bool _xtz_pi_val(TEdit_field& f, KEY key)
|
|||||||
|
|
||||||
{
|
{
|
||||||
if (f.mask().query_mode()) return TRUE;
|
if (f.mask().query_mode()) return TRUE;
|
||||||
TString pi(f.get());
|
TString16 pi(f.get());
|
||||||
if (pi.empty()) return TRUE;
|
if (pi.empty()) return TRUE;
|
||||||
return _xt_pi_val(f, key);
|
return _xt_pi_val(f, key);
|
||||||
}
|
}
|
||||||
@ -280,7 +280,7 @@ HIDDEN bool _xt_cf_val(TEdit_field& f, KEY key)
|
|||||||
{
|
{
|
||||||
if (f.mask().query_mode()) return TRUE;
|
if (f.mask().query_mode()) return TRUE;
|
||||||
|
|
||||||
const TString cf(f.get());
|
const TString16 cf(f.get());
|
||||||
if (cf.empty()) return f.error_box("Codice fiscale obbligatorio");
|
if (cf.empty()) return f.error_box("Codice fiscale obbligatorio");
|
||||||
|
|
||||||
if (!_cf_val(f, key)) return FALSE;
|
if (!_cf_val(f, key)) return FALSE;
|
||||||
@ -288,7 +288,7 @@ HIDDEN bool _xt_cf_val(TEdit_field& f, KEY key)
|
|||||||
if (cf.len() == 11)
|
if (cf.len() == 11)
|
||||||
{
|
{
|
||||||
if (!_xt_pi_val(f, key)) return FALSE;
|
if (!_xt_pi_val(f, key)) return FALSE;
|
||||||
TString stato(f.mask().get(atoi(get_val_param(0))));
|
TString16 stato(f.mask().get(atoi(get_val_param(0))));
|
||||||
if ((stato.not_empty()) && (stato != "IT")) return TRUE;
|
if ((stato.not_empty()) && (stato != "IT")) return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,10 +302,10 @@ HIDDEN bool _xt_cf_val(TEdit_field& f, KEY key)
|
|||||||
TMask_field& fld_com = m.field(atoi(get_val_param(3)));
|
TMask_field& fld_com = m.field(atoi(get_val_param(3)));
|
||||||
|
|
||||||
char sesso = fld_sex.get()[0];
|
char sesso = fld_sex.get()[0];
|
||||||
TString data(fld_dat.get());
|
TString16 data(fld_dat.get());
|
||||||
TString com(fld_com.get());
|
TString16 com(fld_com.get());
|
||||||
|
|
||||||
TString wm("LMNPQRSTUV");
|
TString16 wm("LMNPQRSTUV");
|
||||||
int p;
|
int p;
|
||||||
if ((p = wm.find(cf[6])) != -1) cf[6] = '0' + p;
|
if ((p = wm.find(cf[6])) != -1) cf[6] = '0' + p;
|
||||||
if ((p = wm.find(cf[7])) != -1) cf[7] = '0' + p;
|
if ((p = wm.find(cf[7])) != -1) cf[7] = '0' + p;
|
||||||
@ -494,7 +494,7 @@ HIDDEN bool _numcalc_val(TEdit_field& f, KEY k)
|
|||||||
const char* s = e.varname(i);
|
const char* s = e.varname(i);
|
||||||
if (s[0] != '#')
|
if (s[0] != '#')
|
||||||
{
|
{
|
||||||
TString err(64); err << "Cannot load variable " << s << " in " << e;
|
TString80 err; err << "Cannot load variable " << s << " in " << e;
|
||||||
return f.error_box((const char*)err);
|
return f.error_box((const char*)err);
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
@ -517,7 +517,7 @@ HIDDEN bool _strcalc_val(TEdit_field& f, KEY k)
|
|||||||
const char* s = e.varname(i);
|
const char* s = e.varname(i);
|
||||||
if (s[0] != '#')
|
if (s[0] != '#')
|
||||||
{
|
{
|
||||||
TString err(64); err << "Cannot load variable " << s << " in " << e;
|
TString80 err; err << "Cannot load variable " << s << " in " << e;
|
||||||
return f.error_box((const char*)err);
|
return f.error_box((const char*)err);
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
|
@ -53,7 +53,7 @@ void TWindow_manager::destroy()
|
|||||||
while (_current >= 0)
|
while (_current >= 0)
|
||||||
{
|
{
|
||||||
TWindow* w = cur_win();
|
TWindow* w = cur_win();
|
||||||
w->stop_run(K_QUIT);
|
w->stop_run(K_FORCE_CLOSE);
|
||||||
w->close_modal();
|
w->close_modal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -750,8 +750,17 @@ void xvt_statbar_refresh()
|
|||||||
HIDDEN bool test_menu_tag(MENU_ITEM* mi, MENU_TAG tag)
|
HIDDEN bool test_menu_tag(MENU_ITEM* mi, MENU_TAG tag)
|
||||||
{
|
{
|
||||||
CHECK(mi, "Can't test NULL MENU_ITEM");
|
CHECK(mi, "Can't test NULL MENU_ITEM");
|
||||||
if (mi->tag == tag) return TRUE;
|
|
||||||
if (mi->child != NULL) return test_menu_tag(mi->child, tag);
|
while (mi->tag)
|
||||||
|
{
|
||||||
|
if (mi->tag == tag) return TRUE;
|
||||||
|
if (mi->child != NULL)
|
||||||
|
{
|
||||||
|
const bool ok = test_menu_tag(mi->child, tag);
|
||||||
|
if (ok) return TRUE;
|
||||||
|
}
|
||||||
|
mi++;
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user