Patch level : 2.1 nopatch
Files correlati : ce1.exe ce2.exe Ricompilazione Demo : [ ] Commento : Corretta funzione amminit_get_real, che inspiegabilmente chiamava se stessa, blocando tutto. git-svn-id: svn://10.65.10.50/trunk@12277 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5d36a7772d
commit
2b05ed353a
@ -426,18 +426,18 @@ void TScelta_amm_cat::init_mask(TMask& m)
|
||||
const TRectype& cac = dc.categoria(gru, spe, cat);
|
||||
switch (_tipo)
|
||||
{
|
||||
case 1:
|
||||
case 1: // Immateriali
|
||||
m.set(F_TIPOAMM, cac.get("I1"));
|
||||
m.set(F_MAX_AMM, cac.get("R13"));
|
||||
m.set(F_ANNI, cac.get("I3"));
|
||||
break;
|
||||
case 2:
|
||||
case 2: // Pluriennali
|
||||
m.set(F_TIPOVINC, cac.get("I2"));
|
||||
m.set(F_MIN_AMM, cac.get("R14"));
|
||||
m.set(F_MAX_AMM, cac.get("R15"));
|
||||
m.set(F_ANNI, cac.get("I3"));
|
||||
break;
|
||||
default:
|
||||
default: // Materiali
|
||||
{
|
||||
const real r11 = cac.get_real("R11");
|
||||
const real r12 = cac.get_real("R12");
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
HIDDEN void log(const char* fmt, ...)
|
||||
{
|
||||
#ifdef DBG
|
||||
/* #ifdef DBG
|
||||
char msg[256];
|
||||
va_list argptr;
|
||||
va_start(argptr,fmt);
|
||||
@ -36,7 +36,7 @@ HIDDEN void log(const char* fmt, ...)
|
||||
fprintf(f, "%s\n", msg);
|
||||
fclose(f);
|
||||
}
|
||||
#endif
|
||||
#endif */
|
||||
}
|
||||
|
||||
|
||||
@ -998,15 +998,15 @@ TString& TCespite::ammini_get(const char* pstar) const
|
||||
return _val;
|
||||
}
|
||||
|
||||
bool TCespite::ammini_get_bool(const char* pstar) const
|
||||
bool TCespite::ammini_get_bool(const char* pfield) const
|
||||
{
|
||||
const TString& val = ammini_get(pstar);
|
||||
const TString& val = ammini_get(pfield);
|
||||
return !val.blank();
|
||||
}
|
||||
|
||||
real TCespite::ammini_get_real(const char* pstar) const
|
||||
real TCespite::ammini_get_real(const char* pfield) const
|
||||
{
|
||||
const real val = ammini_get_real(pstar);
|
||||
const real val = ammini_get(pfield);
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -1502,7 +1502,7 @@ void TCespite::calc_amm_residui(bool is_valid)
|
||||
const bool leasing = get_bool(CESPI_LEASING);
|
||||
const int anniric = get_int(CESPI_ANNIRIC);
|
||||
|
||||
if ((tc == tc_materiale && !leasing) || (tc == tc_immateriale && anniric == 0) || is_forz)
|
||||
if ((tc == tc_materiale && !leasing) || (tc == tc_immateriale && anniric <= 0) || is_forz)
|
||||
{
|
||||
const real coeff_durata = cce.coefficiente_durata_esercizio();
|
||||
if (fzquo) // Forzatura quota
|
||||
@ -1514,7 +1514,7 @@ void TCespite::calc_amm_residui(bool is_valid)
|
||||
if (resamm < qnor)
|
||||
_ammpro.put(AMMCE_QNOR, qnor = resamm); // Forzo la quota uguale al residuo
|
||||
|
||||
const real pnor = qnor / coeff_durata * 100.0 / val_amm();
|
||||
const real pnor = qnor / coeff_durata * CENTO / val_amm();
|
||||
ammpro_put_perc(AMMCE_PNOR, pnor);
|
||||
|
||||
resamm -= qnor;
|
||||
@ -1523,7 +1523,7 @@ void TCespite::calc_amm_residui(bool is_valid)
|
||||
real qacc = _ammpro.get_real(AMMCE_QACC);
|
||||
if (resamm < qacc)
|
||||
_ammpro.put(AMMCE_QACC, qacc = resamm); // Forzo la quota uguale al residuo
|
||||
const real pacc = qacc / coeff_durata * 100.0 / val_amm();
|
||||
const real pacc = qacc / coeff_durata * CENTO / val_amm();
|
||||
ammpro_put_perc(AMMCE_PACC, pacc);
|
||||
resamm -= qacc;
|
||||
}
|
||||
@ -1536,7 +1536,7 @@ void TCespite::calc_amm_residui(bool is_valid)
|
||||
real qant = _ammpro.get_real(AMMCE_QANT);
|
||||
if (resamm < qant)
|
||||
_ammpro.put(AMMCE_QANT, qant = resamm); // Forzo la quota uguale al residuo
|
||||
const real pant = qant / coeff_durata * 100.0 / val_amm();
|
||||
const real pant = qant / coeff_durata * CENTO / val_amm();
|
||||
ammpro_put_perc(AMMCE_PANT, pant);
|
||||
resamm -= qant;
|
||||
}
|
||||
@ -1737,12 +1737,12 @@ void TCespite::calc_amm_residui(bool is_valid)
|
||||
if (anniric > 0)
|
||||
qnor = val_amm() / anniric;
|
||||
else
|
||||
qnor = val_amm() * ammini_get_real(AMMCE_PNOR) / 100.0;
|
||||
qnor = val_amm() * ammini_get_real(AMMCE_PNOR) / CENTO;
|
||||
} else
|
||||
if (tc == tc_pluriennale && vincolo == 2 && ammini_get_real(AMMCE_PNOR) > ZERO)
|
||||
{
|
||||
if (anniric > anniamm)
|
||||
qnor = val_amm() * ammini_get_real(AMMCE_PNOR) / 100.0;
|
||||
qnor = val_amm() * ammini_get_real(AMMCE_PNOR) / CENTO;
|
||||
}
|
||||
|
||||
if (resamm < qnor)
|
||||
@ -1753,7 +1753,7 @@ void TCespite::calc_amm_residui(bool is_valid)
|
||||
const real valore = val_amm();
|
||||
if (qnor > ZERO && valore > ZERO)
|
||||
{
|
||||
const real pnor = qnor * 100.0 / valore;
|
||||
const real pnor = qnor * CENTO / valore;
|
||||
ammpro_put_perc(AMMCE_PNOR, pnor);
|
||||
}
|
||||
else
|
||||
@ -1825,7 +1825,7 @@ bool TCespite::calc_amm(int tipo_sit, const TDate& data_limite, bool recalc_spe_
|
||||
log(FR("* Inizio calcolo situazione %d cespite %s"), tipo_sit, (const char*)idcespite);
|
||||
|
||||
#ifdef DBG
|
||||
if (tipo_sit == 1 && atol(idcespite) == 83L)
|
||||
if (tipo_sit == 1 && atol(idcespite) == 1080L)
|
||||
{
|
||||
tipo_sit = 1; // Put your breakpoint here
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user