Patch level : 12.0 912
Files correlati : cg0200a.msk f17.dir f17.trr ve0.exe ve1.exe ve5.exe ve6.exe Commento : Corretta ricostruzione saldi per clifogiac sulle dotazioni quando l'esercizio è chiuso
This commit is contained in:
parent
08e8473259
commit
31015d542f
@ -62,11 +62,11 @@ void TSaldo_mag::set(int codes, const char * codmag, const char * codart, const
|
|||||||
|
|
||||||
int TSaldo_mag::operator==(const TSaldo_mag & s) const
|
int TSaldo_mag::operator==(const TSaldo_mag & s) const
|
||||||
{
|
{
|
||||||
return (_codes == s._codes) &&
|
return (_codes == s._codes) &&
|
||||||
(_codmag == s._codmag) &&
|
(_codmag == s._codmag) &&
|
||||||
(_codart == s._codart) &&
|
(_codart == s._codart) &&
|
||||||
(_livello == s._livello) &&
|
(_livello == s._livello) &&
|
||||||
(_codcaus == s._codcaus);
|
(_codcaus == s._codcaus);
|
||||||
}
|
}
|
||||||
|
|
||||||
TToken_string & TSaldo_mag::key(const TRectype & head, const TRectype & row)
|
TToken_string & TSaldo_mag::key(const TRectype & head, const TRectype & row)
|
||||||
@ -255,12 +255,6 @@ void TMov_mag::set_body_key(TRectype & rowrec)
|
|||||||
rowrec.put(RMOVMAG_NUMREG,get(MOVMAG_NUMREG));
|
rowrec.put(RMOVMAG_NUMREG,get(MOVMAG_NUMREG));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void TMov_mag::load_rows_file(int logicnum)
|
|
||||||
{
|
|
||||||
CHECK(logicnum==LF_RMOVMAG,"L'unico file collegabile ai movimenti sono le righe");
|
|
||||||
TMultiple_rectype::load_rows_file(logicnum);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
int TMov_mag::read(TBaseisamfile& f, word op, word lockop)
|
int TMov_mag::read(TBaseisamfile& f, word op, word lockop)
|
||||||
{
|
{
|
||||||
_saldi_mag.destroy();
|
_saldi_mag.destroy();
|
||||||
@ -510,7 +504,7 @@ void TMov_mag::add_saldi(const bool plus)
|
|||||||
if (s_mag == NULL)
|
if (s_mag == NULL)
|
||||||
{
|
{
|
||||||
s_mag = new TSaldo_mag(*this, rec);
|
s_mag = new TSaldo_mag(*this, rec);
|
||||||
_saldi_mag.add(key_mag, s_mag);
|
_saldi_mag.add(key_mag, s_mag);
|
||||||
}
|
}
|
||||||
|
|
||||||
real quant = rec.get_real(RMOVMAG_QUANT);
|
real quant = rec.get_real(RMOVMAG_QUANT);
|
||||||
@ -531,7 +525,7 @@ void TMov_mag::add_saldi(const bool plus)
|
|||||||
if (s_clifo == NULL)
|
if (s_clifo == NULL)
|
||||||
{
|
{
|
||||||
s_clifo = new TSaldo_mag_clifo(*this, rec);
|
s_clifo = new TSaldo_mag_clifo(*this, rec);
|
||||||
_saldi_mag_clifo.add(key_clifo, s_clifo);
|
_saldi_mag_clifo.add(key_clifo, s_clifo);
|
||||||
}
|
}
|
||||||
s_clifo->add(quant, valore, plus);
|
s_clifo->add(quant, valore, plus);
|
||||||
}
|
}
|
||||||
@ -863,7 +857,7 @@ void TMov_mag::update_balance(TRectype& rec, const char* fieldname, const real&
|
|||||||
rec.add(fieldname, val);
|
rec.add(fieldname, val);
|
||||||
else
|
else
|
||||||
rec.add(fieldname, -val);
|
rec.add(fieldname, -val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TBalance_params
|
struct TBalance_params
|
||||||
@ -921,41 +915,20 @@ void reset_clifogiac(TRectype& rec, const TRectype& oldrec, bool closed)
|
|||||||
rec.zero(CLIFOGIAC_VALORDC);
|
rec.zero(CLIFOGIAC_VALORDC);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool preserve_dot = ini_get_bool(CONFIG_DITTA, "lv", "Aggcong") ||
|
|
||||||
ini_get_bool(CONFIG_DITTA, "mg", "GESMAG");
|
|
||||||
|
|
||||||
if (preserve_dot)
|
if (closed)
|
||||||
{
|
{
|
||||||
if (closed)
|
rec.put(CLIFOGIAC_DOTOD, oldrec.get(CLIFOGIAC_DOTOD));
|
||||||
{
|
rec.put(CLIFOGIAC_DOTIN, oldrec.get(CLIFOGIAC_DOTIN));
|
||||||
rec.add(CLIFOGIAC_DOTOD, oldrec.get_real(CLIFOGIAC_DOTOD));
|
rec.put(CLIFOGIAC_DOTTM, oldrec.get(CLIFOGIAC_DOTTM));
|
||||||
rec.add(CLIFOGIAC_DOTIN, oldrec.get_real(CLIFOGIAC_DOTIN));
|
}
|
||||||
rec.add(CLIFOGIAC_DOTTM, oldrec.get_real(CLIFOGIAC_DOTTM));
|
else
|
||||||
}
|
{
|
||||||
else
|
rec.zero(CLIFOGIAC_DOTOD);
|
||||||
{
|
rec.zero(CLIFOGIAC_DOTIN);
|
||||||
rec.zero(CLIFOGIAC_DOTOD);
|
rec.zero(CLIFOGIAC_DOTTM);
|
||||||
rec.zero(CLIFOGIAC_DOTIN);
|
}
|
||||||
rec.zero(CLIFOGIAC_DOTTM);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (closed)
|
|
||||||
{
|
|
||||||
rec.put(CLIFOGIAC_DOTOD, oldrec.get(CLIFOGIAC_DOTOD));
|
|
||||||
rec.put(CLIFOGIAC_DOTIN, oldrec.get(CLIFOGIAC_DOTIN));
|
|
||||||
rec.put(CLIFOGIAC_DOTTM, oldrec.get(CLIFOGIAC_DOTTM));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rec.zero(CLIFOGIAC_DOTOD);
|
|
||||||
rec.zero(CLIFOGIAC_DOTIN);
|
|
||||||
rec.zero(CLIFOGIAC_DOTTM);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int i = 0; zero_fields[i]; i++)
|
for (int i = 0; zero_fields[i]; i++)
|
||||||
@ -1118,8 +1091,8 @@ bool rebuild_balances(int codes, const TTipo_valorizz tipo_valorizz,
|
|||||||
TCursor mov_cur(&relmovmag, "", 2, &rec, &rec);
|
TCursor mov_cur(&relmovmag, "", 2, &rec, &rec);
|
||||||
relmovmag.lfile().set_curr(new TMov_mag());
|
relmovmag.lfile().set_curr(new TMov_mag());
|
||||||
msg.format(FR("Ricostruzione saldi esercizio %04d ..."), codes);
|
msg.format(FR("Ricostruzione saldi esercizio %04d ..."), codes);
|
||||||
mov_cur.scan(recalc_mov, (void*)&ok, msg);
|
mov_cur.scan(recalc_mov, (void*)&ok, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
a.close();
|
a.close();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user