Patch level : 4.0 858
Files correlati : ca0.exe Ricompilazione Demo : [ ] Commento : modificata gestione dell'indicatore di bilancio sul piano dei conti git-svn-id: svn://10.65.10.50/trunk@16020 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e0af255db2
commit
2cc182c971
@ -39,30 +39,32 @@ bool TPiano_conti_anal_msk::on_field_event(TOperable_field& o, TField_event e, l
|
||||
key << str.get(0) << "|";
|
||||
key << str.get();
|
||||
|
||||
_ind_bilancio = atoi(cache().get(LF_PCON, key, PCN_INDBIL));
|
||||
// _ind_bilancio = atoi(cache().get(LF_PCON, key, PCN_INDBIL));
|
||||
}
|
||||
}
|
||||
else
|
||||
if (e == se_leave)
|
||||
{
|
||||
TSheet_field & s = (TSheet_field &) o;
|
||||
TToken_string str = s.row(s.selected());
|
||||
TString key;
|
||||
|
||||
key << str.get(0) << "|";
|
||||
key << str.get();
|
||||
|
||||
const TRectype & pcon = cache().get(LF_PCON, key);
|
||||
if (!pcon.empty())
|
||||
const int master_indbil = get_int(F_INDBIL);
|
||||
if (master_indbil > 0)
|
||||
{
|
||||
const int ind_bilancio = pcon.get_int(PCN_INDBIL);
|
||||
if (_ind_bilancio == 0)
|
||||
_ind_bilancio = ind_bilancio;
|
||||
if (_ind_bilancio != ind_bilancio)
|
||||
return error_box("Indicatore di bilancio errato %d", ind_bilancio);
|
||||
else
|
||||
return true;
|
||||
TSheet_field & s = (TSheet_field &) o;
|
||||
TToken_string str = s.row(s.selected());
|
||||
TString key;
|
||||
|
||||
key << str.get(0) << "|";
|
||||
key << str.get();
|
||||
|
||||
const TRectype & pcon = cache().get(LF_PCON, key);
|
||||
if (!pcon.empty())
|
||||
{
|
||||
const int ind_bilancio = pcon.get_int(PCN_INDBIL);
|
||||
|
||||
if (master_indbil != ind_bilancio)
|
||||
return error_box("Indicatore di bilancio errato %d", ind_bilancio);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -93,6 +95,7 @@ class TAnalisi_app : public TAnal_app
|
||||
{
|
||||
TAnalisi_rec * _rows;
|
||||
int _maxlev;
|
||||
bool _riclassificato;
|
||||
|
||||
protected:
|
||||
virtual TSimple_anal_msk* create_mask() const { return new TPiano_conti_anal_msk; }
|
||||
@ -240,11 +243,11 @@ void TAnalisi_app::init_indbil(TMask& mask)
|
||||
if (mask.field(F_KEY1+level).shown())
|
||||
break;
|
||||
}
|
||||
enabled = level < _maxlev; // Le foglie sono sempre disabilitate
|
||||
enabled = level < _maxlev || _riclassificato; // Le foglie sono sempre disabilitate
|
||||
if (level > 0) // Devo controllare i nodi padre
|
||||
{
|
||||
TString code; // Codice del piano dei conti
|
||||
for (int i = 0; i <= level; i++)
|
||||
for (int i = 0; i < level; i++)
|
||||
{
|
||||
code << mask.get(F_KEY1+i); // Allungo il codice
|
||||
const TRectype& rec = cache().get(LF_PCONANA, code);
|
||||
@ -289,10 +292,13 @@ bool TAnalisi_app::create()
|
||||
{
|
||||
TConfig& cfg = ca_config();
|
||||
const TString& pdc = cfg.get("Pdci", NULL, 1);
|
||||
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
||||
|
||||
_riclassificato = pdc.full() && use_pdcc;
|
||||
|
||||
if (pdc.blank())
|
||||
{
|
||||
const bool use_cg0 = cfg.get_bool("UsePdcc");
|
||||
if (use_cg0)
|
||||
if (use_pdcc)
|
||||
{
|
||||
TExternal_app app("cg0 -0");
|
||||
app.run(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user