Con questo commit si conclude l'incubo delle fatture con scontrino
git-svn-id: svn://10.65.10.50/trunk@1066 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3bd33062bf
commit
3c8a2244b0
@ -29,7 +29,7 @@ public:
|
|||||||
bool TCopia_archivi::copyfile(int logicnum, long from, long to)
|
bool TCopia_archivi::copyfile(int logicnum, long from, long to)
|
||||||
{
|
{
|
||||||
if (from > 0) set_firm(from);
|
if (from > 0) set_firm(from);
|
||||||
else prefix().set("com");
|
else prefhndl->set("com");
|
||||||
TSystemisamfile file(logicnum);
|
TSystemisamfile file(logicnum);
|
||||||
TFilename t; t.tempdir(); t << "/tr" << logicnum;
|
TFilename t; t.tempdir(); t << "/tr" << logicnum;
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ void TCopia_archivi::clearivd(long to)
|
|||||||
void TCopia_archivi::copyivd(long from, long to)
|
void TCopia_archivi::copyivd(long from, long to)
|
||||||
{
|
{
|
||||||
if (from > 0) set_firm(from);
|
if (from > 0) set_firm(from);
|
||||||
else prefix().set("com");
|
else prefhndl->set("com");
|
||||||
TLocalisamfile pcon(LF_PCON);
|
TLocalisamfile pcon(LF_PCON);
|
||||||
TAssoc_array riclass;
|
TAssoc_array riclass;
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ bool TCopia_archivi::menu(MENU_TAG)
|
|||||||
const bool copy_ivd = _msk->get_bool(F_IVD);
|
const bool copy_ivd = _msk->get_bool(F_IVD);
|
||||||
if (copy_pcon || copy_causali || copy_clifo || copy_ivd)
|
if (copy_pcon || copy_causali || copy_clifo || copy_ivd)
|
||||||
{
|
{
|
||||||
if (prefix().exist(to_firm))
|
if (prefhndl->exist(to_firm))
|
||||||
{
|
{
|
||||||
set_firm(to_firm);
|
set_firm(to_firm);
|
||||||
TLocalisamfile mov(LF_MOV);
|
TLocalisamfile mov(LF_MOV);
|
||||||
|
@ -436,7 +436,7 @@ void TLiquidazione_app::build_nomiditte(TProgind* pnd)
|
|||||||
for (dt.first(); !dt.eof(); dt.next())
|
for (dt.first(); !dt.eof(); dt.next())
|
||||||
{
|
{
|
||||||
// check no archivi
|
// check no archivi
|
||||||
bool good = prefix().exist(dt.get_long("CODDITTA"));
|
bool good = prefhndl->exist(dt.get_long("CODDITTA"));
|
||||||
|
|
||||||
if (good)
|
if (good)
|
||||||
{
|
{
|
||||||
|
@ -347,6 +347,19 @@ void TLiquidazione_app::zero_att(int month, const char* codatt)
|
|||||||
_pim->put("R0","");
|
_pim->put("R0","");
|
||||||
_pim->put("R1","");
|
_pim->put("R1","");
|
||||||
_pim->put("R2","");
|
_pim->put("R2","");
|
||||||
|
_pim->put("R3","");
|
||||||
|
_pim->put("R4","");
|
||||||
|
_pim->put("R5","");
|
||||||
|
_pim->put("R6","");
|
||||||
|
_pim->put("R7","");
|
||||||
|
_pim->put("R8","");
|
||||||
|
_pim->put("R9","");
|
||||||
|
_pim->put("R10","");
|
||||||
|
_pim->put("R11","");
|
||||||
|
_pim->put("R12","");
|
||||||
|
_pim->put("R13","");
|
||||||
|
_pim->put("R14","");
|
||||||
|
_pim->put("S1","");
|
||||||
_pim->rewrite();
|
_pim->rewrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -845,14 +858,15 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
real perc = _iva->get_real("R0")/CENTO;
|
real perc = _iva->get_real("R0")/CENTO;
|
||||||
lor += imponibile + imposta;
|
lor += imponibile + imposta;
|
||||||
real tot = imponibile+imposta;
|
real tot = imponibile+imposta;
|
||||||
if (liq)
|
if (liq) add_corrisp(month, reg, tot, perc, tipodet, codiva);
|
||||||
add_corrisp(month, reg, tot, perc, tipodet, codiva);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tipodoc == "FS")
|
else if (tipodoc == "FS")
|
||||||
{
|
{
|
||||||
// queste sono fatture che seguono scontrino, il lordo va detratto
|
// queste sono fatture che seguono scontrino, il lordo va detratto
|
||||||
// perche' si e' gia' registrato lo scontrino medesimo
|
// perche' si e' gia' registrato lo scontrino medesimo
|
||||||
|
true_corrisp = TRUE; // non e' vero ma non devono essere sommate ai falsi
|
||||||
|
// corrispettivi
|
||||||
if (tipoiva == "VE")
|
if (tipoiva == "VE")
|
||||||
{
|
{
|
||||||
real rr = imponibile + imposta;
|
real rr = imponibile + imposta;
|
||||||
@ -861,32 +875,29 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
vendite += rr;
|
vendite += rr;
|
||||||
add_vendite(month, reg, tipodet, rr);
|
add_vendite(month, reg, tipodet, rr);
|
||||||
}
|
}
|
||||||
else
|
if (liq)
|
||||||
{
|
{
|
||||||
if (liq)
|
// vendite -= imponibile;
|
||||||
{
|
// vendite_iva -= imposta;
|
||||||
vendite += imponibile;
|
|
||||||
vendite_iva += imposta;
|
|
||||||
}
|
|
||||||
imp += imponibile;
|
|
||||||
ivp += imposta;
|
|
||||||
}
|
}
|
||||||
lor -= imponibile + imposta;
|
imp -= imponibile;
|
||||||
ifs += imponibile;
|
ivp -= imposta;
|
||||||
vfs += imposta;
|
lor -= imponibile + imposta;
|
||||||
|
ifs += imponibile;
|
||||||
|
vfs += imposta;
|
||||||
}
|
}
|
||||||
else // vendite normali a tutti gli effetti
|
else // vendite normali a tutti gli effetti
|
||||||
{
|
{
|
||||||
if (liq)
|
if (liq)
|
||||||
{
|
{
|
||||||
vendite += imponibile;
|
vendite += imponibile;
|
||||||
vendite_iva += imposta;
|
vendite_iva += imposta;
|
||||||
}
|
}
|
||||||
imp += imponibile;
|
imp += imponibile;
|
||||||
ivp += imposta;
|
ivp += imposta;
|
||||||
ifs += imponibile;
|
fci += imponibile;
|
||||||
vfs += imposta;
|
fcv += imposta;
|
||||||
_pim_r->put("I0",NETTO);
|
_pim_r->put("I0",NETTO);
|
||||||
}
|
}
|
||||||
} // if corrisp
|
} // if corrisp
|
||||||
else // non corrisp
|
else // non corrisp
|
||||||
|
@ -36,21 +36,49 @@ void TLiquidazione_app::set_page(int file, int cnt)
|
|||||||
|
|
||||||
switch(d._flags)
|
switch(d._flags)
|
||||||
{
|
{
|
||||||
case CHG_PARMS: set_att(d); break;
|
case CHG_PARMS:
|
||||||
case SET_FIRM: set_firm(d); break;
|
set_att(d);
|
||||||
case PIM_ROW: set_pim(d); break;
|
break;
|
||||||
case MISC_LIQ: set_pumpam(d); break;
|
case SET_FIRM:
|
||||||
case TOT_ROW: set_plm(d); break;
|
set_firm(d);
|
||||||
case PLAFOND: set_plafond(d); break;
|
break;
|
||||||
case VENTILA: set_ventila(d); break;
|
case PIM_ROW:
|
||||||
case REGAGR: set_regagr(d); break;
|
set_pim(d);
|
||||||
case REGVIA: set_viaggio(d); break;
|
break;
|
||||||
case THE_END: set_grand(d); break;
|
case MISC_LIQ:
|
||||||
case ACCONTO: set_acconto_p(d); break;
|
set_pumpam(d);
|
||||||
case ACCHEAD: set_acchead_p(d); break;
|
break;
|
||||||
case DELDEB: set_deltab(d, FALSE); break;
|
case TOT_ROW:
|
||||||
case DELCRED: set_deltab(d, TRUE); break;
|
set_plm(d);
|
||||||
}
|
break;
|
||||||
|
case PLAFOND:
|
||||||
|
set_plafond(d);
|
||||||
|
break;
|
||||||
|
case VENTILA:
|
||||||
|
set_ventila(d);
|
||||||
|
break;
|
||||||
|
case REGAGR:
|
||||||
|
set_regagr(d);
|
||||||
|
break;
|
||||||
|
case REGVIA:
|
||||||
|
set_viaggio(d);
|
||||||
|
break;
|
||||||
|
case THE_END:
|
||||||
|
set_grand(d);
|
||||||
|
break;
|
||||||
|
case ACCONTO:
|
||||||
|
set_acconto_p(d);
|
||||||
|
break;
|
||||||
|
case ACCHEAD:
|
||||||
|
set_acchead_p(d);
|
||||||
|
break;
|
||||||
|
case DELDEB:
|
||||||
|
set_deltab(d, FALSE);
|
||||||
|
break;
|
||||||
|
case DELCRED:
|
||||||
|
set_deltab(d, TRUE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print_action TLiquidazione_app::postprocess_page(int file, int cnt)
|
print_action TLiquidazione_app::postprocess_page(int file, int cnt)
|
||||||
@ -415,8 +443,8 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
|||||||
// vedi corrispettivi veri e falsi
|
// vedi corrispettivi veri e falsi
|
||||||
real cvi = _pim->get_real("R0"); // imp. totale
|
real cvi = _pim->get_real("R0"); // imp. totale
|
||||||
real cvv = _pim->get_real("R1"); // iva totale
|
real cvv = _pim->get_real("R1"); // iva totale
|
||||||
real cfi = _pim->get_real("R13"); // imp. falsi corrisp
|
real cfi = _pim->get_real("R13"); // imp. falsi corrispettivi
|
||||||
real cfv = _pim->get_real("R13"); // iva falsi corrisp
|
real cfv = _pim->get_real("R14"); // iva falsi corrispettivi
|
||||||
|
|
||||||
if (corrisp)
|
if (corrisp)
|
||||||
{
|
{
|
||||||
@ -428,13 +456,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
|
||||||
real ifs(_pim->get_real("R5"));
|
real ifs(_pim->get_real("R5")); // imp. fatture con scontrino
|
||||||
real vfs(_pim->get_real("R6"));
|
real vfs(_pim->get_real("R6")); // iva fatture con scontrino
|
||||||
|
|
||||||
d->_r2 += cvi - ifs;
|
d->_r2 += (cvi /* - ifs */); // tolgo FS dai corrispettivi
|
||||||
d->_r3 += cvv - vfs;
|
d->_r3 += (cvv /* - vfs */);
|
||||||
t2 += cvi - ifs;
|
d->_r0 += ifs; // aggiungo FS alle vendite
|
||||||
t3 += cvv - vfs;
|
d->_r1 += vfs;
|
||||||
|
t2 += (cvi /* - ifs */); // idem per i totali
|
||||||
|
t3 += (cvv /* - vfs */);
|
||||||
t0 += ifs;
|
t0 += ifs;
|
||||||
t1 += vfs;
|
t1 += vfs;
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ bool CG4400_application::mask_libun (TMask_field& f, KEY k)
|
|||||||
for (int i = 0; i < app()._ditte->items(); i++)
|
for (int i = 0; i < app()._ditte->items(); i++)
|
||||||
{
|
{
|
||||||
long ditta = app()._ditte->row(i).get_long(1);
|
long ditta = app()._ditte->row(i).get_long(1);
|
||||||
if (prefix().exist(ditta))
|
if (prefhndl->exist(ditta))
|
||||||
{
|
{
|
||||||
app().set_firm(ditta);
|
app().set_firm(ditta);
|
||||||
if (cod.not_empty())
|
if (cod.not_empty())
|
||||||
@ -625,7 +625,7 @@ void CG4400_application::build_nomiditte(TProgind* pnd)
|
|||||||
for (dt.first(); !dt.eof(); dt.next())
|
for (dt.first(); !dt.eof(); dt.next())
|
||||||
{
|
{
|
||||||
// check no archivi
|
// check no archivi
|
||||||
bool good = prefix().exist(dt.get_long("CODDITTA"));
|
bool good = prefhndl->exist(dt.get_long("CODDITTA"));
|
||||||
if (good)
|
if (good)
|
||||||
{
|
{
|
||||||
// check no parametri liquidazione
|
// check no parametri liquidazione
|
||||||
|
Loading…
x
Reference in New Issue
Block a user