Arrotondamento addendi in annuale (follia !!!)
git-svn-id: svn://10.65.10.50/trunk@1989 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a435ab4110
commit
ead7d3020a
@ -10,6 +10,8 @@
|
||||
#include <utility.h>
|
||||
#include "cg4300.h"
|
||||
|
||||
#define CHECK_ROUND(m,x) if(m==13)x.round(ROUND_MILLELIRE)
|
||||
|
||||
// -------------------- QUI comincia l'avventura --------------------------
|
||||
// Datemi un punto di appoggio ******************
|
||||
// e mi ci appoggero' ******************
|
||||
@ -1313,6 +1315,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
real acc_dec = 0.0;
|
||||
real iva_vend = 0.0;
|
||||
real iva_acq = 0.0;
|
||||
real conguaglio = 0.0;
|
||||
|
||||
// totali per agenzie viaggio
|
||||
real c_iCEE = 0.0;
|
||||
@ -1421,9 +1424,10 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
}
|
||||
|
||||
/*
|
||||
* rimborso se chiesto e previsto
|
||||
* rimborso se chiesto e previsto
|
||||
* in annuale non si chiede e non va sommato se no lo cumula
|
||||
*/
|
||||
if (attc == 0 && is_lim)
|
||||
if (attc == 0 && is_lim && m < 13)
|
||||
{
|
||||
risultato += _lim->get_real("R1");
|
||||
rimborsi += _lim->get_real("R1");
|
||||
@ -1445,7 +1449,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
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))
|
||||
!(month == 13 && !isforbenzinaro) && m < 13)
|
||||
{
|
||||
risultato += _lim->get_real("R5");
|
||||
rettifiche += _lim->get_real("R5");
|
||||
@ -1683,7 +1687,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
}
|
||||
|
||||
// questo serve anche per la visualizzazione e per l'estrazione deleghe
|
||||
//if (_isintr && month < 13)
|
||||
//if (_isintr && month < 13z)
|
||||
if ((_isintr && ((month != 12 || (_isbenzinaro && !_gest4)))))
|
||||
_lim->put("R10",interesse_trimestrale(_month));
|
||||
|
||||
@ -1706,7 +1710,72 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
if (_isfinal) _lim->put("B1", "X");
|
||||
|
||||
if (wasdifferita) _isdifferita = TRUE;
|
||||
|
||||
|
||||
// AWFUL! se siamo in annuale, occorre arrotondare alle 1000 lire
|
||||
// TUTTI gli ADDENDI e non il risultato. Cio' e' disonesto e mostruoso;
|
||||
// siccome sa di ricorso al TAR nonche' di errore della Prassi
|
||||
// schiaffo tutto il codice nell'IF che segue, e se lo si vuole togliere
|
||||
// non si fara' che scancellare tutto il blocco
|
||||
if (month == 13)
|
||||
{
|
||||
// molto codice duplicato, ma ne val la pena (vedi sopra)
|
||||
iva_vend.round(ROUND_MILLELIRE);
|
||||
iva_acq.round(ROUND_MILLELIRE);
|
||||
detrazioni.round(ROUND_MILLELIRE);
|
||||
versamenti.round(ROUND_MILLELIRE);
|
||||
vers_int.round(ROUND_MILLELIRE);
|
||||
rimborsi.round(ROUND_MILLELIRE);
|
||||
rettifiche.round(ROUND_MILLELIRE);
|
||||
deb_mens.round(ROUND_MILLELIRE);
|
||||
cred_prec.round(ROUND_MILLELIRE);
|
||||
tot_cong.round(ROUND_MILLELIRE);
|
||||
acc_dec.round(ROUND_MILLELIRE);
|
||||
debt_precd.round(ROUND_MILLELIRE);
|
||||
|
||||
res_cred = iva_acq + versamenti + vers_int + cred_prec + acc_dec;
|
||||
res_debt = iva_vend + rimborsi + deb_mens + debt_precd;
|
||||
|
||||
|
||||
if (tot_cong.sign() > 0) res_debt += tot_cong;
|
||||
else res_cred -= tot_cong;
|
||||
|
||||
if (rettifiche.sign() > 0) res_debt += rettifiche;
|
||||
else res_cred -= rettifiche;
|
||||
|
||||
if (!_isagricolo) res_cred += detrazioni;
|
||||
|
||||
// res_debt.round();
|
||||
// res_cred.round();
|
||||
|
||||
// TString r1(res_debt.string());
|
||||
// TString r2(res_cred.string());
|
||||
|
||||
// real rd(r1);
|
||||
// real rc(r2);
|
||||
|
||||
risultato = res_debt - res_cred;
|
||||
|
||||
// TString r3(risultato.string());
|
||||
|
||||
// tut ricalcule', riscrivem
|
||||
_lim->put("R0", risultato);
|
||||
_lim->put("R2", cred_cost);
|
||||
_lim->put("R3", deb_mens);
|
||||
_lim->put("R1", rimborsi);
|
||||
_lim->put("R5", rettifiche);
|
||||
_lim->put("R7", tot_cong);
|
||||
_lim->put("R8", versamenti);
|
||||
_lim->put("R9", vers_int);
|
||||
_lam->put("R0", iva_vend);
|
||||
_lam->put("R1", iva_acq);
|
||||
_lam->put("R2", cred_prec);
|
||||
_lam->put("R3", debt_precd);
|
||||
_lim->put("R11", acc_dec);
|
||||
_lim->put("R12", res_cred);
|
||||
_lim->put("R13", res_debt);
|
||||
// ciapa
|
||||
}
|
||||
|
||||
_lim->rewrite();
|
||||
_lam->rewrite();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user