Skukkurukkukku'

git-svn-id: svn://10.65.10.50/trunk@916 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-01-26 16:00:13 +00:00
parent d907c91539
commit 80f9fa5396
4 changed files with 54 additions and 54 deletions

View File

@ -578,6 +578,8 @@ bool TLiquidazione_app::set_liquidazione()
do do
{ {
m.field(CG43_RDB_VERS).set(format("%d",(int)_what));
if ((k = m.run()) == K_ESC) break; if ((k = m.run()) == K_ESC) break;
// handlers have set everything // handlers have set everything

View File

@ -1014,12 +1014,12 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
rettifiche= _lim->get_real("R5"); rettifiche= _lim->get_real("R5");
rimborsi = _lim->get_real("R1"); rimborsi = _lim->get_real("R1");
// leggi anche tutti gli altri totali // leggi anche tutti gli altri totali
tt = _lim->get("S0");
iva_vend = tt.get(); iva_acq = tt.get();
tt = _lim->get("S1");
res_debt = tt.get(); res_cred = tt.get();
tt = _lim->get("S2"); tt = _lim->get("S2");
cred_prec = tt.get(); debt_precd = tt.get(); iva_vend = tt.get(0); iva_acq = tt.get(1);
cred_prec = tt.get(2); debt_precd = tt.get(3);
res_debt = (const char*)_lim->get("S5");
res_cred = (const char*)_lim->get("S4");
acc_dec = (const char*)_lim->get("S3"); acc_dec = (const char*)_lim->get("S3");
_year = format("%d", atoi(_year)+1); _year = format("%d", atoi(_year)+1);
} }
@ -1082,11 +1082,14 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
*/ */
if (attc == 0 && is_lim) if (attc == 0 && is_lim)
{ {
// benzinaro le conta solo in annuale, // se sono per benzinaro le conta solo in annuale,
// non benzinaro solo in periodica // se no vanno solo in periodica
// TBC vedi se distinguere rett. benzinai / autotrasport, TString descrett(_lim->get("S0"));
if ((_isbenzinaro && _isannual) || bool isforbenzinaro = descrett[0] == '$' ||
(!_isbenzinaro && !_isannual)) (descrett[0] == '>' && descrett[1] == '>');
if ((isforbenzinaro && _isannual) ||
(!isforbenzinaro && !_isannual))
{ {
risultato += _lim->get_real("R5"); risultato += _lim->get_real("R5");
rettifiche += _lim->get_real("R5"); rettifiche += _lim->get_real("R5");
@ -1234,7 +1237,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
// comprende anche il conguaglio prorata // comprende anche il conguaglio prorata
risultato += tot_cong; risultato += tot_cong;
if (tot_cong.sign() > 0) res_debt += tot_cong; if (tot_cong.sign() > 0) res_debt += tot_cong;
if (tot_cong.sign() < 0) res_cred += tot_cong; if (tot_cong.sign() < 0) res_cred += abs(tot_cong);
look_lim(month,TRUE); look_lim(month,TRUE);
// azzeriamo tutto // azzeriamo tutto
@ -1287,34 +1290,31 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
real interesse = interesse_trimestrale(_month); real interesse = interesse_trimestrale(_month);
real ivi = risultato * (interesse / CENTO); real ivi = risultato * (interesse / CENTO);
ivi.ceil(ROUND_LIRA); ivi.ceil(ROUND_LIRA);
_lim->put("R7", ivi); _lim->put("R11", ivi);
_lim->put("R10",interesse_trimestrale(_month)); _lim->put("R10",interesse_trimestrale(_month));
} }
// totale conguaglio su tutte le attivita'
_lim->put("R7", tot_cong);
_lim->put("R8", versamenti); _lim->put("R8", versamenti);
_lim->put("R9", vers_int); _lim->put("R9", vers_int);
// scrivi: totali IVA vendite e acquisti, credito prec, // scrivi: totali IVA vendite e acquisti, credito prec,
// debito prec, acconto, totale conguaglio prorata // debito prec, acconto, totale conguaglio prorata
// cosi' si fa una volta sola in stampa // cosi' si fa una volta sola in stampa
tt = iva_vend.string(); tt.add(iva_acq.string()); tt = iva_vend.string(); tt.add(iva_acq.string());
_lim->put("S0", tt); tt.add(cred_prec.string()); tt.add(debt_precd.string());
tt = res_debt.string(); tt.add(res_cred.string());
_lim->put("S1", tt);
tt = cred_prec.string(); tt.add(debt_precd.string());
_lim->put("S2", tt); _lim->put("S2", tt);
tt = acc_dec.string(); _lim->put("S3", acc_dec.string());
_lim->put("S3", tt); _lim->put("S4", res_cred.string());
// totale conguaglio su tutte le attivita' _lim->put("S5", res_debt.string());
_lim->put("S4", tot_cong.string());
_lim->put("B0","X"); _lim->put("B0","X");
if (_isfinal) if (_isfinal)
_lim->put("B1", "X"); _lim->put("B1", "X");
_lim->rewrite(); _lim->rewrite();
} }

