diff --git a/cg/cg4300.cpp b/cg/cg4300.cpp index 91b36662c..55b3d94d1 100755 --- a/cg/cg4300.cpp +++ b/cg/cg4300.cpp @@ -664,7 +664,17 @@ bool TLiquidazione_app::lst_tm_handler(TMask_field& f, KEY key) { if (f.to_check(key)) { - const int m = atoi(f.get()); + const int m = atoi(f.get()); + TMask& msk = f.mask(); + + if (m == 13) + { + msk.field(CG43_LST_CALC).set("2"); + msk.field(CG43_LST_CALC).disable(); + } + else + msk.field(CG43_LST_CALC).enable(); + const bool change = (app()._month != 13 && m == 13) || (app()._month == 13 && m != 13); if (change) { diff --git a/cg/cg4301.cpp b/cg/cg4301.cpp index 9bb264cb2..06296bced 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -722,64 +722,83 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) totintra += imposta; // Altre cose di cui tener conto - if (tipomov == acquisto && (tipocr == 1 || tipocr == 5)) - /* - * Acquisto beni per rivendita - */ + // Separo pazientemente per movimenti d'acquisto e movimenti di vendita + // onde evitare rompicapi, rompicazzi ecc... + + switch (tipomov) { - acq_riv += imponibile; - acq_riv_iva += imposta; - was_riv = TRUE; - } - - else if (tipomov == acquisto && tipocr == 2 && tipodet == 0) - // Acquisto beni ammortizzabili detraibili - { - ammort_det += imponibile; - ammort_det_iva += imposta; - } - else if (tipomov == acquisto && tipocr == 2 && tipodet != 0) - // Acquisto beni ammortizzabili indetraibili - { - ammort_indet += imponibile; - ammort_indet_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) - */ - { - /* NO! - * Invece non le deve comprendere nell'annuale - * (Vladimiro 1995, piu' tardi) - */ - if (!(_month == 13 && autodafe)) - { - 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; - } + acquisto: // ACQUISTO (per chi non l'avesse capito) + // Per le anguille delle antille e le saracche delle molucche... + // Gli acquisti con tipocr 1,2,3,5,8 vanno totalizzati se e solo se + // il tipo iva e' diverso da NON SOGGETTO + if (tipoiva != "NS") + { + if (tipocr == 1 || tipocr ==5) + // Acquisto beni per rivendita + { + acq_riv += imponibile; + acq_riv_iva += imposta; + was_riv = TRUE; + } + else if (tipocr == 2 && tipodet == 0) + // Acquisto beni ammortizzabili detraibili + { + ammort_det += imponibile; + ammort_det_iva += imposta; + } + else if (tipocr == 2 && tipodet != 0) + // Acquisto beni ammortizzabili indetraibili + { + ammort_indet += imponibile; + ammort_indet_iva += imposta; + } + else if (tipocr == 3) + // Acquisto beni ammortizzabili detr. 6% + { + ammort_6 += imponibile; + ammort_6_iva += imposta; + ult_detr += imponibile * real(DETRAZIONE_6PERCENTO); + } + else if (tipocr == 8) + // Acquisto beni strum. acquisiti in leasing + { + leasing += imponibile; + leasing_iva += imposta; + } + } // fine if per tipo iva != da NON SOGGETTO + + // Mi chiedo se effettivamente il tipo 9 sia esente da qualsiasi criterio... + if (tipocr == 9) + // Spese generali + { + spgen += imponibile; + spgen_iva += imposta; + } + // else fuck it up, dirty dick head. + break; + vendita: // VENDITA + if (tipocr == 4) + /* + * Vendite strum. art 17 (cess. amm.) + * Comprende anche autofatture, anche nell'annuale + * (Sergio 1995) + */ + { + /* NO! + * Invece non le deve comprendere nell'annuale + * (Vladimiro 1995, piu' tardi) + */ + if (!(_month == 13 && autodafe)) + { + cess_amm += imponibile; + cess_amm_iva += imposta; + } + } + break; + default: // Chissa' cosa cazzo puo' esserci oltre ad acquisto/vendita ? + break; + } // Fine del malefico switch + // operazioni per calcolo rimborso infraanale // Scudler 1995 e molti dopo di lei @@ -890,7 +909,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) TString ivacomp("00"); // Se non esiste o non si trova il conto questo e' il default (fa un poco schifo ma e' cosi') if (_cur->is_first_match(-AGR_PCON1)) // Esiste il conto ? - // Bien, allora controlliamo il se e' un ricavo... + // Bien, allora controlliamo se e' un ricavo... if (_pcon_1_r->get_int(PCN_INDBIL) == 4) if (_cur->is_first_match(-AGR_PCON2)) // Esiste il sottoconto ? { @@ -959,6 +978,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt) // Non che i casi normali siano tanto meglio // ***************************************** } // non sosp_imp ne' altre casistiche che escludono la liq. + /* * Calcolo e aggiornamento * cerca o crea progressivo IVA