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
@ -33,7 +33,7 @@ public:
|
||||
const real& valore() const { return _valore; }
|
||||
void set(int codes, const char * codmag, const char * codart, const char * livello, const char * codcaus);
|
||||
int operator==(const TSaldo_mag&) const;
|
||||
|
||||
|
||||
virtual TObject* dup() const { return new TSaldo_mag(*this); }
|
||||
|
||||
bool is_deletable() const { return _quant == ZERO && _valore == ZERO; }
|
||||
@ -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
|
||||
{
|
||||
return (_codes == s._codes) &&
|
||||
(_codmag == s._codmag) &&
|
||||
(_codart == s._codart) &&
|
||||
(_livello == s._livello) &&
|
||||
(_codcaus == s._codcaus);
|
||||
return (_codes == s._codes) &&
|
||||
(_codmag == s._codmag) &&
|
||||
(_codart == s._codart) &&
|
||||
(_livello == s._livello) &&
|
||||
(_codcaus == s._codcaus);
|
||||
}
|
||||
|
||||
TToken_string & TSaldo_mag::key(const TRectype & head, const TRectype & row)
|
||||
@ -126,7 +126,7 @@ public:
|
||||
const real& valore() const { return _valore; }
|
||||
void set(int codes, char tipocf, const char * codcf, int codindsp, const char * codart, const char * livello, const char * codcaus);
|
||||
int operator==(const TSaldo_mag_clifo&) const;
|
||||
|
||||
|
||||
virtual TObject* dup() const { return new TSaldo_mag_clifo(*this); }
|
||||
|
||||
bool is_deletable() const { return _quant.is_zero() && _valore.is_zero(); }
|
||||
@ -255,12 +255,6 @@ void TMov_mag::set_body_key(TRectype & rowrec)
|
||||
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)
|
||||
{
|
||||
_saldi_mag.destroy();
|
||||
@ -506,11 +500,11 @@ void TMov_mag::add_saldi(const bool plus)
|
||||
const TRectype & rec = b[i];
|
||||
TToken_string & key_mag = TSaldo_mag::key(*this, rec);
|
||||
TSaldo_mag * s_mag = (TSaldo_mag*) _saldi_mag.objptr(key_mag);
|
||||
|
||||
|
||||
if (s_mag == NULL)
|
||||
{
|
||||
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);
|
||||
@ -531,7 +525,7 @@ void TMov_mag::add_saldi(const bool plus)
|
||||
if (s_clifo == NULL)
|
||||
{
|
||||
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);
|
||||
}
|
||||
@ -863,7 +857,7 @@ void TMov_mag::update_balance(TRectype& rec, const char* fieldname, const real&
|
||||
rec.add(fieldname, val);
|
||||
else
|
||||
rec.add(fieldname, -val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct TBalance_params
|
||||
@ -921,41 +915,20 @@ void reset_clifogiac(TRectype& rec, const TRectype& oldrec, bool closed)
|
||||
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)
|
||||
{
|
||||
rec.add(CLIFOGIAC_DOTOD, oldrec.get_real(CLIFOGIAC_DOTOD));
|
||||
rec.add(CLIFOGIAC_DOTIN, oldrec.get_real(CLIFOGIAC_DOTIN));
|
||||
rec.add(CLIFOGIAC_DOTTM, oldrec.get_real(CLIFOGIAC_DOTTM));
|
||||
}
|
||||
else
|
||||
{
|
||||
rec.zero(CLIFOGIAC_DOTOD);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
{
|
||||
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);
|
||||
relmovmag.lfile().set_curr(new TMov_mag());
|
||||
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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user