Zozzerie varie liquidazione
git-svn-id: svn://10.65.10.50/trunk@471 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
23bfc7409e
commit
1301846313
@ -169,10 +169,10 @@ bool CG4300_App::set_print(int n)
|
||||
TString cond(format("ANNOES=%s",(const char*)_year));
|
||||
_cur->setfilter(cond);
|
||||
}*/
|
||||
TRectype & mov = _cur->curr();
|
||||
TRectype from(_cur->curr()); from.zero();
|
||||
TRectype to(mov);
|
||||
TDate f(1, _recalc == one ? _month : 1, atoi(_year));
|
||||
TRectype& mov = _cur->curr();
|
||||
TRectype from(_cur->curr()); from.zero();
|
||||
TRectype to(mov);
|
||||
TDate f(1, 1, atoi(_year));
|
||||
TDate t(1, _month, atoi(_year));
|
||||
|
||||
t.set_end_month();
|
||||
|
@ -29,7 +29,11 @@ bool CG4300_App::recalc_all()
|
||||
if (_selected[l])
|
||||
{
|
||||
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;
|
||||
if (_recalc != ever)
|
||||
{
|
||||
@ -51,7 +55,17 @@ bool CG4300_App::recalc_all()
|
||||
if (is_month_ok(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);
|
||||
@ -726,18 +740,18 @@ void CG4300_App::recalc_annual(const char* att)
|
||||
describe_error("Attivita' non ricalcolata: "
|
||||
"possibili errori",att);
|
||||
look_ptm(i,aaa); look_plm(i,aaa);
|
||||
real vend = _ptm->get("S3");
|
||||
real vend(_ptm->get("S3"));
|
||||
ven_lrd += vend; // lordo vendite
|
||||
// non entra l'IVA per calcolo volume affari
|
||||
vendite += (vend - _plm->get_real("R0"));
|
||||
real eb3 = _ptm->get("S0");
|
||||
real eb3(_ptm->get("S0"));
|
||||
es_b1 += _ptm->get_real("R13");
|
||||
es_b2 += _ptm->get_real("R14");
|
||||
es_b3 += eb3;
|
||||
acq_iva += _plm->get_real("R1");
|
||||
cess_amm += _ptm->get_real("R10");
|
||||
pro_pag += _plm->get_real("R2");
|
||||
real aax = _ptm->get("S2");
|
||||
real aax(_ptm->get("S2"));
|
||||
acq += aax - // rilevanti per aliquota media
|
||||
_ptm->get_real("R3") - // toglie ammortizz. etc
|
||||
_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;
|
||||
look_plm(month,att); look_ptm(month,att);
|
||||
|
||||
real tvol = _ptm->get("S3");
|
||||
real tvol(_ptm->get("S3"));
|
||||
vol_aff += tvol;
|
||||
real esni = _plm->get("S1");
|
||||
real esni(_plm->get("S1"));
|
||||
es_ni += esni;
|
||||
iva_a += _plm->get_real("R1");
|
||||
iva_v += _plm->get_real("R0");
|
||||
real aax = _ptm->get("S2");
|
||||
real aax(_ptm->get("S2"));
|
||||
imp_a += aax - // rilevanti per aliquota media
|
||||
_ptm->get_real("R3") - // toglie ammortizz. etc
|
||||
_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);
|
||||
|
||||
real tvol = _ptm->get("S3");
|
||||
real tvol(_ptm->get("S3"));
|
||||
vol_aff += tvol;
|
||||
real esni = _plm->get("S1");
|
||||
real esni(_plm->get("S1"));
|
||||
es_ni += esni;
|
||||
iva_a += _plm->get_real("R1");
|
||||
iva_v += _plm->get_real("R0");
|
||||
real aax = _ptm->get("S2");
|
||||
real aax(_ptm->get("S2"));
|
||||
imp_a += aax - // rilevanti per aliquota media
|
||||
_ptm->get_real("R3") - // toglie ammortizz. etc
|
||||
_ptm->get_real("R5") - // non detraibili non ci sono
|
||||
|
@ -353,45 +353,46 @@ real CG4300_App::credito_prec(int month)
|
||||
if (is_first_month(month))
|
||||
{
|
||||
look_lia();
|
||||
if (_lia->status() == NOERR)
|
||||
{
|
||||
c = _lia->get_real("R0");
|
||||
if (!c.is_zero()) return c;
|
||||
}
|
||||
int yr = atoi(_year) - 1;
|
||||
_lim->zero();
|
||||
*_lim_anno = yr;
|
||||
*_lim_mese = 12;
|
||||
if (_lim->read() == NOERR)
|
||||
if (_lia->status() == NOERR)
|
||||
{
|
||||
c = _lia->get_real("R0");
|
||||
if (!c.is_zero()) return c;
|
||||
}
|
||||
int yr = atoi(_year) - 1;
|
||||
_lim->zero();
|
||||
*_lim_anno = yr;
|
||||
*_lim_mese = 12;
|
||||
if (_lim->read() == NOERR)
|
||||
// considera anche il rimborso
|
||||
c = _lim->get_real("R0") - _lim->get_real("R1");
|
||||
// e le eventuali rettifiche a debito
|
||||
real rett = _lim->get_real("R5");
|
||||
if (rett.sign() > 0)
|
||||
// e le eventuali rettifiche a debito
|
||||
real rett = _lim->get_real("R5");
|
||||
if (rett.sign() > 0)
|
||||
c -= rett;
|
||||
// e l'acconto versato a dicembre
|
||||
_del->zero();
|
||||
TString ditta = _nditte->curr().get("CODDITTA");
|
||||
*_del_ditta = ditta;
|
||||
*_del_anno = yr;
|
||||
*_del_mese = 12;
|
||||
*_del_tipo = 7;
|
||||
if (_del->read() == NOERR)
|
||||
// e l'acconto versato a dicembre
|
||||
_del->zero();
|
||||
TString ditta = _nditte->curr().get("CODDITTA");
|
||||
*_del_ditta = ditta;
|
||||
*_del_anno = yr;
|
||||
*_del_mese = 12;
|
||||
*_del_tipo = 7;
|
||||
if (_del->read() == NOERR)
|
||||
c -= _del->get_real("R0");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bool ok = look_lim(previous_month(month));
|
||||
if (!ok || !_lim->get_bool("B0"))
|
||||
{
|
||||
update_firm(previous_month(month), FALSE);
|
||||
look_lim(previous_month(month));
|
||||
}
|
||||
c = _lim->get_real("R0") - _lim->get_real("R1");
|
||||
real rett = _lim->get_real("R5");
|
||||
if (rett.sign() > 0)
|
||||
c -= rett;
|
||||
}
|
||||
{
|
||||
bool ok = look_lim(previous_month(month));
|
||||
if (!ok || !_lim->get_bool("B0"))
|
||||
{
|
||||
update_firm(previous_month(month), FALSE);
|
||||
look_lim(previous_month(month));
|
||||
}
|
||||
// toglie il rimborso chiesto
|
||||
c = _lim->get_real("R0") + _lim->get_real("R1");
|
||||
real rett = _lim->get_real("R5");
|
||||
if (rett.sign() > 0)
|
||||
c -= rett;
|
||||
}
|
||||
look_lim(month);
|
||||
|
||||
if (c.sign() < 0) c = abs(c); else c = real(0.0);
|
||||
|
@ -168,7 +168,7 @@ void CG4300_App::recalc_ventilation(int month, const char* codatt)
|
||||
|
||||
// soltanto normali ed esenti IVA sono base di riparto
|
||||
if (_iva->get("S1").empty() ||
|
||||
_iva->get("S1") == "ES")
|
||||
_iva->get("S1") == "ES")
|
||||
{
|
||||
real lurd = _pim->get_real("R0");
|
||||
lurd += _pim->get_real("R1");
|
||||
|
@ -126,8 +126,8 @@ void CG4300_App::describe_ventilation(int month, const char* codatt)
|
||||
TString att(codatt);
|
||||
|
||||
look_ptm(month, att);
|
||||
real r0 = _ptm->get("S4");
|
||||
real r1 = _ptm->get("S5");
|
||||
real r0(_ptm->get("S4"));
|
||||
real r1(_ptm->get("S5"));
|
||||
d->_r0 = r0; d->_r1 = r1;
|
||||
|
||||
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");
|
||||
tiporeg tipomov = (tiporeg)_reg->get_long("I0");
|
||||
|
||||
if (imponibile.is_zero() && imposta.is_zero()) continue;
|
||||
|
||||
if (mese <= month)
|
||||
{
|
||||
if (tipocr == 1 && tipomov == acquisto)
|
||||
|
Loading…
x
Reference in New Issue
Block a user