View File

@ -579,24 +579,22 @@ void TLiquidazione_app::describe_liq(int month, const char* codatts,
_DescrItem* d = new _DescrItem(THE_END); _DescrItem* d = new _DescrItem(THE_END);
// gli diamo la stessa struttura di LIM // gli diamo la stessa struttura di LIM
d->_r0 = _lim->get_real("R0"); d->_r0 = _lim->get_real("R0");
d->_r1 = _lim->get_real("R1"); d->_r1 = _lim->get_real("R1");
d->_r2 = _lim->get_real("R2"); d->_r2 = _lim->get_real("R2");
d->_r3 = _lim->get_real("R3"); d->_r3 = _lim->get_real("R3");
d->_r4 = _lim->get_real("R4"); d->_r4 = _lim->get_real("R4");
d->_r5 = _lim->get_real("R5"); d->_r5 = _lim->get_real("R5");
d->_r6 = _lim->get_real("R6"); d->_r6 = _lim->get_real("R6");
d->_r7 = _lim->get_real("R7"); d->_r7 = _lim->get_real("R11");
d->_r8 = _lim->get_real("R8"); d->_r8 = _lim->get_real("R8");
d->_r9 = _lim->get_real("R9"); d->_r9 = _lim->get_real("R9");
d->_s0 = _lim->get("S0"); d->_r10 = _lim->get_real("R7"); // totale conguaglio prorata
d->_s1 = _lim->get("S1"); d->_s0 = _lim->get("S2");
d->_s2 = _lim->get("S2"); d->_s1 = _lim->get("S3");
d->_s3 = _lim->get("S3"); d->_s2 = _lim->get("S4");
d->_s3 = _lim->get("S5");
d->_r11 = (const char*)_lim->get("R10"); // tasso di interesse d->_r11 = (const char*)_lim->get("R10"); // tasso di interesse
real cong(_lim->get("S4")); // totale conguaglio prorata
d->_r10 = cong;
// aggiunge eventuale satellite per rimborso infraannuale // aggiunge eventuale satellite per rimborso infraannuale
if (di != NULL) d->_arr.add(di); if (di != NULL) d->_arr.add(di);
@ -969,15 +967,13 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
real& conguaglio = d._r10; real& conguaglio = d._r10;
TToken_string tt(d._s0); TToken_string tt(d._s0);
real iva_vend(tt.get(0)); real iva_vend(tt.get(0));
real iva_acq(tt.get(1)); real iva_acq(tt.get(1));
tt = d._s1; real cred_prec(tt.get(2));
real res_debt(tt.get(0)); real debt_prec(tt.get(3));
real res_cred(tt.get(1));
tt = d._s2; real acc_dec(d._s1);
real cred_prec(tt.get(0)); real res_cred(d._s2);
real debt_prec(tt.get(1)); real res_debt(d._s3);
real acc_dec(d._s3);
real rett_debt(0.0); real rett_debt(0.0);
real rett_cred(0.0); real rett_cred(0.0);
real& interesse = d._r11; real& interesse = d._r11;
@ -1034,8 +1030,10 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
} }
if (conguaglio.sign() < 0) if (conguaglio.sign() < 0)
{ {
set_row(rw++,"@11gConguaglio pro-rata@58g%r", &conguaglio); real cg = conguaglio;
cg = -cg;
set_row(rw++,"@11gConguaglio pro-rata@58g%r", &cg);
} }
set_row(rw++,"@11gRISULTATO@58g%r", &res_cred); set_row(rw++,"@11gRISULTATO@58g%r", &res_cred);
@ -1141,10 +1139,10 @@ bool TLiquidazione_app::set_annual(_DescrItem& d)
set_row(row++,"Volume d'affari riga B4@30g%r", &(d._r0)); set_row(row++,"Volume d'affari riga B4@30g%r", &(d._r0));
set_row(row++,"Indetraibilita' @40g%2.2r%%", &(d._r2)); set_row(row++,"Indetraibilita' @40g%2.2r%%", &(d._r2));
if (!(d._r3.is_zero())) if (!(d._r3.is_zero()))
{ {
const char* sss = d._r3.sign() < 0 ? "credito" : "debito";
real ccc = abs(d._r3); real ccc = abs(d._r3);
set_row(row++,"Conguaglio a %s@30g%r", d._r3.sign() < 0 ? "credito" : set_row(row++,"Conguaglio a %s@30g%r", sss, &ccc);
"debito", &ccc);
} }
set_print_zero(FALSE); set_print_zero(FALSE);
} }

View File

@ -117,7 +117,7 @@ bool TLiquidazione_app::extract_delega(int month)
if (look_lim(month)) if (look_lim(month))
{ {
real topay = result_liq(month); real topay = result_liq(month);
real intr = _lim->get_real("R7"); real intr = _lim->get_real("R11");
if (topay.sign() <= 0) if (topay.sign() <= 0)
return TRUE; return TRUE;