Skudlering
git-svn-id: svn://10.65.10.50/trunk@895 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
1de31e18c3
commit
bc816c4971
@ -319,8 +319,10 @@ public:
|
||||
// ritorna l'appropriato credito di costo precedente al mese in corso
|
||||
// (travel agency only)
|
||||
real credito_costo_prec(int month);
|
||||
// ritorna i versamenti effettuati nel mese
|
||||
real versamenti_IVA(int month, bool acconto = FALSE);
|
||||
// ritorna i versamenti effettuati nel mese per
|
||||
// i tipi delega passati (stile tokenstring) sommando
|
||||
// gli interessi se interesse = TRUE
|
||||
real versamenti_IVA(int month, const char* types, bool interesse = FALSE);
|
||||
|
||||
// supporto stampa
|
||||
void describe_firm(int month);
|
||||
|
114
cg/cg4301.cpp
114
cg/cg4301.cpp
@ -886,26 +886,31 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
real vol_aff = 0.0;
|
||||
real debito_prec = 0.0;
|
||||
real detrazioni = 0.0;
|
||||
real versamenti = 0.0;
|
||||
real vers_int = 0.0;
|
||||
real rimborsi = 0.0;
|
||||
real rettifiche = 0.0;
|
||||
|
||||
// totali per agenzie viaggio
|
||||
real c_iCEE(0.0);
|
||||
real c_eCEE(0.0);
|
||||
real a_iCEE(0.0);
|
||||
real a_eCEE(0.0);
|
||||
real c_mCEE(0.0);
|
||||
real a_mCEE(0.0);
|
||||
real a_meCEE(0.0);
|
||||
real cred_cost(0.0);
|
||||
real deb_mens(0.0);
|
||||
real perc_r(0.0);
|
||||
real c_iCEE = 0.0;
|
||||
real c_eCEE = 0.0;
|
||||
real a_iCEE = 0.0;
|
||||
real a_eCEE = 0.0;
|
||||
real c_mCEE = 0.0;
|
||||
real a_mCEE = 0.0;
|
||||
real a_meCEE = 0.0;
|
||||
real cred_cost = 0.0;
|
||||
real deb_mens = 0.0;
|
||||
real perc_r = 0.0;
|
||||
|
||||
bool differita = FALSE;
|
||||
int attc = 0; // counter attivita'
|
||||
|
||||
while ((tmpatt = atts.get()) != NULL)
|
||||
{
|
||||
TString att(tmpatt);
|
||||
|
||||
if (_isdifferita && is_first_month(month))
|
||||
if (_isdifferita && is_first_month(month) && attc == 0)
|
||||
{
|
||||
// usa i totali del mese di dicembre dell'anno
|
||||
// precedente
|
||||
@ -924,7 +929,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
deb_mens = _lim->get_real("R3");
|
||||
detrazioni= _lim->get_real("R6");
|
||||
perc_r = _lim->get_real("R4");
|
||||
cred_cost = _lim->get_real("R2");
|
||||
cred_cost = _lim->get_real("R2");
|
||||
rettifiche= _lim->get_real("R5");
|
||||
rimborsi = _lim->get_real("R1");
|
||||
_year = format("%d", atoi(_year)+1);
|
||||
}
|
||||
else
|
||||
@ -936,15 +943,56 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
if (!is_month_ok(m, month))
|
||||
continue;
|
||||
|
||||
look_plm(month, att); look_ptm(month,att);
|
||||
look_plm(m, att); look_ptm(m,att);
|
||||
bool is_lim = look_lim(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
|
||||
risultato += (_plm->get_real("R0") - _plm->get_real("R1") -
|
||||
_plm->get_real("R3") - _plm->get_real("R4"));
|
||||
risultato += (_plm->get_real("R0") - _plm->get_real("R1"));
|
||||
detrazioni+= (_plm->get_real("R3") + _plm->get_real("R4"));
|
||||
|
||||
|
||||
// detrazioni solo non in regime agricolo
|
||||
if (!_isagricolo)
|
||||
risultato -= (_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 && m < 13)
|
||||
{
|
||||
// l'acconto a dicembre si conteggia a parte solo
|
||||
// nei casi previsti e non in annuale (vedi sotto)
|
||||
versamenti += versamenti_IVA(m , m == 12 ? "1" : "1|7");
|
||||
vers_int += versamenti_IVA(m,"5");
|
||||
}
|
||||
|
||||
/*
|
||||
* rimborso se chiesto e previsto
|
||||
*/
|
||||
if (attc == 0 && is_lim && m < 13)
|
||||
{
|
||||
risultato -= _lim->get_real("R1");
|
||||
rimborsi += _lim->get_real("R1");
|
||||
}
|
||||
/*
|
||||
* rettifiche gia' col loro bravo segno
|
||||
*/
|
||||
if (attc == 0 && is_lim && m < 13)
|
||||
{
|
||||
// benzinaro le conta solo in annuale,
|
||||
// non benzinaro solo in periodica
|
||||
// TBC vedi se distinguere rett. benzinai / autotrasport,
|
||||
if ((_isbenzinaro && month == 13) ||
|
||||
(!_isbenzinaro && month < 13))
|
||||
{
|
||||
risultato += _lim->get_real("R5");
|
||||
rettifiche += _lim->get_real("R5");
|
||||
}
|
||||
}
|
||||
|
||||
/* totalizza importi 74 ter */
|
||||
if (_isviaggio)
|
||||
{
|
||||
// somma totali per calcolo successivo
|
||||
@ -955,7 +1003,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
c_mCEE += _plm->get_real("R9");
|
||||
a_mCEE += _plm->get_real("R10");
|
||||
a_meCEE += _plm->get_real("R11");
|
||||
}
|
||||
}
|
||||
// counter attivita' per evitare troppi versamenti
|
||||
attc++;
|
||||
} // fine ciclo sul mese
|
||||
}
|
||||
|
||||
@ -989,22 +1039,37 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
deb_mens.round(ROUND_LIRA);
|
||||
risultato += deb_mens;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
look_lim(month,TRUE);
|
||||
|
||||
/*
|
||||
* versamenti effettuati: si conteggiano in R0
|
||||
* - annuali se annuale
|
||||
* versamenti effettuati: si conteggiano in R0,
|
||||
* sono >0 solo se andavano calcolati (vedi sopra)
|
||||
*/
|
||||
|
||||
risultato -= (versamenti + vers_int);
|
||||
/*
|
||||
* acconto dicembre se previsto
|
||||
*/
|
||||
if ((month == 12 && _isbenzinaro) ||
|
||||
(month >= 12 && _freqviva == "M"))
|
||||
risultato -= versamenti_IVA(12,"7");
|
||||
|
||||
_lim->put("R0",risultato);
|
||||
_lim->put("R2",cred_cost);
|
||||
_lim->put("R3",deb_mens);
|
||||
_lim->put("R4",perc_r);
|
||||
_lim->put("R6",detrazioni);
|
||||
_lim->put("R6",detrazioni);
|
||||
|
||||
if (month == 13 && differita)
|
||||
{
|
||||
// scrivi totali rettifiche e rimborsi
|
||||
// nella finale oppure se copiati da
|
||||
// anno precedente
|
||||
_lim->put("R1",rimborsi);
|
||||
_lim->put("R5",rettifiche);
|
||||
}
|
||||
|
||||
/*
|
||||
* Interessi dovuti solo da trimestrali in periodica,
|
||||
@ -1018,6 +1083,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
||||
_lim->put("R7",ivi);
|
||||
}
|
||||
|
||||
_lim->put("R8", versamenti);
|
||||
_lim->put("R9", vers_int);
|
||||
|
||||
_lim->put("B0","X");
|
||||
if (_isfinal)
|
||||
_lim->put("B1", "X");
|
||||
|
@ -364,16 +364,10 @@ real TLiquidazione_app::result_liq(int month)
|
||||
// >0 a debito; non comprende il conguaglio prorata (annuale)
|
||||
{
|
||||
real r(0.0);
|
||||
// ulteriori detrazioni, acconti, versamenti,
|
||||
// rettifiche sono gia' comprese in R0
|
||||
if (look_lim(month))
|
||||
{
|
||||
r = _lim->get_real("R0") +
|
||||
_lim->get_real("R1") + // rimborso
|
||||
_lim->get_real("R5"); // rettifiche
|
||||
// le ulteriori detrazioni sono gia' comprese in R0
|
||||
// eventuale acconto versato a dicembre
|
||||
if (month == 12 && look_del(12,7) && _del->get_bool("B1"))
|
||||
r -= _del->get_real("R0");
|
||||
}
|
||||
r = _lim->get_real("R0");
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -402,7 +396,7 @@ real TLiquidazione_app::credito_prec(int month)
|
||||
{
|
||||
if (look_lia())
|
||||
c = _lia->get_real("R0");
|
||||
// e' positivo
|
||||
// e' positivo o 0
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -439,21 +433,18 @@ real TLiquidazione_app::credito_costo_prec(int month)
|
||||
}
|
||||
|
||||
|
||||
real TLiquidazione_app::versamenti_IVA(int month, bool acconto)
|
||||
real TLiquidazione_app::versamenti_IVA(int month, const char* types, bool intr)
|
||||
{
|
||||
// se month e' 12 e acconto == TRUE somma anche
|
||||
// l'eventuale acconto versato a dicembre
|
||||
real ret(0.0);
|
||||
real ret(0.0); TToken_string typ(types);
|
||||
|
||||
if (look_del(month,1))
|
||||
if (_del->get_bool("B0")) // solo se stampata
|
||||
ret = _del->get_real("R0") + _del->get_real("R1");
|
||||
|
||||
if (month == 12 && acconto)
|
||||
if (look_del(month,7))
|
||||
for (int i = 0; i < typ.items(); i++)
|
||||
{
|
||||
int tp = typ.get_int(i);
|
||||
if (look_del(month,tp))
|
||||
if (_del->get_bool("B0")) // solo se stampata
|
||||
ret += _del->get_real("R0") + _del->get_real("R1");
|
||||
|
||||
ret += _del->get_real("R0") +
|
||||
(intr ? _del->get_real("R1") : ZERO);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -624,8 +624,10 @@ void TLiquidazione_app::describe_liq(int month, const char* codatts,
|
||||
d->_r11 = _lim->get_real("R6");
|
||||
|
||||
// se ci sono stati versamenti IVA li riporta in _s2
|
||||
d->_s2 = versamenti_IVA(month).string();
|
||||
|
||||
// e _s3 (integrativi): sono != 0 solo in annuale
|
||||
d->_s2 = versamenti_IVA(month,"1").string();
|
||||
d->_s3 = versamenti_IVA(month,"5").string();
|
||||
|
||||
// vedi se c'era un debito precedente e schiaffa in r10
|
||||
if (!is_first_month(month))
|
||||
{
|
||||
@ -1065,6 +1067,14 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||
rc += vers;
|
||||
set_row(rw++,"@11gVersamenti effettuati@58g%r", &vers);
|
||||
}
|
||||
// versamenti integrativi
|
||||
if (!d._s3.empty())
|
||||
{
|
||||
real unixtihavoluto(d._s3);
|
||||
vers = unixtihavoluto;
|
||||
rc += vers;
|
||||
set_row(rw++,"@11gVersamenti integrativi@58g%r", &vers);
|
||||
}
|
||||
|
||||
set_row(rw++,"@11gRISULTATO@58g%r", &rc);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user