corretto errore stampa liquidazione in coda ai registri
git-svn-id: svn://10.65.10.50/trunk@1473 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9871e8d6a4
commit
69df03a537
195
cg/cg4301.cpp
195
cg/cg4301.cpp
@ -148,7 +148,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
look_lim(liq_month(month), TRUE);
|
look_lim(liq_month(month), TRUE);
|
||||||
|
|
||||||
if (_isregis && _lim->get_bool("B1"))
|
if (_isregis && _lim->get_bool("B1"))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
TConfig cnf(CONFIG_DITTA, "cg");
|
TConfig cnf(CONFIG_DITTA, "cg");
|
||||||
_isdifferita = cnf.get_bool("GeLiDi") && _month != 13;
|
_isdifferita = cnf.get_bool("GeLiDi") && _month != 13;
|
||||||
@ -207,7 +207,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
if (!(_month == 13 && month > 1))
|
if (!(_month == 13 && month > 1))
|
||||||
{
|
{
|
||||||
_vend_arr.destroy();
|
_vend_arr.destroy();
|
||||||
_corr_arr.destroy();
|
_corr_arr.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
cattivs = "";
|
cattivs = "";
|
||||||
@ -258,11 +258,12 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
|
|
||||||
for (_reg->first(); _reg->good(); _reg->next())
|
for (_reg->first(); _reg->good(); _reg->next())
|
||||||
{
|
{
|
||||||
if (codatt == _reg->get("S8") && _reg->get_int("I0") == 2)
|
if (codatt == _reg->get("S8"))
|
||||||
{
|
{
|
||||||
if (!_isvent) _isvent = _reg->get_bool("B3");
|
|
||||||
if (!riepliq) riepliq = _reg->get_bool("B6");
|
if (!riepliq) riepliq = _reg->get_bool("B6");
|
||||||
if (!stliq) stliq = _reg->get_bool("B7");
|
if (!stliq) stliq = _reg->get_bool("B7");
|
||||||
|
if (_reg->get_int("I0") == 2)
|
||||||
|
if (!_isvent) _isvent = _reg->get_bool("B3");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,17 +360,17 @@ bool TLiquidazione_app::update_att(int month, const char* codatt,
|
|||||||
|
|
||||||
void TLiquidazione_app::zero_firm(int month)
|
void TLiquidazione_app::zero_firm(int month)
|
||||||
{
|
{
|
||||||
for (_rmb->first(); !_rmb->eof(); _rmb->next())
|
for (_rmb->first(); !_rmb->eof(); _rmb->next())
|
||||||
{
|
{
|
||||||
if (atoi((const char*)(*_rmb_mese)) == month &&
|
if (atoi((const char*)(*_rmb_mese)) == month &&
|
||||||
_year == (const char*)(*_rmb_anno))
|
_year == (const char*)(*_rmb_anno))
|
||||||
{
|
{
|
||||||
_rmb->put("R0","");
|
_rmb->put("R0","");
|
||||||
_rmb->put("R1","");
|
_rmb->put("R1","");
|
||||||
_rmb->put("R2","");
|
_rmb->put("R2","");
|
||||||
_rmb->rewrite();
|
_rmb->rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TLiquidazione_app::zero_att(int month, const char* codatt)
|
void TLiquidazione_app::zero_att(int month, const char* codatt)
|
||||||
@ -497,7 +498,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
const bool sreg = !isreg;
|
const bool sreg = !isreg;
|
||||||
const bool rs8 = _reg_r->get("S8") != trueatt;
|
const bool rs8 = _reg_r->get("S8") != trueatt;
|
||||||
const bool cmt = !_cur->is_first_match(LF_RMOVIVA);
|
const bool cmt = !_cur->is_first_match(LF_RMOVIVA);
|
||||||
const bool sosp_imp = _reg->get_bool("B1");
|
const bool sosp_imp = _reg->get_bool("B1");
|
||||||
const TRectype& rcs = _cur->curr(LF_CAUSALI);
|
const TRectype& rcs = _cur->curr(LF_CAUSALI);
|
||||||
const bool fattrit = rcs.get_bool("RITFATT");
|
const bool fattrit = rcs.get_bool("RITFATT");
|
||||||
|
|
||||||
@ -531,8 +532,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
real asimp_iva = 0.0; // imposta acquisti sosp. imposta
|
real asimp_iva = 0.0; // imposta acquisti sosp. imposta
|
||||||
real vsimp_imp = 0.0; // imponibile vendite sosp. imposta
|
real vsimp_imp = 0.0; // imponibile vendite sosp. imposta
|
||||||
real vsimp_iva = 0.0; // imposta vendite sosp. imposta
|
real vsimp_iva = 0.0; // imposta vendite sosp. imposta
|
||||||
real rit_imp = 0.0; // imponibile fatture in ritardo
|
real rit_imp = 0.0; // imponibile fatture in ritardo
|
||||||
real rit_iva = 0.0; // IVA fatture in ritardo
|
real rit_iva = 0.0; // IVA fatture in ritardo
|
||||||
|
|
||||||
TString codiva = _iva->get("CODTAB");
|
TString codiva = _iva->get("CODTAB");
|
||||||
TString tipoiva = _iva->get("S1");
|
TString tipoiva = _iva->get("S1");
|
||||||
@ -593,25 +594,25 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
|
|
||||||
if (sosp_imp) // sospensione di imposta
|
if (sosp_imp) // sospensione di imposta
|
||||||
{
|
{
|
||||||
if (tipomov == vendita)
|
if (tipomov == vendita)
|
||||||
{
|
{
|
||||||
vsimp_imp = imponibile;
|
vsimp_imp = imponibile;
|
||||||
vsimp_iva = imposta;
|
vsimp_iva = imposta;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
asimp_imp = imponibile;
|
asimp_imp = imponibile;
|
||||||
asimp_iva = imposta;
|
asimp_iva = imposta;
|
||||||
}
|
}
|
||||||
assp_imp += asimp_imp;
|
assp_imp += asimp_imp;
|
||||||
assp_iva += asimp_iva;
|
assp_iva += asimp_iva;
|
||||||
vssp_imp += vsimp_imp;
|
vssp_imp += vsimp_imp;
|
||||||
vssp_iva += vsimp_iva;
|
vssp_iva += vsimp_iva;
|
||||||
}
|
}
|
||||||
else if (fattrit && month != 13)
|
else if (fattrit && month != 13)
|
||||||
{
|
{
|
||||||
rit_imp = imponibile;
|
rit_imp = imponibile;
|
||||||
rit_iva = imposta;
|
rit_iva = imposta;
|
||||||
}
|
}
|
||||||
else if (!fattrit) // normale
|
else if (!fattrit) // normale
|
||||||
{
|
{
|
||||||
@ -681,31 +682,31 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
|
|
||||||
// operazioni per calcolo rimborso infracazzuale
|
// operazioni per calcolo rimborso infracazzuale
|
||||||
// Scudler 1995
|
// Scudler 1995
|
||||||
if (ivarimb)
|
if (ivarimb)
|
||||||
{
|
{
|
||||||
bool ok = _isagricolo ? tipoagr == 2 : FALSE;
|
bool ok = _isagricolo ? tipoagr == 2 : FALSE;
|
||||||
|
|
||||||
if (tipomov == acquisto && !ok)
|
if (tipomov == acquisto && !ok)
|
||||||
ok = (tipocr == 0 || tipocr == 1 || tipocr == 5 || tipocr == 9);
|
ok = (tipocr == 0 || tipocr == 1 || tipocr == 5 || tipocr == 9);
|
||||||
|
|
||||||
if (tipomov == vendita && !ok)
|
if (tipomov == vendita && !ok)
|
||||||
ok = tipoiva != "NS" && tipodoc != "CR" &&
|
ok = tipoiva != "NS" && tipodoc != "CR" &&
|
||||||
tipodoc != "SC" && tipodoc != "RF" && tipocr != 4;
|
tipodoc != "SC" && tipodoc != "RF" && tipocr != 4;
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
// aggiurna tabedda
|
// aggiurna tabedda
|
||||||
look_rmb(month, codiva, tipomov, TRUE);
|
look_rmb(month, codiva, tipomov, TRUE);
|
||||||
real imp = _rmb->get_real("R0");
|
real imp = _rmb->get_real("R0");
|
||||||
real iva = _rmb->get_real("R1");
|
real iva = _rmb->get_real("R1");
|
||||||
imp += imponibile;
|
imp += imponibile;
|
||||||
iva += imposta;
|
iva += imposta;
|
||||||
_rmb->put("R0", imp);
|
_rmb->put("R0", imp);
|
||||||
_rmb->put("R1", iva);
|
_rmb->put("R1", iva);
|
||||||
_rmb->put("R2", _iva->get_real("R0"));
|
_rmb->put("R2", _iva->get_real("R0"));
|
||||||
_rmb->rewrite();
|
_rmb->rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// operazioni esenti
|
// operazioni esenti
|
||||||
if (tipoiva == "ES")
|
if (tipoiva == "ES")
|
||||||
@ -894,15 +895,15 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
|
|
||||||
if (tipomov == vendita)
|
if (tipomov == vendita)
|
||||||
{
|
{
|
||||||
fsi += vsimp_imp;
|
fsi += vsimp_imp;
|
||||||
fsv += vsimp_iva;
|
fsv += vsimp_iva;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fsi += asimp_imp;
|
fsi += asimp_imp;
|
||||||
fsv += asimp_iva;
|
fsv += asimp_iva;
|
||||||
bdi += bolld_imp;
|
bdi += bolld_imp;
|
||||||
bdv += bolld_iva;
|
bdv += bolld_iva;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (liq && tipomov == vendita && !corrisp)
|
if (liq && tipomov == vendita && !corrisp)
|
||||||
@ -1007,7 +1008,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
* e assegnarli al codice IVA A35 in caso di liq. annuale
|
* e assegnarli al codice IVA A35 in caso di liq. annuale
|
||||||
*/
|
*/
|
||||||
adf += imponibile;
|
adf += imponibile;
|
||||||
adi += imposta;
|
adi += imposta;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (corrisp && !true_corrisp)
|
if (corrisp && !true_corrisp)
|
||||||
@ -1225,8 +1226,8 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
_year = format("%d", atoi(_year)-1);
|
_year = format("%d", atoi(_year)-1);
|
||||||
if (!look_lim(12))
|
if (!look_lim(12))
|
||||||
{
|
{
|
||||||
_year = yr;
|
_year = yr;
|
||||||
differita = FALSE;
|
differita = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (differita)
|
if (differita)
|
||||||
@ -1330,7 +1331,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
/* totalizza importi 74 ter */
|
/* totalizza importi 74 ter */
|
||||||
if (_isviaggio)
|
if (_isviaggio)
|
||||||
{
|
{
|
||||||
// somma totali per calcolo successivo
|
// somma totali per calcolo successivo
|
||||||
c_iCEE += _plm->get_real("R5");
|
c_iCEE += _plm->get_real("R5");
|
||||||
c_eCEE += _plm->get_real("R6");
|
c_eCEE += _plm->get_real("R6");
|
||||||
a_iCEE += _plm->get_real("R7");
|
a_iCEE += _plm->get_real("R7");
|
||||||
@ -1379,7 +1380,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
if (month < 13)
|
if (month < 13)
|
||||||
{
|
{
|
||||||
// toglie credito precedente
|
// toglie credito precedente
|
||||||
cred_prec = credito_prec(month);
|
cred_prec = credito_prec(month);
|
||||||
risultato -= cred_prec;
|
risultato -= cred_prec;
|
||||||
res_cred += cred_prec;
|
res_cred += cred_prec;
|
||||||
// vedi se c'era un debito precedente per debiti < 50.000
|
// vedi se c'era un debito precedente per debiti < 50.000
|
||||||
@ -1407,26 +1408,26 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
int tipoatt = att[att.len() -1] - '0';
|
int tipoatt = att[att.len() -1] - '0';
|
||||||
if (tipoatt == 1) // su PLA l'attivita' e' sempre 1
|
if (tipoatt == 1) // su PLA l'attivita' e' sempre 1
|
||||||
{
|
{
|
||||||
look_pla(att);
|
look_pla(att);
|
||||||
real vf1 = _pla->get_real("R14");
|
real vf1 = _pla->get_real("R14");
|
||||||
real vf2(_pla->get("S1"));
|
real vf2(_pla->get("S1"));
|
||||||
real iaq = _pla->get_real("R11"); // IVA acquisti
|
real iaq = _pla->get_real("R11"); // IVA acquisti
|
||||||
real ppg = _pla->get_real("R12"); // pro-rata pagato
|
real ppg = _pla->get_real("R12"); // pro-rata pagato
|
||||||
|
|
||||||
vol_aff_1 += vf1;
|
vol_aff_1 += vf1;
|
||||||
vol_aff_2 += vf2;
|
vol_aff_2 += vf2;
|
||||||
vol_aff_t = vf1 + vf2;
|
vol_aff_t = vf1 + vf2;
|
||||||
vol_aff_l += _pla->get_real("R0"); // volume affari lordo
|
vol_aff_l += _pla->get_real("R0"); // volume affari lordo
|
||||||
|
|
||||||
real es_b1 = _pla->get_real("R1");
|
real es_b1 = _pla->get_real("R1");
|
||||||
real es_b2 = _pla->get_real("R2");
|
real es_b2 = _pla->get_real("R2");
|
||||||
real es_b3 = _pla->get_real("R3");
|
real es_b3 = _pla->get_real("R3");
|
||||||
real csamm = _pla->get_real("R4");
|
real csamm = _pla->get_real("R4");
|
||||||
|
|
||||||
// calcola nuovo prorata per ogni attivita' (miste: 1+2)
|
// calcola nuovo prorata per ogni attivita' (miste: 1+2)
|
||||||
real ris = vol_aff_t - csamm - es_b3;
|
real ris = vol_aff_t - csamm - es_b3;
|
||||||
real prorata(0.0);
|
real prorata(0.0);
|
||||||
if (!ris.is_zero())
|
if (!ris.is_zero())
|
||||||
prorata = (es_b1/ris) * CENTO;
|
prorata = (es_b1/ris) * CENTO;
|
||||||
real conguaglio = 0.0;
|
real conguaglio = 0.0;
|
||||||
prorata.round(ROUND_LIRA);
|
prorata.round(ROUND_LIRA);
|
||||||
@ -1437,7 +1438,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
conguaglio = topay - ppg;
|
conguaglio = topay - ppg;
|
||||||
conguaglio.round(ROUND_LIRA);
|
conguaglio.round(ROUND_LIRA);
|
||||||
}
|
}
|
||||||
_pla->put("R9", conguaglio);
|
_pla->put("R9", conguaglio);
|
||||||
_pla->put("R10",prorata);
|
_pla->put("R10",prorata);
|
||||||
tot_cong += conguaglio;
|
tot_cong += conguaglio;
|
||||||
_pla->rewrite();
|
_pla->rewrite();
|
||||||
@ -1448,7 +1449,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
look_pla(att, TRUE);
|
look_pla(att, TRUE);
|
||||||
_pla->put("R8", prorata);
|
_pla->put("R8", prorata);
|
||||||
_pla->rewrite();
|
_pla->rewrite();
|
||||||
_year = yr;
|
_year = yr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1512,11 +1513,11 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
|
|
||||||
if (month == 13 || differita)
|
if (month == 13 || differita)
|
||||||
{
|
{
|
||||||
// scrivi totali rettifiche e rimborsi
|
// scrivi totali rettifiche e rimborsi
|
||||||
// nella finale oppure se copiati da
|
// nella finale oppure se copiati da
|
||||||
// anno precedente
|
// anno precedente
|
||||||
_lim->put("R1",rimborsi);
|
_lim->put("R1",rimborsi);
|
||||||
_lim->put("R5",rettifiche);
|
_lim->put("R5",rettifiche);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1606,8 +1607,8 @@ void TLiquidazione_app::recalc_annual(const char* att)
|
|||||||
_reg->get_bool("B1")) // sospensione di imposta
|
_reg->get_bool("B1")) // sospensione di imposta
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (tipoatt == 1) volaff1 += _pim->get_real("R0");
|
if (tipoatt == 1) volaff1 += _pim->get_real("R0");
|
||||||
else volaff2 += _pim->get_real("R0");
|
else volaff2 += _pim->get_real("R0");
|
||||||
}
|
}
|
||||||
|
|
||||||
// calcola esenti, cessioni, lordo vendite, prorata pagato
|
// calcola esenti, cessioni, lordo vendite, prorata pagato
|
||||||
|
Loading…
x
Reference in New Issue
Block a user