Patch level : 2.2 103

Files correlati     :  cg1.exe cg6.exe
Ricompilazione Demo : [ ]
Commento            :

Riportata la versione 2.1 302


git-svn-id: svn://10.65.10.50/trunk@13102 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2005-05-17 13:03:20 +00:00
parent eb92bf8bf8
commit 9e41c7ed10
5 changed files with 627 additions and 935 deletions

View File

@ -49,14 +49,13 @@ class CG1100_application : public TPrintapp
bil_ivd* _bil;
TRectype* _rec;
TSort* _sort;
TRelation * _rel;
TMask* _msk;
const char* _buf;
stampe _tipo_stampa;
bool _salto_pag,_resetta_righe_stampa;
int _old_gruppo;
int _i;
int _cur_c1, _cur_c2;
int _cur_std, _cur_sorted, _cur_senza_ana;
TString _clivd, _clivdo;
TParagraph_string _d1, _d2, _d3;
char _sez_da_stamp,_sez_stamp,_let_da_stamp,_let_stamp;
@ -289,24 +288,21 @@ void CG1100_application::set_page(int file,int counter)
//////////////////////////////////////////////////////////////
void CG1100_application::do_sort()
{
_sort->init();
select_cursor (_cur_std);
TCursor & c = *current_cursor();
TRectype & rec = c.curr();
const long last = c.items();
TProgind prg (last, TR("Elaborazione Piano dei Conti... Prego attendere"), false, true, 30);
if (_tipo_stampa == con_IV_direttiva)
{
char sez_conto,let_conto;
TString16 numr_conto;
TString16 num_conto;
bool classe_conto = false;
_sort->init();
select_cursor (_cur_c1);
TCursor * cursor = current_cursor();
TRectype & rec = cursor->curr();
long last = cursor->items();
TProgind prg (last, TR("Elaborazione Piano dei Conti... Prego attendere"), false, true, 30);
for ( *cursor = 0; cursor->pos() < last; ++(*cursor) )
for ( c = 0L; c.pos() < last; ++c)
{
prg.addstatus(1);
@ -328,7 +324,8 @@ void CG1100_application::do_sort()
if ((g != 0) && (c != 0) && (s == 0))
{
if (sez != '\0' && sez != '0')
classe_conto = sez > '0';
if (classe_conto)
{
sez_conto = sez;
@ -342,11 +339,8 @@ void CG1100_application::do_sort()
numr_conto = numr;
num_conto = num;
classe_conto = true;
riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,s,descr,sez_opp,let_opp,numr_opp,num_opp);
}
else
classe_conto = false;
}
if ((g != 0) && (c != 0) && (s != 0))
@ -355,7 +349,7 @@ void CG1100_application::do_sort()
riempi_record(sez_conto,let_conto,numr_conto,num_conto,g,c,s,descr,sez_opp,let_opp,numr_opp,num_opp);
else
{
if (sez != '\0' && sez != '0')
if (sez > '0')
{
if (let == '\0')
if ((sez == '1')||(sez == '2'))
@ -367,30 +361,15 @@ void CG1100_application::do_sort()
}
}
_sort->endsort();
select_cursor (_cur_c2);
}
if (_tipo_stampa == con_ana_bil)
{
bool livello_conto = false;
_sort->init();
select_cursor (_cur_c1);
TCursor * cursor = current_cursor();
TRectype & rec = cursor->curr();
long last = cursor->items();
TProgind prg (last, TR("Elaborazione Piano dei Conti... Prego attendere"), false, true, 30);
TString c1(12);
int conto_p = -1;
for ( *cursor = 0; cursor->pos() < last; ++(*cursor) )
for ( c = 0L; c.pos() < last; ++c)
{
prg.addstatus(1);
@ -399,7 +378,7 @@ void CG1100_application::do_sort()
if (livello_conto && (conto != conto_p) )
{
c1 = "";
c1.cut(0);
livello_conto = false;
}
@ -425,10 +404,9 @@ void CG1100_application::do_sort()
if (rec.get(PCN_CODCBL).not_empty() )
_sort->sort (rec.string());
}
_sort->endsort();
select_cursor (_cur_c2);
}
_sort->endsort();
select_cursor (_cur_sorted);
}
bool CG1100_application::preprocess_print (int file,int counter)
@ -481,7 +459,6 @@ bool CG1100_application::preprocess_print (int file,int counter)
}
break;
case senza_ana_bil:
break;
default:
break;
}
@ -624,7 +601,7 @@ void CG1100_application::set_con_IV()
set_row (_i,"@120g%8s", (const char*) numrom_opp);
if (num_opp.not_empty())
set_row (_i++,"@129g%-4s", num_opp);
set_row (_i++,"@129g%-4s", (const char *) num_opp);
}
else
_i++;
@ -709,10 +686,12 @@ void CG1100_application::set_con_ana()
else
val = TR("No");
if (_codcbl_da_stamp != _codcbl_stamp)
if (_codcbl_da_stamp != _codcbl_stamp)
{
set_row (_i,"@0g%s", (const char*) _codcbl_da_stamp);
_d3 = descrizione_codcbl(codcbl);
_d3.trim();
set_row (_i,"@13g#a", &_d3);
}
@ -736,6 +715,7 @@ void CG1100_application::set_con_ana()
set_row (_i, "@129g%s", (const char*) val);
_i++;
}
void CG1100_application::set_completa()
@ -1012,8 +992,6 @@ bool CG1100_application::set_print(int)
if (tasto == K_ENTER)
{
select_cursor(_cur_c1);
current_cursor()->setfilter("");
_tipo_stampa = (stampe)_msk->get_int(F_SCELTA_STAMPA);
_salto_pag = _msk->get_bool(F_SALTO_PAGINA);
_data_stampa = _msk->get(F_DATA_STAMPA);
@ -1048,18 +1026,16 @@ bool CG1100_application::set_print(int)
case completa:
case completa_bil:
case senza_IV_direttiva:
select_cursor(_cur_c1);
select_cursor(_cur_std);
break;
case senza_ana_bil:
{
current_cursor()->setfilter("CODCBL==\"\"");
select_cursor(_cur_senza_ana);
break;
}
case con_IV_direttiva:
case con_ana_bil:
init_sort();
do_sort();
select_cursor (_cur_c2); break;
break;
default:
break;
}
@ -1179,15 +1155,24 @@ const TString & CG1100_application::descrizione_codcbl(const TString& codcbl)
bool CG1100_application::user_create()
{
open_files(LF_NDITTE, LF_PCON, LF_TABCOM, LF_TAB, 0);
_rel = new TRelation (LF_PCON);
_msk = new TMask ("cg1100a") ;
TCursor *cursor = new TCursor (_rel);
TCursor * cursor = new TCursor (new TRelation (LF_PCON));
_cur_c1 = add_cursor (cursor);
_cur_std = add_cursor (cursor);
_rec = new TRectype (cursor->curr());
_cur_c2 = add_cursor (NULL);
add_file(LF_PCON);
_cur_sorted = add_cursor (NULL);
add_file(LF_PCON);
TRelation * rel_ana = new TRelation(LF_PCON);
rel_ana->add(LF_PCON, "GRUPPO==GRUPPO|CONTO==CONTO|SOTTOCONTO==0", 1, 0, 201);
rel_ana->add(LF_PCON, "GRUPPO==GRUPPO|CONTO==0|SOTTOCONTO==0", 1, 0, 202);
_cur_senza_ana = add_cursor(new TCursor(rel_ana));
select_cursor(_cur_senza_ana);
TCursor & c = *current_cursor();
c.setfilter("((SOTTOCONTO!=0)&&(CODCBL==\"\")&&(201@->CODCBL==\"\")&&(202@->CODCBL==\"\"))||((SOTTOCONTO==0)&&(201@->CODCBL==\"\")&&(202@->CODCBL==\"\"))||((CONTO==0)&&(202@->CODCBL==\"\"))");
select_cursor(_cur_std);
_tipo_stampa = completa;
_salto_pag = false;
_bil = new bil_ivd;
@ -1198,7 +1183,6 @@ bool CG1100_application::user_create()
bool CG1100_application::user_destroy()
{
delete _rel;
delete _msk;
delete _rec;
delete _bil;

File diff suppressed because it is too large Load Diff

View File

@ -749,7 +749,7 @@ void TRic_tab::conto(TRectype& pcon,char flag,bool esiste)
TString8 sez = _tpcon->get (PCN_SEZIVD);
TString8 let = _tpcon->get (PCN_LETTIVD);
TString8 numr = _tpcon->get (PCN_NUMRIVD);
int num = _tpcon->get_int(PCN_NUMIVD);
TString8 num = _tpcon->get(PCN_NUMIVD);
if (sez.not_empty())
{
@ -790,14 +790,14 @@ void TRic_tab::sottoconto(TRectype& pcon,char flag,bool esiste)
int g = _tpcon->get_int(PCN_GRUPPO);
int c = _tpcon->get_int(PCN_CONTO);
TString sez = _tpcon->get (PCN_SEZIVD);
TString let = _tpcon->get (PCN_LETTIVD);
TString numr = _tpcon->get (PCN_NUMRIVD);
int num = _tpcon->get_int(PCN_NUMIVD);
TString sezop = _tpcon->get (PCN_SEZIVDOPP);
TString letop = _tpcon->get (PCN_LETTIVDOPP);
TString numrop = _tpcon->get (PCN_NUMRIVDOPP);
int numop = _tpcon->get_int(PCN_NUMIVDOPP);
TString sez = _tpcon->get(PCN_SEZIVD);
TString let = _tpcon->get(PCN_LETTIVD);
TString numr = _tpcon->get(PCN_NUMRIVD);
TString num = _tpcon->get(PCN_NUMIVD);
TString sezop = _tpcon->get(PCN_SEZIVDOPP);
TString letop = _tpcon->get(PCN_LETTIVDOPP);
TString numrop = _tpcon->get(PCN_NUMRIVDOPP);
TString numop = _tpcon->get(PCN_NUMIVDOPP);
if (sez.not_empty())
{

View File

@ -851,9 +851,8 @@ bool TInv_cont::invio_pcon()
str.format("%-8s", (const char*) numr);
record.overwrite(str,50); //Numero romano IV dir
int num = _tpcon->get_int(PCN_NUMIVD);
str.format("%02d", num);
record.overwrite(str,58); //Numero arabo IV dir
const TString num = _tpcon->get(PCN_NUMIVD).left(2);
record.overwrite(num,58); //Numero arabo IV dir
// Classe IV direttiva CEE di segno opposto
@ -872,9 +871,8 @@ bool TInv_cont::invio_pcon()
str.format("%-8s", (const char*) numrop);
record.overwrite(str,65); //Numero romano IV dir
int numop = _tpcon->get_int(PCN_NUMIVDOPP);
str.format("%02d", numop);
record.overwrite(str,73); //Numero arabo IV dir
const TString16 numop = _tpcon->get(PCN_NUMIVDOPP).left(2);
record.overwrite(numop,73); //Numero arabo IV dir
}
// Se si tratta di un SOTTOCONTO
@ -923,9 +921,8 @@ bool TInv_cont::invio_pcon()
str.format("%-8s", (const char*) numr);
record.overwrite(str,49); //Numero romano IV dir
int num = _tpcon->get_int(PCN_NUMIVD);
str.format("%02d", num);
record.overwrite(str,57); //Numero arabo IV dir
const TString num = _tpcon->get(PCN_NUMIVD).left(2);
record.overwrite(num, 57); //Numero arabo IV dir
// Classe IV direttiva CEE di segno opposto
@ -944,9 +941,8 @@ bool TInv_cont::invio_pcon()
str.format("%-8s", (const char*) numrop);
record.overwrite(str,64); //Numero romano IV dir
int numop = _tpcon->get_int(PCN_NUMIVDOPP);
str.format("%02d", numop);
record.overwrite(str,72); //Numero arabo IV dir
const TString numop = _tpcon->get(PCN_NUMIVDOPP).left(2);
record.overwrite(numop, 72); //Numero arabo IV dir
int ivacomp = atoi(_tpcon->get(PCN_IVACOMP));
str.format("%02d",ivacomp);

View File

@ -558,9 +558,8 @@ void TInv_cont::invio_piano_conti()
str.format("%8d", numrom);
record.overwrite(str,116); //Numero romano IV dir
int num = _tpcon->get_int(PCN_NUMIVD);
str.format("%02d", num);
record.overwrite(str,124); //Numero arabo IV dir
const TString num = _tpcon->get(PCN_NUMIVD).left(2);
record.overwrite(num,124); //Numero arabo IV dir
// Classe IV direttiva CEE di segno opposto
@ -576,9 +575,8 @@ void TInv_cont::invio_piano_conti()
str.format("%8d", numromop);
record.overwrite(str,128); //Numero romano IV dir
int numop = _tpcon->get_int(PCN_NUMIVDOPP);
str.format("%02d", numop);
record.overwrite(str,136); //Numero arabo IV dir
const TString numop = _tpcon->get(PCN_NUMIVDOPP).left(2);
record.overwrite(numop, 136); //Numero arabo IV dir
}
// Se si tratta di un SOTTOCONTO
@ -626,9 +624,8 @@ void TInv_cont::invio_piano_conti()
str.format("%8d", numrom);
record.overwrite(str,115); //Numero romano IV dir
int num = _tpcon->get_int(PCN_NUMIVD);
str.format("%02d", num);
record.overwrite(str,123); //Numero arabo IV dir
const TString num = _tpcon->get(PCN_NUMIVD).left(2);
record.overwrite(num,123); //Numero arabo IV dir
// Classe IV direttiva CEE di segno opposto
@ -644,9 +641,8 @@ void TInv_cont::invio_piano_conti()
str.format("%8d", numromop);
record.overwrite(str,127); //Numero romano IV dir
int numop = _tpcon->get_int(PCN_NUMIVDOPP);
str.format("%02d", numop);
record.overwrite(str,135); //Numero arabo IV dir
const TString & numop = _tpcon->get(PCN_NUMIVDOPP).left(2);
record.overwrite(numop,135); //Numero arabo IV dir
int ricser = _tpcon->get_int(PCN_RICSER);
str.format("%d", ricser);