- Corretti errori liquidazione numero MI0038 MI0039 MI0026 MI0027
MI0039 MI1057 MI1062 (probabilmnte anche 58 e 60) MI1221 MI0058; - Alcuni errori riportati come MI0044 (arrotondamenti) sono corretti; - Reso compilabile cg3100.cpp git-svn-id: svn://10.65.10.50/trunk@452 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
938542a5cb
commit
1cd883b4b2
@ -11,6 +11,6 @@ int main(int argc,char** argv)
|
||||
cg2200(argc, argv); break;
|
||||
default:
|
||||
cg2100(argc,argv); break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1232,30 +1232,30 @@ int CG3100_application::my_next(TLocalisamfile & mov)
|
||||
int tipo_reg;
|
||||
int ann_reg;
|
||||
|
||||
esito = mov->next();
|
||||
esito = mov.next();
|
||||
|
||||
switch (_scelta_stampa)
|
||||
{
|
||||
case 0:
|
||||
return esito;
|
||||
case 1:
|
||||
while (!mov->eof())
|
||||
while (!mov.eof())
|
||||
{
|
||||
cod_reg = mov->get (MOV_REG);
|
||||
ann_reg = mov->get_int (MOV_ANNOIVA);
|
||||
causale = mov->get (MOV_CODCAUS);
|
||||
cod_reg = mov.get (MOV_REG);
|
||||
ann_reg = mov.get_int (MOV_ANNOIVA);
|
||||
causale = mov.get (MOV_CODCAUS);
|
||||
|
||||
if ( ( _annoes != 0l)
|
||||
|| ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) )
|
||||
{
|
||||
esito=mov->next();
|
||||
esito = mov.next();
|
||||
continue;
|
||||
}
|
||||
tipo_reg = CodiceRegistro (cod_reg, ann_reg);
|
||||
if ( (tipo_reg != 1) && (tipo_reg != 2) )
|
||||
return esito;
|
||||
|
||||
esito=mov->next();
|
||||
esito=mov.next();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1440,17 +1440,17 @@ bool CG3100_application::segnala_errori_ogniriga()
|
||||
_numreg = current_cursor()->file(LF_MOV).get_long(MOV_NUMREG);
|
||||
if (current_cursor()->is_first_match(LF_RMOVIVA))
|
||||
{
|
||||
record = rmoviva.recno();
|
||||
rmoviva.zero();
|
||||
rmoviva.put(RMI_NUMREG, _numreg);
|
||||
for (rmoviva.read(); !rmoviva.eof() ;rmoviva.next())
|
||||
record = rmoviva->recno();
|
||||
rmoviva->zero();
|
||||
rmoviva->put(RMI_NUMREG, _numreg);
|
||||
for (rmoviva->read(); !rmoviva->eof() ;rmoviva->next())
|
||||
{
|
||||
_cod = rmoviva.get(RMI_CODIVA);
|
||||
_tipod = rmoviva.get_int(RMI_TIPODET);
|
||||
_impo = rmoviva.get_real(RMI_IMPONIBILE);
|
||||
_impos = rmoviva.get_real(RMI_IMPOSTA);
|
||||
_tipocr = rmoviva.get_int(RMI_TIPOCR);
|
||||
numreg = rmoviva.get_long(RMI_NUMREG);
|
||||
_cod = rmoviva->get(RMI_CODIVA);
|
||||
_tipod = rmoviva->get_int(RMI_TIPODET);
|
||||
_impo = rmoviva->get_real(RMI_IMPONIBILE);
|
||||
_impos = rmoviva->get_real(RMI_IMPOSTA);
|
||||
_tipocr = rmoviva->get_int(RMI_TIPOCR);
|
||||
numreg = rmoviva->get_long(RMI_NUMREG);
|
||||
if (numreg != _numreg)
|
||||
break;
|
||||
else
|
||||
@ -1512,7 +1512,7 @@ bool CG3100_application::segnala_errori_ogniriga()
|
||||
}
|
||||
}
|
||||
} //for
|
||||
rmoviva.readat (record);
|
||||
rmoviva->readat (record);
|
||||
}
|
||||
}
|
||||
return trovato;
|
||||
|
@ -16,7 +16,7 @@ int main(int argc,char** argv)
|
||||
case 2:
|
||||
cg4300(argc,argv); break;
|
||||
case 3:
|
||||
cg4400(argc,argv); break;
|
||||
/* cg4400(argc,argv); */ break;
|
||||
case 4:
|
||||
cg4500(argc,argv); break;
|
||||
case 5:
|
||||
|
@ -1,4 +1,4 @@
|
||||
S// ------------------------------------------------------------
|
||||
// ------------------------------------------------------------
|
||||
// Calcolo liquidazioni
|
||||
// Part 2: calcolo
|
||||
// fv 21-1-94
|
||||
@ -96,7 +96,7 @@ bool CG4300_App::update_firm(int month, bool recalc)
|
||||
TString cattiv(codatt);
|
||||
|
||||
cattiv << tipoatt;
|
||||
if (look_pla(cattiv, FALSE))
|
||||
if (tipoatt == 1 && look_pla(cattiv, FALSE))
|
||||
{
|
||||
_p8 = _pla->get_real("R5");
|
||||
_p8b = _pla->get_real("R6");
|
||||
@ -118,12 +118,11 @@ bool CG4300_App::update_firm(int month, bool recalc)
|
||||
_isriepilogo = _month == 13;
|
||||
// _isvent = _pla->get_bool("B0");
|
||||
|
||||
TTable reg("REG");
|
||||
|
||||
for (reg.first(); !_isvent && reg.good(); reg.next())
|
||||
for (_reg->first(); !_isvent && _reg->good(); _reg->next())
|
||||
{
|
||||
if (reg.get("S8") == attiv && reg.get_int("I0") == 2)
|
||||
isvent = reg.get_bool("B3");
|
||||
if (codatt == _reg->get("S8") && _reg->get_int("I0") == 2)
|
||||
_isvent = _reg->get_bool("B3");
|
||||
}
|
||||
|
||||
|
||||
@ -666,8 +665,6 @@ void CG4300_App::write_liq(int month, const char* codatts)
|
||||
|
||||
void CG4300_App::recalc_annual(const char* att)
|
||||
{
|
||||
// TBI calcolo nuovo plafond
|
||||
|
||||
// calcolo volume d'affari e altro
|
||||
real es_b1 = 0.0;
|
||||
real es_b2 = 0.0;
|
||||
@ -681,8 +678,24 @@ void CG4300_App::recalc_annual(const char* att)
|
||||
real ivven = 0.0;
|
||||
real ven_lrd = 0.0;
|
||||
|
||||
int tipoatt = att[strlen(att) -1] - '0';
|
||||
TString aaa(att);
|
||||
|
||||
if (tipoatt == 2)
|
||||
{
|
||||
// istanzia ai valori precedenti, calcolati per l'attivita' 1
|
||||
look_pla(aaa);
|
||||
vendite = _pla->get_real("R0");
|
||||
es_b1 = _pla->get_real("R1");
|
||||
es_b2 = _pla->get_real("R2");
|
||||
es_b3 = _pla->get_real("R3");
|
||||
cess_amm = _pla->get_real("R4");
|
||||
ivven = _pla->get_real("R11");
|
||||
ivlac = _pla->get_real("R12");
|
||||
ven_lrd = _pla->get_real("R13");
|
||||
acq = _pla->get_real("R14");
|
||||
}
|
||||
|
||||
for (int i = 1; i <= 12; i++)
|
||||
{
|
||||
if (is_month_ok(i))
|
||||
@ -725,6 +738,7 @@ void CG4300_App::recalc_annual(const char* att)
|
||||
real topay = acq_iva * (prorata / CENTO);
|
||||
conguaglio = topay - pro_pag;
|
||||
}
|
||||
|
||||
// vediamo se la porca aliquota media acquisti e' superiore alla
|
||||
// porca aliquota media vendite
|
||||
|
||||
|
@ -218,7 +218,12 @@ bool CG4300_App::look_pla(const char* a, bool create)
|
||||
{
|
||||
bool ok = FALSE;
|
||||
_pla_r->zero();
|
||||
(*_pla_codatt) = a;
|
||||
|
||||
// forza il tipoatt a 1
|
||||
char buf[10]; strcpy(buf,a);
|
||||
buf[strlen(buf) - 1] = '1';
|
||||
|
||||
(*_pla_codatt) = buf;
|
||||
(*_pla_anno) = _year;
|
||||
|
||||
TString s = _pla_r->get("CODTAB");
|
||||
@ -233,7 +238,7 @@ bool CG4300_App::look_pla(const char* a, bool create)
|
||||
// e (TBI) si controllano incompatibilita' con la normativa
|
||||
|
||||
_pla_r->zero();
|
||||
(*_pla_codatt) = a;
|
||||
(*_pla_codatt) = buf;
|
||||
(*_pla_anno) = atoi(_year) - 1;
|
||||
if (_pla->read() == NOERR)
|
||||
{
|
||||
|
@ -107,9 +107,9 @@ void CG4300_App::recalc_corrispettivi(int month, const char* codatt)
|
||||
if (ci->_month != month)
|
||||
continue;
|
||||
|
||||
real imposta = ci->_totale/(1.00 + ci->_aliquota);
|
||||
imposta.ceil(ROUND_LIRA);
|
||||
real imponibile = ci->_totale - imposta;
|
||||
real imponibile = ci->_totale/(1.00 + ci->_aliquota);
|
||||
imponibile.ceil(ROUND_LIRA);
|
||||
real imposta = ci->_totale - imponibile;
|
||||
|
||||
// aggiusto l'IVA vendite nei plm
|
||||
look_plm(month, codatt);
|
||||
|
@ -98,8 +98,10 @@ void CG4300_App::describe_name(int month, TToken_string& codatts)
|
||||
|
||||
d->_f1 = month;
|
||||
d->_f2 = _isbenzinaro;
|
||||
|
||||
if (_mixed && codatts.items() == 1)
|
||||
d->_f0 = atoi(codatts.mid(5));
|
||||
else d->_f0 = 0;
|
||||
_descr_arr.add(d);
|
||||
}
|
||||
|
||||
@ -294,6 +296,12 @@ void CG4300_App::describe_pims(int month, const char* codatt)
|
||||
// scrivo un cannolo ripieno visto che e' stato ventilato
|
||||
if (tipomov == vendita && tipoiva == "VE") continue;
|
||||
|
||||
// se ha tutti gli importi nulli viene da un annullamento di
|
||||
// movimenti esistenti
|
||||
if (_pim->get_real("R0").is_zero() && _pim->get_real("R1").is_zero() &&
|
||||
_pim->get_real("R2").is_zero())
|
||||
continue;
|
||||
|
||||
if (strcmp((const char*)*_pim_codatt, att) == 0 &&
|
||||
check_month(atoi(*_pim_mese),month) &&
|
||||
_year == (const char*)*_pim_anno)
|
||||
@ -611,8 +619,9 @@ void CG4300_App::set_att(_DescrItem& d)
|
||||
(const char*)_year);
|
||||
}
|
||||
|
||||
TString tipatt;
|
||||
if (d._f0)
|
||||
TString tipatt;
|
||||
|
||||
if (d._f0 > 0)
|
||||
tipatt.format("(att. %d)", d._f0);
|
||||
|
||||
if (d._s3.empty())
|
||||
@ -727,7 +736,7 @@ void CG4300_App::set_plm(_DescrItem& d)
|
||||
real tot1 = d._r7 + d._r4;
|
||||
real tot2 = d._r8 + d._r5;
|
||||
|
||||
set_row(8,"Totale Generale IVA@26g%r %r@58g%r %r@91g%r %r",
|
||||
set_row(8,"Totale Generale IVA@25g%r %r@58g%r %r@91g%r %r",
|
||||
&(d._r0),
|
||||
&(d._r1),
|
||||
&(d._r2),
|
||||
@ -856,7 +865,7 @@ void CG4300_App::set_grand(_DescrItem& d)
|
||||
real iva = rd - rc;
|
||||
char how = iva.sign() < 0 ? 'c' : 'd';
|
||||
iva = abs(iva);
|
||||
iva.round(ROUND_MILLELIRE);
|
||||
iva.round(_isannual ? ROUND_MILLELIRE : ROUND_LIRA);
|
||||
|
||||
if (how == 'c')
|
||||
{
|
||||
@ -872,7 +881,7 @@ void CG4300_App::set_grand(_DescrItem& d)
|
||||
real interesse = interesse_trimestrale(d._f2);
|
||||
real ivi = iva * interesse / CENTO; ivi.round(ROUND_LIRA);
|
||||
real ivt = iva + ivi;
|
||||
ivt.round(ROUND_MILLELIRE);
|
||||
ivt.round(_isannual ? ROUND_MILLELIRE : ROUND_LIRA);
|
||||
set_row(rw++,"@23gInteresse %6.2r %%@75g%r",&interesse, &ivi);
|
||||
|
||||
if (ivt.is_zero() || ivt >= IVA_DA_RIPORTARE || d._f1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user