diff --git a/cg/cg3600.cpp b/cg/cg3600.cpp index e502e41d6..488daed99 100755 --- a/cg/cg3600.cpp +++ b/cg/cg3600.cpp @@ -1612,7 +1612,7 @@ class TMastrini_grid : public TGrid_field TColor_mask _colmsk; COLOR _mas_back, _mas_fore; COLOR _con_back, _con_fore; - bool _primanoting; + bool _primanoting, _contsep; protected: // TGrid_field virtual bool on_record(long rec); @@ -1638,13 +1638,14 @@ public: void save_colors(); void load_colors(); void set_colors(); + void set_contsep(bool cs) { _contsep = cs; } TMastrini_grid(TMask* m); virtual ~TMastrini_grid() { } }; TMastrini_grid::TMastrini_grid(TMask* m) - : TGrid_field(m), _causali(LF_CAUSALI, CAU_DESCR), _primanoting(false) + : TGrid_field(m), _causali(LF_CAUSALI, CAU_DESCR), _primanoting(false), _contsep(false) { load_colors(); } @@ -1734,40 +1735,38 @@ void TMastrini_grid::cell_request(long rec, short id, TGrid_cell& cell) } break; case 104: // Descrizione - if (riga.tipo() == riga_mastrino) - { - const TRectype& rmov = _mastrino.riga(rec); - TString descr(rmov.get(RMV_DESCR)); - const TRectype& mov = _mastrino.testata(rec); - - if (cell.empty()) - { - descr = mov.get(MOV_DESCR); - if (cell.empty()) - { - TBill uncle(rmov,true); - - descr = uncle.descrizione(); - } - } - if (app().query_mask().get_bool(F_ST_CONTSEP)) - descr << "\n" << cache().get("&NPENT", mov.get(MOV_CONTSEP), "S0"); - cell.set(descr); - } - else { const TRectype& rmov = _mastrino.riga(rec); const TRectype& mov = _mastrino.testata(rec); - TString descr(rmov.get(MOV_DESCR)); - - // Bug 0001748: ignora descrizioni generate da contabilizzazione - if (cell.empty() || descr == _mastrino.conto().descrizione()) + TString descr = rmov.get(RMV_DESCR); + if (riga.tipo() == riga_mastrino) + { + if (descr.empty()) + { + const TRectype& mov = _mastrino.testata(rec); + descr = mov.get(MOV_DESCR); + if (descr.empty()) + { + TBill uncle(rmov,true); + descr = uncle.descrizione(); + } + } + } + else { - const TBill conto(rmov); - descr = conto.descrizione(); + // Bug 0001748: ignora descrizioni generate da contabilizzazione + if (descr.empty() || descr == _mastrino.conto().descrizione()) + { + const TBill conto(rmov); + descr = conto.descrizione(); + } + } + if (_contsep) + { + const TString16 cs = mov.get(MOV_CONTSEP); + if (cs.full()) + descr << "\n" << cache().get("&NPENT", cs, "S0"); } - if (app().query_mask().get_bool(F_ST_CONTSEP)) - descr << "\n" << cache().get("&NPENT", mov.get(MOV_CONTSEP), "S0"); cell.set(descr); } break; @@ -2501,8 +2500,9 @@ void TQuery_mask::do_query() const bool provv = get_bool(F_PROVVIS); conto.set(*_gm, F_GRUPPO, F_CONTO, F_SOTTOCONTO, 0, F_DESSOTTOC); - TMastrini_grid & gf = _gm->grid(); + TMastrini_grid& gf = _gm->grid(); + gf.set_contsep(get_bool(F_ST_CONTSEP)); gf.read(conto, annoes, da_data, a_data, da_caus, a_caus, provv); gf.select(get_bool(F_END) ? gf.items() -1 : 0); diff --git a/cg/cg3600a.uml b/cg/cg3600a.uml index 0f85a98cf..9176d5064 100755 --- a/cg/cg3600a.uml +++ b/cg/cg3600a.uml @@ -243,7 +243,7 @@ END BOOLEAN F_END BEGIN - PROMPT 40 12 "Vai in fondo al mastrino" + PROMPT 40 12 "Posizionamento in fondo al mastrino" END GROUPBOX DLG_NULL 76 5 @@ -308,7 +308,7 @@ END BOOLEAN F_ST_CONTSEP BEGIN - PROMPT 2 17 "Visualizza contabilità separata" + PROMPT 2 17 "Visualizzare contabilità separata" MODULE NP END