- 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:
villa 1994-10-25 11:42:58 +00:00
parent 938542a5cb
commit 1cd883b4b2
7 changed files with 66 additions and 38 deletions

View File

@ -11,6 +11,6 @@ int main(int argc,char** argv)
cg2200(argc, argv); break; cg2200(argc, argv); break;
default: default:
cg2100(argc,argv); break; cg2100(argc,argv); break;
} }
return 0; return 0;
} }

View File

@ -1232,30 +1232,30 @@ int CG3100_application::my_next(TLocalisamfile & mov)
int tipo_reg; int tipo_reg;
int ann_reg; int ann_reg;
esito = mov->next(); esito = mov.next();
switch (_scelta_stampa) switch (_scelta_stampa)
{ {
case 0: case 0:
return esito; return esito;
case 1: case 1:
while (!mov->eof()) while (!mov.eof())
{ {
cod_reg = mov->get (MOV_REG); cod_reg = mov.get (MOV_REG);
ann_reg = mov->get_int (MOV_ANNOIVA); ann_reg = mov.get_int (MOV_ANNOIVA);
causale = mov->get (MOV_CODCAUS); causale = mov.get (MOV_CODCAUS);
if ( ( _annoes != 0l) if ( ( _annoes != 0l)
|| ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) ) || ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) )
{ {
esito=mov->next(); esito = mov.next();
continue; continue;
} }
tipo_reg = CodiceRegistro (cod_reg, ann_reg); tipo_reg = CodiceRegistro (cod_reg, ann_reg);
if ( (tipo_reg != 1) && (tipo_reg != 2) ) if ( (tipo_reg != 1) && (tipo_reg != 2) )
return esito; return esito;
esito=mov->next(); esito=mov.next();
} }
break; break;
@ -1440,17 +1440,17 @@ bool CG3100_application::segnala_errori_ogniriga()
_numreg = current_cursor()->file(LF_MOV).get_long(MOV_NUMREG); _numreg = current_cursor()->file(LF_MOV).get_long(MOV_NUMREG);
if (current_cursor()->is_first_match(LF_RMOVIVA)) if (current_cursor()->is_first_match(LF_RMOVIVA))
{ {
record = rmoviva.recno(); record = rmoviva->recno();
rmoviva.zero(); rmoviva->zero();
rmoviva.put(RMI_NUMREG, _numreg); rmoviva->put(RMI_NUMREG, _numreg);
for (rmoviva.read(); !rmoviva.eof() ;rmoviva.next()) for (rmoviva->read(); !rmoviva->eof() ;rmoviva->next())
{ {
_cod = rmoviva.get(RMI_CODIVA); _cod = rmoviva->get(RMI_CODIVA);
_tipod = rmoviva.get_int(RMI_TIPODET); _tipod = rmoviva->get_int(RMI_TIPODET);
_impo = rmoviva.get_real(RMI_IMPONIBILE); _impo = rmoviva->get_real(RMI_IMPONIBILE);
_impos = rmoviva.get_real(RMI_IMPOSTA); _impos = rmoviva->get_real(RMI_IMPOSTA);
_tipocr = rmoviva.get_int(RMI_TIPOCR); _tipocr = rmoviva->get_int(RMI_TIPOCR);
numreg = rmoviva.get_long(RMI_NUMREG); numreg = rmoviva->get_long(RMI_NUMREG);
if (numreg != _numreg) if (numreg != _numreg)
break; break;
else else
@ -1512,7 +1512,7 @@ bool CG3100_application::segnala_errori_ogniriga()
} }
} }
} //for } //for
rmoviva.readat (record); rmoviva->readat (record);
} }
} }
return trovato; return trovato;

View File

@ -16,7 +16,7 @@ int main(int argc,char** argv)
case 2: case 2:
cg4300(argc,argv); break; cg4300(argc,argv); break;
case 3: case 3:
cg4400(argc,argv); break; /* cg4400(argc,argv); */ break;
case 4: case 4:
cg4500(argc,argv); break; cg4500(argc,argv); break;
case 5: case 5:

View File

