Corretto MI6160, MI6161, MI2259, MI2262.
git-svn-id: svn://10.65.10.50/trunk@3966 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b177b0ab6f
commit
40211f0926
487
cg/cg4301.cpp
487
cg/cg4301.cpp
@ -1353,27 +1353,30 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
}
|
||||
|
||||
void TLiquidazione_app::iva11_set_arr(const TString& codatt)
|
||||
// viene chiamata quando vengonon scorsi i movimenti del mese, settando gran parte degli elementi di _iva11_arr.
|
||||
// viene chiamata quando vengono scorsi i movimenti del mese, settando gran parte degli elementi di _iva11_arr.
|
||||
{
|
||||
// My God! Che 2 palle riestrarre tutte le informazioni
|
||||
const TString16 tipodoc = _mov->get("TIPODOC");
|
||||
const real imponibile = _rmoviva->get_real("IMPONIBILE");
|
||||
const real imposta = _rmoviva->get_real("IMPOSTA");
|
||||
const bool intra = _rmoviva->get_bool("INTRA");
|
||||
const int tipocr = _rmoviva->get_int("TIPOCR");
|
||||
const int tipodet = _rmoviva->get_int("TIPODET");
|
||||
const TString codiva = _iva->get("CODTAB");
|
||||
real imponibile = _rmoviva->get_real("IMPONIBILE");
|
||||
real imposta = _rmoviva->get_real("IMPOSTA");
|
||||
const TString16 codiva = _iva->get("CODTAB");
|
||||
const TString tipoiva = _iva->get("S1");
|
||||
const real ali = _iva->get_real("R0");
|
||||
const TString tipoes_v = _iva->get("S2");
|
||||
const TString tipoes_a = _iva->get("S9");
|
||||
const real ali = _iva->get_real("R0");
|
||||
const TString16 tipoes_v = _iva->get("S2");
|
||||
const TString16 tipoes_a = _iva->get("S9");
|
||||
const int tipoagr = atoi(_iva->get("S4"));
|
||||
const TRectype& rcs = _cur->curr(LF_CAUSALI);
|
||||
const bool autofattura = rcs.get_bool("AUTOFATT");
|
||||
const bool valintra = rcs.get_bool("VALINTRA");
|
||||
const bool sosp_imp = _reg->get_bool("B1");
|
||||
const bool corrisp = _reg->get_bool("B0");
|
||||
tiporeg tipomov = (tiporeg)_reg->get_long("I0");
|
||||
const bool is_vendita = tipomov == vendita;
|
||||
const bool is_acquisto = tipomov == acquisto;
|
||||
|
||||
|
||||
_BolgArray b_arr;
|
||||
const bool is_key = _iva11_arr.is_key(codatt);
|
||||
@ -1424,59 +1427,61 @@ void TLiquidazione_app::iva11_set_arr(const TString& codatt)
|
||||
|
||||
if (tipodoc != "BD")
|
||||
{ // Compila prima i campi FC1nn ed FC2nn, poi i campi SBFnn ed SBInn
|
||||
if (ali == 2.00)
|
||||
if (tipodet != 9)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC101);
|
||||
array.add(imposta,TAB11_FC201);
|
||||
}
|
||||
else if (ali == 4.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC102);
|
||||
array.add(imposta,TAB11_FC202);
|
||||
}
|
||||
else if (ali == 8.50)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC103);
|
||||
array.add(imposta,TAB11_FC203);
|
||||
}
|
||||
else if (ali == 9.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC104);
|
||||
array.add(imposta,TAB11_FC204);
|
||||
}
|
||||
else if (ali == 10.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC105);
|
||||
array.add(imposta,TAB11_FC205);
|
||||
}
|
||||
else if (ali == 13.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC106);
|
||||
array.add(imposta,TAB11_FC206);
|
||||
}
|
||||
else if (ali == 16.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC107);
|
||||
array.add(imposta,TAB11_FC207);
|
||||
}
|
||||
else if (ali == 19.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC108);
|
||||
array.add(imposta,TAB11_FC208);
|
||||
}
|
||||
|
||||
if (tipoes_a == "01")
|
||||
array.add(imponibile,TAB11_FC109);
|
||||
else if (tipoes_a == "12")
|
||||
array.add(imponibile,TAB11_FC110);
|
||||
else if (tipoes_a == "13")
|
||||
array.add(imponibile,TAB11_FC111);
|
||||
else if (tipoes_a == "14")
|
||||
array.add(imponibile,TAB11_FC112);
|
||||
else if (tipoes_a == "15")
|
||||
array.add(imponibile,TAB11_FC113);
|
||||
|
||||
if (tipodet == 9)
|
||||
if (ali == 2.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC101);
|
||||
array.add(imposta,TAB11_FC201);
|
||||
}
|
||||
else if (ali == 4.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC102);
|
||||
array.add(imposta,TAB11_FC202);
|
||||
}
|
||||
else if (ali == 8.50)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC103);
|
||||
array.add(imposta,TAB11_FC203);
|
||||
}
|
||||
else if (ali == 9.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC104);
|
||||
array.add(imposta,TAB11_FC204);
|
||||
}
|
||||
else if (ali == 10.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC105);
|
||||
array.add(imposta,TAB11_FC205);
|
||||
}
|
||||
else if (ali == 13.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC106);
|
||||
array.add(imposta,TAB11_FC206);
|
||||
}
|
||||
else if (ali == 16.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC107);
|
||||
array.add(imposta,TAB11_FC207);
|
||||
}
|
||||
else if (ali == 19.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_FC108);
|
||||
array.add(imposta,TAB11_FC208);
|
||||
}
|
||||
|
||||
if (tipoes_a == "01")
|
||||
array.add(imponibile,TAB11_FC109);
|
||||
else if (tipoes_a == "12")
|
||||
array.add(imponibile,TAB11_FC110);
|
||||
else if (tipoes_a == "13")
|
||||
array.add(imponibile,TAB11_FC111);
|
||||
else if (tipoes_a == "14")
|
||||
array.add(imponibile,TAB11_FC112);
|
||||
else if (tipoes_a == "15")
|
||||
array.add(imponibile,TAB11_FC113);
|
||||
}
|
||||
else
|
||||
{
|
||||
array.add(imponibile,TAB11_FC114);
|
||||
if (_sind11)
|
||||
@ -1485,47 +1490,49 @@ void TLiquidazione_app::iva11_set_arr(const TString& codatt)
|
||||
|
||||
if (intra) // Compila i campi SBFnn
|
||||
{
|
||||
if (ali == 4.00)
|
||||
if (tipodet != 9)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF01);
|
||||
array.add(imposta,TAB11_SBI01);
|
||||
if (ali == 4.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF01);
|
||||
array.add(imposta,TAB11_SBI01);
|
||||
}
|
||||
else if (ali == 9.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF02);
|
||||
array.add(imposta,TAB11_SBI02);
|
||||
}
|
||||
else if (ali == 10.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF03);
|
||||
array.add(imposta,TAB11_SBI03);
|
||||
}
|
||||
else if (ali == 13.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF04);
|
||||
array.add(imposta,TAB11_SBI04);
|
||||
}
|
||||
else if (ali == 16.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF05);
|
||||
array.add(imposta,TAB11_SBI05);
|
||||
}
|
||||
else if (ali == 19.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF06);
|
||||
array.add(imposta,TAB11_SBI06);
|
||||
}
|
||||
|
||||
if (tipoes_a == "01")
|
||||
array.add(imponibile,TAB11_SBF07);
|
||||
else if (tipoes_a == "12")
|
||||
array.add(imponibile,TAB11_SBF08);
|
||||
else if (tipoes_a == "13")
|
||||
array.add(imponibile,TAB11_SBF09);
|
||||
else if (tipoes_a == "14")
|
||||
array.add(imponibile,TAB11_SBF10);
|
||||
}
|
||||
else if (ali == 9.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF02);
|
||||
array.add(imposta,TAB11_SBI02);
|
||||
}
|
||||
else if (ali == 10.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF03);
|
||||
array.add(imposta,TAB11_SBI03);
|
||||
}
|
||||
else if (ali == 13.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF04);
|
||||
array.add(imposta,TAB11_SBI04);
|
||||
}
|
||||
else if (ali == 16.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF05);
|
||||
array.add(imposta,TAB11_SBI05);
|
||||
}
|
||||
else if (ali == 19.00)
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF06);
|
||||
array.add(imposta,TAB11_SBI06);
|
||||
}
|
||||
|
||||
if (tipoes_a == "01")
|
||||
array.add(imponibile,TAB11_SBF07);
|
||||
else if (tipoes_a == "12")
|
||||
array.add(imponibile,TAB11_SBF08);
|
||||
else if (tipoes_a == "13")
|
||||
array.add(imponibile,TAB11_SBF09);
|
||||
else if (tipoes_a == "14")
|
||||
array.add(imponibile,TAB11_SBF10);
|
||||
|
||||
if (tipodet == 9)
|
||||
else
|
||||
{
|
||||
array.add(imponibile,TAB11_SBF11);
|
||||
if (_sind11)
|
||||
@ -1538,9 +1545,15 @@ void TLiquidazione_app::iva11_set_arr(const TString& codatt)
|
||||
|
||||
if (is_vendita)
|
||||
{
|
||||
if (corrisp && tipoiva != "VE" && (tipodoc == "CR" || tipodoc == "RF" || tipodoc == "SC") )
|
||||
{
|
||||
real p = ali/CENTO;
|
||||
lordo2netto(imponibile,imposta,p);// In tal caso scorpora l'iva dall'imponibile...
|
||||
}
|
||||
|
||||
if (!valintra)
|
||||
{
|
||||
if ((_isagricolo && tipoagr==2) || !_isagricolo)
|
||||
if (tipodoc != "AF" && ((_isagricolo && tipoagr==2) || !_isagricolo))
|
||||
{
|
||||
if (ali == 4.00)
|
||||
{
|
||||
@ -1687,7 +1700,7 @@ void TLiquidazione_app::iva11_set_arr_pim(const TString& codatt)
|
||||
tiporeg treg;
|
||||
int tipocr,tipodet,tagr;
|
||||
real aliq, imp, iva, vtot, atot, ivav, ivaa;
|
||||
TString cur_att;
|
||||
TString16 cur_att;
|
||||
_BolgArray b_arr;
|
||||
const bool is_key = _iva11_arr.is_key(codatt);
|
||||
_BolgArray& array = is_key ? (_BolgArray&)_iva11_arr.find(codatt) : b_arr;
|
||||
@ -1737,49 +1750,53 @@ void TLiquidazione_app::iva11_set_arr_pim(const TString& codatt)
|
||||
|
||||
if (tipodet == 1)
|
||||
array.add(iva,TAB11_B14);
|
||||
|
||||
if (aliq == 4.00)
|
||||
{
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC101);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC201);
|
||||
}
|
||||
else
|
||||
if (aliq == 9.00)
|
||||
|
||||
// FBC???: tipo detr != 9
|
||||
if (tipodet != 9)
|
||||
{
|
||||
if (aliq == 4.00)
|
||||
{
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC102);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC202);
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC101);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC201);
|
||||
}
|
||||
else
|
||||
if (aliq == 10.00)
|
||||
if (aliq == 9.00)
|
||||
{
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC103);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC203);
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC102);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC202);
|
||||
}
|
||||
else
|
||||
if (aliq == 13.00)
|
||||
if (aliq == 10.00)
|
||||
{
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC104);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC204);
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC103);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC203);
|
||||
}
|
||||
else
|
||||
if (aliq == 16.00)
|
||||
if (aliq == 13.00)
|
||||
{
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC105);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC205);
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC104);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC204);
|
||||
}
|
||||
else
|
||||
if (aliq == 19.00)
|
||||
if (aliq == 16.00)
|
||||
{
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC106);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC206);
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC105);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC205);
|
||||
}
|
||||
|
||||
if (a11 == "12")
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC107);
|
||||
if (a11 == "13" || a11 == "14")
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC108);
|
||||
if (a11 == "15")
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC109);
|
||||
else
|
||||
if (aliq == 19.00)
|
||||
{
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC106);
|
||||
array.add(_pim->get_real("R10"),TAB11_FBC206);
|
||||
}
|
||||
|
||||
if (a11 == "12")
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC107);
|
||||
if (a11 == "13" || a11 == "14")
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC108);
|
||||
if (a11 == "15")
|
||||
array.add(_pim->get_real("R9"),TAB11_FBC109);
|
||||
}
|
||||
} // is_acquisto
|
||||
|
||||
if (is_vendita)
|
||||
@ -1827,7 +1844,7 @@ void TLiquidazione_app::iva11_set_arr_pim(const TString& codatt)
|
||||
}
|
||||
else
|
||||
//acquisti
|
||||
if (tipodet != 9) // Evita di sommare gli quelli con tipo detraibilita' 9 (MI2209)
|
||||
if (tipodet != 9) // Evita di sommare quelli con tipo detraibilita' 9 (MI2209)
|
||||
{
|
||||
atot += imp; ivaa+=iva;
|
||||
}
|
||||
@ -1995,105 +2012,108 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
differita = FALSE;
|
||||
}
|
||||
}
|
||||
{
|
||||
for (int m = 1; m <= 13; m++)
|
||||
{
|
||||
// ciclo su tutti i mesi del caso (1 o 3;
|
||||
// tutti se annuale)
|
||||
if (!is_month_ok(m, month))
|
||||
continue;
|
||||
|
||||
for (int m = 1; m <= 13; m++)
|
||||
{
|
||||
// ciclo su tutti i mesi del caso (1 o 3;
|
||||
// tutti se annuale)
|
||||
if (!is_month_ok(m, month))
|
||||
continue;
|
||||
|
||||
look_plm(differita ? 12 : m, att);
|
||||
bool is_lim = look_lim(_isdifferita ? m+deltam : m);
|
||||
look_plm(differita ? 12 : m, att);
|
||||
bool is_lim = look_lim(_isdifferita ? m+deltam : m);
|
||||
|
||||
// gia' conteggiato: prorata
|
||||
// da conteggiare: IVA vendite ag. viaggio
|
||||
// a debito: IVA vendite, debito precedente
|
||||
// a credito: IVA acquisti, ulteriori detrazioni 1 e 2
|
||||
// gia' conteggiato: prorata
|
||||
// da conteggiare: IVA vendite ag. viaggio
|
||||
// a debito: IVA vendite, debito precedente
|
||||
// a credito: IVA acquisti, ulteriori detrazioni 1 e 2
|
||||
|
||||
if (!_isagricolo)
|
||||
{
|
||||
iva_vend += _plm->get_real("R0");
|
||||
iva_acq += _plm->get_real("R1");
|
||||
risultato += (_plm->get_real("R0") - _plm->get_real("R1"));
|
||||
detrazioni+= (_plm->get_real("R3") + _plm->get_real("R4"));
|
||||
res_debt += _plm->get_real("R0");
|
||||
res_cred += _plm->get_real("R1");
|
||||
} // le storie per l'agricolo sono piu' sotto, oltre la fine del do..while()
|
||||
|
||||
// detrazioni solo non in regime agricolo
|
||||
if (!_isagricolo)
|
||||
{
|
||||
risultato -= (_plm->get_real("R3") + _plm->get_real("R4"));
|
||||
res_cred += (_plm->get_real("R3") + _plm->get_real("R4"));
|
||||
}
|
||||
/* se annuale, somma versamenti mesi 1-12
|
||||
* solo una volta (non per tutte le attivita')
|
||||
*/
|
||||
if (attc == 0 && month == 13)
|
||||
{
|
||||
// l'acconto a dicembre si conteggia a parte solo
|
||||
// nei casi previsti e non in annuale (vedi sotto)
|
||||
real vs(versamenti_IVA(m , m == 12 ? "1" : "1|7"));
|
||||
real vi(versamenti_IVA(m,"5"));
|
||||
versamenti += vs;
|
||||
vers_int += vi;
|
||||
res_cred += vs + vi;
|
||||
}
|
||||
detrazioni+= (_plm->get_real("R3") + _plm->get_real("R4"));
|
||||
res_debt += _plm->get_real("R0");
|
||||
res_cred += _plm->get_real("R1");
|
||||
|
||||
// detrazioni solo non in regime agricolo
|
||||
if (!_isagricolo)
|
||||
{
|
||||
risultato -= (_plm->get_real("R3") + _plm->get_real("R4"));
|
||||
res_cred += (_plm->get_real("R3") + _plm->get_real("R4"));
|
||||
}
|
||||
/* se annuale, somma versamenti mesi 1-12
|
||||
* solo una volta (non per tutte le attivita')
|
||||
*/
|
||||
if (attc == 0 && month == 13)
|
||||
{
|
||||
// l'acconto a dicembre si conteggia a parte solo
|
||||
// nei casi previsti e non in annuale (vedi sotto)
|
||||
real vs(versamenti_IVA(m , m == 12 ? "1" : "1|7"));
|
||||
real vi(versamenti_IVA(m,"5"));
|
||||
versamenti += vs;
|
||||
vers_int += vi;
|
||||
res_cred += vs + vi;
|
||||
}
|
||||
|
||||
/*
|
||||
* rimborso se chiesto e previsto
|
||||
* in annuale non si chiede e non va sommato se no lo cumula
|
||||
*/
|
||||
if (attc == 0 && is_lim && m < 13)
|
||||
{
|
||||
risultato += _lim->get_real("R1");
|
||||
rimborsi += _lim->get_real("R1");
|
||||
res_debt += _lim->get_real("R1");
|
||||
}
|
||||
/*
|
||||
* rettifiche gia' col loro bravo segno
|
||||
*/
|
||||
if (attc == 0 && is_lim)
|
||||
{
|
||||
// se sono per benzinaro le conta solo in annuale,
|
||||
// se no vanno solo in periodica
|
||||
// almeno cosi' dicevano fino ad agosto
|
||||
// poi, sara' il caldo, mi hanno detto che e' sbagliato
|
||||
TString descrett(_lim->get("S0"));
|
||||
bool isforbenzinaro = descrett[0] == '$' ||
|
||||
(descrett[0] == '>' && descrett[1] == '>');
|
||||
/*
|
||||
* rimborso se chiesto e previsto
|
||||
* in annuale non si chiede e non va sommato se no lo cumula
|
||||
*/
|
||||
if (attc == 0 && is_lim && m < 13)
|
||||
{
|
||||
risultato += _lim->get_real("R1");
|
||||
rimborsi += _lim->get_real("R1");
|
||||
res_debt += _lim->get_real("R1");
|
||||
}
|
||||
/*
|
||||
* rettifiche gia' col loro bravo segno
|
||||
*/
|
||||
if (attc == 0 && is_lim)
|
||||
{
|
||||
// se sono per benzinaro le conta solo in annuale,
|
||||
// se no vanno solo in periodica
|
||||
// almeno cosi' dicevano fino ad agosto
|
||||
// poi, sara' il caldo, mi hanno detto che e' sbagliato
|
||||
TString descrett(_lim->get("S0"));
|
||||
bool isforbenzinaro = descrett[0] == '$' ||
|
||||
(descrett[0] == '>' && descrett[1] == '>');
|
||||
|
||||
if (/*(isforbenzinaro && _isannual) || ...alla cincia quest'idea non piaceva piu'
|
||||
(!isforbenzinaro && !_isannual) adesso la storia e' cosi':
|
||||
in ANNUALE solo se benzinaro, altrimenti niente; diversamente tutto*/
|
||||
!(month == 13 && !isforbenzinaro) && m < 13)
|
||||
{
|
||||
risultato += _lim->get_real("R5");
|
||||
rettifiche += _lim->get_real("R5");
|
||||
if (_lim->get_real("R5").sign() < 0)
|
||||
res_cred += abs(_lim->get_real("R5"));
|
||||
else
|
||||
res_debt += abs(_lim->get_real("R5"));
|
||||
}
|
||||
}
|
||||
|
||||
/* totalizza importi 74 ter */
|
||||
if (_isviaggio)
|
||||
if (/*(isforbenzinaro && _isannual) || ...alla cincia quest'idea non piaceva piu'
|
||||
(!isforbenzinaro && !_isannual) adesso la storia e' cosi':
|
||||
in ANNUALE solo se benzinaro, altrimenti niente; diversamente tutto*/
|
||||
!(month == 13 && !isforbenzinaro) && m < 13)
|
||||
{
|
||||
// somma totali per calcolo successivo
|
||||
c_iCEE += _plm->get_real("R5");
|
||||
c_eCEE += _plm->get_real("R6");
|
||||
a_iCEE += _plm->get_real("R7");
|
||||
a_eCEE += _plm->get_real("R8");
|
||||
c_mCEE += _plm->get_real("R9");
|
||||
a_mCEE += _plm->get_real("R10");
|
||||
a_meCEE += _plm->get_real("R11");
|
||||
}
|
||||
} // fine ciclo sul mese
|
||||
risultato += _lim->get_real("R5");
|
||||
rettifiche += _lim->get_real("R5");
|
||||
if (_lim->get_real("R5").sign() < 0)
|
||||
res_cred += abs(_lim->get_real("R5"));
|
||||
else
|
||||
res_debt += abs(_lim->get_real("R5"));
|
||||
}
|
||||
}
|
||||
|
||||
/* totalizza importi 74 ter */
|
||||
if (_isviaggio)
|
||||
{
|
||||
// somma totali per calcolo successivo
|
||||
c_iCEE += _plm->get_real("R5");
|
||||
c_eCEE += _plm->get_real("R6");
|
||||
a_iCEE += _plm->get_real("R7");
|
||||
a_eCEE += _plm->get_real("R8");
|
||||
c_mCEE += _plm->get_real("R9");
|
||||
a_mCEE += _plm->get_real("R10");
|
||||
a_meCEE += _plm->get_real("R11");
|
||||
}
|
||||
} // fine ciclo sul mese
|
||||
|
||||
// counter attivita' per evitare troppi versamenti
|
||||
attc++;
|
||||
if (differita)
|
||||
_year = format("%d", atoi(_year)+1);
|
||||
} // fine else
|
||||
// counter attivita' per evitare troppi versamenti
|
||||
attc++;
|
||||
if (differita)
|
||||
_year = format("%d", atoi(_year)+1);
|
||||
|
||||
if (!(_isdifferita && is_first_month(month+deltam)))
|
||||
{
|
||||
@ -2125,6 +2145,30 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
}
|
||||
} // end ciclo su attivita'
|
||||
|
||||
if (_isagricolo)
|
||||
{ // Ora si deve rettificare risultato in questo modo:
|
||||
// risultato += (cessioni non in reg. agr. - (acq. non in reg. agr - beni amm. + iva detr)
|
||||
// ovvero
|
||||
// risultato += (d._r1 - (d._r2 + d._r10);
|
||||
// Utilizza solo d._r2 perche' gia' non comprensivo dei beni ammortizzabili
|
||||
// Giusto per fare qualcosa di nuovo e non ricalcolare ogni volta gli stessi importi
|
||||
// si reperisce REGAGR da _descr_arr
|
||||
const int items = _descr_arr.items();
|
||||
|
||||
for (int i = 0; i < items; i++)
|
||||
{
|
||||
_DescrItem& d = (_DescrItem&)_descr_arr[i];
|
||||
if (d._flags == REGAGR)
|
||||
{
|
||||
iva_vend = d._r1;
|
||||
iva_acq = d._r2 + d._r10;
|
||||
risultato += (iva_vend - iva_acq);
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
} // __ end of _isagricolo
|
||||
|
||||
if (month < 13) // va bene anche se differita sommando deltam (che e' 0 normalmente)
|
||||
{
|
||||
// toglie credito precedente
|
||||
@ -2422,7 +2466,10 @@ void TLiquidazione_app::recalc_annual(const char* att)
|
||||
real volaff1 = 0.0;
|
||||
real volaff2 = 0.0;
|
||||
real imp_ifs = 0.0;
|
||||
real imp_af = 0.0;
|
||||
real imp_a36 = 0.0;
|
||||
TString16 codiva,reg,tiva;
|
||||
TToken_string a36("",'!');
|
||||
|
||||
int tipoatt = att[strlen(att) -1] - '0';
|
||||
TString aaa(att);
|
||||
@ -2452,6 +2499,10 @@ void TLiquidazione_app::recalc_annual(const char* att)
|
||||
const bool corrisp = _reg->get_bool("B0");
|
||||
const bool simp = _reg->get_bool("B1");
|
||||
imp_ifs = _pim->get_real("R0");
|
||||
imp_af = _pim->get_real("R7");
|
||||
a36 = _pim->get("S0");
|
||||
imp_a36 = a36.get(0);
|
||||
imp_ifs -= imp_af + imp_a36; // Toglie le autofatture e le op. A36
|
||||
if (corrisp) imp_ifs += _pim->get_real("R5"); // Se corrisp. aggiunge le FS
|
||||
|
||||
if ( // ESCLUSI:
|
||||
|
Loading…
x
Reference in New Issue
Block a user