Corretti o sputtanati MI0271 MI0147 MI2121 MI2124 MI2031 MI2038

MI1137 MI0355 MI0356 MI0359 MI0360 MI2011


git-svn-id: svn://10.65.10.50/trunk@794 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1994-12-27 16:28:35 +00:00
parent e8dcb49a76
commit f7b8967ec3
4 changed files with 55 additions and 37 deletions

View File

@ -342,7 +342,7 @@ public:
void set_pim(_DescrItem& d);
void set_plm(_DescrItem& d);
void set_ptm(_DescrItem& d);
void set_annual(_DescrItem& d);
bool set_annual(_DescrItem& d);
void set_grand(_DescrItem& d);
// cercapalle in tabelle con opzione di creazione se serve

View File

@ -182,7 +182,8 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
}
if (month == _month && gheravergot)
describe_att(month,cattiv);
describe_att(month,cattiv);
atts.add(cattiv);
cattivs.add(cattiv);
} // for tipoatt
@ -192,6 +193,10 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
describe_att(month,cattivs);
}
while (_nditte->next_match(LF_ATTIV));
// se quater stampa riepilogo
if (atts.items() > 1 && month == _month)
describe_att(month,atts);
// occorre poterla chiamare altre volte con mesi diversi
_nditte->restore_status();
@ -616,7 +621,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
if (!_prorata.is_zero())
{
prorata = acquisti_iva * (_prorata / CENTO);
prorata.ceil(ROUND_LIRA);
prorata.round(ROUND_LIRA);
}
look_plm(month, codatt, TRUE);
@ -640,7 +645,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
// calcola base da base e credito di costo
// indi abilmente trova il codiva e calcola l'iva del caso
real rip = acq_misCEE / (acq_misCEE + acq_misnoCEE);
real corr_imp = corr_misCEE * rip; corr_imp.ceil(ROUND_LIRA);
real corr_imp = corr_misCEE * rip; corr_imp.round(ROUND_LIRA);
corr_imp += corr_CEE;
real cost_detr = acq_misCEE * acq_CEE;
real base_imp = corr_imp - (cost_detr
@ -659,7 +664,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
{
debito = base_imp * aliquota_agvia();
vendite_iva += debito;
vendite_iva.ceil(ROUND_LIRA);
vendite_iva.round(ROUND_LIRA);
}
// tutte ste minchie le mettiamo in lim anche se sarebbe
@ -890,7 +895,7 @@ void TLiquidazione_app::recalc_annual(const char* att)
// calcolo prorata
real prorata = (es_b1/(vendite - cess_amm - es_b3)) * CENTO;
real conguaglio = 0.0;
prorata.ceil(ROUND_LIRA);
prorata.round(ROUND_LIRA);
if (prorata != _prorata)
{
// calcolo conguaglio -- se positivo e' a debito

View File

@ -10,23 +10,29 @@ void TLiquidazione_app::add_plafond(int month, const char* codatt, int type,
real& howmuch, bool intra)
{
look_ppa(month,codatt,type);
TString att(codatt);
real r0 = _ppa_r->get_real("R0");
real r1 = _ppa_r->get_real("R1");
real r2 = _ppa_r->get_real("R2");
real r0 = _ppa_r->get("R0");
real r1 = _ppa_r->get("R1");
real r2 = _ppa_r->get("R2");
if (intra) r1 += howmuch; else r0 += howmuch;
if (intra)
r1 += howmuch;
else
r0 += howmuch;
if (r2 < (r0+r1))
{
describe_error("Acquisti in eccesso rispetto al plafond disponibile",
codatt);
r2 -= (r0+r1);
if (r2.sign() < 0) r2 = 0.0;
att.cut(5));
}
// r2 -= (r0+r1);
// if (r2.sign() < 0) r2 = 0.0;
_ppa_r->put("R0",r0);
_ppa_r->put("R1",r1);
_ppa_r->put("R2",r2);
// _ppa_r->put("R2",r2);
_ppa->rewrite();
}
@ -56,7 +62,10 @@ void TLiquidazione_app::zero_plafond (int month, const char* codatt)
codatt);
look_ppa(previous_month(month),codatt,jj);
}
r = _ppa_r->get_real("R2");
r = _ppa_r->get_real("R2") -
_ppa_r->get_real("R0") -
_ppa_r->get_real("R1");
_ppa->readat(rn);
}
_ppa_r->put("R2",r);

View File