@ -1,4 +1,4 @@
S// ------------------------------------------------------------ // ------------------------------------------------------------
// Calcolo liquidazioni // Calcolo liquidazioni
// Part 2: calcolo // Part 2: calcolo
// fv 21-1-94 // fv 21-1-94
@ -96,7 +96,7 @@ bool CG4300_App::update_firm(int month, bool recalc)
TString cattiv(codatt); TString cattiv(codatt);
cattiv << tipoatt; cattiv << tipoatt;
if (look_pla(cattiv, FALSE)) if (tipoatt == 1 && look_pla(cattiv, FALSE))
{ {
_p8 = _pla->get_real("R5"); _p8 = _pla->get_real("R5");
_p8b = _pla->get_real("R6"); _p8b = _pla->get_real("R6");
@ -118,12 +118,11 @@ bool CG4300_App::update_firm(int month, bool recalc)
_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()) for (_reg->first(); !_isvent && _reg->good(); _reg->next())
{ {
if (reg.get("S8") == attiv && reg.get_int("I0") == 2) if (codatt == _reg->get("S8") && _reg->get_int("I0") == 2)
isvent = reg.get_bool("B3"); _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) void CG4300_App::recalc_annual(const char* att)
{ {
// TBI calcolo nuovo plafond
// calcolo volume d'affari e altro // calcolo volume d'affari e altro
real es_b1 = 0.0; real es_b1 = 0.0;
real es_b2 = 0.0; real es_b2 = 0.0;
@ -681,8 +678,24 @@ void CG4300_App::recalc_annual(const char* att)
real ivven = 0.0; real ivven = 0.0;
real ven_lrd = 0.0; real ven_lrd = 0.0;
int tipoatt = att[strlen(att) -1] - '0';
TString aaa(att); 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++) for (int i = 1; i <= 12; i++)
{ {
if (is_month_ok(i)) if (is_month_ok(i))
@ -725,6 +738,7 @@ void CG4300_App::recalc_annual(const char* att)
real topay = acq_iva * (prorata / CENTO); 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
// porca aliquota media vendite // porca aliquota media vendite

View File

@ -218,7 +218,12 @@ bool CG4300_App::look_pla(const char* a, bool create)
{ {
bool ok = FALSE; bool ok = FALSE;
_pla_r->zero(); _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; (*_pla_anno) = _year;
TString s = _pla_r->get("CODTAB"); 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 // e (TBI) si controllano incompatibilita' con la normativa
_pla_r->zero(); _pla_r->zero();
(*_pla_codatt) = a; (*_pla_codatt) = buf;
(*_pla_anno) = atoi(_year) - 1; (*_pla_anno) = atoi(_year) - 1;
if (_pla->read() == NOERR) if (_pla->read() == NOERR)
{ {

View File

@ -107,9 +107,9 @@ void CG4300_App::recalc_corrispettivi(int month, const char* codatt)
if (ci->_month != month) if (ci->_month != month)
continue; continue;
real imposta = ci->_totale/(1.00 + ci->_aliquota); real imponibile = ci->_totale/(1.00 + ci->_aliquota);
imposta.ceil(ROUND_LIRA); imponibile.ceil(ROUND_LIRA);
real imponibile = ci->_totale - imposta; real imposta = ci->_totale - imponibile;
// aggiusto l'IVA vendite nei plm // aggiusto l'IVA vendite nei plm
look_plm(month, codatt); look_plm(month, codatt);

View File

@ -98,8 +98,10 @@ void CG4300_App::describe_name(int month, TToken_string& codatts)
d->_f1 = month; d->_f1 = month;
d->_f2 = _isbenzinaro; d->_f2 = _isbenzinaro;
if (_mixed && codatts.items() == 1) if (_mixed && codatts.items() == 1)
d->_f0 = atoi(codatts.mid(5)); d->_f0 = atoi(codatts.mid(5));
else d->_f0 = 0;
_descr_arr.add(d); _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 // scrivo un cannolo ripieno visto che e' stato ventilato
if (tipomov == vendita && tipoiva == "VE") continue; 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 && if (strcmp((const char*)*_pim_codatt, att) == 0 &&
check_month(atoi(*_pim_mese),month) && check_month(atoi(*_pim_mese),month) &&
_year == (const char*)*_pim_anno) _year == (const char*)*_pim_anno)
@ -611,8 +619,9 @@ void CG4300_App::set_att(_DescrItem& d)
(const char*)_year); (const char*)_year);
} }
TString tipatt; TString tipatt;
if (d._f0)
if (d._f0 > 0)
tipatt.format("(att. %d)", d._f0); tipatt.format("(att. %d)", d._f0);
if (d._s3.empty()) if (d._s3.empty())
@ -727,7 +736,7 @@ void CG4300_App::set_plm(_DescrItem& d)
real tot1 = d._r7 + d._r4; real tot1 = d._r7 + d._r4;
real tot2 = d._r8 + d._r5; 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._r0),
&(d._r1), &(d._r1),
&(d._r2), &(d._r2),
@ -856,7 +865,7 @@ void CG4300_App::set_grand(_DescrItem& d)
real iva = rd - rc; real iva = rd - rc;
char how = iva.sign() < 0 ? 'c' : 'd'; char how = iva.sign() < 0 ? 'c' : 'd';
iva = abs(iva); iva = abs(iva);
iva.round(ROUND_MILLELIRE); iva.round(_isannual ? ROUND_MILLELIRE : ROUND_LIRA);
if (how == 'c') if (how == 'c')
{ {
@ -872,7 +881,7 @@ void CG4300_App::set_grand(_DescrItem& d)
real interesse = interesse_trimestrale(d._f2); real interesse = interesse_trimestrale(d._f2);
real ivi = iva * interesse / CENTO; ivi.round(ROUND_LIRA); real ivi = iva * interesse / CENTO; ivi.round(ROUND_LIRA);
real ivt = iva + ivi; 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); 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)