diff --git a/cg/cg6400.cpp b/cg/cg6400.cpp index 36b09c187..84b2bebb6 100755 --- a/cg/cg6400.cpp +++ b/cg/cg6400.cpp @@ -311,7 +311,8 @@ bool TRic_archivi::leggi_marker_rep() return error_box(FR("Gli archivi della ditta %ld non sono presenti su disco"), _dittaric); } else - return error_box(TR("Codici NON PRESENTI in tabella ricezione: caricarli e riprovare")); + return error_box(FR("Codici NON PRESENTI in tabella ricezione:\nStudio %s Ditta inviante %ld"), + (const char*)_nomeid, _dittainv); } return TRUE; @@ -685,14 +686,11 @@ void TRic_archivi::ditta_ricevente() long TRic_archivi::leggi_tabella_tras() { - TString dep(16); long ditta = 0; - bool agg_fatatt,agg_fatpas; - + + TString16 dep; TTable tab_tra ("%TRA"); - - tab_tra.zero(); - dep.format("%10s%05ld", (const char*) _nomeid, _dittainv); + dep.format("%10s%05ld", (const char*)_nomeid, _dittainv); tab_tra.put("CODTAB", dep); if (tab_tra.read() == NOERR) { @@ -703,13 +701,13 @@ long TRic_archivi::leggi_tabella_tras() _agg_clifo = tab_tra.get_char("S1"); _agg_pcon = tab_tra.get_char("S2"); _agg_cls = tab_tra.get_char("S3"); - agg_fatatt = tab_tra.get_bool("B0"); + bool agg_fatatt = tab_tra.get_bool("B0"); if (agg_fatatt) _agg_fatatt = 'X'; else _agg_fatatt = ' '; - agg_fatpas = tab_tra.get_bool("B1"); + bool agg_fatpas = tab_tra.get_bool("B1"); if (agg_fatpas) _agg_fatpas = 'X'; else diff --git a/cg/cg6600.cpp b/cg/cg6600.cpp index 2ce88e364..be52ccb7a 100755 --- a/cg/cg6600.cpp +++ b/cg/cg6600.cpp @@ -26,8 +26,7 @@ #include class TRic_tab : public TSkeleton_application -{ - +{ TTable* _tab_tra; TLocalisamfile* _caus,*_rcaus,*_clifo,*_pcon,*_mov,*_rmov,*_rmoviva; TLocalisamfile* _saldi,*_occas,*_part,*_scad,*_pagsca; @@ -205,7 +204,7 @@ void TRic_tab::main_loop() apri_file_temp(); trasferimento(); - posiz = _tras_file.num('Z'); //Ritorna la posizione della sigla all'interno dell'indice + posiz = _tras_file.num('Z'); //Ritorna la posizione della sigla all'interno dell'indice if (posiz >= 0) { @@ -623,9 +622,9 @@ void TRic_tab::ricevi_pcon(TString& key, char uselab) { _prog->addstatus(1); - int g = _tpcon->get_int (PCN_GRUPPO); - int c = _tpcon->get_int (PCN_CONTO); - long s = _tpcon->get_long(PCN_SOTTOCONTO); + const int g = _tpcon->get_int (PCN_GRUPPO); + const int c = _tpcon->get_int (PCN_CONTO); + const long s = _tpcon->get_long(PCN_SOTTOCONTO); _pcon->curr() = _tpcon->curr(); @@ -668,10 +667,19 @@ void TRic_tab::ricevi_pcon(TString& key, char uselab) if (f_IV == 'T') { + /* if (g != 0 && c == 0) conto(pcon,flag,esiste); if (g != 0 && c != 0 && s != 0) sottoconto(pcon,flag,esiste); + */ + if (g != 0 && c != 0) + { + if (s == 0) + conto(pcon,flag,esiste); + else + sottoconto(pcon,flag,esiste); + } } if (esiste) @@ -735,12 +743,12 @@ void TRic_tab::scrivi_pcon(TRectype& pcon,bool esiste) void TRic_tab::conto(TRectype& pcon,char flag,bool esiste) { - int g = _tpcon->get_int(PCN_GRUPPO); - int c = _tpcon->get_int(PCN_CONTO); + const int g = _tpcon->get_int(PCN_GRUPPO); + const 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); + 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); if (sez.not_empty()) diff --git a/cg/cglib04.cpp b/cg/cglib04.cpp index 805a960a5..782337f89 100755 --- a/cg/cglib04.cpp +++ b/cg/cglib04.cpp @@ -504,7 +504,7 @@ bool TTransfer_file::read_control_rec() NFCHECK("Non e' possibile allocare una stringa di %d in una stringa fissa di %d caratteri", _control_rec->len(),sizeH); _tiporec = _control_rec->left(2); - + if (_tiporec == " 1") { _nome_simb = _control_rec->sub(60,70); @@ -3681,7 +3681,7 @@ bool TTransfer_file::fcopytemp_PC(const char* orig, const char* dest) { const word letti = fread((char*)(const char*)buffer, 1, size, i); - trec = buffer.sub(0,2); + trec = buffer.left(2); if (trec == " 1") // Copio il record di controllo nel file di appoggio { // header. @@ -3749,8 +3749,8 @@ bool TTransfer_file::fcopytemp_PC(const char* orig, const char* dest) } if (sigle.find('P') >= 0) { - delete _tpcon; - delete _deppcon; + delete _tpcon; _tpcon = NULL; + delete _deppcon; _deppcon = NULL; } if (sigle.find('Z') >= 0) { @@ -4028,11 +4028,11 @@ void TTransfer_file::write_clienti_fornitori(TString& record) void TTransfer_file::write_piano_conti(TString& record) { - TString sigla,key; + TString8 key; int numfield = 1; TMappa_trc& trc = mappa(); - sigla = record.mid(0,2); + const TString4 sigla = record.left(2); key.format("%2s%d", (const char*)sigla,numfield); _deppcon->zero();