Corretto errore riepilogativo per non movimentati
git-svn-id: svn://10.65.10.50/trunk@2615 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
6c159db49c
commit
581fbefbc0
401
cg/cg4400.cpp
401
cg/cg4400.cpp
@ -1375,7 +1375,7 @@ messaggio CG4400_application::controlla_b0()
|
|||||||
}
|
}
|
||||||
return B0_settato;
|
return B0_settato;
|
||||||
}
|
}
|
||||||
***/
|
****/
|
||||||
|
|
||||||
messaggio CG4400_application::controlla_liquidazione()
|
messaggio CG4400_application::controlla_liquidazione()
|
||||||
{
|
{
|
||||||
@ -1394,7 +1394,7 @@ messaggio CG4400_application::controlla_liquidazione()
|
|||||||
|
|
||||||
if (_tipo_riepilogativo == ' ' || _tipo_riepilogativo == 'P')
|
if (_tipo_riepilogativo == ' ' || _tipo_riepilogativo == 'P')
|
||||||
{
|
{
|
||||||
if (_frequiva == 'T') //nella tabella LIM ho solo i mesi 3, 6, 9, 12
|
if (_frequiva == 'T') //la LIM esiste solo per i mesi 3, 6, 9, 12
|
||||||
{
|
{
|
||||||
for (i=3; i<=mese; i+=3)
|
for (i=3; i<=mese; i+=3)
|
||||||
{
|
{
|
||||||
@ -1402,12 +1402,8 @@ messaggio CG4400_application::controlla_liquidazione()
|
|||||||
TString16 m (format("%02d", i));
|
TString16 m (format("%02d", i));
|
||||||
chiave << _annoes << m;
|
chiave << _annoes << m;
|
||||||
lim.put("CODTAB", chiave);
|
lim.put("CODTAB", chiave);
|
||||||
if (lim.read() == NOERR)
|
if (lim.read() != NOERR || !lim.get_bool("B0"))
|
||||||
{
|
mesi_cal << itom(i) << "\n";
|
||||||
if (! lim.get_bool("B0"))
|
|
||||||
mesi_cal << itom(i) << "\n";
|
|
||||||
}
|
|
||||||
else mesi_cal << itom(i) << "\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_frequiva == 'M')
|
if (_frequiva == 'M')
|
||||||
@ -1418,12 +1414,8 @@ messaggio CG4400_application::controlla_liquidazione()
|
|||||||
TString16 m (format("%02d", i));
|
TString16 m (format("%02d", i));
|
||||||
chiave << _annoes << m;
|
chiave << _annoes << m;
|
||||||
lim.put("CODTAB", chiave);
|
lim.put("CODTAB", chiave);
|
||||||
if (lim.read() == NOERR)
|
if (lim.read() != NOERR || !lim.get_bool("B0"))
|
||||||
{
|
mesi_cal << itom(i) << "\n";
|
||||||
if (! lim.get_bool("B0"))
|
|
||||||
mesi_cal << itom(i) << "\n";
|
|
||||||
}
|
|
||||||
else mesi_cal << itom(i) << "\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mesi_cal.not_empty())
|
if (mesi_cal.not_empty())
|
||||||
@ -1431,37 +1423,53 @@ messaggio CG4400_application::controlla_liquidazione()
|
|||||||
warning_box ("Ditta %s: la liquidazione da stampare sul registro %s relativa ai mesi di \n %s non e' stata ancora calcolata", (const char*)ditta, (const char*) _codreg, (const char *)mesi_cal);
|
warning_box ("Ditta %s: la liquidazione da stampare sul registro %s relativa ai mesi di \n %s non e' stata ancora calcolata", (const char*)ditta, (const char*) _codreg, (const char *)mesi_cal);
|
||||||
continua = yesno_box("Si desidera ugualmente proseguire?");
|
continua = yesno_box("Si desidera ugualmente proseguire?");
|
||||||
if (!continua) return non_proseguire;
|
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)");
|
continua = yesno_box("Si desidera proseguire con il calcolo e la stampa di liquidazione? \n (altrimenti si prosegue con la sola stampa liquidazione)");
|
||||||
if (!continua) return prosegui_stampa;
|
if (!continua) return prosegui_stampa;
|
||||||
return prosegui_cal_stampa;
|
return prosegui_cal_stampa;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_tipo_riepilogativo == 'A')
|
else if (_tipo_riepilogativo == 'A')
|
||||||
//if (_riep_liq)
|
{
|
||||||
|
chiave = "";
|
||||||
|
chiave << _annoes << 13;
|
||||||
|
lim.put("CODTAB", chiave);
|
||||||
|
if (lim.read() != NOERR || !lim.get_bool("B0"))
|
||||||
{
|
{
|
||||||
chiave = "";
|
continua = yesno_box("Ditta %s: non eseguito calcolo liquidazione annuale da stampare sul registro %s. Si desidera ugualmente proseguire?", (const char*)ditta, (const char*) _codreg);
|
||||||
chiave << _annoes << 13;
|
if (!continua) return non_proseguire;
|
||||||
lim.put("CODTAB", chiave);
|
continua = yesno_box("Si desidera proseguire con il calcolo e la stampa di liquidazione? \n (altrimenti si prosegue con la sola stampa liquidazione)");
|
||||||
if (lim.read() == NOERR)
|
if (!continua) return prosegui_stampa;
|
||||||
|
return prosegui_cal_stampa;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bool need_refresh = FALSE;
|
||||||
|
for (int m=1; m<13; m++)
|
||||||
|
if (_frequiva == 'M' ||
|
||||||
|
(m==3 || m==6 || m==9 || m==12))
|
||||||
|
{
|
||||||
|
chiave = "";
|
||||||
|
TString16 m (format("%02d", m));
|
||||||
|
chiave << _annoes << m;
|
||||||
|
lim.put("CODTAB", chiave);
|
||||||
|
if (lim.read() != NOERR || !lim.get_bool("B0"))
|
||||||
|
{
|
||||||
|
need_refresh = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (need_refresh)
|
||||||
{
|
{
|
||||||
if (! lim.get_bool("B0"))
|
continua = yesno_box("Ditta %s: la liquidazione di alcuni mesi precedenti deve "
|
||||||
{
|
"essere ricalcolata.\n"
|
||||||
continua = yesno_box("Ditta %s: non eseguito calcolo liquidazione annuale da stampare sul registro %s. Si desidera ugualmente proseguire?", (const char*)ditta, (const char*) _codreg);
|
"Si desidera ugualmente proseguire?",(const char*)ditta);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
continua = yesno_box("Ditta %s: non eseguito calcolo liquidazione annuale da stampare sul registro %s. Si desidera ugualmente proseguire?", (const char*)ditta, (const char*) _codreg);
|
|
||||||
if (!continua) return non_proseguire;
|
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)");
|
continua = yesno_box("Si desidera proseguire con il calcolo e la stampa di liquidazione? \n (altrimenti si prosegue con la sola stampa liquidazione)");
|
||||||
if (!continua) return prosegui_stampa;
|
if (!continua) return prosegui_stampa;
|
||||||
return prosegui_cal_stampa;
|
return prosegui_cal_stampa;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return B0_settato;
|
return B0_settato;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3095,8 +3103,8 @@ void CG4400_application::no_movimenti()
|
|||||||
(m == 3 || m == 6 || m == 9 || m == 12))
|
(m == 3 || m == 6 || m == 9 || m == 12))
|
||||||
{
|
{
|
||||||
_datareg = TDate(1, m, _annoes);
|
_datareg = TDate(1, m, _annoes);
|
||||||
stampa_riepilogo(m);
|
if (stampa_riepilogo(m))
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//fine
|
//fine
|
||||||
@ -3225,7 +3233,7 @@ void CG4400_application::send_message(char tipo, const TFilename& nome, int mese
|
|||||||
if (_riep_liq)
|
if (_riep_liq)
|
||||||
ss.add('X');
|
ss.add('X');
|
||||||
else ss.add(' ');
|
else ss.add(' ');
|
||||||
ss.add(_size_header);
|
ss.add(_size_header);
|
||||||
|
|
||||||
TMessage liq (app, "RCL", ss);
|
TMessage liq (app, "RCL", ss);
|
||||||
liq.send();
|
liq.send();
|
||||||
@ -3386,10 +3394,19 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
|
|||||||
if (!ok) continue;
|
if (!ok) continue;
|
||||||
if (_liquidazione)
|
if (_liquidazione)
|
||||||
{
|
{
|
||||||
|
//13/02/1996
|
||||||
|
/***
|
||||||
if (_tipo_stampa == 2 || _tipo_stampa == 4)
|
if (_tipo_stampa == 2 || _tipo_stampa == 4)
|
||||||
_size_header = _stampa_ind_ditta ? 3 : 2;
|
_size_header = _stampa_ind_ditta ? 3 : 2;
|
||||||
else _size_header = 3;
|
else _size_header = 3;
|
||||||
clear_stliq();
|
***/
|
||||||
|
_size_header = 3;
|
||||||
|
//fine
|
||||||
|
clear_stliq();
|
||||||
|
//l'inizializzazione di _scelta vale per tutti
|
||||||
|
//i mesi da stampare di un certo registro (su
|
||||||
|
//cui c'e' la X di stampa liquidazione). Cio'
|
||||||
|
//e' molto importante (per capire vedi appunti)
|
||||||
_scelta = controlla_liquidazione();
|
_scelta = controlla_liquidazione();
|
||||||
if (_scelta == non_proseguire)
|
if (_scelta == non_proseguire)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -3511,9 +3528,14 @@ bool CG4400_application::stampa_registri_IVA(const TMask& m)
|
|||||||
|
|
||||||
if (_liquidazione)
|
if (_liquidazione)
|
||||||
{
|
{
|
||||||
|
//13/02/1996
|
||||||
|
/***
|
||||||
if (_tipo_stampa == 2 || _tipo_stampa == 4)
|
if (_tipo_stampa == 2 || _tipo_stampa == 4)
|
||||||
_size_header = _stampa_ind_ditta ? 3 : 2;
|
_size_header = _stampa_ind_ditta ? 3 : 2;
|
||||||
else _size_header = 3;
|
else _size_header = 3;
|
||||||
|
***/
|
||||||
|
_size_header = 3;
|
||||||
|
//fine
|
||||||
clear_stliq();
|
clear_stliq();
|
||||||
//N.B. E' fondamentale che _scelta venga ri-inizializzata ad ogni
|
//N.B. E' fondamentale che _scelta venga ri-inizializzata ad ogni
|
||||||
//registro(cioe' dopo la stampa di ciascuno). Infatti il B0 di un
|
//registro(cioe' dopo la stampa di ciascuno). Infatti il B0 di un
|
||||||
@ -3582,7 +3604,9 @@ bool CG4400_application::stampa_riepilogo(int m)
|
|||||||
{
|
{
|
||||||
int a, tipo;
|
int a, tipo;
|
||||||
TString16 codtab, codreg, codatt;
|
TString16 codtab, codreg, codatt;
|
||||||
TPrintrow row;
|
TPrintrow row;
|
||||||
|
TRiga_array vect;
|
||||||
|
bool stampato = FALSE;
|
||||||
if (!printer().isopen()) printer().open();
|
if (!printer().isopen()) printer().open();
|
||||||
for (_tabreg->first(); !_tabreg->eof(); _tabreg->next())
|
for (_tabreg->first(); !_tabreg->eof(); _tabreg->next())
|
||||||
{
|
{
|
||||||
@ -3595,169 +3619,172 @@ bool CG4400_application::stampa_riepilogo(int m)
|
|||||||
{
|
{
|
||||||
codreg = codtab.mid(4,3);
|
codreg = codtab.mid(4,3);
|
||||||
codatt = _tabreg->get("S8");
|
codatt = _tabreg->get("S8");
|
||||||
row.reset();
|
//devo stampare sul riepilogativo
|
||||||
printer().print(row);
|
//solo i registri movimentati!!!
|
||||||
row.put("Registro iva:", 0);
|
TTable pim("PIM");
|
||||||
row.put(codreg, 14);
|
TString80 chiave,ctab;
|
||||||
row.put(format("%-.40s",(const char*)_tabreg->get("S0")), 18);
|
TString16 creg,codiva;
|
||||||
row.put("Attivita\'", 60);
|
vect.destroy();
|
||||||
row.put(codatt, 70);
|
//Riepilogo del periodo
|
||||||
TString80 desc = desc_attivita(codatt);
|
chiave << _annoes << _tabreg->get("S8");
|
||||||
row.put(desc, 76);
|
pim.zero();
|
||||||
printer().print(row);
|
pim.put("CODTAB", chiave);
|
||||||
row.reset();
|
TRectype r (pim.curr());
|
||||||
printer().print(row);
|
pim.read(_isgteq);
|
||||||
if (tipo == 1 && _tabreg->get_bool("B0"))
|
for (; !pim.eof(); pim.next())
|
||||||
row.put("------------------ P E R I O D O -------------------", 30);
|
|
||||||
else
|
|
||||||
row.put("---------- P E R I O D O -----------", 30);
|
|
||||||
if (_tipo_stampa != 1)
|
|
||||||
{
|
{
|
||||||
if (tipo == 1 && _tabreg->get_bool("B0"))
|
if (pim.curr() != r) break;
|
||||||
row.put("----------- P R O G R E S S I V I --------------", 84);
|
ctab = pim.get("CODTAB");
|
||||||
else
|
creg = ctab.mid(10,3);
|
||||||
row.put("------ P R O G R E S S I V I ------", 84);
|
int mese = atoi(ctab.mid(13,2));
|
||||||
}
|
if (codreg == creg.trim() && is_mese_ok(mese,m))
|
||||||
printer().print(row);
|
{
|
||||||
row.reset();
|
codiva = ctab.mid(16,4);
|
||||||
row.put("Cod.", 0);
|
real impon = pim.get_real("R0");
|
||||||
if (tipo == 2)
|
real impos = pim.get_real("R1");
|
||||||
|
real impol = pim.get_real("R2");
|
||||||
|
if (_tabreg->get_bool("B0"))
|
||||||
|
{
|
||||||
|
TToken_string cs(pim.get("S2"));
|
||||||
|
impon = cs.get(0);
|
||||||
|
impos = cs.get(1);
|
||||||
|
}
|
||||||
|
if (_tabreg->get_bool("B1"))
|
||||||
|
{
|
||||||
|
impon = pim.get_real("R11");
|
||||||
|
impos = pim.get_real("R12");
|
||||||
|
}
|
||||||
|
TToken_string fatt_rit(pim.get("S1"));
|
||||||
|
impon += fatt_rit.get(0);
|
||||||
|
impos += fatt_rit.get(1);
|
||||||
|
if (impon != ZERO || impos != ZERO || impol != ZERO)
|
||||||
|
vect.add_riga(impon,impos,impol,ZERO,ZERO,ZERO,codiva);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Riepilogo progressivi (solo se stampa di bollato)
|
||||||
|
//cioe' dall'inizio dell'anno
|
||||||
|
if (_tipo_stampa != 1)
|
||||||
|
for (int i=1; i<=m; i++)
|
||||||
{
|
{
|
||||||
row.put("A C Q U I S T I", 40);
|
chiave = "";
|
||||||
if (_tipo_stampa != 1)
|
chiave << _annoes << _tabreg->get("S8");
|
||||||
row.put("A C Q U I S T I", 94);
|
pim.zero();
|
||||||
|
pim.put("CODTAB", chiave);
|
||||||
|
TRectype r (pim.curr());
|
||||||
|
pim.read(_isgteq);
|
||||||
|
for (; !pim.eof(); pim.next())
|
||||||
|
{
|
||||||
|
if (pim.curr() != r) break;
|
||||||
|
ctab = pim.get("CODTAB");
|
||||||
|
creg = ctab.mid(10,3);
|
||||||
|
int mese = atoi(ctab.mid(13,2));
|
||||||
|
if (codreg == creg.trim() && mese == i)
|
||||||
|
{
|
||||||
|
codiva = ctab.mid(16,4);
|
||||||
|
real impon = pim.get_real("R0");
|
||||||
|
real impos = pim.get_real("R1");
|
||||||
|
real impol = pim.get_real("R2");
|
||||||
|
if (_tabreg->get_bool("B0"))
|
||||||
|
{
|
||||||
|
TToken_string cs(pim.get("S2"));
|
||||||
|
impon = cs.get(0);
|
||||||
|
impos = cs.get(1);
|
||||||
|
}
|
||||||
|
if (_tabreg->get_bool("B1"))
|
||||||
|
{
|
||||||
|
impon = pim.get_real("R11");
|
||||||
|
impos = pim.get_real("R12");
|
||||||
|
}
|
||||||
|
TToken_string fatt_rit(pim.get("S1"));
|
||||||
|
impon += fatt_rit.get(0);
|
||||||
|
impos += fatt_rit.get(1);
|
||||||
|
if (impon != ZERO || impos != ZERO || impol != ZERO)
|
||||||
|
vect.add_riga(ZERO,ZERO,ZERO,impon,impos,impol,codiva);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (tipo == 1)
|
|
||||||
|
if (vect.items() > 0)
|
||||||
{
|
{
|
||||||
row.put("V E N D I T E", 41);
|
stampato = TRUE;
|
||||||
if (_tabreg->get_bool("B0"))
|
row.reset();
|
||||||
row.put("CORRISPETTIVI", 67);
|
printer().print(row);
|
||||||
|
row.put("Registro iva:", 0);
|
||||||
|
row.put(codreg, 14);
|
||||||
|
row.put(format("%-.40s",(const char*)_tabreg->get("S0")), 18);
|
||||||
|
row.put("Attivita\'", 60);
|
||||||
|
row.put(codatt, 70);
|
||||||
|
TString80 desc = desc_attivita(codatt);
|
||||||
|
row.put(desc, 76);
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
printer().print(row);
|
||||||
|
if (tipo == 1 && _tabreg->get_bool("B0"))
|
||||||
|
row.put("------------------ P E R I O D O -------------------", 30);
|
||||||
|
else
|
||||||
|
row.put("---------- P E R I O D O -----------", 30);
|
||||||
if (_tipo_stampa != 1)
|
if (_tipo_stampa != 1)
|
||||||
{
|
{
|
||||||
if (_tabreg->get_bool("B0"))
|
if (tipo == 1 && _tabreg->get_bool("B0"))
|
||||||
{
|
row.put("----------- P R O G R E S S I V I --------------", 84);
|
||||||
|
else
|
||||||
|
row.put("------ P R O G R E S S I V I ------", 84);
|
||||||
|
}
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
row.put("Cod.", 0);
|
||||||
|
if (tipo == 2)
|
||||||
|
{
|
||||||
|
row.put("A C Q U I S T I", 40);
|
||||||
|
if (_tipo_stampa != 1)
|
||||||
|
row.put("A C Q U I S T I", 94);
|
||||||
|
}
|
||||||
|
if (tipo == 1)
|
||||||
|
{
|
||||||
|
row.put("V E N D I T E", 41);
|
||||||
|
if (_tabreg->get_bool("B0"))
|
||||||
|
row.put("CORRISPETTIVI", 67);
|
||||||
|
if (_tipo_stampa != 1)
|
||||||
|
{
|
||||||
|
if (_tabreg->get_bool("B0"))
|
||||||
|
{
|
||||||
row.put("V E N D I T E", 94);
|
row.put("V E N D I T E", 94);
|
||||||
row.put("CORRISPETTIVI", 118);
|
row.put("CORRISPETTIVI", 118);
|
||||||
}
|
}
|
||||||
else row.put("V E N D I T E", 95);
|
else row.put("V E N D I T E", 95);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printer().print(row);
|
printer().print(row);
|
||||||
row.reset();
|
row.reset();
|
||||||
row.put("iva Descrizione", 0);
|
row.put("iva Descrizione", 0);
|
||||||
row.put("Imponibile", 34);
|
row.put("Imponibile", 34);
|
||||||
row.put("Imposta", 53);
|
row.put("Imposta", 53);
|
||||||
if (tipo == 1 && _tabreg->get_bool("B0"))
|
|
||||||
row.put("Importi lordi", 67);
|
|
||||||
if (_tipo_stampa != 1)
|
|
||||||
{
|
|
||||||
row.put("Imponibile", 87);
|
|
||||||
row.put("Imposta", 107);
|
|
||||||
if (tipo == 1 && _tabreg->get_bool("B0"))
|
if (tipo == 1 && _tabreg->get_bool("B0"))
|
||||||
row.put("Importi lordi", 118);
|
row.put("Importi lordi", 67);
|
||||||
}
|
if (_tipo_stampa != 1)
|
||||||
printer().print(row);
|
{
|
||||||
row.reset();
|
row.put("Imponibile", 87);
|
||||||
printer().print(row);
|
row.put("Imposta", 107);
|
||||||
|
if (tipo == 1 && _tabreg->get_bool("B0"))
|
||||||
|
row.put("Importi lordi", 118);
|
||||||
|
}
|
||||||
|
printer().print(row);
|
||||||
|
row.reset();
|
||||||
|
printer().print(row);
|
||||||
|
|
||||||
stampa_pims(row, codreg, tipo, m);
|
stampa_pims(row, vect, tipo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return stampato;
|
||||||
}
|
}
|
||||||
//fine
|
|
||||||
|
|
||||||
void CG4400_application::stampa_pims(TPrintrow& riga, const TString& creg,
|
void CG4400_application::stampa_pims(TPrintrow& riga, TRiga_array& vect,
|
||||||
int t, int m)
|
int t)
|
||||||
{
|
{
|
||||||
TTable pim("PIM");
|
|
||||||
TString80 chiave, codtab;
|
|
||||||
TString16 codreg, codiva;
|
|
||||||
TRiga_array vect;
|
|
||||||
vect.destroy();
|
|
||||||
riga.reset();
|
|
||||||
//Riepilogo del periodo
|
|
||||||
chiave << _annoes << _tabreg->get("S8");
|
|
||||||
pim.zero();
|
|
||||||
pim.put("CODTAB", chiave);
|
|
||||||
TRectype r (pim.curr());
|
|
||||||
pim.read(_isgteq);
|
|
||||||
for (; !pim.eof(); pim.next())
|
|
||||||
{
|
|
||||||
if (pim.curr() != r) break;
|
|
||||||
|
|
||||||
codtab = pim.get("CODTAB");
|
|
||||||
codreg = codtab.mid(10,3);
|
|
||||||
int mese = atoi(codtab.mid(13,2));
|
|
||||||
if (creg == codreg.trim() && is_mese_ok(mese,m))
|
|
||||||
{
|
|
||||||
codiva = codtab.mid(16,4);
|
|
||||||
real impon = pim.get_real("R0");
|
|
||||||
real impos = pim.get_real("R1");
|
|
||||||
real impol = pim.get_real("R2");
|
|
||||||
if (_tabreg->get_bool("B0"))
|
|
||||||
{
|
|
||||||
TToken_string cs(pim.get("S2"));
|
|
||||||
impon = cs.get(0);
|
|
||||||
impos = cs.get(1);
|
|
||||||
}
|
|
||||||
if (_tabreg->get_bool("B1"))
|
|
||||||
{
|
|
||||||
impon = pim.get_real("R11");
|
|
||||||
impos = pim.get_real("R12");
|
|
||||||
}
|
|
||||||
TToken_string fatt_rit(pim.get("S1"));
|
|
||||||
impon += fatt_rit.get(0);
|
|
||||||
impos += fatt_rit.get(1);
|
|
||||||
if (impon != ZERO || impos != ZERO || impol != ZERO)
|
|
||||||
vect.add_riga(impon,impos,impol,ZERO,ZERO,ZERO,codiva);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Riepilogo progressivi (solo se stampa di bollato)
|
|
||||||
//cioe' dall'inizio dell'anno
|
|
||||||
if (_tipo_stampa != 1)
|
|
||||||
for (int i=1; i<=m; i++)
|
|
||||||
{
|
|
||||||
chiave = "";
|
|
||||||
chiave << _annoes << _tabreg->get("S8");
|
|
||||||
pim.zero();
|
|
||||||
pim.put("CODTAB", chiave);
|
|
||||||
TRectype r (pim.curr());
|
|
||||||
pim.read(_isgteq);
|
|
||||||
for (; !pim.eof(); pim.next())
|
|
||||||
{
|
|
||||||
if (pim.curr() != r) break;
|
|
||||||
codtab = pim.get("CODTAB");
|
|
||||||
codreg = codtab.mid(10,3);
|
|
||||||
int mese = atoi(codtab.mid(13,2));
|
|
||||||
if (creg == codreg.trim() && mese == i)
|
|
||||||
{
|
|
||||||
codiva = codtab.mid(16,4);
|
|
||||||
real impon = pim.get_real("R0");
|
|
||||||
real impos = pim.get_real("R1");
|
|
||||||
real impol = pim.get_real("R2");
|
|
||||||
if (_tabreg->get_bool("B0"))
|
|
||||||
{
|
|
||||||
TToken_string cs(pim.get("S2"));
|
|
||||||
impon = cs.get(0);
|
|
||||||
impos = cs.get(1);
|
|
||||||
}
|
|
||||||
if (_tabreg->get_bool("B1"))
|
|
||||||
{
|
|
||||||
impon = pim.get_real("R11");
|
|
||||||
impos = pim.get_real("R12");
|
|
||||||
}
|
|
||||||
TToken_string fatt_rit(pim.get("S1"));
|
|
||||||
impon += fatt_rit.get(0);
|
|
||||||
impos += fatt_rit.get(1);
|
|
||||||
if (impon != ZERO || impos != ZERO || impol != ZERO)
|
|
||||||
vect.add_riga(ZERO,ZERO,ZERO,impon,impos,impol,codiva);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
real t_impon, t_impos, t_impol, t_imponp, t_imposp, t_impolp;
|
real t_impon, t_impos, t_impol, t_imponp, t_imposp, t_impolp;
|
||||||
t_impon = t_impos = t_impol = t_imponp = t_imposp = t_impolp = ZERO;
|
t_impon = t_impos = t_impol = t_imponp = t_imposp = t_impolp = ZERO;
|
||||||
|
riga.reset();
|
||||||
//ordinamento per codice iva
|
//ordinamento per codice iva
|
||||||
vect.sort(compare_rows);
|
vect.sort(compare_rows);
|
||||||
for (int k=0; k<vect.items(); k++)
|
for (int k=0; k<vect.items(); k++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user