Patch level : 12.0 290
Files correlati : Commento : Patch 290Patch level : 10.0 290 Files correlati : Commento : Corretta liquidazione per quanto riguarda l'IVA differita, In particolare la ripartizione fra imponibile e imposta nei pagamenti git-svn-id: svn://10.65.10.50/branches/R_10_00@23388 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
47c63259e6
commit
d1ef71d7d8
@ -1123,10 +1123,12 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
TPartite_array arrpart; // Partite interessate
|
||||
TPointer_array pagscatt; // Righe di pagsca interessate
|
||||
|
||||
#ifdef DBG
|
||||
const long nr = _mov->get_long(MOV_NUMREG);
|
||||
|
||||
if (nr == 23121 || nr == 23112)
|
||||
int i = 1 ;
|
||||
#endif
|
||||
|
||||
if (bIsMovDiff && tm == tm_fattura)
|
||||
{
|
||||
@ -1335,16 +1337,15 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
real nin_iva = ZERO; // imposta non incassati
|
||||
|
||||
const TString4 codiva = _rmoviva->get(RMI_CODIVA);
|
||||
if (!look_iva(codiva))
|
||||
TCodiceIVA civa(codiva);
|
||||
|
||||
if (!civa.ok())
|
||||
{
|
||||
error_box(FR("Codice IVA \"%s\" non riconosciuto alla riga %d del movimento %ld."),
|
||||
(const char*)codiva, _rmoviva->get_int(RMI_NUMRIG), _rmoviva->get_long(RMI_NUMREG));
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
CHECKS(codiva == _iva->get("CODTAB"), "Codice IVA simile ", (const char*)codiva);
|
||||
}
|
||||
|
||||
const TString4 tipoiva = _iva->get("S1");
|
||||
const TString4 tipoes_v = _iva->get("S2");
|
||||
const TString4 tipoes_a = _iva->get("S9");
|
||||
@ -1374,6 +1375,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
|
||||
const real imponibile_orig = _rmoviva->get_real(RMI_IMPONIBILE);
|
||||
const real imposta_orig = _rmoviva->get_real(RMI_IMPOSTA);
|
||||
const real lordo_orig = imponibile_orig + imposta_orig;
|
||||
|
||||
real diff_imp; // Liquidazione differita imponibile
|
||||
real diff_iva; // Liquidazione differita imposta
|
||||
@ -1436,7 +1438,8 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
if (!pagscatt.empty())
|
||||
{
|
||||
const char sezpag = tipomov == vendita ? 'A' : 'D';
|
||||
const real totfat = _mov->get(MOV_TOTDOC);
|
||||
real totfat = _mov->get(MOV_TOTDOC);
|
||||
real tot = totfat;
|
||||
|
||||
TLocalisamfile id(LF_IVADIFF);
|
||||
TRectype& idcurr = id.curr();
|
||||
@ -1511,14 +1514,9 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
|
||||
idcurr.put("MESELIQ", meseliq);
|
||||
idcurr.put("SEZIONE", pagtmp.sezione());
|
||||
|
||||
const real perc = pagtmp.valore() / totfat;
|
||||
|
||||
real val_imp = imponibile_orig * perc;
|
||||
round_al_centesimo(val_imp);
|
||||
|
||||
real val_iva = imposta_orig * perc;
|
||||
round_al_centesimo(val_iva);
|
||||
|
||||
real val_imp = pagtmp.valore() * lordo_orig / tot;
|
||||
real val_iva = civa.scorpora(val_imp, TCurrency::get_firm_dec());
|
||||
|
||||
idcurr.put("IMPORTO", val_imp + val_iva);
|
||||
idcurr.put(RMI_IMPONIBILE, val_imp);
|
||||
idcurr.put(RMI_IMPOSTA, val_iva);
|
||||
|
Loading…
x
Reference in New Issue
Block a user