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
|
||||
|
||||
#define _BREAK(func, par, values) func(par, values);
|
||||
#define BREAK_DBG _BREAK(check_nreg, __nreg, __values)
|
||||
#define LOAD_VAL load_values()
|
||||
#define BREAK_NREG _BREAK(check_nreg, __nreg, __nregs)
|
||||
#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 filename("dbg");
|
||||
const char * names[] = { "NReg", "CodIVA"};
|
||||
|
||||
filename << main_app().name();
|
||||
dbgname.currdir();
|
||||
dbgname.add(filename);
|
||||
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)
|
||||
@ -62,8 +64,20 @@ bool check_nreg(TToken_string &nreg, TToken_string &values)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool check_codiva(const TString4 &codiva, TToken_string &values)
|
||||
{
|
||||
|
||||
FOR_EACH_TOKEN(values, val)
|
||||
{
|
||||
if (codiva == val)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
#define BREAK_DBG
|
||||
#define BREAK_NREG
|
||||
#define BREAK_CODIVA
|
||||
#endif
|
||||
|
||||
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);
|
||||
#ifdef DBG
|
||||
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
|
||||
|
||||
BREAK_DBG;
|
||||
BREAK_NREG;
|
||||
const int liqmonth = _mov->get_int(MOV_MESELIQ);
|
||||
const TString4 reg = _mov->get("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
|
||||
TPointer_array pagscatt; // Righe di pagsca interessate
|
||||
|
||||
BREAK_DBG;
|
||||
BREAK_NREG;
|
||||
if (fattrit)
|
||||
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;
|
||||
TImporto residuo;
|
||||
|
||||
BREAK_DBG;
|
||||
BREAK_NREG;
|
||||
if (has_sc)
|
||||
{
|
||||
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 first_month = regular_month && date > inizio + 1L;
|
||||
|
||||
BREAK_DBG;
|
||||
#ifdef DBG
|
||||
if (rp.get_long(PART_NREG) == 100616)
|
||||
int i = 1;
|
||||
#endif
|
||||
BREAK_NREG;
|
||||
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)
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
found = true;
|
||||
BREAK_DBG;
|
||||
BREAK_NREG;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
@ -1368,7 +1380,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
||||
datainc = data_end_cassa;
|
||||
#ifdef DBG
|
||||
else
|
||||
BREAK_DBG;
|
||||
BREAK_NREG;
|
||||
#endif
|
||||
_mov->put(MOV_DATAINC, datainc);
|
||||
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);
|
||||
|
||||
#ifdef DBG
|
||||
BREAK_DBG;
|
||||
BREAK_NREG;
|
||||
if (tipomov == vendite)
|
||||
int i = 1;
|
||||
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 int tp = clifo.alleg();
|
||||
|
||||
BREAK_DBG;
|
||||
BREAK_NREG;
|
||||
if ((soloiva &&
|
||||
(caus_reg.objptr(codcaus) != NULL || tp < 1)) &&
|
||||
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_totr = diff_impr + diff_ivar;
|
||||
|
||||
|
||||
if (diff_totr == ZERO)
|
||||
continue;
|
||||
|
||||
BREAK_CODIVA(codiva);
|
||||
TDate datafat = _mov->get_date(MOV_DATAREG);
|
||||
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;
|
||||
bool ok = is_month_ok(mesereg, month) && (atoi(_year) == datareg.year());
|
||||
|
||||
BREAK_DBG;
|
||||
BREAK_NREG;
|
||||
if (ok)
|
||||
{
|
||||
datafat = datareg;
|
||||
@ -1918,7 +1932,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
||||
bool bMovDiffToAdd = true;
|
||||
|
||||
#ifdef DBG
|
||||
BREAK_DBG;
|
||||
BREAK_NREG;
|
||||
if (!bIsMovDiff && (civa.percentuale() == 20))
|
||||
real p = imposta_orig / imponibile_orig * CENTO;
|
||||
#endif
|
||||
@ -2689,7 +2703,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt, TAssoc_array &
|
||||
if (diff_imp > ZERO)
|
||||
int i = 1;
|
||||
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("R33", incdiff_iva);
|
||||
fdiff_imp_acq += diff_imp;
|
||||
|
Loading…
x
Reference in New Issue
Block a user