Patch level : 12.0 1138
Files correlati : cg4 Commento: Corretta imputazione quadro VT ora viene usato il comune dell'unità locale corretto calcolo imponibile nel caso di fatture pagate nel periodo in acluni casi aggiungieva l'imonibile 2 volte
This commit is contained in:
parent
28e577caff
commit
52a5a5a0df
@ -36,19 +36,21 @@
|
|||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
|
|
||||||
#define _BREAK(func, par, values) func(par, values);
|
#define _BREAK(func, par, values) func(par, values);
|
||||||
#define BREAK_DBG _BREAK(check_nreg, __nreg, __values)
|
#define BREAK_NREG _BREAK(check_nreg, __nreg, __nregs)
|
||||||
#define LOAD_VAL load_values()
|
#define BREAK_CODIVA(codiva) _BREAK(check_codiva, codiva, __codivas)
|
||||||
|
#define LOAD_VAL(sel) load_values(sel)
|
||||||
|
|
||||||
const char * load_values()
|
const char * load_values(int selector)
|
||||||
{
|
{
|
||||||
TFilename dbgname;
|
TFilename dbgname;
|
||||||
TFilename filename("dbg");
|
TFilename filename("dbg");
|
||||||
|
const char * names[] = { "NReg", "CodIVA"};
|
||||||
|
|
||||||
filename << main_app().name();
|
filename << main_app().name();
|
||||||
dbgname.currdir();
|
dbgname.currdir();
|
||||||
dbgname.add(filename);
|
dbgname.add(filename);
|
||||||
dbgname.ext("ini");
|
dbgname.ext("ini");
|
||||||
return ini_get_string(dbgname, "Main", "Values");
|
return ini_get_string(dbgname, "Main", names[selector]);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool check_nreg(TToken_string &nreg, TToken_string &values)
|
bool check_nreg(TToken_string &nreg, TToken_string &values)
|
||||||
@ -62,8 +64,20 @@ bool check_nreg(TToken_string &nreg, TToken_string &values)
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool check_codiva(const TString4 &codiva, TToken_string &values)
|
||||||
|
{
|
||||||
|
|
||||||
|
FOR_EACH_TOKEN(values, val)
|
||||||
|
{
|
||||||
|
if (codiva == val)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
#define BREAK_DBG
|
#define BREAK_NREG
|
||||||
|
#define BREAK_CODIVA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool TLiquidazione_app::recalc_all()
|
bool TLiquidazione_app::recalc_all()
|
||||||
@ -1149,10 +1163,11 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
TDate date = _mov->get(MOV_DATAREG);
|
TDate date = _mov->get(MOV_DATAREG);
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
TToken_string __nreg = _mov->get(MOV_NUMREG);
|
TToken_string __nreg = _mov->get(MOV_NUMREG);
|
||||||
TToken_string __values = LOAD_VAL;
|
TToken_string __nregs = LOAD_VAL(0);
|
||||||
|
TToken_string __codivas = LOAD_VAL(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BREAK_DBG;
|
BREAK_NREG;
|
||||||
const int liqmonth = _mov->get_int(MOV_MESELIQ);
|
const int liqmonth = _mov->get_int(MOV_MESELIQ);
|
||||||
const TString4 reg = _mov->get("REG");
|
const TString4 reg = _mov->get("REG");
|
||||||
const bool isreg = look_reg(reg);
|
const bool isreg = look_reg(reg);
|
||||||
@ -1200,7 +1215,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
TPartite_array arrpart; // Partite interessate
|
TPartite_array arrpart; // Partite interessate
|
||||||
TPointer_array pagscatt; // Righe di pagsca interessate
|
TPointer_array pagscatt; // Righe di pagsca interessate
|
||||||
|
|
||||||
BREAK_DBG;
|
BREAK_NREG;
|
||||||
if (fattrit)
|
if (fattrit)
|
||||||
dok = (atoi(_year) == datadoc.year()) && _month == 13;
|
dok = (atoi(_year) == datadoc.year()) && _month == 13;
|
||||||
|
|
||||||
@ -1222,7 +1237,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
bool game_found = false;
|
bool game_found = false;
|
||||||
TImporto residuo;
|
TImporto residuo;
|
||||||
|
|
||||||
BREAK_DBG;
|
BREAK_NREG;
|
||||||
if (has_sc)
|
if (has_sc)
|
||||||
{
|
{
|
||||||
arrpart.add_numreg(numreg);
|
arrpart.add_numreg(numreg);
|
||||||
@ -1254,13 +1269,10 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
bool regular_month = orizzonte >= date;
|
bool regular_month = orizzonte >= date;
|
||||||
bool first_month = regular_month && date > inizio + 1L;
|
bool first_month = regular_month && date > inizio + 1L;
|
||||||
|
|
||||||
BREAK_DBG;
|
BREAK_NREG;
|
||||||
#ifdef DBG
|
|
||||||
if (rp.get_long(PART_NREG) == 100616)
|
|
||||||
int i = 1;
|
|
||||||
#endif
|
|
||||||
flag_pg_nc = rp.calcola_pagato_periodo(first_month ? botime : inizio + 1L, orizzonte, pg_per, nc_per, &pagscatt) && regular_month;
|
flag_pg_nc = rp.calcola_pagato_periodo(first_month ? botime : inizio + 1L, orizzonte, pg_per, nc_per, &pagscatt) && regular_month;
|
||||||
residuo += pg_per;
|
if (IMPORTO_NON_ZERO(residuo))
|
||||||
|
residuo += pg_per;
|
||||||
if (pagscatt.items() >= 2)
|
if (pagscatt.items() >= 2)
|
||||||
{
|
{
|
||||||
// Fondo tra loro le righe generate dallo stesso pagamento
|
// Fondo tra loro le righe generate dallo stesso pagamento
|
||||||
@ -1305,7 +1317,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
if (ps == obj)
|
if (ps == obj)
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
BREAK_DBG;
|
BREAK_NREG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
@ -1368,7 +1380,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
datainc = data_end_cassa;
|
datainc = data_end_cassa;
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
else
|
else
|
||||||
BREAK_DBG;
|
BREAK_NREG;
|
||||||
#endif
|
#endif
|
||||||
_mov->put(MOV_DATAINC, datainc);
|
_mov->put(MOV_DATAINC, datainc);
|
||||||
if (datainc < date)
|
if (datainc < date)
|
||||||
@ -1454,7 +1466,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
const TCodiceIVA& civa = cached_codIVA(codiva);
|
const TCodiceIVA& civa = cached_codIVA(codiva);
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
BREAK_DBG;
|
BREAK_NREG;
|
||||||
if (tipomov == vendite)
|
if (tipomov == vendite)
|
||||||
int i = 1;
|
int i = 1;
|
||||||
if (!bIsMovDiff && (civa.percentuale() == 20))
|
if (!bIsMovDiff && (civa.percentuale() == 20))
|
||||||
@ -1528,7 +1540,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
const TCli_for & clifo = cached_clifor(LF_MOV, _mov->curr());
|
const TCli_for & clifo = cached_clifor(LF_MOV, _mov->curr());
|
||||||
const int tp = clifo.alleg();
|
const int tp = clifo.alleg();
|
||||||
|
|
||||||
BREAK_DBG;
|
BREAK_NREG;
|
||||||
if ((soloiva &&
|
if ((soloiva &&
|
||||||
(caus_reg.objptr(codcaus) != NULL || tp < 1)) &&
|
(caus_reg.objptr(codcaus) != NULL || tp < 1)) &&
|
||||||
sosp_imp != vol_affari)
|
sosp_imp != vol_affari)
|
||||||
@ -1551,9 +1563,11 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
real diff_ivar = (is_detr_diff == 0) ? impos_det : impos_ind;
|
real diff_ivar = (is_detr_diff == 0) ? impos_det : impos_ind;
|
||||||
real diff_totr = diff_impr + diff_ivar;
|
real diff_totr = diff_impr + diff_ivar;
|
||||||
|
|
||||||
|
|
||||||
if (diff_totr == ZERO)
|
if (diff_totr == ZERO)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
BREAK_CODIVA(codiva);
|
||||||
TDate datafat = _mov->get_date(MOV_DATAREG);
|
TDate datafat = _mov->get_date(MOV_DATAREG);
|
||||||
long numreg = _rmoviva->get_long(RMI_NUMREG);
|
long numreg = _rmoviva->get_long(RMI_NUMREG);
|
||||||
|
|
||||||
@ -1567,7 +1581,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
int mesereg = liqmonth == 0 ? datareg.month() : liqmonth;
|
int mesereg = liqmonth == 0 ? datareg.month() : liqmonth;
|
||||||
bool ok = is_month_ok(mesereg, month) && (atoi(_year) == datareg.year());
|
bool ok = is_month_ok(mesereg, month) && (atoi(_year) == datareg.year());
|
||||||
|
|
||||||
BREAK_DBG;
|
BREAK_NREG;
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
datafat = datareg;
|
datafat = datareg;
|
||||||
@ -1918,7 +1932,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
bool bMovDiffToAdd = true;
|
bool bMovDiffToAdd = true;
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
BREAK_DBG;
|
BREAK_NREG;
|
||||||
if (!bIsMovDiff && (civa.percentuale() == 20))
|
if (!bIsMovDiff && (civa.percentuale() == 20))
|
||||||
real p = imposta_orig / imponibile_orig * CENTO;
|
real p = imposta_orig / imponibile_orig * CENTO;
|
||||||
#endif
|
#endif
|
||||||
@ -2689,7 +2703,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
|||||||
if (diff_imp > ZERO)
|
if (diff_imp > ZERO)
|
||||||
int i = 1;
|
int i = 1;
|
||||||
tab->curr().add("R30", diff_imp);
|
tab->curr().add("R30", diff_imp);
|
||||||
tab->curr().add("R31", diff_iva);
|
tab->curr().add("R31", diff_iva);
|
||||||
tab->curr().add("R32", incdiff_imp);
|
tab->curr().add("R32", incdiff_imp);
|
||||||
tab->curr().add("R33", incdiff_iva);
|
tab->curr().add("R33", incdiff_iva);
|
||||||
fdiff_imp_acq += diff_imp;
|
fdiff_imp_acq += diff_imp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user