diff --git a/cg/cg0500.cpp b/cg/cg0500.cpp index 9585a7241..01d2a0636 100755 --- a/cg/cg0500.cpp +++ b/cg/cg0500.cpp @@ -188,6 +188,7 @@ typedef enum { acquisto, vendita, incasso_pagamento, TRelation * _rel; TMask * _msk; + TLocalisamfile * _conti; int _mode; // Modo maschera corrente int _items; @@ -235,6 +236,7 @@ public: void add_riga (int numrig, char cf, char sz, TString& d, TString& da, bool riva, TString& civa, TConto& tc); bool MostraCampi(TMask_field& f); + TLocalisamfile & conti() { return *_conti; } CG0500_application() {} }; @@ -596,7 +598,7 @@ bool CG0500_application::sottoconto_hndl (TMask_field& f, KEY k) return f.warning_box("Non accetto un sottoconto con gruppo o conto vuoti"); TConto tc(g,c,s); - if (!tc.read()) + if (!tc.read(app()->conti().curr())) return f.warning_box("Conto inesistente"); } return TRUE; @@ -1039,6 +1041,8 @@ bool CG0500_application::user_create() _rel = new TRelation (LF_CAUSALI); _rel->add(LF_RCAUSALI, "CODCAUS=CODCAUS"); + _conti = new TLocalisamfile (LF_PCON); + _msk = new TMask("cg0500a"); if (!salda_conto()) { @@ -1084,6 +1088,7 @@ bool CG0500_application::user_destroy() { delete _msk; delete _rel; + delete _conti; return TRUE; }