Nuove kakkole liquidazione corrette
git-svn-id: svn://10.65.10.50/trunk@1386 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5d70340ffa
commit
4aad0b7754
@ -231,7 +231,7 @@ bool TLiquidazione_app::user_create()
|
|||||||
TRectype from(_cur->curr()); from.zero();
|
TRectype from(_cur->curr()); from.zero();
|
||||||
TRectype to(from);
|
TRectype to(from);
|
||||||
TDate f(1, 1, atoi(_year));
|
TDate f(1, 1, atoi(_year));
|
||||||
TDate t(1, _month, atoi(_year));
|
TDate t(1, _month == 13 ? 12 : _month, atoi(_year));
|
||||||
t.set_end_month();
|
t.set_end_month();
|
||||||
from.put(MOV_DATAREG, f);
|
from.put(MOV_DATAREG, f);
|
||||||
to.put(MOV_DATAREG, t);
|
to.put(MOV_DATAREG, t);
|
||||||
@ -242,6 +242,7 @@ bool TLiquidazione_app::user_create()
|
|||||||
if (is_month_ok_strict(_month))
|
if (is_month_ok_strict(_month))
|
||||||
update_firm(_month);
|
update_firm(_month);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//modifica del 03/05/1995
|
//modifica del 03/05/1995
|
||||||
int need_refresh = FALSE;
|
int need_refresh = FALSE;
|
||||||
for (int m = 1; m < _month; m++)
|
for (int m = 1; m < _month; m++)
|
||||||
@ -355,7 +356,7 @@ bool TLiquidazione_app::set_print(int)
|
|||||||
TRectype from(_cur->curr()); from.zero();
|
TRectype from(_cur->curr()); from.zero();
|
||||||
TRectype to(from);
|
TRectype to(from);
|
||||||
TDate f(1, 1, atoi(_year));
|
TDate f(1, 1, atoi(_year));
|
||||||
TDate t(1, _month, atoi(_year));
|
TDate t(1, _month == 13 ? 12 : _month, atoi(_year));
|
||||||
t.set_end_month();
|
t.set_end_month();
|
||||||
from.put(MOV_DATAREG, f);
|
from.put(MOV_DATAREG, f);
|
||||||
to.put(MOV_DATAREG, t);
|
to.put(MOV_DATAREG, t);
|
||||||
@ -377,7 +378,7 @@ bool TLiquidazione_app::set_print(int)
|
|||||||
TRectype from(_cur->curr()); from.zero();
|
TRectype from(_cur->curr()); from.zero();
|
||||||
TRectype to(from);
|
TRectype to(from);
|
||||||
TDate f(1, _recalc == one ? _month : 1, atoi(_year));
|
TDate f(1, _recalc == one ? _month : 1, atoi(_year));
|
||||||
TDate t(1, _month, atoi(_year));
|
TDate t(1, _month == 13 ? 12 : _month, atoi(_year));
|
||||||
t.set_end_month();
|
t.set_end_month();
|
||||||
from.put(MOV_DATAREG, f);
|
from.put(MOV_DATAREG, f);
|
||||||
to.put(MOV_DATAREG, t);
|
to.put(MOV_DATAREG, t);
|
||||||
@ -399,7 +400,7 @@ bool TLiquidazione_app::set_print(int)
|
|||||||
TRectype from(_cur->curr()); from.zero();
|
TRectype from(_cur->curr()); from.zero();
|
||||||
TRectype to(from);
|
TRectype to(from);
|
||||||
TDate f(1, _recalc == one ? _month : 1, atoi(_year));
|
TDate f(1, _recalc == one ? _month : 1, atoi(_year));
|
||||||
TDate t(1, _month, atoi(_year));
|
TDate t(1, _month == 13 ? 12 : _month, atoi(_year));
|
||||||
t.set_end_month();
|
t.set_end_month();
|
||||||
from.put(MOV_DATAREG, f);
|
from.put(MOV_DATAREG, f);
|
||||||
to.put(MOV_DATAREG, t);
|
to.put(MOV_DATAREG, t);
|
||||||
|
@ -199,7 +199,6 @@ class TLiquidazione_app : public TPrint_application
|
|||||||
long _n_ditte; // numero ditte
|
long _n_ditte; // numero ditte
|
||||||
bool _comp_acconto; // stiamo calcolando l'acconto
|
bool _comp_acconto; // stiamo calcolando l'acconto
|
||||||
TArray _nomiditte; // array descr. ditte per sheet
|
TArray _nomiditte; // array descr. ditte per sheet
|
||||||
bool _proper_recalc; // vedi nel testo
|
|
||||||
|
|
||||||
TProgind* _prind;
|
TProgind* _prind;
|
||||||
int _row;
|
int _row;
|
||||||
@ -458,6 +457,12 @@ public:
|
|||||||
// liquidazione, ma ritorna TRUE per le trimestrali solo
|
// liquidazione, ma ritorna TRUE per le trimestrali solo
|
||||||
// se il mese cade ESATTAMENTE su un trimestre
|
// se il mese cade ESATTAMENTE su un trimestre
|
||||||
bool is_month_ok_strict(int x, int month = -1);
|
bool is_month_ok_strict(int x, int month = -1);
|
||||||
|
// questa e' la piu' semplice, per vedere se devo
|
||||||
|
// calcolare il mese fottendomene dell'annuale
|
||||||
|
bool is_month_plain(int x);
|
||||||
|
// questa serve per i progressivi: la data passata va bene
|
||||||
|
// se il movimento deve essere considerato in calcolo e riepilogo
|
||||||
|
// per la liquidazione di month
|
||||||
bool is_date_ok (TDate& d, int month);
|
bool is_date_ok (TDate& d, int month);
|
||||||
bool is_first_month (int m);
|
bool is_first_month (int m);
|
||||||
int liq_month(int x);
|
int liq_month(int x);
|
||||||
|
@ -64,37 +64,37 @@ END
|
|||||||
|
|
||||||
NUMBER CG43_FLD_ANNO 4
|
NUMBER CG43_FLD_ANNO 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 31 7 "Anno "
|
PROMPT 32 7 "Anno "
|
||||||
HELP "Anno per cui effettuare il calcolo"
|
HELP "Anno per cui effettuare il calcolo"
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST CG43_LST_MESE 13
|
LIST CG43_LST_MESE 14
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 7 "Periodo "
|
PROMPT 4 7 "Periodo "
|
||||||
HELP "Mese per cui effettuare il calcolo liquidazione"
|
HELP "Mese per cui effettuare il calcolo liquidazione"
|
||||||
ITEM "13|Annuale"
|
ITEM "13|13a liquid."
|
||||||
FLAGS "AM"
|
FLAGS "AM"
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST CG43_LST_TRIM 13
|
LIST CG43_LST_TRIM 14
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 7 "Periodo "
|
PROMPT 4 7 "Periodo "
|
||||||
HELP "Trimestre di cui effettuare il calcolo liquidazione"
|
HELP "Trimestre di cui effettuare il calcolo liquidazione"
|
||||||
ITEM "3|1 Trimestre "
|
ITEM "3|1 Trimestre "
|
||||||
ITEM "6|2 Trimestre "
|
ITEM "6|2 Trimestre "
|
||||||
ITEM "9|3 Trimestre "
|
ITEM "9|3 Trimestre "
|
||||||
ITEM "12|4 Tr./Annuale"
|
ITEM "12|4 Trimestre"
|
||||||
ITEM "13|Controllo 13a"
|
ITEM "13|13a liquid."
|
||||||
END
|
END
|
||||||
|
|
||||||
LIST CG43_LST_CALC 13
|
LIST CG43_LST_CALC 14
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 4 8 "Ricalcola "
|
PROMPT 4 8 "Ricalcola "
|
||||||
HELP "Indicare se rifare il calcolo durante la stampa"
|
HELP "Indicare se rifare il calcolo durante la stampa"
|
||||||
// ITEM "1|Se necessario"
|
// ITEM "1|Se necessario"
|
||||||
ITEM "2|Mese corrente"
|
ITEM "2|Mese/trimestre"
|
||||||
ITEM "3|Tutti i mesi"
|
ITEM "3|Da inizio anno"
|
||||||
// ITEM "4|Non calcolare"
|
// ITEM "4|Non calcolare"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -64,12 +64,17 @@ bool TLiquidazione_app::recalc_all()
|
|||||||
_nditte->read();
|
_nditte->read();
|
||||||
|
|
||||||
// decidi per stocazzo di annuale
|
// decidi per stocazzo di annuale
|
||||||
|
// ***************** Previous kasin ***************************
|
||||||
// per QUALSIASI annuale il mese diventa 13
|
// per QUALSIASI annuale il mese diventa 13
|
||||||
_isannual = (_month == 12 && !mens && !_isbenzinaro) ||
|
// _isannual = (_month == 12 && !mens && !_isbenzinaro) ||
|
||||||
(_month == 13 && (mens || _isbenzinaro));
|
// (_month == 13 && (mens || _isbenzinaro));
|
||||||
_isriepilogo = _month == 13 && !mens;
|
// _isriepilogo = _month == 13 && !mens;
|
||||||
if (_isannual) _month = 13; // che ti piaccia o no
|
// if (_isannual) _month = 13; // che ti piaccia o no
|
||||||
|
// ************************************************************
|
||||||
|
|
||||||
|
// strasemplificato: per l'annuale si sceglie annuale, altrimenti
|
||||||
|
// e' la 12ma anche per le trimestrali.
|
||||||
|
_isannual = _isriepilogo = _month == 13;
|
||||||
|
|
||||||
TApplication::set_firm(nomeditta.get_long(1));
|
TApplication::set_firm(nomeditta.get_long(1));
|
||||||
_prind->addstatus(1);
|
_prind->addstatus(1);
|
||||||
@ -103,15 +108,9 @@ bool TLiquidazione_app::recalc_all()
|
|||||||
|
|
||||||
|
|
||||||
for (int m = 1; m <= _month; m++) // fino a 13 compreso
|
for (int m = 1; m <= _month; m++) // fino a 13 compreso
|
||||||
if (is_month_ok(m, _month) || _recalc == ever)
|
if (is_month_plain(m) || _recalc == ever)
|
||||||
{
|
{
|
||||||
if (_prind->iscancelled()) break;
|
if (_prind->iscancelled()) break;
|
||||||
|
|
||||||
// questo serve ad evitare che il ricalcolo mesi precedenti
|
|
||||||
// per l'annuale segua le stesse regole del ricalcolo annuale
|
|
||||||
// propriamente inteso
|
|
||||||
_proper_recalc = m == 13;
|
|
||||||
|
|
||||||
update_firm(m);
|
update_firm(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,6 +179,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
TString16 codatt = _nditte->curr(LF_ATTIV).get("CODATT");
|
TString16 codatt = _nditte->curr(LF_ATTIV).get("CODATT");
|
||||||
TString80 desatt = _nditte->curr(LF_ATTIV).get("DESCR");
|
TString80 desatt = _nditte->curr(LF_ATTIV).get("DESCR");
|
||||||
quater = _nditte->curr().get_bool("FLIVA11Q");
|
quater = _nditte->curr().get_bool("FLIVA11Q");
|
||||||
|
|
||||||
// attivita' mista: ce ne sono in realta' due
|
// attivita' mista: ce ne sono in realta' due
|
||||||
// viene calcolato nel ciclo su tipoatt (che viene ripetuto solo
|
// viene calcolato nel ciclo su tipoatt (che viene ripetuto solo
|
||||||
// se diventa TRUE);
|
// se diventa TRUE);
|
||||||
@ -190,6 +190,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
month,
|
month,
|
||||||
(const char*)_nditte_r->get("RAGSOC"),
|
(const char*)_nditte_r->get("RAGSOC"),
|
||||||
(const char*)desatt);
|
(const char*)desatt);
|
||||||
|
|
||||||
if (_prind) _prind->set_text(buf);
|
if (_prind) _prind->set_text(buf);
|
||||||
|
|
||||||
// se ricalcola l'annuale si tiene tutte le vendite e corrispettivi di
|
// se ricalcola l'annuale si tiene tutte le vendite e corrispettivi di
|
||||||
@ -233,7 +234,13 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
|
|||||||
_pla->put("R2","");
|
_pla->put("R2","");
|
||||||
_pla->put("R3","");
|
_pla->put("R3","");
|
||||||
_pla->put("R4","");
|
_pla->put("R4","");
|
||||||
_pla->put("S1","0|0");
|
_pla->put("R13","");
|
||||||
|
_pla->put("R9","");
|
||||||
|
_pla->put("R10","");
|
||||||
|
_pla->put("R11","");
|
||||||
|
_pla->put("R12","");
|
||||||
|
_pla->put("R14","");
|
||||||
|
_pla->put("S1","0");
|
||||||
_pla->put("S2","0");
|
_pla->put("S2","0");
|
||||||
_pla->put("S3","0");
|
_pla->put("S3","0");
|
||||||
_pla->rewrite();
|
_pla->rewrite();
|
||||||
@ -454,7 +461,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
real bdog_imp = 0.0;
|
real bdog_imp = 0.0;
|
||||||
real bdog_iva = 0.0;
|
real bdog_iva = 0.0;
|
||||||
|
|
||||||
|
|
||||||
*_cur = 0;
|
*_cur = 0;
|
||||||
long items = _cur->items();
|
long items = _cur->items();
|
||||||
TString trueatt(codatt);
|
TString trueatt(codatt);
|
||||||
@ -531,12 +537,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
// autofatture art. 17 per non residenti, con trattamento
|
// autofatture art. 17 per non residenti, con trattamento
|
||||||
// speciale in liquidazione annuale
|
// speciale in liquidazione annuale
|
||||||
bool autodafe = (tipodoc == "AF" && tipocr == 4);
|
bool autodafe = (tipodoc == "AF" && tipocr == 4);
|
||||||
// validi per calcolo volume di affari settano
|
|
||||||
// flag che va in B2 di pim
|
|
||||||
bool isvolaff = (tipomov == vendita && tipocr != 4 &&
|
|
||||||
tipoiva != "NS" && tipoiva != "ES" &&
|
|
||||||
!(tipoiva == "ES" &&
|
|
||||||
(riga11_v == "B3" || riga11_v.empty())));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* puo' capitare per motivi brutalmente prassici
|
* puo' capitare per motivi brutalmente prassici
|
||||||
@ -556,7 +556,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
* In liq. annuale si totalizzano
|
* In liq. annuale si totalizzano
|
||||||
* solo le stranezze che seguono
|
* solo le stranezze che seguono
|
||||||
*/
|
*/
|
||||||
if (_month == 13 && _proper_recalc)
|
if (month == 13)
|
||||||
{
|
{
|
||||||
// si contano soltanto le vendite.
|
// si contano soltanto le vendite.
|
||||||
bool okc = tipomov == vendita;
|
bool okc = tipomov == vendita;
|
||||||
@ -591,7 +591,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
vssp_imp += vsimp_imp;
|
vssp_imp += vsimp_imp;
|
||||||
vssp_iva += vsimp_iva;
|
vssp_iva += vsimp_iva;
|
||||||
}
|
}
|
||||||
else if (fattrit && _month != 13)
|
else if (fattrit && month != 13)
|
||||||
{
|
{
|
||||||
rit_imp = imponibile;
|
rit_imp = imponibile;
|
||||||
rit_iva = imposta;
|
rit_iva = imposta;
|
||||||
@ -820,13 +820,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
* Calcolo e aggiornamento
|
* Calcolo e aggiornamento
|
||||||
* cerca o crea progressivo IVA
|
* cerca o crea progressivo IVA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
look_pim(month, codatt, reg, tipocr_s, codiva, tipodet, TRUE);
|
look_pim(month, codatt, reg, tipocr_s, codiva, tipodet, TRUE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* se ign == TRUE non bisogna neppure PROGRESSIVARLI
|
* se ign == TRUE non bisogna neppure PROGRESSIVARLI
|
||||||
*/
|
*/
|
||||||
bool ign = sosp_imp || (fattrit && _month != 13);
|
bool ign = sosp_imp || (fattrit && month != 13);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* se liq == FALSE gli importi non contano ai fini
|
* se liq == FALSE gli importi non contano ai fini
|
||||||
@ -1000,8 +999,6 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
|||||||
fcv += imposta;
|
fcv += imposta;
|
||||||
}
|
}
|
||||||
|
|
||||||
_pim_r->put("B2",isvolaff);
|
|
||||||
|
|
||||||
if (!ign)
|
if (!ign)
|
||||||
{
|
{
|
||||||
_pim_r->put("R0",imp);
|
_pim_r->put("R0",imp);
|
||||||
@ -1404,12 +1401,12 @@ void TLiquidazione_app::write_liq(int month, const char* codatts)
|
|||||||
real csamm = _pla->get_real("R4");
|
real csamm = _pla->get_real("R4");
|
||||||
|
|
||||||
// calcola nuovo prorata per ogni attivita' (miste: 1+2)
|
// calcola nuovo prorata per ogni attivita' (miste: 1+2)
|
||||||
real ris = vol_aff_t + csamm + es_b3;
|
real ris = vol_aff_t - csamm - es_b3;
|
||||||
real prorata(0.0);
|
real prorata(0.0);
|
||||||
if (!ris.is_zero())
|
if (!ris.is_zero())
|
||||||
prorata = (es_b1/ris) * CENTO;
|
prorata = (es_b1/ris) * CENTO;
|
||||||
real conguaglio = 0.0;
|
real conguaglio = 0.0;
|
||||||
prorata.round(-2);
|
prorata.round(ROUND_LIRA);
|
||||||
if (prorata != _prorata)
|
if (prorata != _prorata)
|
||||||
{
|
{
|
||||||
// calcolo conguaglio -- se positivo e' a debito
|
// calcolo conguaglio -- se positivo e' a debito
|
||||||
@ -1565,30 +1562,36 @@ void TLiquidazione_app::recalc_annual(const char* att)
|
|||||||
pro_pag = _pla->get_real("R12");
|
pro_pag = _pla->get_real("R12");
|
||||||
iva_acq = _pla->get_real("R11");
|
iva_acq = _pla->get_real("R11");
|
||||||
|
|
||||||
// 1) Calcola volume di affari dai PIM, controllando il
|
for (_pim->first(); !_pim->eof(); _pim->next())
|
||||||
// flag B2 settato da update_att per i progressivi che
|
|
||||||
// entrano nel calcolo
|
|
||||||
|
|
||||||
for (_pim->first(); !_pim->eof(); _pim->next())
|
|
||||||
{
|
{
|
||||||
if (_year != (const char*)_pim_anno || aaa != (const char*)_pim_codatt)
|
if (_year != *_pim_anno) continue;
|
||||||
continue;
|
|
||||||
if (_pim->get_bool("B2"))
|
int tipocr = atoi(*_pim_tipocr);
|
||||||
{
|
TString16 codiva = *_pim_codiva;
|
||||||
if (tipoatt == 1) volaff1 += _pim->get_real("R0");
|
TString16 reg = *_pim_codreg;
|
||||||
else volaff2 += _pim->get_real("R0");
|
look_iva(codiva); look_reg(reg);
|
||||||
}
|
|
||||||
|
if ( // ESCLUSI:
|
||||||
|
(int)_reg->get_long("I0") != vendita || // non vendite
|
||||||
|
tipocr == 4 || // cessioni beni ammortizzabili
|
||||||
|
_iva->get("S1") == "NS" || // non soggetti
|
||||||
|
_iva->get("S0") == "B3" || // bi tre
|
||||||
|
_reg->get_bool("B1")) // sospensione di imposta
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (tipoatt == 1) volaff1 += _pim->get_real("R0");
|
||||||
|
else volaff2 += _pim->get_real("R0");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2) calcola esenti, cessioni, lordo vendite, prorata pagato
|
// calcola esenti, cessioni, lordo vendite, prorata pagato
|
||||||
// e IVA acquisti dai plm/ptm
|
// e IVA acquisti dai plm/ptm/pum/pam/pom
|
||||||
|
|
||||||
for (int i = 1; i <= 13; i++)
|
for (int i = 1; i <= 13; i++)
|
||||||
{
|
{
|
||||||
if (!look_plm(i,aaa))
|
if (!look_plm(i,aaa))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ven_lrd += _pam->get_real("R1");
|
vendite += _pam->get_real("R1");
|
||||||
iva_acq += _plm->get_real("R1");
|
iva_acq += _plm->get_real("R1");
|
||||||
es_b1 += _pum->get_real("R4");
|
es_b1 += _pum->get_real("R4");
|
||||||
es_b2 += _pum->get_real("R5");
|
es_b2 += _pum->get_real("R5");
|
||||||
@ -1597,7 +1600,7 @@ void TLiquidazione_app::recalc_annual(const char* att)
|
|||||||
pro_pag += _plm->get_real("R2");
|
pro_pag += _plm->get_real("R2");
|
||||||
}
|
}
|
||||||
|
|
||||||
_pla->put("R0", ven_lrd);
|
_pla->put("R0", vendite);
|
||||||
_pla->put("R1", es_b1);
|
_pla->put("R1", es_b1);
|
||||||
_pla->put("R2", es_b2);
|
_pla->put("R2", es_b2);
|
||||||
_pla->put("R3", es_b3);
|
_pla->put("R3", es_b3);
|
||||||
|
@ -24,6 +24,21 @@ bool TLiquidazione_app::is_month_ok_strict(int x, int month)
|
|||||||
( x <= month && is_trim(x));
|
( x <= month && is_trim(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TLiquidazione_app::is_month_plain(int x)
|
||||||
|
// la piu' semplice: vero se mese == _month o se fa parte del
|
||||||
|
// trimestre indicato da month
|
||||||
|
{
|
||||||
|
bool ok = x == _month;
|
||||||
|
if (!ok && _freqviva == "T")
|
||||||
|
{
|
||||||
|
// aggiusta al trimestre il mese da calcolare
|
||||||
|
int mto = _month;
|
||||||
|
mto += 2 - ((mto-1) % 3);
|
||||||
|
ok = x > (mto - 3) && x <= mto;
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
bool TLiquidazione_app::is_month_ok(int x, int mtocalc)
|
bool TLiquidazione_app::is_month_ok(int x, int mtocalc)
|
||||||
// TRUE se il mese passato e' compatibile con il mese da calcolare
|
// TRUE se il mese passato e' compatibile con il mese da calcolare
|
||||||
// rispetto al regime di liquidazione scelto
|
// rispetto al regime di liquidazione scelto
|
||||||
|
@ -347,6 +347,8 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
|||||||
// cumulando per tutte le attivita' nominatele
|
// cumulando per tutte le attivita' nominatele
|
||||||
// ogni riga riguarda un codiva ma tutti i registri
|
// ogni riga riguarda un codiva ma tutti i registri
|
||||||
// se il mese e' 13 si guarda tutto l'anno
|
// se il mese e' 13 si guarda tutto l'anno
|
||||||
|
// se si tratta di una sola attivita' in att. mista evidenziata o servizievole,
|
||||||
|
// stampa solo vendite e corrispettivi
|
||||||
{
|
{
|
||||||
TToken_string atts(codatt);
|
TToken_string atts(codatt);
|
||||||
TString ref(atts.items() == 1 ? codatt : "ALL");
|
TString ref(atts.items() == 1 ? codatt : "ALL");
|
||||||
@ -356,6 +358,8 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
|||||||
real t0, t1, t2, t3, t4, t5;
|
real t0, t1, t2, t3, t4, t5;
|
||||||
real autodafe, autodafe_iva;
|
real autodafe, autodafe_iva;
|
||||||
|
|
||||||
|
bool skip_acq = atts.items() == 1 && _mixed;
|
||||||
|
|
||||||
// descrittore riga autodafe'
|
// descrittore riga autodafe'
|
||||||
_DescrItem* ads = NULL;
|
_DescrItem* ads = NULL;
|
||||||
|
|
||||||
@ -390,13 +394,17 @@ void TLiquidazione_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 e' il dettaglio di una attivita' mista non stampa
|
||||||
|
// gli acquisti, il perche' losalamadonna
|
||||||
|
if (tipomov == acquisto && skip_acq) continue;
|
||||||
|
|
||||||
// questi non vanno in liquidazione, i totali sono
|
// questi non vanno in liquidazione, i totali sono
|
||||||
// gia' calcolati altrove
|
// gia' calcolati altrove
|
||||||
if (tipodet == 1 || tipodet == 3 || tipodet == 9)
|
if (tipodet == 1 || tipodet == 3 || tipodet == 9)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// se ha tutti gli importi nulli viene da un annullamento di
|
// se ha tutti gli importi nulli viene da un annullamento di
|
||||||
// movimenti esistenti
|
// progressivi esistenti
|
||||||
if (_pim->get_real("R0").is_zero() &&
|
if (_pim->get_real("R0").is_zero() &&
|
||||||
_pim->get_real("R1").is_zero() &&
|
_pim->get_real("R1").is_zero() &&
|
||||||
_pim->get_real("R2").is_zero())
|
_pim->get_real("R2").is_zero())
|
||||||
@ -420,8 +428,8 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
|||||||
_DescrItem* dd = new _DescrItem(PIM_ROW);
|
_DescrItem* dd = new _DescrItem(PIM_ROW);
|
||||||
// CicciaPrassi li vuole in ordine crescente
|
// CicciaPrassi li vuole in ordine crescente
|
||||||
_descr_arr.insert(dd,i);
|
_descr_arr.insert(dd,i);
|
||||||
// che Cazzo di due Marroni: se quello dopo
|
// che due maron stereofonic: se quello dopo
|
||||||
// era il primo, quello prima e' dopo
|
// era il primo, quello prima va dopo
|
||||||
if (d->_f0)
|
if (d->_f0)
|
||||||
{
|
{
|
||||||
dd->_f0 = TRUE;
|
dd->_f0 = TRUE;
|
||||||
@ -476,9 +484,9 @@ void TLiquidazione_app::describe_pims(int month, const char* codatt)
|
|||||||
d->_r3 += (cvv /* - vfs */);
|
d->_r3 += (cvv /* - vfs */);
|
||||||
d->_r0 += ifs; // aggiungo FS alle vendite
|
d->_r0 += ifs; // aggiungo FS alle vendite
|
||||||
d->_r1 += vfs;
|
d->_r1 += vfs;
|
||||||
t0 += (cvi /* - ifs */); // idem per i totali (era t2/t3: sk MI0452)
|
t2 += (cvi /* - ifs */); // idem per i totali
|
||||||
t1 += (cvv /* - vfs */); // non sono molto convinto ma vogliono cio'
|
t3 += (cvv /* - vfs */); // non sono molto convinto ma vogliono cio'
|
||||||
t0 += ifs;
|
t0 += ifs; // ...avevo ragione e infatti l'ho cambiato
|
||||||
t1 += vfs;
|
t1 += vfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1021,18 +1029,24 @@ void TLiquidazione_app::set_plm(_DescrItem& d)
|
|||||||
&acq_pint_iva);
|
&acq_pint_iva);
|
||||||
}
|
}
|
||||||
|
|
||||||
real iva74ter(d._s2);
|
// real iva74ter(d._s2);
|
||||||
if (!iva74ter.is_zero())
|
// if (!iva74ter.is_zero())
|
||||||
{
|
// {
|
||||||
set_row(rw++, "Iva dovuta - 74ter@41g%r", &iva74ter);
|
// set_row(rw++, "Iva dovuta - 74ter@41g%r", &iva74ter);
|
||||||
d._r1 += iva74ter;
|
// d._r1 += iva74ter;
|
||||||
}
|
// }
|
||||||
|
|
||||||
real tot1 = d._r7 + d._r4 + d._r9 + acq_pint;
|
real tot1 = d._r7 + d._r4 + d._r9 + acq_pint;
|
||||||
real tot2 = d._r8 + d._r5 + d._r10 + acq_pint_iva;
|
real tot2 = d._r8 + d._r5 + d._r10 + acq_pint_iva;
|
||||||
|
|
||||||
if (tot1 != d._r4 || tot2 != d._r5)
|
if (tot1 != d._r4 || tot2 != d._r5)
|
||||||
{
|
{
|
||||||
|
// i corrispettivi finiscono nelle vendite
|
||||||
|
d._r0 += d._r2;
|
||||||
|
d._r1 += d._r3;
|
||||||
|
d._r2 = ZERO;
|
||||||
|
d._r3 = ZERO;
|
||||||
|
// per ora lascio r2 e r3 anche se sono sempre 0
|
||||||
set_row(rw++, "");
|
set_row(rw++, "");
|
||||||
set_row(rw++,"Totale Generale IVA@25g%r@41g%r@58g%r@74g%r@91g%r@107g%r",
|
set_row(rw++,"Totale Generale IVA@25g%r@41g%r@58g%r@74g%r@91g%r@107g%r",
|
||||||
&(d._r0),
|
&(d._r0),
|
||||||
@ -1133,9 +1147,10 @@ void TLiquidazione_app::set_pumpam(_DescrItem& d)
|
|||||||
if (d._f0)
|
if (d._f0)
|
||||||
{
|
{
|
||||||
printed = TRUE;
|
printed = TRUE;
|
||||||
|
real prc(dp.get(0));
|
||||||
|
|
||||||
set_row(row++, "%% PRO-RATA ed IVA non detraibile (%s%%)@69g%r",
|
set_row(row++, "%% PRO-RATA ed IVA non detraibile (%s%%)@69g%r",
|
||||||
(const char*)(dp.get(0)),
|
(const char*)prc.string(), &(d._r11));
|
||||||
&(d._r11));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// items vari per dichiarazione annuale
|
// items vari per dichiarazione annuale
|
||||||
@ -1394,7 +1409,7 @@ bool TLiquidazione_app::set_annual(_DescrItem& d)
|
|||||||
set_row(row++,"Operazioni esenti riga B2@30g%r", &(d._r4));
|
set_row(row++,"Operazioni esenti riga B2@30g%r", &(d._r4));
|
||||||
set_row(row++,"Operazioni esenti riga B3@30g%r", &(d._r5));
|
set_row(row++,"Operazioni esenti riga B3@30g%r", &(d._r5));
|
||||||
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%r%%", &(d._r2));
|
||||||
if (!(d._r3.is_zero()))
|
if (!(d._r3.is_zero()))
|
||||||
{
|
{
|
||||||
const char* sss = d._r3.sign() < 0 ? "credito" : "debito";
|
const char* sss = d._r3.sign() < 0 ? "credito" : "debito";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user