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));
|
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();
|
||||||
|
@ -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
|
||||||
|
@ -353,45 +353,46 @@ real CG4300_App::credito_prec(int month)
|
|||||||
if (is_first_month(month))
|
if (is_first_month(month))
|
||||||
{
|
{
|
||||||
look_lia();
|
look_lia();
|
||||||
if (_lia->status() == NOERR)
|
if (_lia->status() == NOERR)
|
||||||
{
|
{
|
||||||
c = _lia->get_real("R0");
|
c = _lia->get_real("R0");
|
||||||
if (!c.is_zero()) return c;
|
if (!c.is_zero()) return c;
|
||||||
}
|
}
|
||||||
int yr = atoi(_year) - 1;
|
int yr = atoi(_year) - 1;
|
||||||
_lim->zero();
|
_lim->zero();
|
||||||
*_lim_anno = yr;
|
*_lim_anno = yr;
|
||||||
*_lim_mese = 12;
|
*_lim_mese = 12;
|
||||||
if (_lim->read() == NOERR)
|
if (_lim->read() == NOERR)
|
||||||
// considera anche il rimborso
|
// considera anche il rimborso
|
||||||
c = _lim->get_real("R0") - _lim->get_real("R1");
|
c = _lim->get_real("R0") - _lim->get_real("R1");
|
||||||
// e le eventuali rettifiche a debito
|
// e le eventuali rettifiche a debito
|
||||||
real rett = _lim->get_real("R5");
|
real rett = _lim->get_real("R5");
|
||||||
if (rett.sign() > 0)
|
if (rett.sign() > 0)
|
||||||
c -= rett;
|
c -= rett;
|
||||||
// e l'acconto versato a dicembre
|
// e l'acconto versato a dicembre
|
||||||
_del->zero();
|
_del->zero();
|
||||||
TString ditta = _nditte->curr().get("CODDITTA");
|
TString ditta = _nditte->curr().get("CODDITTA");
|
||||||
*_del_ditta = ditta;
|
*_del_ditta = ditta;
|
||||||
*_del_anno = yr;
|
*_del_anno = yr;
|
||||||
*_del_mese = 12;
|
*_del_mese = 12;
|
||||||
*_del_tipo = 7;
|
*_del_tipo = 7;
|
||||||
if (_del->read() == NOERR)
|
if (_del->read() == NOERR)
|
||||||
c -= _del->get_real("R0");
|
c -= _del->get_real("R0");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool ok = look_lim(previous_month(month));
|
bool ok = look_lim(previous_month(month));
|
||||||
if (!ok || !_lim->get_bool("B0"))
|
if (!ok || !_lim->get_bool("B0"))
|
||||||
{
|
{
|
||||||
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
|
||||||
real rett = _lim->get_real("R5");
|
c = _lim->get_real("R0") + _lim->get_real("R1");
|
||||||
if (rett.sign() > 0)
|
real rett = _lim->get_real("R5");
|
||||||
c -= rett;
|
if (rett.sign() > 0)
|
||||||
}
|
c -= rett;
|
||||||
|
}
|
||||||
look_lim(month);
|
look_lim(month);
|
||||||
|
|
||||||
if (c.sign() < 0) c = abs(c); else c = real(0.0);
|
if (c.sign() < 0) c = abs(c); else c = real(0.0);
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user