Correzione MI2003 MI0048 MI0049 MI0052 etc..
git-svn-id: svn://10.65.10.50/trunk@442 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
272a350bed
commit
bb1672cd35
@ -8,6 +8,8 @@
|
|||||||
#include "cg4300a.h"
|
#include "cg4300a.h"
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
|
|
||||||
|
real CG4300_App::CENTO(100.0);
|
||||||
|
|
||||||
inline CG4300_App& app()
|
inline CG4300_App& app()
|
||||||
{ return (CG4300_App&)main_app(); }
|
{ return (CG4300_App&)main_app(); }
|
||||||
|
|
||||||
@ -158,7 +160,7 @@ bool CG4300_App::set_print(int n)
|
|||||||
{
|
{
|
||||||
case 1: // liquidazione
|
case 1: // liquidazione
|
||||||
_isprint = TRUE;
|
_isprint = TRUE;
|
||||||
if (set_liquidazione())
|
while (set_liquidazione())
|
||||||
{
|
{
|
||||||
if (_selected.ones() > 0l)
|
if (_selected.ones() > 0l)
|
||||||
{
|
{
|
||||||
@ -185,48 +187,56 @@ bool CG4300_App::set_print(int n)
|
|||||||
break;
|
break;
|
||||||
case 2: // estrazione deleghe
|
case 2: // estrazione deleghe
|
||||||
_isprint = FALSE;
|
_isprint = FALSE;
|
||||||
if (set_deleghe())
|
while (set_deleghe())
|
||||||
{
|
{
|
||||||
/* if (_year != yy)
|
if (_calcall || _selected.ones() > 0l)
|
||||||
{
|
{
|
||||||
TString cond(format("ANNOES=%s",(const char*)_year));
|
/* if (_year != yy)
|
||||||
_cur->setfilter(cond);
|
{
|
||||||
} */
|
TString cond(format("ANNOES=%s",(const char*)_year));
|
||||||
TRectype & mov = _cur->curr();
|
_cur->setfilter(cond);
|
||||||
TRectype from(_cur->curr()); from.zero();
|
} */
|
||||||
TRectype to(mov);
|
TRectype & mov = _cur->curr();
|
||||||
TDate f(1, _recalc == one ? _month : 1, atoi(_year));
|
TRectype from(_cur->curr()); from.zero();
|
||||||
TDate t(1, _month, atoi(_year));
|
TRectype to(mov);
|
||||||
|
TDate f(1, _recalc == one ? _month : 1, atoi(_year));
|
||||||
t.set_end_month();
|
TDate t(1, _month, atoi(_year));
|
||||||
from.put(MOV_DATAREG, f);
|
|
||||||
to.put(MOV_DATAREG, t);
|
t.set_end_month();
|
||||||
_cur->setregion(from, to);
|
from.put(MOV_DATAREG, f);
|
||||||
extract_deleghe();
|
to.put(MOV_DATAREG, t);
|
||||||
return FALSE;
|
_cur->setregion(from, to);
|
||||||
|
extract_deleghe();
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else warning_box("Nessuna ditta selezionata!");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3: // calcolo acconto
|
case 3: // calcolo acconto
|
||||||
_isprint = TRUE;
|
_isprint = TRUE;
|
||||||
if (set_acconto())
|
while (set_acconto())
|
||||||
{
|
{
|
||||||
/* if (_year != yy)
|
if (_calcall || _selected.ones() > 0l)
|
||||||
{
|
{
|
||||||
TString cond(format("ANNOES=%s",(const char*)_year));
|
/* if (_year != yy)
|
||||||
_cur->setfilter(cond);
|
{
|
||||||
}*/
|
TString cond(format("ANNOES=%s",(const char*)_year));
|
||||||
TRectype & mov = _cur->curr();
|
_cur->setfilter(cond);
|
||||||
TRectype from(_cur->curr()); from.zero();
|
}*/
|
||||||
TRectype to(mov);
|
TRectype & mov = _cur->curr();
|
||||||
TDate f(1, _recalc == one ? _month : 1, atoi(_year));
|
TRectype from(_cur->curr()); from.zero();
|
||||||
TDate t(1, _month, atoi(_year));
|
TRectype to(mov);
|
||||||
|
TDate f(1, _recalc == one ? _month : 1, atoi(_year));
|
||||||
t.set_end_month();
|
TDate t(1, _month, atoi(_year));
|
||||||
from.put(MOV_DATAREG, f);
|
|
||||||
to.put(MOV_DATAREG, t);
|
t.set_end_month();
|
||||||
_cur->setregion(from, to);
|
from.put(MOV_DATAREG, f);
|
||||||
recalc_acconti();
|
to.put(MOV_DATAREG, t);
|
||||||
return _isprint;
|
_cur->setregion(from, to);
|
||||||
|
recalc_acconti();
|
||||||
|
return _isprint;
|
||||||
|
}
|
||||||
|
else warning_box("Nessuna ditta selezionata!");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// ------------------------------------------------------------
|
S// ------------------------------------------------------------
|
||||||
// Calcolo liquidazioni
|
// Calcolo liquidazioni
|
||||||
// Part 2: calcolo
|
// Part 2: calcolo
|
||||||
// fv 21-1-94
|
// fv 21-1-94
|
||||||
@ -116,7 +116,16 @@ bool CG4300_App::update_firm(int month, bool recalc)
|
|||||||
_isannual = (_month == 12 && !mens && !_isbenzinaro) ||
|
_isannual = (_month == 12 && !mens && !_isbenzinaro) ||
|
||||||
(_month == 13 && (mens || _isbenzinaro));
|
(_month == 13 && (mens || _isbenzinaro));
|
||||||
_isriepilogo = _month == 13;
|
_isriepilogo = _month == 13;
|
||||||
_isvent = _pla->get_bool("B0");
|
// _isvent = _pla->get_bool("B0");
|
||||||
|
|
||||||
|
TTable reg("REG");
|
||||||
|
|
||||||
|
for (reg.first(); !_isvent && reg.good(); reg.next())
|
||||||
|
{
|
||||||
|
if (reg.get("S8") == attiv && reg.get_int("I0") == 2)
|
||||||
|
isvent = reg.get_bool("B3");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((month != 13 || _isannual) && (calc || !recalc))
|
if ((month != 13 || _isannual) && (calc || !recalc))
|
||||||
if (!update_att(month, cattiv))
|
if (!update_att(month, cattiv))
|
||||||
@ -459,7 +468,7 @@ void CG4300_App::recalc_att(int month, const char* codatt)
|
|||||||
else
|
else
|
||||||
if (corrisp)
|
if (corrisp)
|
||||||
{
|
{
|
||||||
real perc = _iva->get_real("R0")/100.00;
|
real perc = _iva->get_real("R0") / CENTO;
|
||||||
|
|
||||||
lor += imponibile;
|
lor += imponibile;
|
||||||
lor += imposta;
|
lor += imposta;
|
||||||
@ -489,7 +498,7 @@ void CG4300_App::recalc_att(int month, const char* codatt)
|
|||||||
// calcola il lercio prorata
|
// calcola il lercio prorata
|
||||||
real prorata;
|
real prorata;
|
||||||
if (!_prorata.is_zero())
|
if (!_prorata.is_zero())
|
||||||
prorata = acquisti_iva * (_prorata / 100.0);
|
prorata = acquisti_iva * (_prorata / CENTO);
|
||||||
|
|
||||||
look_plm(month, codatt, TRUE);
|
look_plm(month, codatt, TRUE);
|
||||||
|
|
||||||
@ -707,13 +716,13 @@ void CG4300_App::recalc_annual(const char* att)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// calcolo prorata
|
// calcolo prorata
|
||||||
real prorata = (es_b1/(vendite - cess_amm - es_b3)) * 100.0;
|
real prorata = (es_b1/(vendite - cess_amm - es_b3)) * CENTO;
|
||||||
real conguaglio = 0.0;
|
real conguaglio = 0.0;
|
||||||
prorata.round(ROUND_LIRA);
|
prorata.round(ROUND_LIRA);
|
||||||
if (prorata != _prorata)
|
if (prorata != _prorata)
|
||||||
{
|
{
|
||||||
// calcolo conguaglio -- se positivo e' a debito
|
// calcolo conguaglio -- se positivo e' a debito
|
||||||
real topay = acq_iva * (prorata / 100.0);
|
real topay = acq_iva * (prorata / CENTO);
|
||||||
conguaglio = topay - pro_pag;
|
conguaglio = topay - pro_pag;
|
||||||
}
|
}
|
||||||
// vediamo se la porca aliquota media acquisti e' superiore alla
|
// vediamo se la porca aliquota media acquisti e' superiore alla
|
||||||
@ -811,8 +820,8 @@ _DescrItem* CG4300_App::recalc_rimborso(int month, const char* codatts)
|
|||||||
d->_r3 = imp_a;
|
d->_r3 = imp_a;
|
||||||
d->_r4 = iva_v;
|
d->_r4 = iva_v;
|
||||||
d->_r5 = iva_a;
|
d->_r5 = iva_a;
|
||||||
d->_r6 = alv * real(100.0);
|
d->_r6 = alv * CENTO;
|
||||||
d->_r7 = ala * real(100.0);
|
d->_r7 = ala * CENTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rimborsami)
|
if (rimborsami)
|
||||||
|
@ -138,9 +138,9 @@ void CG4300_App::recalc_ventilation(int month, const char* codatt)
|
|||||||
if (_vend_arr.items() == 0) return;
|
if (_vend_arr.items() == 0) return;
|
||||||
|
|
||||||
TString att(codatt);
|
TString att(codatt);
|
||||||
look_pla(att);
|
// look_pla(att);
|
||||||
_pla->put("B0","X");
|
// _pla->put("B0","X");
|
||||||
_pla->rewrite();
|
// _pla->rewrite();
|
||||||
_isvent = TRUE;
|
_isvent = TRUE;
|
||||||
|
|
||||||
// 1) ricalcola i pim dei mesi dal primo al corrente se necessario
|
// 1) ricalcola i pim dei mesi dal primo al corrente se necessario
|
||||||
@ -180,7 +180,7 @@ void CG4300_App::recalc_ventilation(int month, const char* codatt)
|
|||||||
look_iva(other);
|
look_iva(other);
|
||||||
perc = _iva->get_real("R0");
|
perc = _iva->get_real("R0");
|
||||||
}
|
}
|
||||||
add_ventilation(perc/100.0, lurd, *_pim_codiva);
|
add_ventilation(perc / CENTO, lurd, *_pim_codiva);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -558,14 +558,14 @@ void CG4300_App::set_firm(_DescrItem& d)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (d._s3 == "T")
|
if (d._s3 == "T")
|
||||||
tim_title << format(" del %dx Trimestre", d._f1/3);
|
tim_title << format(" del %d° Trimestre %s", d._f1/3, (const char *) _year);
|
||||||
else
|
else
|
||||||
tim_title << format(" del mese di %s %s", itom(d._f1),
|
tim_title << format(" del mese di %s %s", itom(d._f1),
|
||||||
(const char*)_year);
|
(const char*)_year);
|
||||||
}
|
}
|
||||||
|
|
||||||
reset_header();
|
reset_header();
|
||||||
set_header(1,"Ditta %s %s@97gStudio@109gData @<@125gPag. @#",
|
set_header(1,"Ditta %s %s@109gData @<@125gPag. @#",
|
||||||
(const char*)(d._s0), (const char*)(d._s1));
|
(const char*)(d._s0), (const char*)(d._s1));
|
||||||
set_header(2,"");
|
set_header(2,"");
|
||||||
set_header(3,sep);
|
set_header(3,sep);
|
||||||
@ -605,13 +605,15 @@ void CG4300_App::set_att(_DescrItem& d)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (d._s4 == "T")
|
if (d._s4 == "T")
|
||||||
tim_title << format(" del %dx Trimestre", d._f1/3);
|
tim_title << format(" del %dx Trimestre %s", d._f1/3, (const char *) _year);
|
||||||
else
|
else
|
||||||
tim_title << format(" del mese di %s %s", itom(d._f1),
|
tim_title << format(" del mese di %s %s", itom(d._f1),
|
||||||
(const char*)_year);
|
(const char*)_year);
|
||||||
}
|
}
|
||||||
|
|
||||||
TString tipatt = d._f0 ? "" : format("(att. %d)", d._f0);
|
TString tipatt;
|
||||||
|
if (d._f0)
|
||||||
|
tipatt.format("(att. %d)", d._f0);
|
||||||
|
|
||||||
if (d._s3.empty())
|
if (d._s3.empty())
|
||||||
{
|
{
|
||||||
@ -625,7 +627,7 @@ void CG4300_App::set_att(_DescrItem& d)
|
|||||||
(const char*)tipatt);
|
(const char*)tipatt);
|
||||||
|
|
||||||
reset_header();
|
reset_header();
|
||||||
set_header(1,"Ditta %s %s@97gStudio@109gData @<@125gPag. @#",
|
set_header(1,"Ditta %s %s@109gData @<@125gPag. @#",
|
||||||
(const char*)(d._s0), (const char*)(d._s1));
|
(const char*)(d._s0), (const char*)(d._s1));
|
||||||
set_header(2,"");
|
set_header(2,"");
|
||||||
set_header(3,sep);
|
set_header(3,sep);
|
||||||
@ -866,10 +868,12 @@ void CG4300_App::set_grand(_DescrItem& d)
|
|||||||
{
|
{
|
||||||
// trimestrale: interesse
|
// trimestrale: interesse
|
||||||
set_row(rw++,"@23gIVA DOVUTA@75g%r",&iva);
|
set_row(rw++,"@23gIVA DOVUTA@75g%r",&iva);
|
||||||
real ivi = iva * interesse_trimestrale(d._f2);
|
|
||||||
|
real interesse = interesse_trimestrale(d._f2);
|
||||||
|
real ivi = iva * interesse / CENTO; ivi.round(ROUND_LIRA);
|
||||||
real ivt = iva + ivi;
|
real ivt = iva + ivi;
|
||||||
ivt.round(ROUND_MILLELIRE);
|
ivt.round(ROUND_MILLELIRE);
|
||||||
set_row(rw++,"@23gInteresse 1.50 %%@75g%r",&ivi);
|
set_row(rw++,"@23gInteresse %6.2r %%@75g%r",&interesse, &ivi);
|
||||||
|
|
||||||
if (ivt.is_zero() || ivt >= IVA_DA_RIPORTARE || d._f1)
|
if (ivt.is_zero() || ivt >= IVA_DA_RIPORTARE || d._f1)
|
||||||
set_row(rw++,"@23gIVA DA VERSARE@75g%r",&ivt);
|
set_row(rw++,"@23gIVA DA VERSARE@75g%r",&ivt);
|
||||||
@ -903,7 +907,7 @@ void CG4300_App::set_grand(_DescrItem& d)
|
|||||||
set_row(rw++,"1) Soggetto con quota di operazioni esenti e non"
|
set_row(rw++,"1) Soggetto con quota di operazioni esenti e non"
|
||||||
" imponibili superiore al 50%%");
|
" imponibili superiore al 50%%");
|
||||||
|
|
||||||
real perc = (di._r0/di._r1) * real(100.0);
|
real perc = (di._r0/di._r1) * CENTO;
|
||||||
|
|
||||||
TString sep(strlen(REAL_PICTURE)+2); sep.fill('-');
|
TString sep(strlen(REAL_PICTURE)+2); sep.fill('-');
|
||||||
set_row(rw++,"");
|
set_row(rw++,"");
|
||||||
@ -1088,7 +1092,7 @@ void CG4300_App::set_viaggio(_DescrItem& d)
|
|||||||
int ln = max(up.len(), dn.len()) + 2;
|
int ln = max(up.len(), dn.len()) + 2;
|
||||||
TString den(ln); den.fill('-');
|
TString den(ln); den.fill('-');
|
||||||
up.center_just(ln); dn.center_just(ln);
|
up.center_just(ln); dn.center_just(ln);
|
||||||
real rip = d._r7 * 100.0; rip.round(2);
|
real rip = d._r7 * CENTO; rip.round(2);
|
||||||
|
|
||||||
// la bella frazioncina degli imponibili viaggi misti
|
// la bella frazioncina degli imponibili viaggi misti
|
||||||
TString tmp2 = d._r1.string(REAL_PICTURE); tmp2.ltrim();
|
TString tmp2 = d._r1.string(REAL_PICTURE); tmp2.ltrim();
|
||||||
@ -1238,7 +1242,7 @@ void CG4300_App::set_acconto_p(_DescrItem& d)
|
|||||||
void CG4300_App::set_acchead_p(_DescrItem& d)
|
void CG4300_App::set_acchead_p(_DescrItem& d)
|
||||||
{
|
{
|
||||||
reset_header();
|
reset_header();
|
||||||
set_header(1,"Gestione IVA@97gStudio@109gData @<@125gPag. @#");
|
set_header(1,"Gestione IVA@109gData @<@125gPag. @#");
|
||||||
set_header(3,sep);
|
set_header(3,sep);
|
||||||
|
|
||||||
if (d._f0) // base anno in corso
|
if (d._f0) // base anno in corso
|
||||||
|
@ -17,10 +17,9 @@ bool CG4300_App::set_deleghe()
|
|||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (k == K_ESC)
|
if (k == K_ESC || k == K_ENTER)
|
||||||
break;
|
|
||||||
if (k == K_ENTER && (_calcall || _selected.ones() > 0l))
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
k = m.run();
|
k = m.run();
|
||||||
|
|
||||||
// _isprint = m.get_bool(CHK_CGB_PRINT);
|
// _isprint = m.get_bool(CHK_CGB_PRINT);
|
||||||
@ -158,9 +157,7 @@ bool CG4300_App::set_acconto()
|
|||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (k == K_ESC)
|
if (k == K_ESC || k == K_ENTER)
|
||||||
break;
|
|
||||||
if (k == K_ENTER && (_calcall || _selected.ones() > 0l))
|
|
||||||
break;
|
break;
|
||||||
k = m.run();
|
k = m.run();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user