diff --git a/cg/cg4305.cpp b/cg/cg4305.cpp index e85f7cafc..11784462f 100755 --- a/cg/cg4305.cpp +++ b/cg/cg4305.cpp @@ -13,8 +13,6 @@ #include "cg4300c.h" #include "cg4800b.h" -#define IVA_DA_VERSARE_ALTRI_MESI real(50500.0) -#define IVA_DA_VERSARE_MESE_12 real(500.0) //chiesto conferma a Milano: e' proprio cosi' // -------------------------------------------------- estrazione deleghe bool TLiquidazione_app::set_deleghe() @@ -70,7 +68,7 @@ bool TLiquidazione_app::set_deleghe() } bool TLiquidazione_app::extract_deleghe() -{ +{ char buf[256]; TArray desc; _prind = new TProgind(_calcall ? _n_ditte : _selected.ones(), " Estrazione deleghe \n" @@ -78,6 +76,8 @@ bool TLiquidazione_app::extract_deleghe() " \n ", TRUE,TRUE,40); + if (_ver->read(atoi(_year),(_month > 12) ? 12 : _month) != NOERR) + warning_box("Errore %d in lettura tabella versamenti ed interessi.",_ver->status()); for (int l = 0; l < _ditte->items(); l++) { if (_prind->iscancelled()) @@ -165,11 +165,11 @@ bool TLiquidazione_app::extract_delega(int month, TArray& desc) { real topay = result_liq(month); // TBC non si puo' fa' accussi'!!!!! pena il casino! if (month == 12) - { - if (topay > IVA_DA_VERSARE_MESE_12) + { + if (topay > _ver->get(I_ANNUALE)) versare = TRUE; } - else if (topay > IVA_DA_VERSARE_ALTRI_MESI) + else if (topay > _ver->get(I_PERIODICO)) versare = TRUE; real intr = _lim->get_real("R14"); @@ -363,6 +363,8 @@ bool TLiquidazione_app::recalc_acconti(real& inf, real& ina) "\n ", TRUE,TRUE,40); + if (_ver->read(atoi(_year),(_month > 12) ? 12 : _month) != NOERR) + warning_box("Errore %d in lettura tabella versamenti ed interessi.",_ver->status()); for (int l = 0; l < _ditte->items(); l++) { if (_prind->iscancelled()) @@ -406,6 +408,7 @@ bool TLiquidazione_app::recalc_acconti(real& inf, real& ina) bool TLiquidazione_app::recalc_acconto(real& inf, real& ina) { + TConfig cnf(CONFIG_DITTA, "cg"); real bc = 0.0; real acc = 0.0; real cre = 0.0; @@ -418,7 +421,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina) real iva_pro = 0.0; real cre_pre = 0.0; real acq_intr = 0.0; - bool isdifferita = FALSE; + bool isdifferita = cnf.get_bool("GeLiDi"); bool error = FALSE; TString16 tipo_acc; @@ -513,7 +516,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina) if (bc.sign() > 0) //debito { - acc = bc * ACCONTO_DICEMBRE; + acc = bc * _ver->get(isdifferita ? B_LIQ_DIFF : B_LIQ_NORM); acc.round(ROUND_LIRA); } @@ -623,8 +626,6 @@ else if (_basecalc == incorso) // sbatti l'acconto (e non solo!) in LIA if (look_lia()) { - TConfig cnf(CONFIG_DITTA, "cg"); - isdifferita = cnf.get_bool("GeLiDi"); if (isdifferita && _basecalc == incorso) { acc *= real(2.0); @@ -646,6 +647,11 @@ if (look_lia()) } /*** Non bisogna aggiornare la delega + Se in un prossimo futuro si decidesse di ripristinare questa + parte di codice, ricordarsi che il valore ACCONTO_MINIMO_DA_VERSARE + va sostituito con cio' che si trova nella tabella %VER, al + periodo corrispondente (campo I_ACCONTOIVA). + bool wasdel = look_del(12,7); if (acc.sign() > 0 && acc >= ACCONTO_MINIMO_DA_VERSARE)