Modificati programmi iva

git-svn-id: svn://10.65.10.50/trunk@1782 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1995-09-06 12:15:41 +00:00
parent 3f2dcd785c
commit 73af6258b3
7 changed files with 4748 additions and 4717 deletions

View File

@ -24,6 +24,10 @@ int main(int argc,char** argv)
cg4500(argc,argv); break;
case 5:
cg4600(argc,argv); break;
case 6:
cg4700(argc,argv); break;
case 7:
cg4800(argc,argv); break;
default:
error_box(usage, argv[0]);
}

View File

@ -11,6 +11,8 @@ int cg4300(int argc, char* argv[]);
int cg4400(int argc, char* argv[]);
int cg4500(int argc, char* argv[]);
int cg4600(int argc, char* argv[]);
int cg4700(int argc, char* argv[]);
int cg4800(int argc, char* argv[]);
#ifdef __MAIN__
#define extern

View File

@ -44,10 +44,16 @@ MENUBAR MENU_BAR(5)
MENU MENU_BAR(5)
SUBMENU MENU_FILE "~File"
/* cg4 -6 Visualizzazione liquidazione */
/* cg4 -6 Gestione acconti */
MENUBAR MENU_BAR(6)
MENU MENU_BAR(6)
SUBMENU MENU_FILE "~File"
/* cg4 -7 Creazione versam. acconti dicembre */
MENUBAR MENU_BAR(7)
MENU MENU_BAR(7)
SUBMENU MENU_FILE "~File"

View File

@ -482,7 +482,7 @@ bool TLiquidazione_app::look_del(int month, int type, bool create)
if (abi.empty())
{
abi = anag.get("CODABI");
abi = anag.get("CODCAB");
cab = anag.get("CODCAB");
}
_del->put("S7", abi);

View File

@ -1819,14 +1819,14 @@ void TLiquidazione_app::set_viaggio(_DescrItem& d)
void TLiquidazione_app::set_acconto_p(_DescrItem& d)
{
set_print_zero(TRUE);
//set_print_zero(TRUE);
const char* errmsg[3] = {
{"manca la tabella risultati liquidazione per l'anno corrente"},
{"manca la tabella risultati liquidazione per l'anno precedente"},
{"manca la tabella dichiarazione annuale per l'anno precedente"}};
set_row(1,"%t@8g%t",&(d._s0), &(d._s1));
set_row(1,"%t@7g%t",&(d._s0), &(d._s1));
if (d._f2)
set_row(1,"@50g@b*** %s ***@r", errmsg[d._f2 -1]);
else
@ -1835,6 +1835,7 @@ else
{
if (d._f1) // stampa base di calcolo
{
/***
real bc = d._r0;
if (bc.sign() < 0)
{
@ -1845,21 +1846,21 @@ else
else
set_row(1,"@55g%r@86g%r@119g%s", &bc, &(d._r1),
d._f3 ? "Si" : "No");
***/
set_row(1,"@58g%r@74g%r@96g%r@122g%s", &(d._r3),
&(d._r2), &(d._r1), d._f3 ? "Si" : "No");
}
else
{
set_row(1,"@51g%r@75g%s", &(d._r1), d._f3 ? "Si" : "No");
}
else set_row(1,"@62g%r@91g%s", &(d._r1), d._f3 ? "Si" : "No");
}
else
{
if (d._f1) // stampa base di calcolo
set_row(1,"@57g%r@85g%r", &(d._r0), &(d._r1));
set_row(1,"@58g%r@88g%r", &(d._r0), &(d._r1));
else
set_row(1,"@85g%r",&(d._r1));
set_row(1,"@87g%r",&(d._r1));
}
}
set_print_zero(FALSE);
//set_print_zero(FALSE);
}
void TLiquidazione_app::set_acchead_p(_DescrItem& d)
@ -1870,33 +1871,34 @@ void TLiquidazione_app::set_acchead_p(_DescrItem& d)
if (d._f0) // base anno in corso
{
set_header(2,"@40gCALCOLO ACCONTI IVA DICEMBRE "
"1994 (base anno in corso)");
set_header(2,"@40gCALCOLO ACCONTI IVA DICEMBRE %s "
"(base anno in corso)", (const char*) _year);
if (d._f1) // stampa base calcolo
{
set_header(4,"@51g------- Base di calcolo -------");
set_header(5,"@1gDitta@8gDenominazione@55gDebito@73gCredito"
"@86gACCONTO calcolato@109gLiq. differita");
set_header(4,"@58g------- Base di calcolo -------");
set_header(5,"Ditta@7gDenominazione@62gDebito@78gCredito"
"@94gACCONTO calcolato@115gLiq. differita");
set_header(6,sep);
set_header(7,"");
}
else
{
set_header(4,"@1gDitta@8gDenominazione@51gACCONTO calcolato"
"@75gLiq. differita");
set_header(4,"Ditta@7gDenominazione@60gACCONTO calcolato"
"@84gLiq. differita");
set_header(5,sep);
set_header(6,"");
}
}
else
{
set_header(2,"@40gCALCOLO ACCONTI IVA DICEMBRE %s", (const char*) _year);
set_header(5,sep);
set_header(6,"");
if (d._f1)
set_header(4,"@1gDitta@8gDenominazione@57gBase di calcolo"
"@85gACCONTO calcolato");
set_header(4,"Ditta@7gDenominazione@58gBase di calcolo"
"@86gACCONTO calcolato");
else
set_header(4,"@1gDitta@8gDenominazione@85gACCONTO calcolato");
set_header(4,"Ditta@7gDenominazione@85gACCONTO calcolato");
}
}

