diff --git a/cg/cg4300.cpp b/cg/cg4300.cpp index 08fb764ac..79917f5a7 100755 --- a/cg/cg4300.cpp +++ b/cg/cg4300.cpp @@ -106,11 +106,11 @@ bool TLiquidazione_app::user_create() _plm = new TTable("PLM"); _lim = new TTable("LIM"); _lam = new TTable("LAM"); - _pla = new TTable("PLA"); + _pla = new TTable("%PLA"); _reg = new TTable("REG"); _iva = new TTable("%IVA"); _del = new TTable("%DEL"); - _lia = new TTable("LIA"); + _lia = new TTable("%LIA"); _rmb = new TTable("RMB"); _mov = &_cur->file(LF_MOV); diff --git a/cg/cg4301.cpp b/cg/cg4301.cpp index 67dfdab72..4c73c8e37 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -11,10 +11,6 @@ #include "cg4300.h" // -------------------- QUI comincia l'avventura -------------------------- -// ----------------------------------------------------- ****************** -// che nel gennaio 1995 non solo non e' finita, ma si fa ****************** -// ogni giorno piu' odiosa e nevrastenica ****************** -// ----------------------------------------------------- ****************** // Datemi un punto di appoggio ****************** // e mi ci appoggero' ****************** // ----------------------------------------------------- ****************** @@ -407,16 +403,11 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) const bool sreg = !isreg; const bool rs8 = _reg_r->get("S8") != trueatt; const bool cmt = !_cur->is_first_match(LF_RMOVIVA); + const bool sosp_imp = _reg->get_bool("B1"); const TRectype& rcs = _cur->curr(LF_CAUSALI); if (dok || sreg || rs8 || cmt) continue; - /* - * Fatture in sospensione di imposta non vengono considerate - */ - if (_reg->get_bool("B1")) - continue; - /* * Tipo documento da eliminare (Scudler 1994) * Trattasi per lo piu' di non incassati @@ -444,7 +435,15 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) do { look_iva(_rmoviva->get("CODIVA")); - + + // totali parziali registrati nei pim per motivi ignoti + real bolld_imp = 0.0; // imponibile bolle doganali + real bolld_iva = 0.0; // imposta bolle doganali + real asimp_imp = 0.0; // imponibile acquisti sosp. imposta + real asimp_iva = 0.0; // imposta acquisti sosp. imposta + real vsimp_imp = 0.0; // imponibile vendite sosp. imposta + real vsimp_iva = 0.0; // imposta vendite sosp. imposta + TString codiva = _iva->get("CODTAB"); TString tipoiva = _iva->get("S1"); TString riga11_v = _iva->get("S0"); @@ -502,195 +501,219 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) if (!(okc && (cond1 || cond2))) continue; } + - // ***************************************** - // casi particolari - // ***************************************** + if (sosp_imp) // sospensione di imposta + { + if (tipomov == vendita) + { + vsimp_imp = imponibile; + vsimp_iva = imposta; + } + else + { + asimp_imp = imponibile; + asimp_iva = imposta; + } + } + else // normale + { + + // ***************************************** + // casi particolari + // ***************************************** - // imposta acquisti intracomunitari - if (tipomov == acquisto && intra) - totintra += imposta; + // imposta acquisti intracomunitari + if (tipomov == acquisto && intra) + totintra += imposta; - // Altre cose di cui tener conto - if (tipomov == acquisto && (tipocr == 1 || tipocr == 5)) - /* - * Acquisto beni per rivendita: sono comunque sommati, ma - * vengono considerati in ventilazione solo se l'apposito - * parametro ditta e' settato, piu' altre condizioni (vedi - * recalc_ventilation() for spulcing) - */ - { - acq_riv += imponibile; - acq_riv_iva += imposta; - } - - else if (tipomov == acquisto && tipocr == 2) - // Acquisto beni ammortizzabili - { - ammort += imponibile; - ammort_iva += imposta; - } - else if (tipomov == acquisto && tipocr == 3) - // Acquisto beni ammortizzabili detr. 6% - { - ammort_6 += imponibile; - ammort_6_iva += imposta; - ult_detr += imponibile * real(DETRAZIONE_6PERCENTO); - } - else if (tipomov == vendita && tipocr == 4) - /* - * Vendite strum. art 17 (cess. amm.) - * Comprende anche autofatture, anche nell'annuale - * (Sergio 1995) - */ - { - cess_amm += imponibile; - cess_amm_iva += imposta; - } - else if (tipomov == acquisto && tipocr == 8) - // Acquisto beni strum. acquisiti in leasing - { - leasing += imponibile; - leasing_iva += imposta; - } - else if (tipomov == acquisto && tipocr == 9) - // Spese generali - { - spgen += imponibile; - spgen_iva += imposta; - } - - // operazioni per calcolo rimborso infracazzuale - // Scudler 1995 - if (ivarimb) - { - bool ok = _isagricolo ? tipoagr == 2 : FALSE; - - if (tipomov == acquisto && !ok) - ok = (tipocr == 0 || tipocr == 1 || tipocr == 5); - - if (tipomov == vendita && !ok) - ok = tipoiva.empty() && tipodoc != "CR" && - tipodoc != "SC" && tipodoc != "RF"; - - if (ok) - { - // aggiurna tabedda - look_rmb(month, codiva, tipomov, TRUE); - real imp = _rmb->get_real("R0"); - real iva = _rmb->get_real("R1"); - imp += imponibile; - iva += imposta; - _rmb->put("R0", imp); - _rmb->put("R1", iva); - _rmb->put("R2", _iva->get_real("R0")); - _rmb->rewrite(); - } - } - - // operazioni esenti - if (tipoiva == "ES") - { - if (tipomov == vendita) + // Altre cose di cui tener conto + if (tipomov == acquisto && (tipocr == 1 || tipocr == 5)) + /* + * Acquisto beni per rivendita: sono comunque sommati, ma + * vengono considerati in ventilazione solo se l'apposito + * parametro ditta e' settato, piu' altre condizioni (vedi + * recalc_ventilation() for spulcing) + */ { - switch(tipoes_v) + acq_riv += imponibile; + acq_riv_iva += imposta; + } + + else if (tipomov == acquisto && tipocr == 2) + // Acquisto beni ammortizzabili + { + ammort += imponibile; + ammort_iva += imposta; + } + else if (tipomov == acquisto && tipocr == 3) + // Acquisto beni ammortizzabili detr. 6% + { + ammort_6 += imponibile; + ammort_6_iva += imposta; + ult_detr += imponibile * real(DETRAZIONE_6PERCENTO); + } + else if (tipomov == vendita && tipocr == 4) + /* + * Vendite strum. art 17 (cess. amm.) + * Comprende anche autofatture, anche nell'annuale + * (Sergio 1995) + */ + { + cess_amm += imponibile; + cess_amm_iva += imposta; + } + else if (tipomov == acquisto && tipocr == 8) + // Acquisto beni strum. acquisiti in leasing + { + leasing += imponibile; + leasing_iva += imposta; + } + else if (tipomov == acquisto && tipocr == 9) + // Spese generali + { + spgen += imponibile; + spgen_iva += imposta; + } + + // operazioni per calcolo rimborso infracazzuale + // Scudler 1995 + if (ivarimb) + { + bool ok = _isagricolo ? tipoagr == 2 : FALSE; + + if (tipomov == acquisto && !ok) + ok = (tipocr == 0 || tipocr == 1 || tipocr == 5); + + if (tipomov == vendita && !ok) + ok = tipoiva.empty() && tipodoc != "CR" && + tipodoc != "SC" && tipodoc != "RF"; + + if (ok) + { + // aggiurna tabedda + look_rmb(month, codiva, tipomov, TRUE); + real imp = _rmb->get_real("R0"); + real iva = _rmb->get_real("R1"); + imp += imponibile; + iva += imposta; + _rmb->put("R0", imp); + _rmb->put("R1", iva); + _rmb->put("R2", _iva->get_real("R0")); + _rmb->rewrite(); + } + } + + // operazioni esenti + if (tipoiva == "ES") + { + if (tipomov == vendita) + { + switch(tipoes_v) + { + case 1: + esenti_b1 += imponibile; + break; + case 2: + esenti_b2 += imponibile; + break; + case 3: + esenti_b3 += imponibile; + break; + } + } + else if (tipoes_a == 14) + esenti_b14 += imponibile; + } + + // bolle doganali + if (tipodoc == "BD") + { + bolld_imp = imponibile; + bolld_iva = imposta; + } + + // plafond + if (_isplafond && tipomov == acquisto && month != 13 && + tipoiva == "NI" && tipopla != 0) + { + add_plafond(month, codatt, tipopla, imponibile, tipodoc == "BD"); + } + + // agenzie viaggio (CHECK imponibili etc.) + if (_isviaggio) + switch (tipoag) { case 1: - esenti_b1 += imponibile; + if (tipomov == acquisto) acq_CEE += imponibile; + else corr_CEE += imponibile; break; - case 2: - esenti_b2 += imponibile; - break; - case 3: - esenti_b3 += imponibile; + case 2: + if (tipomov == acquisto) acq_noCEE += imponibile; + else corr_noCEE += imponibile; break; + case 3: corr_misCEE += imponibile; break; + case 4: acq_misCEE += imponibile; break; + case 5: acq_misnoCEE += imponibile; break; + } + + if (_isagricolo) + { + /* + * rifatto sensu Scudler 1995 con invidiabile sicurezza + * senza porsi domande e mettendo NUMERI uguali + * al TIPO RECORD del frigorifero + */ + if (tipomov == vendita) + { + if (tipoagr == 1 && tipoagr == 3) + agr_1 += imposta; + else if (tipoagr == 2) + agr_2 += imposta; + } + else if (tipodet == 0) + { + if (tipoagr == 2) + { + if (tipocr != 2 && tipocr != 3 && tipocr != 8) + agr_3 += imposta; + else + agr_4 += imposta; + } + else + { + if (tipocr != 2 && tipocr != 3 && tipocr != 8) + agr_5 += imposta; + else + agr_6 += imposta; + } } } - else if (tipoes_a == 14) - esenti_b14 += imponibile; - } - - // plafond - if (_isplafond && tipomov == acquisto && month != 13 && - tipoiva == "NI" && tipopla != 0) - { - add_plafond(month, codatt, tipopla, imponibile, tipodoc == "BD"); - } - - // agenzie viaggio (CHECK imponibili etc.) - if (_isviaggio) - switch (tipoag) - { - case 1: - if (tipomov == acquisto) acq_CEE += imponibile; - else corr_CEE += imponibile; - break; - case 2: - if (tipomov == acquisto) acq_noCEE += imponibile; - else corr_noCEE += imponibile; - break; - case 3: corr_misCEE += imponibile; break; - case 4: acq_misCEE += imponibile; break; - case 5: acq_misnoCEE += imponibile; break; + if (tipodet == 1) // acquisti indeducibili su ricavi esenti art. 10 + { + acq_ies += imponibile; + acq_ies_iva += imposta; } - if (_isagricolo) - { - /* - * rifatto sensu Scudler 1995 con invidiabile sicurezza - * senza porsi domande e mettendo NUMERI uguali - * al TIPO RECORD del frigorifero - */ - if (tipomov == vendita) - { - if (tipoagr == 1 && tipoagr == 3) - agr_1 += imposta; - else if (tipoagr == 2) - agr_2 += imposta; + if (tipodet == 3) // passaggi interni (solo per ventilaz) + { + acq_pint += imponibile; + acq_pint_iva += imposta; } - else if (tipodet == 0) + + // acquisti non detraibili art. 19 + // possono valere per la ventilazione + if (tipodet == 9) { - if (tipoagr == 2) - { - if (tipocr != 2 && tipocr != 3 && tipocr != 8) - agr_3 += imposta; - else - agr_4 += imposta; - } - else - { - if (tipocr != 2 && tipocr != 3 && tipocr != 8) - agr_5 += imposta; - else - agr_6 += imposta; - } + nond19_imp += imponibile; + nond19_iva += imposta; } - } - if (tipodet == 1) // acquisti indeducibili su ricavi esenti art. 10 - { - acq_ies += imponibile; - acq_ies_iva += imposta; - } - if (tipodet == 3) // passaggi interni (solo per ventilaz) - { - acq_pint += imponibile; - acq_pint_iva += imposta; - } - - // acquisti non detraibili art. 19 - // possono valere per la ventilazione - if (tipodet == 9) - { - nond19_imp += imponibile; - nond19_iva += imposta; - } - - // ***************************************** - // Fine casi particolari - // Non che i casi normali siano tanto meglio - // ***************************************** - + // ***************************************** + // Fine casi particolari + // Non che i casi normali siano tanto meglio + // ***************************************** + } // non sosp_imp /* * Calcolo e aggiornamento * cerca o crea progressivo IVA @@ -702,7 +725,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) * se liq == FALSE gli importi non contano ai fini * del calcolo liquidazione */ - bool liq = !(tipodet == 1 || tipodet == 3 || tipodet == 9); + bool liq = !(tipodet == 1 || tipodet == 3 || tipodet == 9 || sosp_imp); real imp = _pim_r->get_real("R0"); // imponibile real ivp = _pim_r->get_real("R1"); // IVA su imp. @@ -723,8 +746,28 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) * NELL'OTTICA di una PIU' CORRETTA e CONSONA ...................... */ real adf = _pim_r->get_real("R7"); - real adi = _pim_r->get_real("R8"); - + real adi = _pim_r->get_real("R8"); + + /* le fottute fatture in sospensione di imposta */ + real fsi = _pim_r->get_real("R11"); + real fsv = _pim_r->get_real("R12"); + + /* le putride bolle doganali */ + real bdi = _pim_r->get_real("R9"); + real bdv = _pim_r->get_real("R10"); + + if (tipomov == vendita) + { + fsi += vsimp_imp; + fsv += vsimp_iva; + } + else + { + fsi += asimp_imp; + fsv += asimp_iva; + bdi += bolld_imp; + bdv += bolld_iva; + } if (liq && tipomov == vendita && !corrisp) // i corrispettivi sono gestiti a parte @@ -831,15 +874,23 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) } _pim_r->put("B2",isvolaff); - _pim_r->put("R0",imp); - _pim_r->put("R1",ivp); - _pim_r->put("R2",lor); - _pim_r->put("R5",ifs); - _pim_r->put("R6",vfs); - _pim_r->put("R7",adf); - _pim_r->put("R8",adi); + if (!sosp_imp) + { + _pim_r->put("R0",imp); + _pim_r->put("R1",ivp); + _pim_r->put("R2",lor); + _pim_r->put("R5",ifs); + _pim_r->put("R6",vfs); + _pim_r->put("R7",adf); + _pim_r->put("R8",adi); + _pim_r->put("R9",bdi); + _pim_r->put("R10",bdv); + } + // questi servono per i ricalcoli altrui (classify_pim) + _pim_r->put("R11",fsi); + _pim_r->put("R12",fsv); _pim_r->put("I1", (long)tipomov); _pim_r->put("B3", ivarimb ? "X" : ""); _pim_r->put("B4", _isricacq ? "X" : ""); diff --git a/cg/classpim.cpp b/cg/classpim.cpp new file mode 100755 index 000000000..808dcf70d --- /dev/null +++ b/cg/classpim.cpp @@ -0,0 +1,220 @@ +// classpim.cpp +// funzione per classificare i PIM e sommare tutto cio' che contengono +#include "classpim.h" +#include + +bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t) +{ + static int last_checked = -1; + + // parse CODTAB of pim record + TString ctab = pimr.get("CODTAB"); + + const int tipocr = atoi(ctab.mid(15,1)); // tipo costo_ricavo + const int tipodet = atoi(ctab.mid(20,1)); // tipo detraibilita' + const int corrisp = (int)pimr.get_long("I0"); // netto = 1, lordo = 2 + const int tipomov = (int)pimr.get_long("I1"); // 1 = vendita, 2 = acquisto + + const bool vola = pimr.get_bool("B2"); + const bool rimb = pimr.get_bool("B3"); + const bool ricl = pimr.get_bool("B4"); + + TString tipoiva = pimr.get("S5"); + + // cominciamo cosi' + imp = ZERO; iva = ZERO; + + for (int i = last_checked + 1; i <= MAX_TIPOREC; i++) + { + tiporec tocheck = (tiporec)i; + bool found = FALSE; + + switch(tocheck) + { + case acq_norm: + found = tipomov == 2 && tipoiva != "NS"; + found &= (tipodet == 0 || tipodet == 1 || tipodet == 3 || + tipodet == 5 || tipodet == 9); + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + } + break; + case vend_norm: + found = tipomov == 1 && corrisp == 1 && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + } + break; + case acq_simp: + if (tipomov == 2) + { + imp = pimr.get_real("R11"); + iva = pimr.get_real("R12"); + } + found = !imp.is_zero() || !iva.is_zero(); + break; + case vend_simp: + if (tipomov == 1 && corrisp == 1) + { + imp = pimr.get_real("R11"); + iva = pimr.get_real("R12"); + } + found = !imp.is_zero() || !iva.is_zero(); + break; + case bolle_doganali: + if (tipomov == 2 && tipoiva != "NS") + { + imp = pimr.get_real("R9"); + iva = pimr.get_real("R10"); + } + found = !imp.is_zero() || !iva.is_zero(); + break; + case acq_beni_riv: + found = (tipomov == 2 && tipodet != 9 && tipocr == 1); + found &= (tipoiva != "NS" && tipoiva != "NI" && tipoiva != "ES"); + found &= (ricl ? TRUE : tipodet == 3); + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + } + found &= !imp.is_zero() || !iva.is_zero(); + break; + case base_ventilazione: + found = (tipomov == 2 && tipodet != 9 && (tipocr == 1 || tipocr == 5)); + found &= tipoiva != "NS" && tipoiva != "NI" && tipoiva != "ES"; + found &= (ricl ? TRUE : tipodet == 3); + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + } + found &= (!imp.is_zero() || !iva.is_zero()); + break; + case corr_norm: + found = tipomov == 1 && corrisp == 2 && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + case corr_simp: + if (tipomov == 1 && corrisp == 2) + { + imp = pimr.get_real("R11"); + iva = pimr.get_real("R12"); + } + found = !imp.is_zero() || !iva.is_zero(); + break; + case acq_beni_ammort: + found = tipomov == 2 && tipocr == 2 && + tipodet == 0 && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + case acq_beni_ammort_nd: + found = tipomov == 2 && tipocr ==2 && + tipodet != 0 && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + case acq_beni_leasing: + found = tipomov == 2 && tipocr == 8 && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + case acq_amm_ultdetr: + found = tipomov == 2 && tipocr == 3 && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + case acq_ind_op_es: + found = tipomov == 2 && tipodet == 1 && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + case acq_ind_pass_int: + found = tipomov == 2 && tipodet == 3 && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + case acq_ind_art_19: + found = tipomov == 2 && tipodet == 9 && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + case cess_amm: + found = tipomov == 1 && tipocr == 4 && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + case vend_rimborso: + found = tipomov == 1 && rimb && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + case acq_rimborso: + found = tipomov == 2 && rimb && tipoiva != "NS"; + if (found) + { + imp = pimr.get_real("R0"); + iva = pimr.get_real("R1"); + found &= (!imp.is_zero() || !iva.is_zero()); + } + break; + } + + if (i == MAX_TIPOREC) + last_checked = -1; + else if (found) + { + t = tocheck; + last_checked = i; + break; + } + } + + return last_checked != -1; +} diff --git a/cg/classpim.h b/cg/classpim.h new file mode 100755 index 000000000..4e44a0501 --- /dev/null +++ b/cg/classpim.h @@ -0,0 +1,86 @@ +// classpim.h +// funzioni ed enum per classificare i pim + +#ifndef __CLASSPIM_H +#define __CLASSPIM_H + +#ifndef __ISAM_H +#include +#endif + +#ifndef __REAL_H +#include +#endif + + +// per ora ci si fotte di agenzie viaggio e di +// regimi agricoli + +enum tiporec { acq_norm = 0, vend_norm = 1, // acquisti e vendite normali + acq_simp = 2, vend_simp = 3, // acq. e vend. sosp. imposta + bolle_doganali = 4, // bolle doganali (acquisti) + acq_beni_riv = 5, // acq. beni per rivendita + base_ventilazione = 6, // base calcolo per ventil. + corr_norm = 7, corr_simp = 8, // corrispettivi n. e s. imp. + acq_beni_ammort = 9, // acq. beni ammortizz. detr. + acq_beni_ammort_nd = 10, // beni ammort. non detraibili + acq_beni_leasing = 11, // beni strum. acq in leasing + acq_amm_ultdetr = 12, // beni amm. ult. detr 6% + acq_ind_op_es = 13, // acq. indetr. su op.es. + acq_ind_pass_int = 14, // passaggi interni + acq_ind_art_19 = 15, // indetr. art. 19 + cess_amm = 16, // cessioni amministrative + vend_rimborso = 17, // vendite valide per rimborso + acq_rimborso = 18 // acq. validi per rimborso + // ACHTUNG: se si aggiunge, cambiare sotto!!! + }; + +// questo serve nel cpp ma lo metto qua se no +// non lo cambiero' mai quando serve +const int MAX_TIPOREC = 18; + +// --------------------------------------------------------------- +// "classifica" un record progressivo IVA passato per reference +// mette l'imponibile in imp, l'imposta in iva, e in t mette +// un valore dell'enum di cui sopra, che dice di che tipo e' +// l'importo ritornato +// --------------------------------------------------------------- +// RITORNA TRUE SE VA CHIAMATA ANCORA CON LO STESSO PIM come +// parametro (ovvero: ci sono altri valori da passare che fanno +// parte dello stesso pim) +// --------------------------------------------------------------- +// mese, anno, attivita' vanno gestiti esternamente. Quando un pim +// contiene dati che valgono per piu' di un caso, ritorna TRUE +// finche' i casi possibili non sono esauriti +// --------------------------------------------------------------- + +// ------------------------------- ESEMPIO che fa sempre bene +// TTable pim("PIM"); +// while (pim.first(); !pim.eof(); pim.next()) +// { +// real imponibile, imposta; +// tiporec tipo; +// +// // Escludi i pim che non vuoi (per attivita', anno, mese) +// if (questo_non_lo_volevo) continue; +// +// +// while (classify_pim(pim.curr(), imponibile, imposta, tipo)) +// { +// switch(tipo) +// { +// case acq_norm: +// acq_imponibile += imponibile; +// acq_imposta += imposta; +// break; +// // eccetera +// } +// } +// } +// +// CONTENTA? ciao, f. :) +// ----------------------------------------------------------- + +bool classify_pim(TRectype& pimr, real& imp, real& iva, tiporec& t); + +#endif \ No newline at end of file