Zozzerie varie liquidazione

git-svn-id: svn://10.65.10.50/trunk@471 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1994-10-27 11:47:11 +00:00
parent 23bfc7409e
commit 1301846313
5 changed files with 69 additions and 52 deletions

View File

@ -169,10 +169,10 @@ bool CG4300_App::set_print(int n)
TString cond(format("ANNOES=%s",(const char*)_year)); TString cond(format("ANNOES=%s",(const char*)_year));
_cur->setfilter(cond); _cur->setfilter(cond);
}*/ }*/
TRectype & mov = _cur->curr(); TRectype& mov = _cur->curr();
TRectype from(_cur->curr()); from.zero(); TRectype from(_cur->curr()); from.zero();
TRectype to(mov); TRectype to(mov);
TDate f(1, _recalc == one ? _month : 1, atoi(_year)); TDate f(1, 1, atoi(_year));
TDate t(1, _month, atoi(_year)); TDate t(1, _month, atoi(_year));
t.set_end_month(); t.set_end_month();

View File

@ -30,6 +30,10 @@ bool CG4300_App::recalc_all()
{ {
TApplication::set_firm(_nditte->curr().get_long("CODDITTA")); TApplication::set_firm(_nditte->curr().get_long("CODDITTA"));
_prind->addstatus(1); _prind->addstatus(1);
// trimestrali impropriamente selezionate per mesi intermedi
if (!is_month_ok(_month)) continue;
int need_refresh = FALSE; int need_refresh = FALSE;
if (_recalc != ever) if (_recalc != ever)
{ {
@ -52,6 +56,16 @@ bool CG4300_App::recalc_all()
update_firm(m); update_firm(m);
} }
update_firm(_month); update_firm(_month);
// se ci sono altri mesi dopo quello calcolato, invalida il
// flag 'calcolato' del primo, per causare il ricalcolo dei
// successivi (evitando problemi per credito precedente)
for (int m = _month+1; m <= 13; m++)
if (is_month_ok(m) && look_lim(m))
{
_lim->put("B0","");
break;
}
} }
} }
if (!_prind->iscancelled()) _prind->addstatus(1); if (!_prind->iscancelled()) _prind->addstatus(1);
@ -726,18 +740,18 @@ void CG4300_App::recalc_annual(const char* att)
describe_error("Attivita' non ricalcolata: " describe_error("Attivita' non ricalcolata: "
"possibili errori",att); "possibili errori",att);
look_ptm(i,aaa); look_plm(i,aaa); look_ptm(i,aaa); look_plm(i,aaa);
real vend = _ptm->get("S3"); real vend(_ptm->get("S3"));
ven_lrd += vend; // lordo vendite ven_lrd += vend; // lordo vendite
// non entra l'IVA per calcolo volume affari // non entra l'IVA per calcolo volume affari
vendite += (vend - _plm->get_real("R0")); vendite += (vend - _plm->get_real("R0"));
real eb3 = _ptm->get("S0"); real eb3(_ptm->get("S0"));
es_b1 += _ptm->get_real("R13"); es_b1 += _ptm->get_real("R13");
es_b2 += _ptm->get_real("R14"); es_b2 += _ptm->get_real("R14");
es_b3 += eb3; es_b3 += eb3;
acq_iva += _plm->get_real("R1"); acq_iva += _plm->get_real("R1");
cess_amm += _ptm->get_real("R10"); cess_amm += _ptm->get_real("R10");
pro_pag += _plm->get_real("R2"); pro_pag += _plm->get_real("R2");
real aax = _ptm->get("S2"); real aax(_ptm->get("S2"));
acq += aax - // rilevanti per aliquota media acq += aax - // rilevanti per aliquota media
_ptm->get_real("R3") - // toglie ammortizz. etc _ptm->get_real("R3") - // toglie ammortizz. etc
_ptm->get_real("R5") - // non detraibili non ci sono _ptm->get_real("R5") - // non detraibili non ci sono
@ -793,13 +807,13 @@ _DescrItem* CG4300_App::recalc_rimborso(int month, const char* codatts)
att = tmpatt; att = tmpatt;
look_plm(month,att); look_ptm(month,att); look_plm(month,att); look_ptm(month,att);
real tvol = _ptm->get("S3"); real tvol(_ptm->get("S3"));
vol_aff += tvol; vol_aff += tvol;
real esni = _plm->get("S1"); real esni(_plm->get("S1"));
es_ni += esni; es_ni += esni;
iva_a += _plm->get_real("R1"); iva_a += _plm->get_real("R1");
iva_v += _plm->get_real("R0"); iva_v += _plm->get_real("R0");
real aax = _ptm->get("S2"); real aax(_ptm->get("S2"));
imp_a += aax - // rilevanti per aliquota media imp_a += aax - // rilevanti per aliquota media
_ptm->get_real("R3") - // toglie ammortizz. etc _ptm->get_real("R3") - // toglie ammortizz. etc
_ptm->get_real("R5") - // non detraibili non ci sono _ptm->get_real("R5") - // non detraibili non ci sono
@ -817,13 +831,13 @@ _DescrItem* CG4300_App::recalc_rimborso(int month, const char* codatts)
look_ptm(m,att); look_ptm(m,att);
real tvol = _ptm->get("S3"); real tvol(_ptm->get("S3"));
vol_aff += tvol; vol_aff += tvol;
real esni = _plm->get("S1"); real esni(_plm->get("S1"));
es_ni += esni; es_ni += esni;
iva_a += _plm->get_real("R1"); iva_a += _plm->get_real("R1");
iva_v += _plm->get_real("R0"); iva_v += _plm->get_real("R0");
real aax = _ptm->get("S2"); real aax(_ptm->get("S2"));
imp_a += aax - // rilevanti per aliquota media imp_a += aax - // rilevanti per aliquota media
_ptm->get_real("R3") - // toglie ammortizz. etc _ptm->get_real("R3") - // toglie ammortizz. etc
_ptm->get_real("R5") - // non detraibili non ci sono _ptm->get_real("R5") - // non detraibili non ci sono