View File

@ -217,8 +217,10 @@ bool TLiquidazione_app::set_acconto(real& inf, real& ina)
_isbase = m.get_bool(CHK_CGC_BASE);
_basecalc = (tbc)m.get_long(RDB_CGC_BASE);
inf = real(m.get(FLD_CGC_INF));
ina = real(m.get(FLD_CGC_INA));
//inf = real(m.get(FLD_CGC_INF));
//ina = real(m.get(FLD_CGC_INA));
inf = ina = ZERO;
switch (k)
{
@ -293,7 +295,7 @@ bool TLiquidazione_app::recalc_acconti(real& inf, real& ina)
bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
{
real bc, acc;
real bc, acc, cre, deb;
bool isdifferita = FALSE;
bool error = FALSE;
@ -363,9 +365,19 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
// basecalcolo: 10, 11, 12 anno prec., 10 e 11 se a debito, 12 vedi acconto;
// sommare e prendi 88% se a debito
if (!look_lim(10)) error = 2;
else bc += _lim->get_real("R0");
else
{
real app = _lim->get_real("R0");
if (app.sign() > 0) //a debito
bc += app;
}
if (!look_lim(11)) error = 2;
else bc += _lim->get_real("R0");
else
{
real app = _lim->get_real("R0");
if (app.sign() > 0) //a debito
bc += app;
}
if (!look_lim(12)) error = 2;
else
{
@ -376,7 +388,7 @@ bool TLiquidazione_app::recalc_acconto(real& inf, real& ina)
break;
}
if (bc.sign() > 0)
if (bc.sign() > 0) //debito
{
acc = bc * ACCONTO_DICEMBRE;
acc.round(ROUND_LIRA);
@ -399,7 +411,9 @@ else if (_basecalc == incorso)
// TBC trimestrali, differite
bc = result_liq(12);
// somma i non fatturati/non annotati
bc += inf + ina;
//bc += inf + ina;
cre = _lim->get_real("R12");
deb = _lim->get_real("R13");
if (bc.sign() > 0) acc = bc;
}
else error = 1;
@ -412,14 +426,15 @@ else if (_basecalc == incorso)
// sbatti l'acconto in LIA
if (look_lia())
{
_lia->put("R4",acc);
isdifferita = _lia->get_bool("B1");
if (isdifferita && _basecalc == incorso) acc *= real(double(2/3));
_lia->put("R4",acc);
_lia->rewrite();
}
bool wasdel = look_del(12,7);
if (acc.sign() > 0 && acc > ACCONTO_MINIMO_DA_VERSARE)
if (acc.sign() > 0 && acc >= ACCONTO_MINIMO_DA_VERSARE)
{
// crea o aggiorna delega
// TBC everything
@ -441,6 +456,8 @@ else if (wasdel)
_DescrItem* d = new _DescrItem(ACCONTO);
d->_r0 = bc;
d->_r1 = acc;
d->_r2 = cre;
d->_r3 = deb;
d->_f0 = _basecalc == incorso;
d->_f1 = _isbase;
d->_f2 = error;