Pulizia stampe (cg1 - fase 1).

git-svn-id: svn://10.65.10.50/trunk@51 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-08-23 12:53:59 +00:00
parent ec0c54497d
commit 5f96e2e4ea
7 changed files with 7833 additions and 7967 deletions

View File

@ -9,14 +9,22 @@ int main(int argc,char** argv)
const int n = (argc > 1) ? atoi(argv[1]+1) : -1; const int n = (argc > 1) ? atoi(argv[1]+1) : -1;
switch(n) switch(n)
{ {
case 0: cg1100(argc,argv); break; case 0:
case 1: cg1200(argc,argv); break; cg1100(argc,argv); break;
case 2: cg1300(argc,argv); break; case 1:
case 3: cg1400(argc,argv); break; cg1200(argc,argv); break;
case 4: cg1500(argc,argv); break; case 2:
// case 5: cg1600(argc,argv); break; cg1300(argc,argv); break;
case 6: cg1700(argc,argv); break; case 3:
default: error_box(usage, argv[0]); break; cg1400(argc,argv); break;
case 4:
cg1500(argc,argv); break;
case 5:
cg1600(argc,argv); break;
case 6:
cg1700(argc,argv); break;
default:
error_box(usage, argv[0]); break;
} }
return n < 0; return n < 0;

View File

@ -21,7 +21,7 @@ int cg1200(int argc, char* argv[]);
int cg1300(int argc, char* argv[]); int cg1300(int argc, char* argv[]);
int cg1400(int argc, char* argv[]); int cg1400(int argc, char* argv[]);
int cg1500(int argc, char* argv[]); int cg1500(int argc, char* argv[]);
//int cg1600(int argc, char* argv[]); int cg1600(int argc, char* argv[]);
int cg1700(int argc, char* argv[]); int cg1700(int argc, char* argv[]);
#endif // __CG1_H #endif // __CG1_H

View File

