Aggiunto utilizzo tabella %VER.

git-svn-id: svn://10.65.10.50/trunk@2766 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1996-04-24 16:54:45 +00:00
parent 383c83b3d5
commit ccb742cacc

View File

@ -13,8 +13,6 @@
#include "cg4300c.h" #include "cg4300c.h"
#include "cg4800b.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 // -------------------------------------------------- estrazione deleghe
bool TLiquidazione_app::set_deleghe() bool TLiquidazione_app::set_deleghe()
@ -70,7 +68,7 @@ bool TLiquidazione_app::set_deleghe()
} }
bool TLiquidazione_app::extract_deleghe() bool TLiquidazione_app::extract_deleghe()
{ {
char buf[256]; TArray desc; char buf[256]; TArray desc;
_prind = new TProgind(_calcall ? _n_ditte : _selected.ones(), _prind = new TProgind(_calcall ? _n_ditte : _selected.ones(),
" Estrazione deleghe \n" " Estrazione deleghe \n"
@ -78,6 +76,8 @@ bool TLiquidazione_app::extract_deleghe()
" \n ", " \n ",
TRUE,TRUE,40); 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++) for (int l = 0; l < _ditte->items(); l++)
{ {
if (_prind->iscancelled()) 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! real topay = result_liq(month); // TBC non si puo' fa' accussi'!!!!! pena il casino!
if (month == 12) if (month == 12)
{ {
if (topay > IVA_DA_VERSARE_MESE_12) if (topay > _ver->get(I_ANNUALE))
versare = TRUE; versare = TRUE;
} }
else if (topay > IVA_DA_VERSARE_ALTRI_MESI) else if (topay > _ver->get(I_PERIODICO))
versare = TRUE; versare = TRUE;
real intr = _lim->get_real("R14"); real intr = _lim->get_real("R14");
@ -363,6 +363,8 @@ bool TLiquidazione_app::recalc_acconti(real& inf, real& ina)
"\n ", "\n ",
TRUE,TRUE,40); 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++) for (int l = 0; l < _ditte->items(); l++)
{ {
if (_prind->iscancelled()) 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) bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
{ {
TConfig cnf(CONFIG_DITTA, "cg");
real bc = 0.0; real bc = 0.0;
real acc = 0.0; real acc = 0.0;
real cre = 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 iva_pro = 0.0;
real cre_pre = 0.0; real cre_pre = 0.0;
real acq_intr = 0.0; real acq_intr = 0.0;
bool isdifferita = FALSE; bool isdifferita = cnf.get_bool("GeLiDi");
bool error = FALSE; bool error = FALSE;
TString16 tipo_acc; TString16 tipo_acc;
@ -513,7 +516,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
if (bc.sign() > 0) //debito if (bc.sign() > 0) //debito
{ {
acc = bc * ACCONTO_DICEMBRE; acc = bc * _ver->get(isdifferita ? B_LIQ_DIFF : B_LIQ_NORM);
acc.round(ROUND_LIRA); acc.round(ROUND_LIRA);
} }
@ -623,8 +626,6 @@ else if (_basecalc == incorso)
// sbatti l'acconto (e non solo!) in LIA // sbatti l'acconto (e non solo!) in LIA
if (look_lia()) if (look_lia())
{ {
TConfig cnf(CONFIG_DITTA, "cg");
isdifferita = cnf.get_bool("GeLiDi");
if (isdifferita && _basecalc == incorso) if (isdifferita && _basecalc == incorso)
{ {
acc *= real(2.0); acc *= real(2.0);
@ -646,6 +647,11 @@ if (look_lia())
} }
/*** Non bisogna aggiornare la delega /*** 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); bool wasdel = look_del(12,7);
if (acc.sign() > 0 && acc >= ACCONTO_MINIMO_DA_VERSARE) if (acc.sign() > 0 && acc >= ACCONTO_MINIMO_DA_VERSARE)