Corretta ventilazione trimestrale. Considerava i mesi singolarmente e
poi ne sommava i risultati. Ora fa come l'annuale: considera i mesi globalmente. git-svn-id: svn://10.65.10.50/trunk@4812 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
bd12d42977
commit
b53b8baa81
@ -231,7 +231,8 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
|
|
||||||
// se ricalcola l'annuale si tiene tutte le vendite e corrispettivi di
|
// se ricalcola l'annuale si tiene tutte le vendite e corrispettivi di
|
||||||
// tutti i lerci mesi
|
// tutti i lerci mesi
|
||||||
if (!(_month == 13 && month > 1))
|
// Analogamente se sta calcolando una trimestrale
|
||||||
|
if (!(_month == 13 && month > 1 || _freqviva == "T" && (month != 4 && month != 7 && month != 10)))
|
||||||
{
|
{
|
||||||
_vend_arr.destroy();
|
_vend_arr.destroy();
|
||||||
_corr_arr.destroy();
|
_corr_arr.destroy();
|
||||||
@ -420,8 +421,9 @@ bool TLiquidazione_app::update_att(int month, const char* codatt,
|
|||||||
if (calc || !recalc)
|
if (calc || !recalc)
|
||||||
{
|
{
|
||||||
zero_att(month,codatt);
|
zero_att(month,codatt);
|
||||||
recalc_att(month,codatt);
|
recalc_att(month,codatt);
|
||||||
recalc_ventilation(month, codatt);
|
if (_freqviva == "M" || (_freqviva == "T" && month == _month) || _month == 13)
|
||||||
|
recalc_ventilation(month, codatt);
|
||||||
recalc_corrispettivi(month, codatt);
|
recalc_corrispettivi(month, codatt);
|
||||||
//13/12/1995
|
//13/12/1995
|
||||||
// if (month == 13)
|
// if (month == 13)
|
||||||
|
@ -281,8 +281,8 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
totacq += vv._totale;
|
totacq += vv._totale;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool is_annual = _month == 13 && month == 13;
|
const bool is_annual_or_trim = (_month == 13 && month == 13) || (_freqviva == "T");
|
||||||
for (j = 0; is_annual && j < _vend_arr.items(); j++)
|
for (j = 0; is_annual_or_trim && j < _vend_arr.items(); j++)
|
||||||
{
|
{
|
||||||
_VendItem& vi = (_VendItem&)_vend_arr[j];
|
_VendItem& vi = (_VendItem&)_vend_arr[j];
|
||||||
totven += vi._totale;
|
totven += vi._totale;
|
||||||
@ -292,15 +292,15 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
for (int i = 0; i < _vend_arr.items(); i++)
|
for (int i = 0; i < _vend_arr.items(); i++)
|
||||||
{
|
{
|
||||||
_VendItem* vi = (_VendItem*)&_vend_arr[i];
|
_VendItem* vi = (_VendItem*)&_vend_arr[i];
|
||||||
if (vi->_month != month && !is_annual)
|
if (vi->_month != month && !is_annual_or_trim)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// questo serve solo per il prospettino di m.
|
// questo serve solo per il prospettino di m.
|
||||||
if (!is_annual)
|
if (!is_annual_or_trim)
|
||||||
totven += vi->_totale;
|
totven += vi->_totale;
|
||||||
|
|
||||||
// 3.2) calcola percentuali di ripartizione e prepara l'affettatrice
|
// 3.2) calcola percentuali di ripartizione e prepara l'affettatrice
|
||||||
TDistrib dst(!is_annual ? vi->_totale : totven,ROUND_LIRA);
|
TDistrib dst(!is_annual_or_trim ? vi->_totale : totven,ROUND_LIRA);
|
||||||
for (j = 0; j < _vent_arr.items(); j++)
|
for (j = 0; j < _vent_arr.items(); j++)
|
||||||
{
|
{
|
||||||
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
_VentItem* vv = (_VentItem*)&_vent_arr[j];
|
||||||
@ -331,7 +331,7 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
if ((totven - tlor) == real(1.0))
|
if ((totven - tlor) == real(1.0))
|
||||||
imposta += real(1.0);
|
imposta += real(1.0);
|
||||||
|
|
||||||
if (is_annual)
|
if (is_annual_or_trim)
|
||||||
{
|
{
|
||||||
// memorizza i dati della ventilazione annuale in un TArray
|
// memorizza i dati della ventilazione annuale in un TArray
|
||||||
a_item.imposta() = imposta;
|
a_item.imposta() = imposta;
|
||||||
@ -375,7 +375,7 @@ void TLiquidazione_app::recalc_ventilation(int month, const char* codatt)
|
|||||||
_pim->rewrite();
|
_pim->rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_annual)
|
if (is_annual_or_trim)
|
||||||
{
|
{
|
||||||
// Cazzeggia e riscrive i PIM/PAM/PLM (veid sopra) ripartendo equamente gli importi annuali
|
// Cazzeggia e riscrive i PIM/PAM/PLM (veid sopra) ripartendo equamente gli importi annuali
|
||||||
// tra i vari mesi, tipodet e codici IVA.
|
// tra i vari mesi, tipodet e codici IVA.
|
||||||
|
@ -308,8 +308,8 @@ void TLiquidazione_app::describe_ventilation(int month, const char* codatt)
|
|||||||
}
|
}
|
||||||
if (vd == NULL) { vd = new _vDesc; }
|
if (vd == NULL) { vd = new _vDesc; }
|
||||||
|
|
||||||
vd->_vnd += imponibile;
|
vd->_vnd += imponibile;
|
||||||
vd->_viv += imposta;
|
vd->_viv += imposta;
|
||||||
|
|
||||||
d->_r1 += imponibile+imposta;
|
d->_r1 += imponibile+imposta;
|
||||||
|
|
||||||
@ -324,7 +324,11 @@ void TLiquidazione_app::describe_ventilation(int month, const char* codatt)
|
|||||||
if (d->_r1.is_zero() || d->_r0.is_zero())
|
if (d->_r1.is_zero() || d->_r0.is_zero())
|
||||||
delete d;
|
delete d;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
// Questo e' il fantastico moltiplicatore
|
||||||
|
d->_r2 = d->_r1 / d->_r0;
|
||||||
_descr_arr.add(d);
|
_descr_arr.add(d);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TLiquidazione_app::describe_agricolo(int month, const char* codatt)
|
void TLiquidazione_app::describe_agricolo(int month, const char* codatt)
|
||||||
@ -1922,8 +1926,7 @@ void TLiquidazione_app::set_ventila(_DescrItem& d)
|
|||||||
&(d._r0));
|
&(d._r0));
|
||||||
set_row(5,"@10gTotale dei corrispettivi da ventilare@55g%r",
|
set_row(5,"@10gTotale dei corrispettivi da ventilare@55g%r",
|
||||||
&(d._r1));
|
&(d._r1));
|
||||||
real m = d._r1 / d._r0;
|
set_row(6,"@10gMoltiplicatore@59g%3.9r",&(d._r2));
|
||||||
set_row(6,"@10gMoltiplicatore@59g%3.9r",&m);
|
|
||||||
set_row(7,"");
|
set_row(7,"");
|
||||||
set_row(8,"@10gCod.");
|
set_row(8,"@10gCod.");
|
||||||
set_row(9,"@10gIVA@17gDescrizione@48gAcquisti"
|
set_row(9,"@10gIVA@17gDescrizione@48gAcquisti"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user