@ -3,14 +3,16 @@
#include <mask.h> #include <mask.h>
#include <printapp.h> #include <printapp.h>
#include <scanner.h> // #include <scanner.h>
#include <relation.h> #include <relation.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
#include <lffiles.h>
#include <sort.h> #include <sort.h>
#include <pconti.h> #include <mailbox.h>
#include <execp.h>
#include <lffiles.h>
#include <pconti.h>
#include "cg1.h" #include "cg1.h"
#include "cg1100.h" #include "cg1100.h"
@ -63,31 +65,35 @@ public:
void set_senza_ana (); void set_senza_ana ();
const char * decodifica_codanabil (const char * ); const char * decodifica_codanabil (const char * );
const char * decodifica_IV_sez (const char * ); // const char * decodifica_IV_sez (const char * );
const char * decodifica_IV_dir (const char * , const char * , const char * , int); const char * decodifica_IV_dir (const char * sezivd,
const char * lettivd = "",
const char * numrivd = "",
int numivd = 0);
void process_link(int id, const char* txt);
CG1100_application() : _tab (TAB_IVD), _tab_anabil (TAB_ANABIL) {} CG1100_application() : _tab (TAB_IVD), _tab_anabil (TAB_ANABIL) {}
}; };
void CG1100_application::process_link(int id, const char* txt)
{
TString ss = "1|"; ss << txt;
TMessage fs(cmd2name("cg0","0"), MSG_LN, ss);
TMailbox m;
m.send(fs);
TExternal_app cg0("cg -0");
if (cg0.run()) beep();
}
print_action CG1100_application::postprocess_page(int file,int counter) print_action CG1100_application::postprocess_page(int file,int counter)
{ {
switch (_tipo_stampa) switch (_tipo_stampa)
{ {
case completa: case completa:
break;
case con_IV_direttiva:
const char * buf;
if ( (buf = _sort->retrieve()) != NULL)
{
(*_rec) = buf;
return REPEAT_PAGE;
}
break;
case senza_IV_direttiva: case senza_IV_direttiva:
case senza_ana_bil:
break; break;
case con_IV_direttiva:
case con_ana_bil: case con_ana_bil:
{ {
const char * buf; const char * buf;
@ -98,10 +104,6 @@ print_action CG1100_application::postprocess_page(int file,int counter)
} }
break; break;
} }
case senza_ana_bil:
break;
default: default:
break; break;
@ -117,12 +119,11 @@ void CG1100_application::set_page(int file,int counter)
set_completa(); set_completa();
break; break;
case con_IV_direttiva: case con_IV_direttiva:
case con_ana_bil:
break; break;
case senza_IV_direttiva: case senza_IV_direttiva:
set_senza_IV(); set_senza_IV();
break; break;
case con_ana_bil:
break;
case senza_ana_bil: case senza_ana_bil:
set_senza_ana (); set_senza_ana ();
break; break;
@ -222,13 +223,6 @@ bool CG1100_application::preprocess_print (int file,int counter)
switch (_tipo_stampa) switch (_tipo_stampa)
{ {
case con_IV_direttiva: case con_IV_direttiva:
if ((buf = _sort->retrieve()) != NULL)
{
(*_rec) = buf;
return TRUE;
}
else
return FALSE;
case con_ana_bil: case con_ana_bil:
if ((buf = _sort->retrieve()) != NULL) if ((buf = _sort->retrieve()) != NULL)
{ {
@ -265,7 +259,7 @@ void CG1100_application::set_con_IV()
c3 = _rec->get(PCN_NUMRIVD); c3 = _rec->get(PCN_NUMRIVD);
c4 = _rec->get_int(PCN_NUMIVD); c4 = _rec->get_int(PCN_NUMIVD);
descr_IV_sez = decodifica_IV_sez (c1); descr_IV_sez = decodifica_IV_dir (c1);
descr_IV_dir = decodifica_IV_dir (c1, c2, c3, c4); descr_IV_dir = decodifica_IV_dir (c1, c2, c3, c4);
o1 = _rec->get (PCN_SEZIVDOPP); o1 = _rec->get (PCN_SEZIVDOPP);
@ -290,9 +284,9 @@ void CG1100_application::set_con_IV()
set_row (2, "@18g%40s", (const char *) descr_IV_dir); set_row (2, "@18g%40s", (const char *) descr_IV_dir);
set_row (2, "@60g%03d.", (const char *) g); set_row (2, "@60g$[r]%03d$[n].", (const char *) g);
set_row (2, "@64g%03d.", (const char *) c); set_row (2, "@64g$[r]%03d$[n].", (const char *) c);
set_row (2, "@68g%06d", (const char *) s); set_row (2, "@68g$[r]%06d$[n]", (const char *) s);
set_row (2, "@78g%2d", (const char *) c4); set_row (2, "@78g%2d", (const char *) c4);
@ -304,9 +298,9 @@ void CG1100_application::set_senza_IV()
reset_row (1); reset_row (1);
set_row (1, "@1g@pn", FLD(lnum,PCN_GRUPPO, "@@@.") ); set_row (1, "@1g$[r]@pn$[n]", FLD(lnum,PCN_GRUPPO, "@@@.") );
set_row (1, "@5g@pn", FLD(lnum,PCN_CONTO, "@@@.") ); set_row (1, "@5g$[r]@pn$[n]", FLD(lnum,PCN_CONTO, "@@@.") );
set_row (1, "@9g@pn", FLD(lnum, PCN_SOTTOCONTO, "@@@@@@") ); set_row (1, "@9g$[r]@pn$[n]", FLD(lnum, PCN_SOTTOCONTO, "@@@@@@") );
set_row (1, "@16g@50s", FLD(lnum,PCN_DESCR) ); set_row (1, "@16g@50s", FLD(lnum,PCN_DESCR) );
@ -352,12 +346,11 @@ void CG1100_application::set_con_ana()
CodTabAnabil = _rec->get(PCN_CODCBL); CodTabAnabil = _rec->get(PCN_CODCBL);
set_row (1, "%-10s", (const char *)CodTabAnabil); set_row (1, "%-10s", (const char *)CodTabAnabil);
// DescrCodTabAnabil = decodifica_codanabil(CodTabAnabil);
set_row (1, "@15g%-10s", (const char *)DescrCodTabAnabil); set_row (1, "@15g%-10s", (const char *)DescrCodTabAnabil);
set_row (1, "@61g%03d.", g ); set_row (1, "@61g$[r]%03d$[n].", g );
set_row (1, "%03d.", c ); set_row (1, "$[r]%03d$[n].", c );
set_row (1, "%06ld", s ); set_row (1, "$[r]%06ld$[n]", s );
int r=1; int r=1;
while ((d = desc_conto.get()) != NULL) while ((d = desc_conto.get()) != NULL)
@ -374,9 +367,9 @@ void CG1100_application::set_senza_ana()
reset_row (1); reset_row (1);
set_row (1, "@1g@pn", FLD(lnum,PCN_GRUPPO, "@@@.") ); set_row (1, "@1g$[r]@pn$[n]", FLD(lnum,PCN_GRUPPO, "@@@.") );
set_row (1, "@5g@pn", FLD(lnum,PCN_CONTO, "@@@.") ); set_row (1, "@5$[r]g@pn$[n]", FLD(lnum,PCN_CONTO, "@@@.") );
set_row (1, "@9g@pn", FLD(lnum, PCN_SOTTOCONTO, "@@@@@@") ); set_row (1, "@9$[r]g@pn$[n]", FLD(lnum, PCN_SOTTOCONTO, "@@@@@@") );
set_row (1, "@16g@50s", FLD(lnum,PCN_DESCR) ); set_row (1, "@16g@50s", FLD(lnum,PCN_DESCR) );
@ -391,7 +384,6 @@ void CG1100_application::set_senza_ana()
set_row (1, "@107g@f", FLD(lnum, PCN_COMPENS) ); set_row (1, "@107g@f", FLD(lnum, PCN_COMPENS) );
set_row (1, "@114g@1n", FLD(lnum, PCN_TIPOSPRIC) ); set_row (1, "@114g@1n", FLD(lnum, PCN_TIPOSPRIC) );
set_row (1, "@120g@1s", FLD(lnum, PCN_SEZSALDI) ); set_row (1, "@120g@1s", FLD(lnum, PCN_SEZSALDI) );
// set_row (1, "@118g@f", FLD(lnum, PCN_STSOTTAB));
} }
@ -401,9 +393,9 @@ void CG1100_application::set_completa()
reset_row (1); reset_row (1);
set_row (1, "@1g@pn", FLD(lnum,PCN_GRUPPO, "@@@.") ); set_row (1, "@1g$[r]@pn$[n]", FLD(lnum,PCN_GRUPPO, "@@@.") );
set_row (1, "@5g@pn", FLD(lnum,PCN_CONTO, "@@@.") ); set_row (1, "@5g$[r]@pn$[n]", FLD(lnum,PCN_CONTO, "@@@.") );
set_row (1, "@9g@pn", FLD(lnum, PCN_SOTTOCONTO, "@@@@@@") ); set_row (1, "@9g$[r]@pn", FLD(lnum, PCN_SOTTOCONTO, "@@@@@@") );
set_row (1, "@16g@50s", FLD(lnum,PCN_DESCR) ); set_row (1, "@16g@50s", FLD(lnum,PCN_DESCR) );
@ -418,7 +410,6 @@ void CG1100_application::set_completa()
set_row (1, "@107g@f", FLD(lnum, PCN_COMPENS) ); set_row (1, "@107g@f", FLD(lnum, PCN_COMPENS) );
set_row (1, "@114g@1n", FLD(lnum, PCN_TIPOSPRIC) ); set_row (1, "@114g@1n", FLD(lnum, PCN_TIPOSPRIC) );
set_row (1, "@120g@1s", FLD(lnum, PCN_SEZSALDI) ); set_row (1, "@120g@1s", FLD(lnum, PCN_SEZSALDI) );
// set_row (1, "@118g@f", FLD(lnum, PCN_STSOTTAB));
} }
bool CG1100_application::elabora_riga() bool CG1100_application::elabora_riga()
@ -426,62 +417,46 @@ bool CG1100_application::elabora_riga()
static int old_gruppo = 0; static int old_gruppo = 0;
int new_gruppo = 0, new_conto = 0; int new_gruppo = 0, new_conto = 0;
long new_sottoc = 0l; long new_sottoc = 0l;
TRectype& curr_rec = *_rec;
switch (_tipo_stampa) switch (_tipo_stampa)
{ {
case completa: case completa:
case senza_ana_bil: case senza_ana_bil:
case senza_IV_direttiva: case senza_IV_direttiva:
{ curr_rec = current_cursor()->curr(LF_PCON); break;
TRectype curr_rec = current_cursor()->curr(LF_PCON); case con_ana_bil:
case con_IV_direttiva:
curr_rec = *_rec; break;
default:
break;
}
new_gruppo = curr_rec.get_int(PCN_GRUPPO); new_gruppo = curr_rec.get_int(PCN_GRUPPO);
new_conto = curr_rec.get_int(PCN_CONTO); new_conto = curr_rec.get_int(PCN_CONTO);
new_sottoc = curr_rec.get_long(PCN_SOTTOCONTO); new_sottoc = curr_rec.get_long(PCN_SOTTOCONTO);
if (new_gruppo != 0 && new_conto != 0)
{
// se e' un sottoconto stampo sotttab in 127 // se e' un sottoconto stampo sotttab in 127
if ((new_gruppo != 0) && (new_conto != 0) && (new_sottoc != 0)) if (new_sottoc != 0)
{ {
set_row (1, "@127g@f", FLD(LF_PCON, PCN_STSOTTAB)); set_row (1, "@127g@f", FLD(LF_PCON, PCN_STSOTTAB));
set_row (1, "@124g "); set_row (1, "@124g ");
} }
else else
// se e' un conto stampo sotttab in 124 // se e' un conto stampo sotttab in 124
if ((new_gruppo != 0) && (new_conto != 0) && (new_sottoc == 0))
{ {
set_row (1, "@124g@f", FLD(LF_PCON, PCN_STSOTTAB)); set_row (1, "@124g@f", FLD(LF_PCON, PCN_STSOTTAB));
set_row (1, "@127g "); set_row (1, "@127g ");
} }
break;
} }
case con_ana_bil:
case con_IV_direttiva:
new_gruppo = _rec->get_int(PCN_GRUPPO);
new_conto = _rec->get_int(PCN_CONTO);
new_sottoc = _rec->get_long(PCN_SOTTOCONTO);
// se e' un sottoconto stampo sotttab in 127
if ((new_gruppo != 0) && (new_conto != 0) && (new_sottoc != 0))
{
set_row (1, "@127g%c", (char)_rec->get_bool(PCN_STSOTTAB));
set_row (1, "@124g ");
}
else
// se e' un conto stampo sotttab in 124
if ((new_gruppo != 0) && (new_conto != 0) && (new_sottoc == 0))
{
set_row (1, "@124g%c", (char)_rec->get_bool(PCN_STSOTTAB));
set_row (1, "@127g ");
}
break;
default:
break;
}
// Gestione salto pagina // Gestione salto pagina
if (old_gruppo == 0) old_gruppo = new_gruppo;
if (new_gruppo != old_gruppo) if (_salto_pag && new_gruppo != old_gruppo)
{ {
const bool salta = old_gruppo > 0;
old_gruppo = new_gruppo; old_gruppo = new_gruppo;
if (_salto_pag) return TRUE; return salta;
} }
return FALSE; return FALSE;
} }
@ -490,9 +465,6 @@ bool CG1100_application::preprocess_page(int file,int counter)
{ {
if (elabora_riga()) if (elabora_riga())
printer().formfeed(); printer().formfeed();
// set_auto_ff(TRUE);
// else
// set_auto_ff(FALSE);
if (_tipo_stampa == con_IV_direttiva) set_con_IV(); if (_tipo_stampa == con_IV_direttiva) set_con_IV();
if (_tipo_stampa == con_ana_bil) set_con_ana(); if (_tipo_stampa == con_ana_bil) set_con_ana();
@ -512,6 +484,7 @@ bool CG1100_application::set_print(int)
intesta (_tipo_stampa); intesta (_tipo_stampa);
scegli_cur(); scegli_cur();
enable_link("Collegamento Piano dei conti : ", 'r');
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
@ -519,13 +492,11 @@ bool CG1100_application::set_print(int)
void CG1100_application::intesta (stampe tipo) void CG1100_application::intesta (stampe tipo)
{ {
int soh; // riga d'inizio dell'intestazione int soh = 1; // riga d'inizio dell'intestazione
TString sep(132); TString sep(132);
reset_header (); reset_header ();
soh=1;
sep << "Ditta : " << get_firm(); sep << "Ditta : " << get_firm();
sep.left_just(132); sep.left_just(132);
@ -587,7 +558,10 @@ const char * CG1100_application::decodifica_IV_dir (const char * sezivd, const c
TString dep (CODTABLEN); TString dep (CODTABLEN);
_tab.curr().zero(); _tab.curr().zero();
dep << format ("%1s%1s%8s%02d", sezivd, lettivd, numrivd, numivd); if (numrivd != 0)
dep.format("%1s%1s%8s%02d", sezivd, lettivd, numrivd, numivd);
else
dep.format("%1s%1s%8s", sezivd, lettivd, numrivd);
_tab.curr().put("CODTAB", (const char*)dep); _tab.curr().put("CODTAB", (const char*)dep);
_tab.read(); _tab.read();
@ -607,20 +581,20 @@ const char * CG1100_application::decodifica_codanabil (const char * codpcab)
return _tab_anabil.curr().get ("S0"); return _tab_anabil.curr().get ("S0");
} }
const char * CG1100_application::decodifica_IV_sez (const char * sezivd) //const char * CG1100_application::decodifica_IV_sez (const char * sezivd)
{ //{
TString dep (CODTABLEN); // TString dep (CODTABLEN);
TString dep2(CODTABLEN); // TString dep2(CODTABLEN);
_tab.zero(); // _tab.zero();
dep << format ("%1s", sezivd); // dep << format ("%1s", sezivd);
_tab.put("CODTAB", dep); // _tab.put("CODTAB", dep);
_tab.read(); // _tab.read();
dep2 = _tab.get("CODTAB"); // dep2 = _tab.get("CODTAB");
if (dep != dep2) // if (dep != dep2)
_tab.zero(); // _tab.zero();
return _tab.get ("S0"); // return _tab.get ("S0");
} //}
void CG1100_application::user_create() void CG1100_application::user_create()
{ {

View File

@ -2,7 +2,12 @@
#include <mask.h> #include <mask.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
#include <mailbox.h>
#include <execp.h>
#include <clifo.h>
#include <saldi.h>
#include <comuni.h>
#include "cg1200a.h" #include "cg1200a.h"
#include "cg1200b.h" #include "cg1200b.h"
@ -55,6 +60,7 @@ public:
void set_elenco(); void set_elenco();
void set_rubriche(); void set_rubriche();
void set_etichette(); void set_etichette();
void process_link(int id, const char* txt);
CG1200_App() : TPrintapp(), _piva(30), _telefono(50), CG1200_App() : TPrintapp(), _piva(30), _telefono(50),
_name(60) _name(60)
@ -62,6 +68,7 @@ public:
_rel = NULL; _pr_type = undefined; _startrow = 2; _startcol = 3; _rel = NULL; _pr_type = undefined; _startrow = 2; _startcol = 3;
_rows_et = 9; _cols_et = 40; _rows_et = 9; _cols_et = 40;
} }
}; };
@ -70,6 +77,27 @@ public:
/* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */
void CG1200_App::process_link(int id, const char* txt)
{
TString ss = "1|";
switch (_pr_what)
{
case clienti :
ss << "C|"; break;
case fornitori :
ss << "F|"; break;
case both :
default :
break;
}
ss << txt;
TMessage fs(cmd2name("cg0","1"), MSG_LN, ss);
TMailbox m;
m.send(fs);
TExternal_app cg0("cg -1");
if (cg0.run()) beep();
}
TRectype& CG1200_App::look_com(TString& cod) TRectype& CG1200_App::look_com(TString& cod)
{ {
_comuni->curr().zero(); _comuni->curr().zero();
@ -97,27 +125,27 @@ bool CG1200_App::preprocess_page(int counter)
{ {
// se non movimentato // se non movimentato
_saldi->curr().zero(); _saldi->curr().zero();
_saldi->curr().put("GRUPPO",get_field(LF_CLIFO,"GRUPPO")); _saldi->curr().put(SLD_GRUPPO,get_field(LF_CLIFO,CLI_GRUPPO));
_saldi->curr().put("CONTO",get_field(LF_CLIFO,"CONTO")); _saldi->curr().put(SLD_CONTO,get_field(LF_CLIFO, CLI_CONTO));
_saldi->curr().put("SOTTOCONTO",get_field(LF_CLIFO,"CODCF")); _saldi->curr().put(SLD_SOTTOCONTO,get_field(LF_CLIFO,CLI_CODCF));
_saldi->read(); _saldi->read();
if (_saldi->curr().get("GRUPPO") == get_field(LF_CLIFO,"GRUPPO") && if (_saldi->curr().get(SLD_GRUPPO) == get_field(LF_CLIFO, CLI_GRUPPO) &&
_saldi->curr().get("CONTO") == get_field(LF_CLIFO,"CONTO") && _saldi->curr().get(SLD_CONTO) == get_field(LF_CLIFO,CLI_CONTO) &&
_saldi->curr().get("SOTTOCONTO") == get_field(LF_CLIFO,"CODCF")) _saldi->curr().get(SLD_SOTTOCONTO) == get_field(LF_CLIFO,CLI_CODCF))
// OSTIA! e' MOVIMENTATO! // OSTIA! e' MOVIMENTATO!
return FALSE; return FALSE;
} }
// set variable fields // set variable fields
_piva = get_field(LF_CLIFO,"COFI"); _piva = get_field(LF_CLIFO, CLI_COFI);
if (_piva.empty()) _piva = get_field(LF_CLIFO,"PAIV"); if (_piva.empty()) _piva = get_field(LF_CLIFO, CLI_PAIV);
_telefono = get_field(LF_CLIFO,"PTEL"); _telefono = get_field(LF_CLIFO, CLI_PTEL);
if (!_telefono.empty()) _telefono << "/"; if (!_telefono.empty()) _telefono << "/";
_telefono << get_field(LF_CLIFO,"TEL"); _telefono << get_field(LF_CLIFO, CLI_TEL);
_name = get_field(LF_CLIFO,"RAGSOC"); _name = get_field(LF_CLIFO, CLI_RAGSOC);
if (strcmp(get_field(LF_CLIFO,"TIPOAPER"),"F") == 0) if (strcmp(get_field(LF_CLIFO, CLI_TIPOAPER),"F") == 0)
{ {
TString surname = _name.mid(30,50); surname.trim(); TString surname = _name.mid(30,50); surname.trim();
_name = _name.mid(0,30); _name.trim(); _name = _name.mid(0,30); _name.trim();
@ -193,19 +221,19 @@ void CG1200_App::set_elenco()
set_header(6,"@55gCodice per allegato@90gPercipiente 770"); set_header(6,"@55gCodice per allegato@90gPercipiente 770");
set_header(7, (const char *)(TString(132).fill('-'))); set_header(7, (const char *)(TString(132).fill('-')));
// body // body
set_row(1,"@pn #s@55g@s@91g@s @s@117g@s #s", set_row(1,"$[r]@pn$[n} #s@55g@s@91g@s @s@117g@s #s",
FLD(LF_CLIFO, "CODCF","@@@@@@"), FLD(LF_CLIFO, CLI_CODCF,"@@@@@@"),
(const char*)_name, (const char*)_name,
FLD(LF_CLIFO, "INDCF"), FLD(LF_CLIFO, CLI_INDCF),
FLD(LF_CLIFO, "CAPCF"), FLD(LF_CLIFO, CLI_CAPCF),
FLD(LF_COMUNI,"DENCOM"), FLD(LF_COMUNI,COM_DENCOM),
FLD(LF_COMUNI,"PROVCOM"), FLD(LF_COMUNI,COM_PROVCOM),
(const char*)_telefono); (const char*)_telefono);
set_row(2,"@54g#s@90g@2n @2n @pn", set_row(2,"@54g#s@90g@2n @2n @pn",
(const char *)_piva, (const char *)_piva,
FLD(LF_CLIFO,"GRUPPORIC"), FLD(LF_CLIFO,CLI_GRUPPORIC),
FLD(LF_CLIFO,"CONTORIC"), FLD(LF_CLIFO,CLI_CONTORIC),
FLD(LF_CLIFO,"SOTTOCRIC","@@@@@@")); FLD(LF_CLIFO, CLI_SOTTOCRIC,"@@@@@@"));
for(int i = 0; i < _interline; i++) for(int i = 0; i < _interline; i++)
set_row(i+3,""); set_row(i+3,"");
@ -224,13 +252,13 @@ void CG1200_App::set_rubriche()
"@104gPr Partita iva Telefono"); "@104gPr Partita iva Telefono");
set_header(5, (const char *)(TString(132).fill('-'))); set_header(5, (const char *)(TString(132).fill('-')));
// body // body
set_row(1,"@pn #s@55g@s@91g@s @s@117g@s #s", set_row(1,"$[r]@pn$[n] #s@55g@s@91g@s @s@117g@s #s",
FLD(LF_CLIFO,"CODCF","@@@@@@"), FLD(LF_CLIFO,CLI_CODCF,"@@@@@@"),
(const char *)_name, (const char *)_name,
FLD(LF_CLIFO,"INDCF"), FLD(LF_CLIFO,CLI_INDCF),
FLD(LF_CLIFO,"CAPCF"), FLD(LF_CLIFO, CLI_CAPCF),
FLD(LF_COMUNI,"DENCOM"), FLD(LF_COMUNI, COM_DENCOM),
FLD(LF_COMUNI,"PROVCOM"), FLD(LF_COMUNI, COM_PROVCOM),
(const char*)_telefono); (const char*)_telefono);
} }
@ -278,12 +306,12 @@ void CG1200_App::set_etichette()
set_row(_startrow, format("@%dg#%ds",_startcol, _cols_et - _startcol), set_row(_startrow, format("@%dg#%ds",_startcol, _cols_et - _startcol),
(const char*)_name); (const char*)_name);
set_row(_startrow+1, format("@%dg@%ds",_startcol, _cols_et - _startcol), set_row(_startrow+1, format("@%dg@%ds",_startcol, _cols_et - _startcol),
FLD(LF_CLIFO,"INDCF")); FLD(LF_CLIFO, CLI_INDCF));
set_row(_startrow+2, format("@%dg@5s @%ds @2s",_startcol, set_row(_startrow+2, format("@%dg@5s @%ds @2s",_startcol,
_cols_et - _startcol - 9), _cols_et - _startcol - 9),
FLD(LF_CLIFO,"CAPCF"), FLD(LF_CLIFO, CLI_CAPCF),
FLD(LF_COMUNI,"DENCOM"), FLD(LF_COMUNI, COM_DENCOM),
FLD(LF_COMUNI,"PROVCOM")); FLD(LF_COMUNI, COM_PROVCOM));
for (i = _startrow+3; i <= _rows_et; i++) for (i = _startrow+3; i <= _rows_et; i++)
set_row(i,""); set_row(i,"");
@ -316,6 +344,8 @@ bool CG1200_App::set_print(int)
_sort = atoi(mask.get(RDB_CG12_SORT)); _sort = atoi(mask.get(RDB_CG12_SORT));
_pr_what = (pw)atoi(mask.get(RDB_CG12_TYPE)); _pr_what = (pw)atoi(mask.get(RDB_CG12_TYPE));
if (_pr_what != both && _pr_type != rubriche)
enable_link("Collegamento Archivio clienti e fornitori : ", 'r');
_interline = atoi(mask.get(LST_CG12_INTERLINE)); _interline = atoi(mask.get(LST_CG12_INTERLINE));
_mov_only = mask.get(CHK_CG12_MOVIM) == "X"; _mov_only = mask.get(CHK_CG12_MOVIM) == "X";
@ -351,15 +381,15 @@ bool CG1200_App::set_print(int)
tr1.zero(); tr2.zero(); tr1.zero(); tr2.zero();
if (_sort == 1) if (_sort == 1)
{ {
tr1.put("CODCF",cod_from); tr1.put(CLI_CODCF,cod_from);
tr2.put("CODCF",cod_to); tr2.put(CLI_CODCF,cod_to);
tr1.put("TIPOCF", _pr_what == clienti ? "C" : "F"); tr1.put(CLI_TIPOCF, _pr_what == clienti ? "C" : "F");
tr2.put("TIPOCF", _pr_what == clienti ? "C" : "F"); tr2.put(CLI_TIPOCF, _pr_what == clienti ? "C" : "F");
} }
else else
{ {
tr1.put("RAGSOC",cod_from); tr1.put(CLI_RAGSOC,cod_from);
tr2.put("RAGSOC",cod_to); tr2.put(CLI_RAGSOC,cod_to);
} }
current_cursor()->setregion(cod_from.empty() ? NULL : &tr1, current_cursor()->setregion(cod_from.empty() ? NULL : &tr1,
cod_to.empty() ? NULL : &tr2); cod_to.empty() ? NULL : &tr2);

File diff suppressed because it is too large Load Diff

View File

@ -332,12 +332,20 @@ public:
bool calcola(int,int,long,const TDate&,const TDate&); bool calcola(int,int,long,const TDate&,const TDate&);
bool calcola_saldo(real&, real&,int,int,long,int); bool calcola_saldo(real&, real&,int,int,long,int);
bool ricerca_sottoc_clifo(int,int,char,TString&,TString&,TString&,int,int); bool ricerca_sottoc_clifo(int,int,char,TString&,TString&,TString&,int,int);
const char* causale_apertura_ese() { return _causale_ap;} const char* causale_apertura() { return _causale_ap;}
bool causale_apertura(long); const char* causale_chiusura() { return _causale_chi;}
const char* causale_chiusura_ese() { return _causale_chi;}
bool causale_chiusura(long);
void stampa_saldo_132(const real&); void stampa_saldo_132(const real&);
void stampa_saldo_198(real&, real&); void stampa_saldo_198(real&, real&);
void set_bil_key(bil_ivd* b, char lettera, char sezione,
const char* numero_romano, int numero,
bool conti_ordine = TRUE, int conto = 0,
int gruppo = 0, long sottoconto = 0L, char tipocf = ' ');
void set_bil_val(bil_ivd* b, const real& saldo = ZERO,
const real& saldorafr = ZERO,
const real& sld_prg_dare = ZERO,
const real& sld_prg_avere = ZERO,
const real& mov_dare = ZERO,
const real& mov_avere = ZERO);
CG1600_application() {} CG1600_application() {}
}; };
@ -349,7 +357,64 @@ print_action CG1600_application::postprocess_print(int file, int counter)
return NEXT_PAGE; return NEXT_PAGE;
} }
void CG1600_application::set_bil_key(bil_ivd* b, char lettera, char sezione,
const char* numero_romano, int numero,
bool conti_ordine, int conto, int gruppo,
long sottoconto, char tipocf)
{
b->sez = sezione;
//Se esiste solamente la sezione,significa che e' un conto d'ordine
//Forzo la lettera della classe a Z, per ottenere, grazie
//all'ordinamento del sort, i record dei conti d'ordine per ultimi
b->let = (conti_ordine && lettera == '\0' && sezione < '3') ? 'Z' : lettera;
strcpy(b->numr, numero_romano);
sprintf(b->num , "%2d", numero);
if (gruppo < 0)
{
strcpy(b->gruppo, "ZZZ");
strcpy(b->conto, "ZZZ");
strcpy(b->sottoc, "ZZZZZZ");
b->tipocf = ' ';
}
else
if (gruppo == 0)
{
strcpy(b->gruppo, "AAA");
strcpy(b->conto, "AAA");
strcpy(b->sottoc, "AAAAAA");
b->tipocf = ' ';
}
else
{
sprintf(b->gruppo , "%3d", gruppo);
sprintf(b->conto , "%3d", conto);
sprintf(b->sottoc , "%6ld", sottoconto);
b->tipocf = tipocf;
}
}
void CG1600_application::set_bil_val(bil_ivd* b, const real& saldo = ZERO,
const real& saldorafr = ZERO,
const real& sld_prg_dare = ZERO,
const real& sld_prg_avere = ZERO,
const real& mov_dare = ZERO,
const real& mov_avere = ZERO)
{
b->saldo = saldo;
b->saldorafr = saldorafr;
b->sld_prg_dare = sld_prg_dare;
b->sld_prg_avere = sld_prg_avere;
b->mov_dare = mov_dare;
b->mov_avere = mov_avere;
}
bool our_handler(TMask_field& f, KEY key) bool our_handler(TMask_field& f, KEY key)
{
if (key == K_ENTER)
{ {
TMask& m = f.mask(); TMask& m = f.mask();
int tipobil,tipostampa; int tipobil,tipostampa;
@ -360,8 +425,6 @@ bool our_handler(TMask_field& f, KEY key)
tipobil = atoi(m.get(F_TIPOBIL)); tipobil = atoi(m.get(F_TIPOBIL));
tipostampa = atoi(m.get(F_TIPOSTAMPA)); tipostampa = atoi(m.get(F_TIPOSTAMPA));
if (key == K_ENTER)
{
long annoese = m.get_long(F_ANNOESE); long annoese = m.get_long(F_ANNOESE);
long annoprec = annoese - 1; long annoprec = annoese - 1;
a->_anni_es.aggiungi_anno(annoese, in, fin); a->_anni_es.aggiungi_anno(annoese, in, fin);
@ -450,35 +513,13 @@ void CG1600_application::scrivi_record(const TString& sez,
const real& sld_dare,const real& sld_avere, const real& sld_dare,const real& sld_avere,
const real& mov_dare,const real& mov_avere,char tipocf) const real& mov_dare,const real& mov_avere,char tipocf)
{ {
// if (sez == "")
// _bil->sez = '9';
// else
_bil->sez = sez[0];
//Se esiste solamente la sezione,significa che e' un conto d'ordine //Se esiste solamente la sezione,significa che e' un conto d'ordine
//Forzo la lettera della classe a Z, per ottenere, grazie //Forzo la lettera della classe a Z, per ottenere, grazie
//all'ordinamento del sort, i record dei conti d'ordine per ultimi //all'ordinamento del sort, i record dei conti d'ordine per ultimi
if (let != "") set_bil_key(_bil, sez[0], let[0], numerorom, numero, TRUE, g, c, s, tipocf);
_bil->let = let[0]; set_bil_val(_bil, saldo, saldorafr, sld_dare, sld_avere, mov_dare, mov_avere);
else
if ((sez == "1")||(sez == "2"))
_bil->let = 'Z';
else
_bil->let = let[0];
sprintf (_bil->numr, "%8s", (const char*) numerorom);
sprintf (_bil->num , "%2d", numero);
sprintf (_bil->gruppo, "%3d", g);
sprintf (_bil->conto, "%3d", c);
sprintf (_bil->sottoc, "%6ld", s);
_bil->saldo = saldo;
_bil->saldorafr = saldorafr;
_bil->sld_prg_dare = sld_dare;
_bil->sld_prg_avere = sld_avere;
_bil->mov_dare = mov_dare;
_bil->mov_avere = mov_avere;
_bil->tipocf = tipocf;
_sort->sort ((const char*) _bil); _sort->sort ((const char*) _bil);
} }
@ -486,32 +527,8 @@ void CG1600_application::scrivi_record_fittizio(const TString& sez,
const TString& let,const TString& numerorom,int numero) const TString& let,const TString& numerorom,int numero)
{ {
_bil->sez = sez[0]; set_bil_key(_bil, sez[0], let[0], numerorom, numero, TRUE, 0);
set_bil_val(_bil);
//Se esiste solamente la sezione,significa che e' un conto d'ordine
//Forzo la lettera della classe a Z, per ottenere, grazie
//all'ordinamento del sort, i record dei conti d'ordine per ultimi
if (let != "")
_bil->let = let[0];
else
if ((sez == "1")||(sez == "2"))
_bil->let = 'Z';
else
_bil->let = let[0];
sprintf (_bil->numr, "%8s", (const char*) numerorom);
sprintf (_bil->num , "%2d", numero);
sprintf (_bil->gruppo, "%s", "AAA");
sprintf (_bil->conto , "%s", "AAA");
sprintf (_bil->sottoc, "%s", "AAAAAA");
_bil->saldo = 0.00;
_bil->saldorafr = 0.00;
_bil->sld_prg_dare = 0.00;
_bil->sld_prg_avere = 0.00;
_bil->mov_dare = 0.00;
_bil->mov_avere = 0.00;
_bil->tipocf = '\0';
_sort->sort ((const char*) _bil); _sort->sort ((const char*) _bil);
} }
@ -521,20 +538,8 @@ void CG1600_application::riempi_record(const TString& sez,
const real& sld_dare,const real& sld_avere, const real& sld_dare,const real& sld_avere,
const real& mov_dare,const real& mov_avere,char tipocf) const real& mov_dare,const real& mov_avere,char tipocf)
{ {
_bil->sez = sez[0]; set_bil_key(_bil, sez[0], let[0], numerorom, numero, FALSE, g, c, s, tipocf);
_bil->let = let[0]; set_bil_val(_bil, saldo, saldorafr, sld_dare, sld_avere, mov_dare, mov_avere);
sprintf (_bil->numr, "%8s", (const char*) numerorom);
sprintf (_bil->num , "%2d", numero);
sprintf (_bil->gruppo, "%3d", g);
sprintf (_bil->conto, "%3d", c);
sprintf (_bil->sottoc, "%6ld", s);
_bil->saldo = saldo;
_bil->saldorafr = saldorafr;
_bil->sld_prg_dare = sld_dare;
_bil->sld_prg_avere = sld_avere;
_bil->mov_dare = mov_dare;
_bil->mov_avere = mov_avere;
_bil->tipocf = tipocf;
_sort->sort ((const char*) _bil); _sort->sort ((const char*) _bil);
} }
@ -544,7 +549,10 @@ void CG1600_application::crea_sort_tabella()
TString codtab_prec; TString codtab_prec;
TTable tabivd(TAB_IVD); TTable tabivd(TAB_IVD);
TRecfield codtab_curr(tabivd.curr(),"CODTAB"); TRecfield codtab_curr(tabivd.curr(),"CODTAB");
TString provanumero; TRecfield sezione (tabivd.curr(),"CODTAB",0,0);
TRecfield lettera (tabivd.curr(),"CODTAB",1,1);
TRecfield numerorom (tabivd.curr(),"CODTAB",2,9);
TRecfield numero (tabivd.curr(),"CODTAB",10,11);
int preclen; int preclen;
bool FINITO=FALSE; bool FINITO=FALSE;
@ -567,7 +575,6 @@ void CG1600_application::crea_sort_tabella()
tabivd.zero(); tabivd.zero();
FINITO=TRUE; FINITO=TRUE;
} }
// codtab_curr = tabivd.get("CODTAB");
recno_curr = tabivd.recno(); recno_curr = tabivd.recno();
preclen = codtab_prec.len(); preclen = codtab_prec.len();
if (!strncmp(codtab_curr,codtab_prec,preclen)) if (!strncmp(codtab_curr,codtab_prec,preclen))
@ -575,23 +582,12 @@ void CG1600_application::crea_sort_tabella()
else else
{ {
tabivd.readat(recno_prec); tabivd.readat(recno_prec);
TRecfield sezione (tabivd.curr(),"CODTAB",0,0); const char sez = *((const char*) sezione);
TRecfield lettera (tabivd.curr(),"CODTAB",1,1); const char let = *((const char*) lettera);
TRecfield numerorom (tabivd.curr(),"CODTAB",2,9);
TRecfield numero (tabivd.curr(),"CODTAB",10,11);
TString dep;
dep = (const char *) sezione;
_bil->sez = dep[0];
dep = (const char *) lettera;
_bil->let = dep[0];
sprintf (_bil->numr, "%s", (const char*) numerorom); set_bil_key(_bil, sez, let, numerorom, numero, FALSE);
sprintf (_bil->num , "%d", int(numero)); set_bil_val(_bil);
sprintf (_bil->gruppo, "%s", "ZZZ");
sprintf (_bil->conto , "%s", "ZZZ");
sprintf (_bil->sottoc, "%s", "ZZZZZZ");
_sort->sort ((const char*) _bil); _sort->sort ((const char*) _bil);
provanumero = _bil->numr;
tabivd.readat(recno_curr); tabivd.readat(recno_curr);
codtab_prec = (const char *)codtab_curr; codtab_prec = (const char *)codtab_curr;
} }
@ -624,10 +620,10 @@ void CG1600_application::crea_sort_piano_conti_scalare()
tmcf = ' '; tmcf = ' ';
indbil = 0; indbil = 0;
saldo_conto = 0.00; saldo_conto = ZERO;
saldo_conto_raf = 0.00; saldo_conto_raf = ZERO;
saldo_conto_opp = 0.00; saldo_conto_opp = ZERO;
saldo_conto_raf_opp = 0.00; saldo_conto_raf_opp = ZERO;
gruppo_prec = -1; gruppo_prec = -1;
conto_prec = -1; conto_prec = -1;
@ -645,8 +641,8 @@ void CG1600_application::crea_sort_piano_conti_scalare()
numerorom = pconti.get(PCN_NUMRIVD); numerorom = pconti.get(PCN_NUMRIVD);
numero = pconti.get_int (PCN_NUMIVD); numero = pconti.get_int (PCN_NUMIVD);
saldo = 0.00; saldo = ZERO;
saldo_raf = 0.00; saldo_raf = ZERO;
if (conto_dettagliato) if (conto_dettagliato)
{ {
@ -656,9 +652,9 @@ void CG1600_application::crea_sort_piano_conti_scalare()
{ {
if (no_sez_opposta) if (no_sez_opposta)
{ {
riempi_record(sez_conto,let_conto,numr_conto,num_conto,gruppo_prec,conto_prec,0,saldo_conto,saldo_conto_raf,real(0.0),real(0.0),real(0.0),real(0.0),tmcf); riempi_record(sez_conto,let_conto,numr_conto,num_conto,gruppo_prec,conto_prec,0,saldo_conto,saldo_conto_raf,ZERO,ZERO,ZERO,ZERO,tmcf);
saldo_conto = 0.00; saldo_conto = ZERO;
saldo_conto_raf = 0.00; saldo_conto_raf = ZERO;
classe_conto = FALSE; classe_conto = FALSE;
no_sez_opposta = FALSE; no_sez_opposta = FALSE;
} }
@ -674,7 +670,7 @@ void CG1600_application::crea_sort_piano_conti_scalare()
TString numr_opp = lriga->num_rom(); TString numr_opp = lriga->num_rom();
int num_opp = lriga->numero(); int num_opp = lriga->numero();
real saldo_conto_opp = lriga->saldo_conto(); real saldo_conto_opp = lriga->saldo_conto();
riempi_record(sez_opp,let_opp,numr_opp,num_opp,gruppo_prec,conto_prec,0,saldo_conto_opp,real(0.0),real(0.0),real(0.0),real(0.0),real(0.0),tmcf); riempi_record(sez_opp,let_opp,numr_opp,num_opp,gruppo_prec,conto_prec,0,saldo_conto_opp,ZERO,ZERO,ZERO,ZERO,ZERO,tmcf);
} }
sez_opposta = FALSE; sez_opposta = FALSE;
@ -764,21 +760,21 @@ void CG1600_application::crea_sort_piano_conti_scalare()
if (classe_conto) if (classe_conto)
{ {
sez_opp = pconti.get(PCN_SEZIVDOPP); sez_opp = pconti.get(PCN_SEZIVDOPP);
if ((sez_opp != "")&&(((sez_conto=="1")&&(saldo.sign()<0))||((sez_conto=="2")&&(saldo.sign()>0)))) if ((sez_opp != "")&&(((sez_conto=="1")&&(saldo < ZERO))||((sez_conto=="2")&&(saldo > ZERO))))
{ {
let_opp = pconti.get(PCN_LETTIVDOPP); let_opp = pconti.get(PCN_LETTIVDOPP);
numr_opp = pconti.get(PCN_NUMRIVDOPP); numr_opp = pconti.get(PCN_NUMRIVDOPP);
num_opp = pconti.get_int(PCN_NUMIVDOPP); num_opp = pconti.get_int(PCN_NUMIVDOPP);
sez_opposta = TRUE; sez_opposta = TRUE;
saldo = saldo * (-1.00); saldo = -saldo;
_sezopps.add(g,c,s,sez_opp,let_opp,numr_opp,num_opp,saldo); _sezopps.add(g,c,s,sez_opp,let_opp,numr_opp,num_opp,saldo);
riempi_record(sez_opp,let_opp,numr_opp,num_opp,g,c,s,saldo,saldo_raf,real(0.0),real(0.0),real(0.0),real(0.0),tmcf); riempi_record(sez_opp,let_opp,numr_opp,num_opp,g,c,s,saldo,saldo_raf,ZERO,ZERO,ZERO,ZERO,tmcf);
} }
else else
{ {
riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,s,saldo,saldo_raf,real(0.0),real(0.0),real(0.0),real(0.0),tmcf); riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,s,saldo,saldo_raf,ZERO,ZERO,ZERO,ZERO,tmcf);
saldo_conto += saldo; saldo_conto += saldo;
saldo_conto_raf += saldo_raf; saldo_conto_raf += saldo_raf;
no_sez_opposta = TRUE; no_sez_opposta = TRUE;
@ -787,12 +783,12 @@ void CG1600_application::crea_sort_piano_conti_scalare()
else else
{ {
sez_opp = pconti.get(PCN_SEZIVDOPP); sez_opp = pconti.get(PCN_SEZIVDOPP);
if ((sez_opp != "")&&(((sez=="1")&&(saldo.sign()<0))||((sez=="2")&&(saldo.sign()>0)))) if ((sez_opp != "")&&(((sez=="1")&&(saldo < ZERO))||((sez=="2")&&(saldo > ZERO))))
{ {
let_opp = pconti.get(PCN_LETTIVDOPP); let_opp = pconti.get(PCN_LETTIVDOPP);
numr_opp = pconti.get(PCN_NUMRIVDOPP); numr_opp = pconti.get(PCN_NUMRIVDOPP);
num_opp = pconti.get_int(PCN_NUMIVDOPP); num_opp = pconti.get_int(PCN_NUMIVDOPP);
riempi_record(sez_opp,let_opp,numr_opp,num_opp,g,c,s,saldo,saldo_raf,real(0.0),real(0.0),real(0.0),real(0.0),tmcf); riempi_record(sez_opp,let_opp,numr_opp,num_opp,g,c,s,saldo,saldo_raf,ZERO,ZERO,ZERO,ZERO,tmcf);
} }
else else
{ {
@ -801,7 +797,7 @@ void CG1600_application::crea_sort_piano_conti_scalare()
// if (sez == "") // if (sez == "")
// sez = "9"; // sez = "9";
scrivi_record(sez,let,numerorom,numero,g,c,s,saldo,saldo_raf,real(0.0),real(0.0),real(0.0),real(0.0),tmcf); scrivi_record(sez,let,numerorom,numero,g,c,s,saldo,saldo_raf,ZERO,ZERO,ZERO,ZERO,tmcf);
} }
} }
} }
@ -819,9 +815,9 @@ void CG1600_application::crea_sort_piano_conti_scalare()
{ {
if (no_sez_opposta) if (no_sez_opposta)
{ {
riempi_record(sez_conto,let_conto,numr_conto,num_conto,gruppo_prec,c,0,saldo_conto,saldo_conto_raf,real(0.0),real(0.0),real(0.0),real(0.0),tmcf); riempi_record(sez_conto,let_conto,numr_conto,num_conto,gruppo_prec,c,0,saldo_conto,saldo_conto_raf,ZERO,ZERO,ZERO,ZERO,tmcf);
saldo_conto = 0.00; saldo_conto = ZERO;
saldo_conto_raf = 0.00; saldo_conto_raf = ZERO;
classe_conto = FALSE; classe_conto = FALSE;
no_sez_opposta = FALSE; no_sez_opposta = FALSE;
} }
@ -837,7 +833,7 @@ void CG1600_application::crea_sort_piano_conti_scalare()
TString numr_opp = lriga->num_rom(); TString numr_opp = lriga->num_rom();
int num_opp = lriga->numero(); int num_opp = lriga->numero();
real saldo_conto_opp = lriga->saldo_conto(); real saldo_conto_opp = lriga->saldo_conto();
riempi_record(sez_opp,let_opp,numr_opp,num_opp,gruppo_prec,conto_prec,0,saldo_conto_opp,real(0.0),real(0.0),real(0.0),real(0.0),real(0.0),tmcf); riempi_record(sez_opp,let_opp,numr_opp,num_opp,gruppo_prec,conto_prec,0,saldo_conto_opp,ZERO,ZERO,ZERO,ZERO,ZERO,tmcf);
} }
sez_opposta = FALSE; sez_opposta = FALSE;
@ -865,11 +861,11 @@ void CG1600_application::crea_sort_piano_conti_verifica()
real saldo,sld_prg_dare,sld_prg_avere,mov_dare,mov_avere; real saldo,sld_prg_dare,sld_prg_avere,mov_dare,mov_avere;
real saldo_conto,sld_prg_dare_conto,sld_prg_avere_conto,mov_dare_conto,mov_avere_conto; real saldo_conto,sld_prg_dare_conto,sld_prg_avere_conto,mov_dare_conto,mov_avere_conto;
saldo_conto = 0.00; saldo_conto = ZERO;
sld_prg_dare_conto = 0.00; sld_prg_dare_conto = ZERO;
sld_prg_avere_conto = 0.00; sld_prg_avere_conto = ZERO;
mov_dare_conto = 0.00; mov_dare_conto = ZERO;
mov_avere_conto = 0.00; mov_avere_conto = ZERO;
indbil = 0; indbil = 0;
gruppo_prec = -1; gruppo_prec = -1;
@ -892,12 +888,12 @@ void CG1600_application::crea_sort_piano_conti_verifica()
numero = pconti.get_int (PCN_NUMIVD); numero = pconti.get_int (PCN_NUMIVD);
real app; real app;
saldo = 0.00; saldo = ZERO;
sld_prg_dare = 0.00; sld_prg_dare = ZERO;
sld_prg_avere = 0.00; sld_prg_avere = ZERO;
mov_dare = 0.00; mov_dare = ZERO;
mov_avere = 0.00; mov_avere = ZERO;
app = 0.00; app = ZERO;
if (conto_dettagliato) if (conto_dettagliato)
{ {
@ -907,12 +903,12 @@ void CG1600_application::crea_sort_piano_conti_verifica()
{ {
if (c != conto_prec && conto_prec != -1) if (c != conto_prec && conto_prec != -1)
{ {
riempi_record(sez_conto,let_conto,numr_conto,num_conto,gruppo_prec,conto_prec,0,saldo_conto,real(0.0),sld_prg_dare_conto,sld_prg_avere_conto,mov_dare_conto,mov_avere_conto,tmcf); riempi_record(sez_conto,let_conto,numr_conto,num_conto,gruppo_prec,conto_prec,0,saldo_conto,ZERO,sld_prg_dare_conto,sld_prg_avere_conto,mov_dare_conto,mov_avere_conto,tmcf);
saldo_conto = 0.00; saldo_conto = ZERO;
sld_prg_dare_conto = 0.00; sld_prg_dare_conto = ZERO;
sld_prg_avere_conto = 0.00; sld_prg_avere_conto = ZERO;
mov_dare_conto = 0.00; mov_dare_conto = ZERO;
mov_avere_conto = 0.00; mov_avere_conto = ZERO;
classe_conto = FALSE; classe_conto = FALSE;
stamp_almeno_un_sottoc = FALSE; stamp_almeno_un_sottoc = FALSE;
} }
@ -1031,16 +1027,16 @@ void CG1600_application::crea_sort_piano_conti_verifica()
if (!_sld.calcola(_annoese,0,g,c,s,"","",indbil,FALSE,"","","",FALSE)) if (!_sld.calcola(_annoese,0,g,c,s,"","",indbil,FALSE,"","","",FALSE))
continue; continue;
app = _sld.saldoini(); app = _sld.saldoini();
if (app.sign() < 0) if (app < ZERO)
{ {
app = app * (-1.00); app = -app;
sld_prg_dare = 0.00; sld_prg_dare = ZERO;
sld_prg_avere = app; sld_prg_avere = app;
} }
else else
{ {
sld_prg_dare = app; sld_prg_dare = app;
sld_prg_avere = 0.00; sld_prg_avere = ZERO;
} }
mov_dare = _sld.prgdare(); mov_dare = _sld.prgdare();
mov_avere = _sld.prgavere(); mov_avere = _sld.prgavere();
@ -1052,8 +1048,8 @@ void CG1600_application::crea_sort_piano_conti_verifica()
if (!_sld.calcola (_annoese,_annoese-1,g,c,s,"","",indbil,FALSE,"","","",FALSE)) if (!_sld.calcola (_annoese,_annoese-1,g,c,s,"","",indbil,FALSE,"","","",FALSE))
continue; continue;
sld_prg_dare = 0.00; sld_prg_dare = ZERO;
sld_prg_avere = 0.00; sld_prg_avere = ZERO;
mov_dare = _sld.prgdare(); mov_dare = _sld.prgdare();
mov_avere = _sld.prgavere(); mov_avere = _sld.prgavere();
saldo = mov_dare - mov_avere; saldo = mov_dare - mov_avere;
@ -1061,7 +1057,7 @@ void CG1600_application::crea_sort_piano_conti_verifica()
if (classe_conto) if (classe_conto)
{ {
riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,s,saldo,real(0.0),sld_prg_dare,sld_prg_avere,mov_dare,mov_avere,tmcf); riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,s,saldo,ZERO,sld_prg_dare,sld_prg_avere,mov_dare,mov_avere,tmcf);
saldo_conto += saldo; saldo_conto += saldo;
sld_prg_dare_conto += sld_prg_dare; sld_prg_dare_conto += sld_prg_dare;
sld_prg_avere_conto += sld_prg_avere; sld_prg_avere_conto += sld_prg_avere;
@ -1076,7 +1072,7 @@ void CG1600_application::crea_sort_piano_conti_verifica()
// if (sez == "") // if (sez == "")
// sez = "9"; // sez = "9";
scrivi_record(sez,let,numerorom,numero,g,c,s,saldo,real(0.0),sld_prg_dare,sld_prg_avere,mov_dare,mov_avere,tmcf); scrivi_record(sez,let,numerorom,numero,g,c,s,saldo,ZERO,sld_prg_dare,sld_prg_avere,mov_dare,mov_avere,tmcf);
stamp_almeno_un_sottoc = TRUE; stamp_almeno_un_sottoc = TRUE;
} }
} }
@ -1094,12 +1090,12 @@ void CG1600_application::crea_sort_piano_conti_verifica()
{ {
if (c != conto_prec && conto_prec != -1) if (c != conto_prec && conto_prec != -1)
{ {
riempi_record(sez_conto,let_conto,numr_conto,num_conto,gruppo_prec,c,0,saldo_conto,real(0.0),sld_prg_dare_conto,sld_prg_avere_conto,mov_dare_conto,mov_avere_conto,tmcf); riempi_record(sez_conto,let_conto,numr_conto,num_conto,gruppo_prec,c,0,saldo_conto,ZERO,sld_prg_dare_conto,sld_prg_avere_conto,mov_dare_conto,mov_avere_conto,tmcf);
saldo_conto = 0.00; saldo_conto = ZERO;
sld_prg_dare_conto = 0.00; sld_prg_dare_conto = ZERO;
sld_prg_avere_conto = 0.00; sld_prg_avere_conto = ZERO;
mov_dare_conto = 0.00; mov_dare_conto = ZERO;
mov_avere_conto = 0.00; mov_avere_conto = ZERO;
classe_conto = FALSE; classe_conto = FALSE;
stamp_almeno_un_sottoc = FALSE; stamp_almeno_un_sottoc = FALSE;
} }
@ -1119,11 +1115,11 @@ bool CG1600_application::ricerca_sottoc_clifo(int g,int c,char tipocf,TString& s
TString sez_conto,let_conto,numr_conto; TString sez_conto,let_conto,numr_conto;
int num_conto; int num_conto;
saldo_conto = 0.00; saldo_conto = ZERO;
sld_prg_dare_conto = 0.00; sld_prg_dare_conto = ZERO;
sld_prg_avere_conto = 0.00; sld_prg_avere_conto = ZERO;
mov_dare_conto = 0.00; mov_dare_conto = ZERO;
mov_avere_conto = 0.00; mov_avere_conto = ZERO;
int items = _listacf->items(); int items = _listacf->items();
if (items >= 2) if (items >= 2)
@ -1146,12 +1142,12 @@ bool CG1600_application::ricerca_sottoc_clifo(int g,int c,char tipocf,TString& s
const TRectype& r=_listacf->clifo(i); const TRectype& r=_listacf->clifo(i);
s = r.get_long(CLI_CODCF); s = r.get_long(CLI_CODCF);
saldo = 0.00; saldo = ZERO;
sld_prg_dare = 0.00; sld_prg_dare = ZERO;
sld_prg_avere = 0.00; sld_prg_avere = ZERO;
mov_dare = 0.00; mov_dare = ZERO;
mov_avere = 0.00; mov_avere = ZERO;
app = 0.00; app = ZERO;
if (_tipo_stampa == 1) if (_tipo_stampa == 1)
{ {
@ -1181,16 +1177,16 @@ bool CG1600_application::ricerca_sottoc_clifo(int g,int c,char tipocf,TString& s
if (!_sld.calcola (_annoese,0,g,c,s,"","",indbil,FALSE,"","","",FALSE)) if (!_sld.calcola (_annoese,0,g,c,s,"","",indbil,FALSE,"","","",FALSE))
continue; continue;
app = _sld.saldoini(); app = _sld.saldoini();
if (app.sign() < 0) if (app < ZERO)
{ {
app = app * (-1.00); app = -app;
sld_prg_dare = 0.00; sld_prg_dare = ZERO;
sld_prg_avere = app; sld_prg_avere = app;
} }
else else
{ {
sld_prg_dare = app; sld_prg_dare = app;
sld_prg_avere = 0.00; sld_prg_avere = ZERO;
} }
mov_dare = _sld.prgdare(); mov_dare = _sld.prgdare();
mov_avere = _sld.prgavere(); mov_avere = _sld.prgavere();
@ -1202,26 +1198,26 @@ bool CG1600_application::ricerca_sottoc_clifo(int g,int c,char tipocf,TString& s
if (!_sld.calcola (_annoese,_annoese-1,g,c,s,"","",indbil,FALSE,"","","",FALSE)) if (!_sld.calcola (_annoese,_annoese-1,g,c,s,"","",indbil,FALSE,"","","",FALSE))
continue; continue;
sld_prg_dare = 0.00; sld_prg_dare = ZERO;
sld_prg_avere = 0.00; sld_prg_avere = ZERO;
mov_dare = _sld.prgdare(); mov_dare = _sld.prgdare();
mov_avere = _sld.prgavere(); mov_avere = _sld.prgavere();
saldo = mov_dare - mov_avere; saldo = mov_dare - mov_avere;
} }
riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,s,saldo,real(0.0),sld_prg_dare,sld_prg_avere,mov_dare,mov_avere,tipocf); riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,s,saldo,ZERO,sld_prg_dare,sld_prg_avere,mov_dare,mov_avere,tipocf);
saldo_conto += saldo; saldo_conto += saldo;
sld_prg_dare_conto += sld_prg_dare; sld_prg_dare_conto += sld_prg_dare;
sld_prg_avere_conto += sld_prg_avere; sld_prg_avere_conto += sld_prg_avere;
mov_dare_conto += mov_dare; mov_dare_conto += mov_dare;
mov_avere_conto += mov_avere; mov_avere_conto += mov_avere;
} }
riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,0,saldo_conto,real(0.0),sld_prg_dare_conto,sld_prg_avere_conto,mov_dare_conto,mov_avere_conto,tipocf); riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,0,saldo_conto,ZERO,sld_prg_dare_conto,sld_prg_avere_conto,mov_dare_conto,mov_avere_conto,tipocf);
saldo_conto = 0.00; saldo_conto = ZERO;
sld_prg_dare_conto = 0.00; sld_prg_dare_conto = ZERO;
sld_prg_avere_conto = 0.00; sld_prg_avere_conto = ZERO;
mov_dare_conto = 0.00; mov_dare_conto = ZERO;
mov_avere_conto = 0.00; mov_avere_conto = ZERO;
delete _listacf; delete _listacf;
return TRUE; return TRUE;
@ -1299,44 +1295,10 @@ bool CG1600_application::calcola_saldo(real& saldo, real& saldo_raf,int g,int c,
return TRUE; return TRUE;
} }
bool CG1600_application::causale_apertura(long nr)
{
TString codcaus;
TLocalisamfile mov (LF_MOV);
mov.zero();
mov.put (MOV_NUMREG,nr);
if (mov.read() == NOERR)
{
codcaus = mov.get(MOV_CODCAUS);
if (codcaus == causale_apertura_ese())
return TRUE;
}
return FALSE;
}
bool CG1600_application::causale_chiusura(long nr)
{
TString codcaus;
TLocalisamfile mov (LF_MOV);
mov.zero();
mov.put (MOV_NUMREG,nr);
if (mov.read() == NOERR)
{
codcaus = mov.get(MOV_CODCAUS);
if (codcaus == causale_chiusura_ese())
return TRUE;
}
return FALSE;
}
bool CG1600_application::calcola(int g, int c, long s, bool CG1600_application::calcola(int g, int c, long s,
const TDate& fine_es, const TDate& fine_es_prec) const TDate& fine_es, const TDate& fine_es_prec)
{ {
TString sezione, provvis; TString sezione;
real importo; real importo;
int annoe; int annoe;
long num_reg; long num_reg;
@ -1345,12 +1307,12 @@ bool CG1600_application::calcola(int g, int c, long s,
TLocalisamfile rmov(LF_RMOV); TLocalisamfile rmov(LF_RMOV);
TLocalisamfile mov(LF_MOV); TLocalisamfile mov(LF_MOV);
_mov_periodo_dare = 0.00; _mov_periodo_dare = ZERO;
_mov_periodo_avere = 0.00; _mov_periodo_avere = ZERO;
_prg_prec_dare = 0.00; _prg_prec_dare = ZERO;
_prg_prec_avere = 0.00; _prg_prec_avere = ZERO;
_saldo_ini_dare = 0.00; _saldo_ini_dare = ZERO;
_saldo_ini_avere = 0.00; _saldo_ini_avere = ZERO;
rmov.setkey(2); rmov.setkey(2);
rmov.zero(); rmov.zero();
@ -1369,32 +1331,27 @@ bool CG1600_application::calcola(int g, int c, long s,
annoe = rmov.get_int(RMV_ANNOES); annoe = rmov.get_int(RMV_ANNOES);
data_rmv = rmov.get_date(RMV_DATAREG); data_rmv = rmov.get_date(RMV_DATAREG);
num_reg = rmov.get_long(RMV_NUMREG); num_reg = rmov.get_long(RMV_NUMREG);
sezione = rmov.get(RMV_SEZIONE);
importo = rmov.get_real(RMV_IMPORTO);
if ((annoe != _annoese && annoe != _annoese - 1) || (importo == ZERO))
continue;
mov.setkey(1); mov.setkey(1);
mov.zero(); mov.zero();
mov.put(MOV_NUMREG, num_reg); mov.put(MOV_NUMREG, num_reg);
mov.read(); mov.read();
if (mov.bad()) if (mov.bad()) mov.zero();
mov.zero(); const bool movprovv = mov.get(MOV_PROVVIS).not_empty();
provvis = mov.get(MOV_PROVVIS);
if ((!_stampa_mov_prov)&&(provvis.trim().not_empty())) //se non richiesto if (!_stampa_mov_prov && movprovv) //se non richiesto
continue; //stampa mov provv. continue; //stampa mov provv.
//li scarto //li scarto
const TString codcaus(mov.get(MOV_CODCAUS));
if (causale_chiusura(num_reg)) //la causale e' uguale a quella di chiusura if (codcaus == causale_chiusura()) //la causale e' uguale a quella di chiusura
break; break;
sezione = rmov.get(RMV_SEZIONE);
importo = rmov.get_real(RMV_IMPORTO);
if (annoe != _annoese)
if (annoe != _annoese - 1)
continue;
if (importo == 0) //oppure la causale e' uguale a quella di chiusura
continue;
if (_competenza) if (_competenza)
if (annoe == _annoese -1) if (annoe == _annoese -1)
if (_datafine == fine_es) if (_datafine == fine_es)
@ -1408,7 +1365,8 @@ bool CG1600_application::calcola(int g, int c, long s,
//calcolo i movimenti del periodo //calcolo i movimenti del periodo
if ( (data_rmv >= _dataini) && (data_rmv <= _datafine) ) if ( (data_rmv >= _dataini) && (data_rmv <= _datafine) )
if (((causale_apertura(num_reg))&&(_data_ini_ese != _dataini))||(!causale_apertura(num_reg))) if ((codcaus == causale_apertura() && _data_ini_ese != _dataini) ||
(codcaus != causale_apertura()))
{ {
conto_mov = TRUE; conto_mov = TRUE;
if (sezione == "D") if (sezione == "D")
@ -1420,7 +1378,7 @@ bool CG1600_application::calcola(int g, int c, long s,
if (_dataini == _data_ini_ese) //calcolo il saldo iniziale if (_dataini == _data_ini_ese) //calcolo il saldo iniziale
{ {
if (causale_apertura(num_reg)) if (codcaus == causale_apertura())
{ {
if (sezione == "D") if (sezione == "D")
_saldo_ini_dare += importo; _saldo_ini_dare += importo;
@ -2090,9 +2048,9 @@ void CG1600_application::stampa_totali_verifica()
if (!_stampa_modulo) if (!_stampa_modulo)
{ {
if (_tot_num_saldo.sign() < 0) if (_tot_num_saldo < ZERO)
{ {
_tot_num_saldo = _tot_num_saldo * (-1.00); _tot_num_saldo = -_tot_num_saldo;
_tot_sez_saldo = 'A'; _tot_sez_saldo = 'A';
} }
else else
@ -2107,11 +2065,11 @@ void CG1600_application::stampa_totali_verifica()
} }
} }
_cont_gcs = 0; _cont_gcs = 0;
_tot_num_prg_d = 0.00; _tot_num_prg_d = ZERO;
_tot_num_prg_a = 0.00; _tot_num_prg_a = ZERO;
_tot_num_mov_d = 0.00; _tot_num_mov_d = ZERO;
_tot_num_mov_a = 0.00; _tot_num_mov_a = ZERO;
_tot_num_saldo = 0.00; _tot_num_saldo = ZERO;
} }
if (_numr_da_stamp!=_numr_tot) if (_numr_da_stamp!=_numr_tot)
{ {
@ -2131,9 +2089,9 @@ void CG1600_application::stampa_totali_verifica()
if (!_stampa_modulo) if (!_stampa_modulo)
{ {
if (_tot_num_saldo.sign() < 0) if (_tot_num_saldo < ZERO)
{ {
_tot_num_saldo = _tot_num_saldo * (-1.00); _tot_num_saldo = -_tot_num_saldo;
_tot_sez_saldo = 'A'; _tot_sez_saldo = 'A';
} }
else else
@ -2160,9 +2118,9 @@ void CG1600_application::stampa_totali_verifica()
if (!_stampa_modulo) if (!_stampa_modulo)
{ {
if (_tot_numr_saldo.sign() < 0) if (_tot_numr_saldo < ZERO)
{ {
_tot_numr_saldo = _tot_numr_saldo * (-1.00); _tot_numr_saldo = -_tot_numr_saldo;
_tot_sez_saldo = 'A'; _tot_sez_saldo = 'A';
} }
else else
@ -2178,16 +2136,16 @@ void CG1600_application::stampa_totali_verifica()
} }
_cont_gcs = 0; _cont_gcs = 0;
_cont_num = 0; _cont_num = 0;
_tot_num_prg_d = 0.00; _tot_num_prg_d = ZERO;
_tot_num_prg_a = 0.00; _tot_num_prg_a = ZERO;
_tot_num_mov_d = 0.00; _tot_num_mov_d = ZERO;
_tot_num_mov_a = 0.00; _tot_num_mov_a = ZERO;
_tot_num_saldo = 0.00; _tot_num_saldo = ZERO;
_tot_numr_prg_d = 0.00; _tot_numr_prg_d = ZERO;
_tot_numr_prg_a = 0.00; _tot_numr_prg_a = ZERO;
_tot_numr_mov_d = 0.00; _tot_numr_mov_d = ZERO;
_tot_numr_mov_a = 0.00; _tot_numr_mov_a = ZERO;
_tot_numr_saldo = 0.00; _tot_numr_saldo = ZERO;
} }
if ((_let_da_stamp!=_let_tot) || (_sez_da_stamp != _sez_tot)) if ((_let_da_stamp!=_let_tot) || (_sez_da_stamp != _sez_tot))
{ {
@ -2207,9 +2165,9 @@ void CG1600_application::stampa_totali_verifica()
if (!_stampa_modulo) if (!_stampa_modulo)
{ {
if (_tot_num_saldo.sign() < 0) if (_tot_num_saldo < ZERO)
{ {
_tot_num_saldo = _tot_num_saldo * (-1.00); _tot_num_saldo = -_tot_num_saldo;
_tot_sez_saldo = 'A'; _tot_sez_saldo = 'A';
} }
else else
@ -2236,9 +2194,9 @@ void CG1600_application::stampa_totali_verifica()
if (!_stampa_modulo) if (!_stampa_modulo)
{ {
if (_tot_numr_saldo.sign() < 0) if (_tot_numr_saldo < ZERO)
{ {
_tot_numr_saldo = _tot_numr_saldo * (-1.00); _tot_numr_saldo = -_tot_numr_saldo;
_tot_sez_saldo = 'A'; _tot_sez_saldo = 'A';
} }
else else
@ -2263,9 +2221,9 @@ void CG1600_application::stampa_totali_verifica()
if (!_stampa_modulo) if (!_stampa_modulo)
{ {
if (_tot_let_saldo.sign() < 0) if (_tot_let_saldo < ZERO)
{ {
_tot_let_saldo = _tot_let_saldo * (-1.00); _tot_let_saldo = -_tot_let_saldo;
_tot_sez_saldo = 'A'; _tot_sez_saldo = 'A';
} }
else else
@ -2282,21 +2240,21 @@ void CG1600_application::stampa_totali_verifica()
_cont_gcs = 0; _cont_gcs = 0;
_cont_num = 0; _cont_num = 0;
_cont_numr = 0; _cont_numr = 0;
_tot_num_prg_d = 0.00; _tot_num_prg_d = ZERO;
_tot_num_prg_a = 0.00; _tot_num_prg_a = ZERO;
_tot_num_mov_d = 0.00; _tot_num_mov_d = ZERO;
_tot_num_mov_a = 0.00; _tot_num_mov_a = ZERO;
_tot_num_saldo = 0.00; _tot_num_saldo = ZERO;
_tot_numr_prg_d = 0.00; _tot_numr_prg_d = ZERO;
_tot_numr_prg_a = 0.00; _tot_numr_prg_a = ZERO;
_tot_numr_mov_d = 0.00; _tot_numr_mov_d = ZERO;
_tot_numr_mov_a = 0.00; _tot_numr_mov_a = ZERO;
_tot_numr_saldo = 0.00; _tot_numr_saldo = ZERO;
_tot_let_prg_d = 0.00; _tot_let_prg_d = ZERO;
_tot_let_prg_a = 0.00; _tot_let_prg_a = ZERO;
_tot_let_mov_d = 0.00; _tot_let_mov_d = ZERO;
_tot_let_mov_a = 0.00; _tot_let_mov_a = ZERO;
_tot_let_saldo = 0.00; _tot_let_saldo = ZERO;
} }
} }
@ -2306,8 +2264,8 @@ void CG1600_application::stampa_saldo_198(real& saldo_d,real& saldo_a)
set_row (_i,"@48g|@81g|@114g|@131g|"); set_row (_i,"@48g|@81g|@114g|@131g|");
set_row (_i,"@133g%r", &saldo_a); set_row (_i,"@133g%r", &saldo_a);
set_row (_i++,"@48g|@81g|@114g|@131g|"); set_row (_i++,"@48g|@81g|@114g|@131g|");
saldo_d = real(0.00); saldo_d = real(ZERO);
saldo_a = real(0.00); saldo_a = real(ZERO);
} }
void CG1600_application::stampa_saldo_132(const real& saldo) void CG1600_application::stampa_saldo_132(const real& saldo)
@ -2535,12 +2493,12 @@ bool CG1600_application::preprocess_stampa_scalare(int counter)
if ((g != 0) && (c != 0) && (s != 0)) if ((g != 0) && (c != 0) && (s != 0))
{ {
if (_sez_da_stamp == '5') if (_sez_da_stamp == '5')
if (_sale.sign() < 0) if (_sale < ZERO)
_sale = _sale * (-1.00); _sale = -_sale;
if (_sez_da_stamp == '9') if (_sez_da_stamp == '9')
if (_sale.sign() > 0) if (_sale> ZERO)
_sale = _sale * (-1.00); _sale = -_sale;
_totale_numero += _sale; _totale_numero += _sale;
_totale_numr += _sale; _totale_numr += _sale;
@ -2568,11 +2526,11 @@ bool CG1600_application::preprocess_stampa_scalare(int counter)
if (_annoeserafr != 0) if (_annoeserafr != 0)
{ {
if (_sez_da_stamp == '5') if (_sez_da_stamp == '5')
if (_salerafr.sign() < 0) if (_salerafr < ZERO)
_salerafr = _salerafr * (-1.00); _salerafr = -_salerafr;
if (_sez_da_stamp == '9') if (_sez_da_stamp == '9')
if (_salerafr.sign() > 0) if (_salerafr> ZERO)
_salerafr = _salerafr * (-1.00); _salerafr = -_salerafr;
_totale_num_raf += _salerafr; _totale_num_raf += _salerafr;
_totale_numr_raf += _salerafr; _totale_numr_raf += _salerafr;
@ -2675,9 +2633,9 @@ bool CG1600_application::preprocess_stampa_verifica(int counter)
if (!_stampa_modulo) if (!_stampa_modulo)
{ {
if (_tot_gen_saldo.sign() < 0) if (_tot_gen_saldo < ZERO)
{ {
_tot_gen_saldo = _tot_gen_saldo * (-1.00); _tot_gen_saldo = -_tot_gen_saldo;
_tot_sez_saldo = 'A'; _tot_sez_saldo = 'A';
} }
else else
@ -2762,15 +2720,15 @@ bool CG1600_application::preprocess_stampa_verifica(int counter)
if ((g != 0) && (c != 0) && (s == 0)) if ((g != 0) && (c != 0) && (s == 0))
{ {
if (_sld_prg_avere.sign() < 0) if (_sld_prg_avere < ZERO)
_sld_prg_avere = _sld_prg_avere * (-1.00); _sld_prg_avere = -_sld_prg_avere;
if (_mov_avere.sign() < 0) if (_mov_avere < ZERO)
_mov_avere = _mov_avere * (-1.00); _mov_avere = -_mov_avere;
if (_sale.sign() < 0) if (_sale < ZERO)
{ {
_sale = _sale * (-1.00); _sale = -_sale;
_sez_saldo = 'A'; _sez_saldo = 'A';
} }
else else
@ -2784,15 +2742,15 @@ bool CG1600_application::preprocess_stampa_verifica(int counter)
_tot_let_saldo += _sale; _tot_let_saldo += _sale;
_tot_gen_saldo += _sale; _tot_gen_saldo += _sale;
if (_sld_prg_avere.sign() < 0) if (_sld_prg_avere < ZERO)
_sld_prg_avere = _sld_prg_avere * (-1.00); _sld_prg_avere = -_sld_prg_avere;
if (_mov_avere.sign() < 0) if (_mov_avere < ZERO)
_mov_avere = _mov_avere * (-1.00); _mov_avere = -_mov_avere;
if (_sale.sign() < 0) if (_sale < ZERO)
{ {
_sale = _sale * (-1.00); _sale = -_sale;
_sez_saldo = 'A'; _sez_saldo = 'A';
if (_stampa_modulo) if (_stampa_modulo)
{ {

View File

@ -50,9 +50,9 @@ $(EP)cg0500a.msk : cg0500a.uml
$(O)/cg1.o: cg1.cpp $(I10) $(I24) $(I32) $(O)/cg1.o: cg1.cpp $(I10) $(I24) $(I32)
$(O)/cg1100.o: cg1100.cpp $(I6) $(I10) $(I24) $(I27) $(I33) cg1100.h $(O)/cg1100.o: cg1100.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I47) $(I48) cg1100.h $(IP)pconti.h
$(O)/cg1200.o: cg1200.cpp $(I6) $(I10) $(I24) $(I27) $(I33) cg1200a.h $(O)/cg1200.o: cg1200.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I47) $(I48) cg1200a.h $(IP)saldi.h $(IP)clifo.h $(IP)comuni.h
$(O)/cg1300.o: cg1200.cpp $(I24) $(I31) $(I33) $(I51) $(O)/cg1300.o: cg1200.cpp $(I24) $(I31) $(I33) $(I51)