Corrette le angoscie di rovina e di morte con cui la Prassi straccia le
palle in maniera perfino inusitata. Nella fattispecie: credito precedente, fatture con scontrino, iva quater (che funziona, con i loro archivi, gia' da prima). git-svn-id: svn://10.65.10.50/trunk@826 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3b41e66469
commit
23fa9fcff0
@ -172,7 +172,7 @@ bool TLiquidazione_app::user_create()
|
|||||||
|
|
||||||
// calcola liquidazione
|
// calcola liquidazione
|
||||||
printer().setdate(printdate);
|
printer().setdate(printdate);
|
||||||
_recalc = one;
|
_recalc = needed;
|
||||||
TApplication::set_firm(ditta);
|
TApplication::set_firm(ditta);
|
||||||
|
|
||||||
if (!look_lia()) return FALSE;
|
if (!look_lia()) return FALSE;
|
||||||
|
@ -108,6 +108,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
bool calc = (_recalc == ever || (_recalc == one && month == _month));
|
bool calc = (_recalc == ever || (_recalc == one && month == _month));
|
||||||
if (!calc && _recalc != never) calc = !ok;
|
if (!calc && _recalc != never) calc = !ok;
|
||||||
bool gheravergot = FALSE;
|
bool gheravergot = FALSE;
|
||||||
|
bool quater = FALSE;
|
||||||
|
|
||||||
TToken_string atts;
|
TToken_string atts;
|
||||||
TToken_string cattivs;
|
TToken_string cattivs;
|
||||||
@ -120,7 +121,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
{
|
{
|
||||||
TString16 codatt = _nditte->curr(LF_ATTIV).get("CODATT");
|
TString16 codatt = _nditte->curr(LF_ATTIV).get("CODATT");
|
||||||
TString80 desatt = _nditte->curr(LF_ATTIV).get("DESCR");
|
TString80 desatt = _nditte->curr(LF_ATTIV).get("DESCR");
|
||||||
|
quater = _nditte->curr().get_bool("FLIVA11Q");
|
||||||
// attivita' mista: ce ne sono in realta' due
|
// attivita' mista: ce ne sono in realta' due
|
||||||
// viene calcolato nel ciclo su tipoatt (che viene ripetuto solo
|
// viene calcolato nel ciclo su tipoatt (che viene ripetuto solo
|
||||||
// se diventa TRUE);
|
// se diventa TRUE);
|
||||||
@ -201,7 +202,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
while (_nditte->next_match(LF_ATTIV));
|
while (_nditte->next_match(LF_ATTIV));
|
||||||
|
|
||||||
// se quater stampa riepilogo
|
// se quater stampa riepilogo
|
||||||
if (atts.items() > 1 && month == _month)
|
if (/* atts.items() > 1*/ quater && month == _month)
|
||||||
describe_att(month,atts);
|
describe_att(month,atts);
|
||||||
|
|
||||||
// occorre poterla chiamare altre volte con mesi diversi
|
// occorre poterla chiamare altre volte con mesi diversi
|
||||||
@ -531,7 +532,13 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
real imp = _pim_r->get_real("R0"); // imponibile
|
real imp = _pim_r->get_real("R0"); // imponibile
|
||||||
real ivp = _pim_r->get_real("R1"); // IVA su imp.
|
real ivp = _pim_r->get_real("R1"); // IVA su imp.
|
||||||
real lor = _pim_r->get_real("R2"); // lordo
|
real lor = _pim_r->get_real("R2"); // lordo
|
||||||
|
// le maledette fatture con scontrino sono sul registro dei
|
||||||
|
// corrispettivi, ma vanno riportate nelle vendite in stampa;
|
||||||
|
// dunque, le sommiamo in R5 e R6 di PIM anche se continuiamo
|
||||||
|
// a riportare il totale in R0 e R1. La stampa (describe_pim)
|
||||||
|
// dovra' scorporare
|
||||||
|
real ifs = _pim_r->get_real("R5"); // imponibile fatture con scontrino
|
||||||
|
real vfs = _pim_r->get_real("R6"); // IVA fatt. con scontrino
|
||||||
|
|
||||||
if (liq && tipomov == vendita && !corrisp) // i corrispettivi sono gestiti a parte
|
if (liq && tipomov == vendita && !corrisp) // i corrispettivi sono gestiti a parte
|
||||||
{
|
{
|
||||||
@ -550,7 +557,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
if (corrisp)
|
if (corrisp)
|
||||||
{
|
{
|
||||||
// l'ultimo casino
|
// l'ultimo casino
|
||||||
if (tipodoc == "CR" || tipodoc == "RF" || tipodoc == "SC")
|
if (tipodoc == "CR" || tipodoc == "RF" || tipodoc == "SC" ||
|
||||||
|
tipodoc == "SN" || tipodoc == "CN")
|
||||||
{
|
{
|
||||||
// questi sono corrispettivi davvero; comportamento normale
|
// questi sono corrispettivi davvero; comportamento normale
|
||||||
if (tipoiva == "VE") // da ventilare
|
if (tipoiva == "VE") // da ventilare
|
||||||
@ -590,6 +598,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
ivp += imposta;
|
ivp += imposta;
|
||||||
}
|
}
|
||||||
lor -= imponibile + imposta;
|
lor -= imponibile + imposta;
|
||||||
|
ifs += imponibile;
|
||||||
|
vfs += imposta;
|
||||||
}
|
}
|
||||||
else // vendite normali a tutti gli effetti
|
else // vendite normali a tutti gli effetti
|
||||||
{
|
{
|
||||||
@ -600,12 +610,13 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
}
|
}
|
||||||
imp += imponibile;
|
imp += imponibile;
|
||||||
ivp += imposta;
|
ivp += imposta;
|
||||||
|
ifs += imponibile;
|
||||||
|
vfs += imposta;
|
||||||
_pim_r->put("I0",NETTO);
|
_pim_r->put("I0",NETTO);
|
||||||
}
|
}
|
||||||
} // if corrisp
|
} // if corrisp
|
||||||
else // non corrisp
|
else // non corrisp
|
||||||
{
|
{ // imponibile e imposta separata
|
||||||
// imponibile e imposta separata
|
|
||||||
imp += imponibile;
|
imp += imponibile;
|
||||||
ivp += imposta;
|
ivp += imposta;
|
||||||
_pim_r->put("I0",NETTO);
|
_pim_r->put("I0",NETTO);
|
||||||
@ -614,6 +625,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
_pim_r->put("R0",imp);
|
_pim_r->put("R0",imp);
|
||||||
_pim_r->put("R1",ivp);
|
_pim_r->put("R1",ivp);
|
||||||
_pim_r->put("R2",lor);
|
_pim_r->put("R2",lor);
|
||||||
|
_pim_r->put("R5",ifs);
|
||||||
|
_pim_r->put("R6",vfs);
|
||||||
_pim->rewrite();
|
_pim->rewrite();
|
||||||
}
|
}
|
||||||
while (_cur->next_match(LF_RMOVIVA));
|
while (_cur->next_match(LF_RMOVIVA));
|
||||||
|
@ -364,15 +364,16 @@ real TLiquidazione_app::credito_prec(int month)
|
|||||||
*_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
|
// e le eventuali rettifiche
|
||||||
real rett = _lim->get_real("R5");
|
real rett = _lim->get_real("R5");
|
||||||
c += -rett;
|
c += rett;
|
||||||
// e le ulteriori detrazioni
|
// e le ulteriori detrazioni
|
||||||
real detr = _lim->get_real("R6");
|
real detr = _lim->get_real("R6");
|
||||||
c += detr;
|
c -= detr;
|
||||||
// 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;
|
||||||
@ -391,9 +392,12 @@ real TLiquidazione_app::credito_prec(int month)
|
|||||||
}
|
}
|
||||||
// toglie il rimborso chiesto
|
// toglie il rimborso chiesto
|
||||||
c = _lim->get_real("R0") + _lim->get_real("R1");
|
c = _lim->get_real("R0") + _lim->get_real("R1");
|
||||||
|
// e le eventuali rettifiche
|
||||||
real rett = _lim->get_real("R5");
|
real rett = _lim->get_real("R5");
|
||||||
if (rett.sign() > 0)
|
c += rett;
|
||||||
c -= rett;
|
// e le ulteriori detrazioni
|
||||||
|
real detr = _lim->get_real("R6");
|
||||||
|
c -= detr;
|
||||||
}
|
}
|
||||||
look_lim(month);
|
look_lim(month);
|
||||||
|
|
||||||
|
@ -387,10 +387,15 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
|||||||
{
|
{
|
||||||
// usa R0 e R1 visto che la ventilazione e' gia'
|
// usa R0 e R1 visto che la ventilazione e' gia'
|
||||||
// stata calcolata
|
// stata calcolata
|
||||||
d->_r2 += _pim->get_real("R0");
|
real ifs(_pim->get_real("R5"));
|
||||||
d->_r3 += _pim->get_real("R1");
|
real vfs(_pim->get_real("R6"));
|
||||||
t2 += _pim->get_real("R0");
|
|
||||||
t3 += _pim->get_real("R1");
|
d->_r2 += _pim->get_real("R0") - ifs;
|
||||||
|
d->_r3 += _pim->get_real("R1") - vfs;
|
||||||
|
t2 += _pim->get_real("R0") - ifs;
|
||||||
|
t3 += _pim->get_real("R1") - vfs;
|
||||||
|
t0 += ifs;
|
||||||
|
t1 += vfs;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -557,9 +562,9 @@ void TLiquidazione_app::describe_liq(int month, const char* codatts,
|
|||||||
d->_r3 += _lim->get_real("R0"); // risultato
|
d->_r3 += _lim->get_real("R0"); // risultato
|
||||||
d->_r4 += _lim->get_real("R1"); // rimborso
|
d->_r4 += _lim->get_real("R1"); // rimborso
|
||||||
if (_lim->get("S7") == "D")
|
if (_lim->get("S7") == "D")
|
||||||
d->_r5 += _lim->get_real("R5"); // rettifiche a debito
|
d->_r5 += abs(_lim->get_real("R5")); // rettifiche a debito
|
||||||
else
|
else
|
||||||
d->_r6 += _lim->get_real("R5"); // rettifiche a credito
|
d->_r6 += abs(_lim->get_real("R5")); // rettifiche a credito
|
||||||
|
|
||||||
d->_f0 = _freqviva == "T";
|
d->_f0 = _freqviva == "T";
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ bool Visliq_app::vis_one(int m)
|
|||||||
|
|
||||||
// ricalcolo liquidazione TMessage msg;
|
// ricalcolo liquidazione TMessage msg;
|
||||||
TFilename f;
|
TFilename f;
|
||||||
f.temp();
|
f.temp("prliq");
|
||||||
|
|
||||||
TToken_string body(36);
|
TToken_string body(36);
|
||||||
body.add(_year);
|
body.add(_year);
|
||||||
@ -382,20 +382,17 @@ bool Visliq_app::vis_one(int m)
|
|||||||
msk.field(F_ACCONTO).set(acconto.string());
|
msk.field(F_ACCONTO).set(acconto.string());
|
||||||
|
|
||||||
long line;
|
long line;
|
||||||
CURSOR oldcur = get_cursor(TASK_WIN);
|
|
||||||
TExternal_app liq("cg4 -2");
|
TExternal_app liq("cg4 -2");
|
||||||
{
|
{
|
||||||
TProgind(10l,"Estrazione liquidazione\nPrego attendere", FALSE,FALSE);
|
TProgind(10l,"Estrazione liquidazione\nPrego attendere", FALSE,FALSE);
|
||||||
liq.run();
|
liq.run();
|
||||||
|
|
||||||
set_cursor(TASK_WIN,CURSOR_WAIT);
|
|
||||||
|
|
||||||
if (liq.error())
|
if (liq.error())
|
||||||
{
|
{
|
||||||
beep();
|
beep();
|
||||||
set_cursor(TASK_WIN, oldcur);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
begin_wait();
|
||||||
line = brw.set_text(f, "CALCOLO LIQUIDAZIONE D'IMPOSTA");
|
line = brw.set_text(f, "CALCOLO LIQUIDAZIONE D'IMPOSTA");
|
||||||
brw.goto_pos(brw.lines()-16l, 9);
|
brw.goto_pos(brw.lines()-16l, 9);
|
||||||
|
|
||||||
@ -418,7 +415,7 @@ bool Visliq_app::vis_one(int m)
|
|||||||
if (lrisd == -1l || lrisc == -1l) return FALSE;
|
if (lrisd == -1l || lrisc == -1l) return FALSE;
|
||||||
if (lvers == -1l) lvers = lrisc+1l;
|
if (lvers == -1l) lvers = lrisc+1l;
|
||||||
|
|
||||||
set_cursor(TASK_WIN, oldcur);
|
end_wait();
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
@ -524,8 +521,9 @@ bool Visliq_app::vis_one(int m)
|
|||||||
{
|
{
|
||||||
_lim->put("B0", "");
|
_lim->put("B0", "");
|
||||||
_lim->rewrite();
|
_lim->rewrite();
|
||||||
vsw->refresh();
|
|
||||||
}
|
}
|
||||||
|
if (write_lim || write_lia)
|
||||||
|
vsw->refresh();
|
||||||
}
|
}
|
||||||
else if (k == K_ESC || k == K_END) break;
|
else if (k == K_ESC || k == K_END) break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user