Scaccolati errori in visualizzazione liquidazione
Aggiunti versamenti effettuati in prospetto liquidazione git-svn-id: svn://10.65.10.50/trunk@857 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8e349d2dcc
commit
e3626153e1
@ -310,6 +310,8 @@ public:
|
||||
// ritorna l'appropriato credito di costo precedente al mese in corso
|
||||
// (travel agency only)
|
||||
real credito_costo_prec(int month, const char* codatt);
|
||||
// ritorna i versamenti effettuati nel mese passato
|
||||
real versamenti_IVA(int month, bool acconto = FALSE);
|
||||
|
||||
// supporto stampa
|
||||
void describe_firm(int month);
|
||||
|
@ -628,7 +628,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
// corrispettivi
|
||||
if (corrisp)
|
||||
{
|
||||
// l'ultimo casino
|
||||
// ennesimo casino: non tutti i corrispettivi sono
|
||||
// corrispettivi; in effetti, alcuni corrispettivi
|
||||
// non sono corrispettivi. Ci si potrebbe domandare
|
||||
// se gli altri corrispettivi sono corrispettivi o
|
||||
// no; ebbene, gli altri corrispettivi risultano
|
||||
// fortunatamente essere corrispettivi.
|
||||
if (tipodoc == "CR" || tipodoc == "RF" || tipodoc == "SC" ||
|
||||
tipodoc == "SN" || tipodoc == "CN")
|
||||
{
|
||||
@ -694,15 +699,15 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
_pim_r->put("I0",NETTO);
|
||||
}
|
||||
|
||||
if (autodafe)
|
||||
if (autodafe) // autofatture non residenti art, 17
|
||||
{
|
||||
/*
|
||||
* Si devono riportare a parte in annuale
|
||||
* e non comparire nel riepilogo del codice IVA
|
||||
* corrispondente, solo se la liq. e' annuale
|
||||
* Li metto in S0 di pim (imp|iva) e li sommo anche nelle
|
||||
* Li metto in R7/R8 di pim e li sommo anche nelle
|
||||
* vendite; la describe_pim() dovra' sommarli su tutti i
|
||||
* pim, scorporarli dalle vendite corrispondenti
|
||||
* pim, scorporarli dalle rispettive vendite
|
||||
* e assegnarli al codice IVA A35 in caso di liq. annuale
|
||||
*/
|
||||
adf += imponibile;
|
||||
|
@ -471,6 +471,18 @@ real TLiquidazione_app::credito_costo_prec(int month, const char* codatt)
|
||||
}
|
||||
|
||||
|
||||
real TLiquidazione_app::versamenti_IVA(int month, bool acconto)
|
||||
{
|
||||
real ret(0.0);
|
||||
int typ = acconto ? 7 : 1;
|
||||
|
||||
if (look_del(month,typ))
|
||||
if (_del->get_bool("B0")) // solo se stampata
|
||||
ret = _del->get_real("R0") + _del->get_real("R1");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
real TLiquidazione_app::aliquota_agvia()
|
||||
{
|
||||
TConfig cnf(CONFIG_STUDIO);
|
||||
|
@ -607,6 +607,9 @@ void TLiquidazione_app::describe_liq(int month, const char* codatts,
|
||||
// r11 = ulteriori detrazioni
|
||||
d->_r11 = _lim->get_real("R6");
|
||||
|
||||
// se ci sono stati versamenti IVA li riporta in _s2
|
||||
d->_s2 = versamenti_IVA(month).string();
|
||||
|
||||
// vedi se c'era un debito precedente e schiaffa in r10
|
||||
if (!is_first_month(month))
|
||||
{
|
||||
@ -630,8 +633,6 @@ void TLiquidazione_app::describe_liq(int month, const char* codatts,
|
||||
d->_r8 = _lia->get_real("R4");
|
||||
// r9 = conguaglio prorata
|
||||
d->_r9 = conguaglio;
|
||||
// TBI ci vogliono tutti i versamenti effettuati
|
||||
// presi dalle deleghe
|
||||
}
|
||||
|
||||
// aggiunge eventuale satellite per rimborso infraannuale
|
||||
@ -995,10 +996,13 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||
set_row(6,""); int rw = 7;
|
||||
set_row(rw++," @66gCredito@84gDebito"); set_row(rw++,"");
|
||||
set_row(rw++,"@11gIva sulle operazioni di vendita@75g%r", &(d._r0));
|
||||
set_row(rw++,"%s@11gRettifiche IVA a debito@75g%r", _is_visliq ? "$[r]" : "", &(d._r5));
|
||||
set_row(rw++,"%s@11gIva chiesta a rimborso@75g%r", _is_visliq ? "$[r]" : "", &(d._r4));
|
||||
set_row(rw++,"%s@11gRettifiche IVA a debito@75g%r",
|
||||
_is_visliq ? "$[r]" : "", &(d._r5));
|
||||
set_row(rw++,"%s@11gIva chiesta a rimborso@75g%r",
|
||||
_is_visliq ? "$[r]" : "", &(d._r4));
|
||||
real rd = d._r0 + d._r5 + d._r4;
|
||||
|
||||
real vers;
|
||||
|
||||
// conguaglio prorata
|
||||
if (d._r9.sign() < 0)
|
||||
{
|
||||
@ -1027,12 +1031,21 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||
if (!(d._r11.is_zero()))
|
||||
set_row(rw++,"@11gUlteriori detrazioni@58g%r", &(d._r11));
|
||||
|
||||
set_row(rw++,"%s@11gRettifiche IVA a credito@58g%r", _is_visliq ? "$[r]" : "", &(d._r6));
|
||||
set_row(rw++,"%s@11gRettifiche IVA a credito@58g%r",
|
||||
_is_visliq ? "$[r]" : "", &(d._r6));
|
||||
real rc = d._r1 + d._r7 + d._r8 + d._r6 -d._r11;
|
||||
|
||||
// conguaglio prorata
|
||||
if (d._r9.sign() < 0) rc -= d._r9;
|
||||
|
||||
// versamenti effettuati
|
||||
if (!d._s2.empty())
|
||||
{
|
||||
vers = real(d._s2);
|
||||
rc += vers;
|
||||
set_row(rw++,"@11gVersamenti effettuati@58g%r", &vers);
|
||||
}
|
||||
|
||||
set_row(rw++,"@11gRISULTATO@58g%r", &rc);
|
||||
|
||||
// TBI versamenti integrativi e non, e chissa' cos'altro
|
||||
@ -1049,7 +1062,7 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||
else
|
||||
{
|
||||
if (how == 'c')
|
||||
{
|
||||
{
|
||||
set_row(rw++,"@23gCREDITO ATTUALE@58g%r",&iva);
|
||||
}
|
||||
else
|
||||
@ -1057,27 +1070,35 @@ void TLiquidazione_app::set_grand(_DescrItem& d)
|
||||
if (d._f0)
|
||||
{
|
||||
// trimestrale: interesse
|
||||
set_row(rw++,"@23gIVA DOVUTA@75g%r",&iva);
|
||||
|
||||
real interesse = interesse_trimestrale(d._f2);
|
||||
real ivi = iva * interesse / CENTO; ivi.ceil(ROUND_LIRA);
|
||||
real ivt = iva + ivi;
|
||||
ivt.ceil(_isannual ? ROUND_MILLELIRE : ROUND_LIRA);
|
||||
set_row(rw++,"@23gInteresse %6.2r %%@75g%r",&interesse, &ivi);
|
||||
|
||||
if (!iva.is_zero())
|
||||
{
|
||||
set_row(rw++,"@23gIVA DOVUTA@75g%r",&iva);
|
||||
set_row(rw++,"@23gInteresse %6.2r %%@75g%r",&interesse, &ivi);
|
||||
|
||||
if (ivt.is_zero() || ivt >= IVA_DA_RIPORTARE || d._f1)
|
||||
set_row(rw++,"@23gIVA DA VERSARE@75g%r",&ivt);
|
||||
else
|
||||
set_row(rw++,"@23gIVA DA VERSARE@85g0 (%s < 50.000)",
|
||||
(const char*)ivt.string("."));
|
||||
if (ivt.is_zero() || ivt >= IVA_DA_RIPORTARE || d._f1)
|
||||
set_row(rw++,"@23gIVA DA VERSARE@75g%r",&ivt);
|
||||
else
|
||||
set_row(rw++,"@23gIVA DA VERSARE@85g0 (%s < 50.000)",
|
||||
(const char*)ivt.string("."));
|
||||
}
|
||||
else set_row(rw++,"");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (iva >= IVA_DA_RIPORTARE || d._f1)
|
||||
set_row(rw++,"@23gIVA DA VERSARE@75g%r",&iva);
|
||||
else
|
||||
set_row(rw++,"@23gIVA DA VERSARE@85g0 (%s < 50.000)",
|
||||
(const char*)iva.string("."));
|
||||
{
|
||||
if (!iva.is_zero())
|
||||
{
|
||||
if (iva >= IVA_DA_RIPORTARE || d._f1)
|
||||
set_row(rw++,"@23gIVA DA VERSARE@75g%r",&iva);
|
||||
else
|
||||
set_row(rw++,"@23gIVA DA VERSARE@85g0 (%s < 50.000)",
|
||||
(const char*)iva.string("."));
|
||||
}
|
||||
else set_row(rw++,"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -150,6 +150,8 @@ bool Visliq_app::set_ditta(TMask_field& f, KEY k)
|
||||
{
|
||||
long ditta = atol(f.get());
|
||||
|
||||
if (ditta <= 0) return k != K_ENTER;
|
||||
|
||||
if (!prefhndl->exist(ditta))
|
||||
{
|
||||
warning_box("Archivi ditta %l non presenti!", ditta);
|
||||
|
@ -45,7 +45,7 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
SPREADSHEET F_VISLIQ1 80 11
|
||||
SPREADSHEET F_VISLIQ1 0 11
|
||||
BEGIN
|
||||
PROMPT 1 7 "Liquidazione"
|
||||
ITEM "V@1F#109"
|
||||
@ -78,7 +78,7 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
SPREADSHEET F_VISLIQ2 80 11
|
||||
SPREADSHEET F_VISLIQ2 0 11
|
||||
BEGIN
|
||||
PROMPT 1 5 "Versamenti"
|
||||
ITEM "V@1F#109"
|
||||
|
@ -44,7 +44,7 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
SPREADSHEET F_VISLIQ1 80 5
|
||||
SPREADSHEET F_VISLIQ1 0 5
|
||||
BEGIN
|
||||
PROMPT 1 6 "Liquidazione"
|
||||
ITEM "V@1F#109"
|
||||
@ -56,7 +56,7 @@ BEGIN
|
||||
ITEM "D/C"
|
||||
END
|
||||
|
||||
SPREADSHEET F_VISLIQ2 80 5
|
||||
SPREADSHEET F_VISLIQ2 0 5
|
||||
BEGIN
|
||||
PROMPT 1 12 "Versamenti"
|
||||
ITEM "V@1F#109"
|
||||
|
Loading…
x
Reference in New Issue
Block a user