diff --git a/cg/cg3100.cpp b/cg/cg3100.cpp index 8f4cfbb75..26bc94304 100755 --- a/cg/cg3100.cpp +++ b/cg/cg3100.cpp @@ -1,11 +1,13 @@ +// //Lista movimenti - +// +#include "cg3.h" +#include "cg3100.h" #include #include #include #include #include - #include #include #include @@ -16,9 +18,6 @@ #include #include #include - -#include "cg3.h" -#include "cg3100.h" #include "cglib03.h" #include "cg2103.h" @@ -75,7 +74,7 @@ class TListaMov_application : public TPrintapp TRigaiva_array _c; TTable * _tabiva, * _tabtpd, * _tabreg, * _tabes; TLocalisamfile * _caus,* _comuni,* _rmoviva, * _clifo, * _pcon, * _attiv, *_nditte, *_saldi; - TRelation * _relmov,* _relmov1,* _relmov2,* _relmov3; + TRelation * _relmov1,* _relmov2,* _relmov3; TCursor * _curr1, * _curr2, * _curr3; TBit_array _err; TDate _data_ini, _data_fin, _datareg, _data_prec, _datacomp; @@ -612,11 +611,11 @@ void TListaMov_application::stampa_errori_rmov() _nr++; if (anno != _annoeser || datareg != _datareg) - set_row(_nr++, "@11gAnno esercizio o data di registrazione inconsistente tra testata e righe"); + set_row(_nr++, "@11gUno o piu' campi non sono costanti nella riga dell' operazione"); if (sez != 'D' && sez != 'A') - set_row(_nr++, "@11gIndicato tipo sezione Dare/Avere errato"); + set_row(_nr++, "@11gIndicato tipo movimento Dare/Avere errato"); if (tc.empty()) - set_row(_nr++, "@11gCodice gruppo/conto/sottoconto non presente"); + set_row(_nr++, "@11gNon presente codice gruppo/conto/sottoconto"); if (!tc.ok()) set_row(_nr++, "@11gCodice gruppo/conto/sottoconto non corrisponde ad un sottoconto"); @@ -626,7 +625,7 @@ void TListaMov_application::stampa_errori_rmov() g = TRUE; tc.set(gruppo,conto,0l); if (!tc.read(pc)) - set_row(_nr++, "@11gCodice gruppo/conto/sottoconto non presente nel Piano dei Conti"); + set_row(_nr++, "@11gCodice gruppo/conto/sottoconto non presente in Piano dei Conti"); else { t = pc.get_char(PCN_TMCF); @@ -878,7 +877,7 @@ void TListaMov_application::stampa_intestazione() bool TListaMov_application::preprocess_page(int file,int counter) { - TCursor * cur = current_cursor(); + TCursor* cur = current_cursor(); if (counter) return TRUE; @@ -1282,8 +1281,9 @@ print_action TListaMov_application::postprocess_page(int file,int count) if (_registro.not_empty() && _mov_di_sola_iva) { compila_clifo(); - set_row(++r, "@1g%3s %-.19s@25g%-35s %6ld %-50s", (const char*)_causale, (const char*)_descr_causale, - (const char*) _descr_doc, _codcf, (const char*)_ragsoc); + // set_row(++r, "@1g%3s %-.19s@25g%-35s %6ld %-50s", (const char*)_causale, (const char*)_descr_causale, + // (const char*) _descr_doc, _codcf, (const char*)_ragsoc); + set_row(++r, "@1g%3s %-50s %6ld %-50s", (const char*)_causale, (const char*)_descr_causale, _codcf, (const char*)_ragsoc); } if ( _scelta_stampa == 0 && _stampa_parte_iva ) { @@ -2209,7 +2209,12 @@ bool TListaMov_application::user_create() bool TListaMov_application::user_destroy() // releasev e arrmask { - delete _relmov; + delete _relmov1; + delete _relmov2; + delete _relmov3; + delete _curr1; + delete _curr2; + delete _curr3; delete _clifo; delete _caus; delete _pcon; @@ -2217,7 +2222,8 @@ bool TListaMov_application::user_destroy() // releasev e arrmask delete _comuni; delete _tabiva; delete _tabreg; - delete _tabtpd; + delete _tabtpd; + delete _tabes; delete _rmoviva; delete _saldi; diff --git a/cg/cg4400.cpp b/cg/cg4400.cpp index b98dc0575..2c647e5cf 100755 --- a/cg/cg4400.cpp +++ b/cg/cg4400.cpp @@ -773,11 +773,11 @@ void CG4400_application::calcola_progressivi() real impo = pim.get_real("R0"); real impos = pim.get_real("R1"); real implo = pim.get_real("R2"); - TToken_string& fatt_rit = (TToken_string&)pim.get("S1"); - real im = real::ita2eng(fatt_rit.get(0)); - real is = real::ita2eng(fatt_rit.get(1)); - impo += im; - impos += is; + TToken_string fatt_rit (pim.get("S1")); + real im (fatt_rit.get(0)); + real is (fatt_rit.get(1)); + impo += im; + impos += is; implo += im+is; _tot_iva_array.add_riga(impo,impos,implo,ZERO,ZERO,ZERO,codiva); if (_tipo_reg == 2) //registro acquisti @@ -813,9 +813,9 @@ void CG4400_application::calcola_progressivi() real impo = pim.get_real("R0"); real impos = pim.get_real("R1"); real implo = pim.get_real("R2"); - TToken_string& fatt_rit = (TToken_string&)pim.get("S1"); - real im = real::ita2eng(fatt_rit.get(0)); - real is = real::ita2eng(fatt_rit.get(1)); + TToken_string fatt_rit (pim.get("S1")); + real im (fatt_rit.get(0)); + real is (fatt_rit.get(1)); impo += im; impos += is; implo += im+is; @@ -883,12 +883,16 @@ int CG4400_application::setta_riga(int r, const TRigaiva& riga, real& tot1, set_row(r, "%4s", (const char*)riga._codiva); TString descr = descr_iva(riga._codiva); set_row(r, "@5g%-.21s",(const char*)descr); - set_row(r, "@25g%r", &riga._imponibile); - set_row(r, "@41g%r", &riga._imposta); + if (riga._imponibile != ZERO) + set_row(r, "@25g%r", &riga._imponibile); + if (riga._imposta != ZERO) + set_row(r, "@41g%r", &riga._imposta); if (_tipo_stampa != 1) { - set_row(r, "@81g%r", &riga._imponibilep); - set_row(r++, "@98g%r", &riga._impostap); + if (riga._imponibilep != ZERO) + set_row(r, "@81g%r", &riga._imponibilep); + if (riga._impostap != ZERO) + set_row(r++, "@98g%r", &riga._impostap); } else r++; tot1 += riga._imponibile; @@ -902,7 +906,6 @@ int CG4400_application::setta_riga(int r, const TRigaiva& riga, real& tot1, messaggio CG4400_application::controlla_liquidazione() { TTable lim ("LIM"); - TTable pim ("PIM"); TString mesi_cal = ""; TString16 chiave = ""; TString16 ditta = ""; @@ -910,13 +913,6 @@ messaggio CG4400_application::controlla_liquidazione() bool continua; ditta << get_firm(); - /* - if (lim.empty()) - return yesno_box("Ditta %s: non esiste la tabella liquidazione iva mensile! Vuoi ugualmente continuare la stampa?", (const char*) ditta); - if (pim.empty()) - return yesno_box("Ditta %s: non esiste la tabella progressivi iva mensile! Vuoi ugualmente continuare la stampa?", (const char*) ditta); - */ - if (_tipo_stampa == 1) //stampa di prova mese = _data_a.month(); else @@ -932,9 +928,12 @@ messaggio CG4400_application::controlla_liquidazione() TString16 m (format("%02d", i)); chiave << _annoes << m; lim.put("CODTAB", chiave); - if (lim.read() == NOERR) + if (lim.read() == NOERR) + { if (! lim.get_bool("B0")) mesi_cal << itom(i) << "\n"; + } + else mesi_cal << itom(i) << "\n"; } } if (_frequiva == 'M') @@ -946,8 +945,11 @@ messaggio CG4400_application::controlla_liquidazione() chiave << _annoes << m; lim.put("CODTAB", chiave); if (lim.read() == NOERR) + { if (! lim.get_bool("B0")) mesi_cal << itom(i) << "\n"; + } + else mesi_cal << itom(i) << "\n"; } } if (mesi_cal.not_empty()) @@ -967,6 +969,7 @@ messaggio CG4400_application::controlla_liquidazione() chiave << _annoes << 13; lim.put("CODTAB", chiave); if (lim.read() == NOERR) + { if (! lim.get_bool("B0")) { continua = yesno_box("Ditta %s: non eseguito calcolo liquidazione da stampare sul registro %s. Si desidera ugualmente proseguire?", (const char*)ditta, (const char*) _codreg); @@ -974,7 +977,16 @@ messaggio CG4400_application::controlla_liquidazione() continua = yesno_box("Si desidera proseguire con il calcolo e la stampa di liquidazione? \n (altrimenti si prosegue con la sola stampa di liquidazione)"); if (!continua) return prosegui_stampa; return prosegui_cal_stampa; - } + } + } + else + { + continua = yesno_box("Ditta %s: non eseguito calcolo liquidazione da stampare sul registro %s. Si desidera ugualmente proseguire?", (const char*)ditta, (const char*) _codreg); + if (!continua) return non_proseguire; + continua = yesno_box("Si desidera proseguire con il calcolo e la stampa di liquidazione? \n (altrimenti si prosegue con la sola stampa di liquidazione)"); + if (!continua) return prosegui_stampa; + return prosegui_cal_stampa; + } } return B0_settato; } @@ -1168,7 +1180,7 @@ int CG4400_application::stampa_acquisti(int row) row+=2; int tdetprec = -1; int rw = row; - tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00; + tot_imponib = tot_imposta = tot_imponibp = tot_impostap = ZERO; _iva_array.sort(compare_fields); for (int s = 0; s < _iva_array.items(); s++) @@ -1192,9 +1204,21 @@ int CG4400_application::stampa_acquisti(int row) break; case 3: if (tdetprec == 1) { - set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta); + //set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta); + set_row(++rw, "TOTALE"); + if (tot_imponib != ZERO) + set_row(rw, "@25g%r", &tot_imponib); + if (tot_imposta != ZERO) + set_row(rw, "@41g%r", &tot_imposta); + if (_tipo_stampa != 1) - set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap); + { + //set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap); + if (tot_imponibp != ZERO) + set_row(rw, "@81g%r", &tot_imponibp); + if (tot_impostap != ZERO) + set_row(rw, "@98g%r", &tot_impostap); + } tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00; rw+=2; } @@ -1214,9 +1238,20 @@ int CG4400_application::stampa_acquisti(int row) break; case 9: if ( (tdetprec == 1) || (tdetprec == 3) ) { - set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta); - if (_tipo_stampa != 1) - set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap); + //set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta); + set_row(++rw, "TOTALE"); + if (tot_imponib != ZERO) + set_row(rw, "@25g%r", &tot_imponib); + if (tot_imposta != ZERO) + set_row(rw, "@41g%r", &tot_imposta); + if (_tipo_stampa != 1) + { + //set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap); + if (tot_imponibp != ZERO) + set_row(rw, "@81g%r", &tot_imponibp); + if (tot_impostap != ZERO) + set_row(rw, "@98g%r", &tot_impostap); + } tot_imponib = tot_imposta = tot_imponibp = tot_impostap = 0.00; rw+=2; } @@ -1240,9 +1275,20 @@ int CG4400_application::stampa_acquisti(int row) if (_iva_array.items() > 0) if (tdetprec == 9) { - set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta); + //set_row(++rw, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta); + set_row(++rw, "TOTALE"); + if (tot_imponib != ZERO) + set_row(rw, "@25g%r", &tot_imponib); + if (tot_imposta != ZERO) + set_row(rw, "@41g%r", &tot_imposta); if (_tipo_stampa != 1) - set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap); + { + //set_row(rw, "@81g%r@98g%r", &tot_imponibp, &tot_impostap); + if (tot_imponibp != ZERO) + set_row(rw, "@81g%r", &tot_imponibp); + if (tot_impostap != ZERO) + set_row(rw, "@98g%r", &tot_impostap); + } } _iva_array.destroy(); rw++; @@ -1383,14 +1429,25 @@ void CG4400_application::set_page_tot_reg() } _tot_iva_array.destroy(); rr++; - set_row(rr, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta); - if (_tipo_reg == 1 && _corrispettivi) - set_row(rr, "@61g%r", &tot_lordo); + //set_row(rr, "TOTALE@25g%r@41g%r", &tot_imponib, &tot_imposta); + set_row(rr, "TOTALE"); + if (tot_imponib != ZERO) + set_row(rr, "@25g%r", &tot_imponib); + if (tot_imposta != ZERO) + set_row(rr, "@41g%r", &tot_imposta); + if (_tipo_reg == 1 && _corrispettivi) + if (tot_lordo != ZERO) + set_row(rr, "@61g%r", &tot_lordo); if (_tipo_stampa != 1) { - set_row(rr, "@81g%r@98g%r", &tot_imponibp, &tot_impostap); + //set_row(rr, "@81g%r@98g%r", &tot_imponibp, &tot_impostap); + if (tot_imponibp != ZERO) + set_row(rr, "@81g%r", &tot_imponibp); + if (tot_impostap != ZERO) + set_row(rr, "@98g%r", &tot_impostap); if (_tipo_reg == 1 && _corrispettivi) - set_row(rr, "@115g%r", &tot_lordop); + if (tot_lordop != ZERO) + set_row(rr, "@115g%r", &tot_lordop); } if (_tipo_reg == 2) rr = stampa_acquisti(rr); @@ -2259,6 +2316,12 @@ void CG4400_application::liq_other_case() app.temp(); send_message('C', app, _datareg.month()); } + if (_scelta == no_liquidazione) + { + TFilename app; + app.temp(); + send_message('C', app, _datareg.month()); + } } print_action CG4400_application::postprocess_page (int file, int counter) @@ -2549,7 +2612,8 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m) _intesta_vidi = FALSE; _ok_vidi = FALSE; _stampa_mese = 13; - _scelta = prosegui_stampa; + _scelta = no_liquidazione; + TApplication::set_firm(_ditta); look_lia(); ok = compila_reg(m); @@ -2657,8 +2721,9 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m) _intesta_vidi = FALSE; _ok_vidi = FALSE; _stampa_mese = 13; - _scelta = prosegui_stampa; - ok = setta_mask(i); + _scelta = no_liquidazione; //sul registro non va stampata la liq. ma comunque + //va richiamata per il calcolo progressivi + ok = setta_mask(i); if (!ok) continue; if (_liquidazione) diff --git a/cg/cg4400.h b/cg/cg4400.h index 87c0b4d92..544d419ca 100755 --- a/cg/cg4400.h +++ b/cg/cg4400.h @@ -27,6 +27,7 @@ #include "conto.h" enum messaggio { + no_liquidazione, B0_settato, non_proseguire, prosegui_stampa,