@ -715,7 +715,7 @@ void TLiquidazione_app::set_att(_DescrItem& d)
if (d._s3.empty())
{
att_title = "Riepilogo attivita' ";
att_title << d._s2;
// att_title << d._s2;
}
else
att_title = format("Attivita' %s %s %s",
@ -746,9 +746,9 @@ void TLiquidazione_app::set_att(_DescrItem& d)
void TLiquidazione_app::set_plafond(_DescrItem& d)
{
real r1 = d._r0 + d._r1 + d._r2;
real r2 = d._r3 + d._r4 + d._r5;
real r3 = d._r6 + d._r7 + d._r8;
real r1 = d._r2 - d._r1 - d._r0;
real r2 = d._r5 - d._r4 - d._r3;
real r3 = d._r8 - d._r7 - d._r6;
set_print_zero(TRUE);
@ -757,24 +757,24 @@ void TLiquidazione_app::set_plafond(_DescrItem& d)
set_row(2,""); set_row(3,"");
set_row(4,"Art. 8 1° comma lettere a-b@31gDisponibile@48g%r",
&r1);
&(d._r2));
set_row(5,"Utilizzato all'interno@48g%r", &(d._r0));
set_row(6,"Utilizzato per l'importazione@48g%r@69gRiporto@78g%r",
&(d._r1), &(d._r2));
&(d._r1), &r1);
set_row(7,"");
set_row(8,"Art. 8bis 1° comma@31gDisponibile@48g%r",
&r2);
&(d._r5));
set_row(9,"Utilizzato all'interno@48g%r", &(d._r3));
set_row(10,"Utilizzato per l'importazione@48g%r@69gRiporto@78g%r",
&(d._r4), &(d._r5));
&(d._r4), &(r2));
set_row(11,"");
set_row(12,"Art. 9 1° comma@31gDisponibile@48g%r",
&r3);
&(d._r8));
set_row(13,"Utilizzato all'interno@48g%r", &(d._r6));
set_row(14,"Utilizzato per l'importazione@48g%r@69gRiporto@78g%r",
&(d._r7), &(d._r8));
&(d._r7), &r3);
set_print_zero(FALSE);
set_auto_ff();
@ -890,20 +890,20 @@ void TLiquidazione_app::set_ptm(_DescrItem& d)
&(d._r0),
&(d._r1));
}
if (! (spgn.is_zero() && spgn_iva.is_zero()))
if (!(spgn.is_zero() && spgn_iva.is_zero()))
{
set_row(row++, "Spese generali@50g%r@69g%r",
&spgn,
&spgn_iva);
}
if (! (d._r6.is_zero() && d._r7.is_zero()))
if (!(d._r6.is_zero() && d._r7.is_zero()))
{
printed = TRUE;
set_row(row++, "Altri beni strumentali acquisiti in leasing@50g%r@69g%r",
&(d._r6),
&(d._r7));
}
if (! (d._r2.is_zero() && d._r3.is_zero()))
if (!(d._r2.is_zero() && d._r3.is_zero()))
{
printed = TRUE;
real rn = d._r2 * real(DETRAZIONE_6PERCENTO);
@ -924,9 +924,8 @@ void TLiquidazione_app::set_ptm(_DescrItem& d)
// items vari per dichiarazione annuale
for (int i = 0; i < d._arr.items(); i++)
{
printed = TRUE;
_DescrItem& dd = (_DescrItem&)d._arr[i];
set_annual(dd);
printed |= set_annual(dd);
}
if (printed)
@ -1090,12 +1089,15 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
}
void TLiquidazione_app::set_annual(_DescrItem& d)
bool TLiquidazione_app::set_annual(_DescrItem& d)
{
// chiamata internamente a set_pims
bool ret = FALSE;
int row = get_maxrow()+1;
if (d._f0 & IS_PRORATA)
{
{
ret = TRUE;
set_print_zero(TRUE);
set_row(row++,"");
set_row(row++,"CALCOLO DELLA PERCENTUALE DI INDETRAIBILITA'");
@ -1113,6 +1115,7 @@ void TLiquidazione_app::set_annual(_DescrItem& d)
}
set_print_zero(FALSE);
}
return ret;
}
@ -1244,7 +1247,7 @@ void TLiquidazione_app::set_viaggio(_DescrItem& d)
int ln = max(up.len(), dn.len()) + 2;
TString den(ln); den.fill('-');
up.center_just(ln); dn.center_just(ln);
real rip = d._r7 * CENTO; rip.ceil(2);
real rip = d._r7 * CENTO; rip.round(2);
// la bella frazioncina degli imponibili viaggi misti
TString tmp2 = d._r1.string(REAL_PICTURE); tmp2.ltrim();
@ -1262,7 +1265,7 @@ void TLiquidazione_app::set_viaggio(_DescrItem& d)
int rem2 = pos1+ den.len() + 11;
int pos2 = rem2 + 20;
real cim = d._r1 * d._r7; cim.ceil(ROUND_LIRA);
real cim = d._r1 * d._r7; cim.round(ROUND_LIRA);
set_row(19,format("@%dg%%t@%dg%%t", pos1, pos2),
&up, &up2);
@ -1323,7 +1326,8 @@ void TLiquidazione_app::set_viaggio(_DescrItem& d)
else
{
real aliva = aliquota_agvia();
real dovuta = bil * aliva; dovuta.ceil(ROUND_LIRA);
real dovuta = bil - (bil / (aliva+real(1.0)));
dovuta.ceil(ROUND_LIRA);
aliva *= 100.0;
tmp = bil.string(REAL_PICTURE); tmp.ltrim();