View File

@ -387,7 +387,8 @@ real CG4300_App::credito_prec(int month)
update_firm(previous_month(month), FALSE); update_firm(previous_month(month), FALSE);
look_lim(previous_month(month)); look_lim(previous_month(month));
} }
c = _lim->get_real("R0") - _lim->get_real("R1"); // toglie il rimborso chiesto
c = _lim->get_real("R0") + _lim->get_real("R1");
real rett = _lim->get_real("R5"); real rett = _lim->get_real("R5");
if (rett.sign() > 0) if (rett.sign() > 0)
c -= rett; c -= rett;

View File

@ -126,8 +126,8 @@ void CG4300_App::describe_ventilation(int month, const char* codatt)
TString att(codatt); TString att(codatt);
look_ptm(month, att); look_ptm(month, att);
real r0 = _ptm->get("S4"); real r0(_ptm->get("S4"));
real r1 = _ptm->get("S5"); real r1(_ptm->get("S5"));
d->_r0 = r0; d->_r1 = r1; d->_r0 = r0; d->_r1 = r1;
for (_pim->first(); !_pim->eof(); _pim->next()) for (_pim->first(); !_pim->eof(); _pim->next())
@ -145,6 +145,8 @@ void CG4300_App::describe_ventilation(int month, const char* codatt)
real imposta = _pim->get_real("R1"); real imposta = _pim->get_real("R1");
tiporeg tipomov = (tiporeg)_reg->get_long("I0"); tiporeg tipomov = (tiporeg)_reg->get_long("I0");
if (imponibile.is_zero() && imposta.is_zero()) continue;
if (mese <= month) if (mese <= month)
{ {
if (tipocr == 1 && tipomov == acquisto) if (tipocr == 1 && tipomov == acquisto)