From 758a6f016d03c7c8874baa4d660de144923630ca Mon Sep 17 00:00:00 2001 From: angelo Date: Mon, 11 Dec 1995 10:15:19 +0000 Subject: [PATCH] Corretta la selezione del cursore sul piano dei conti per descrizione. Modifica valida sia per la stampa scaduto che la stampa scadenzario. git-svn-id: svn://10.65.10.50/trunk@2261 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- sc/sc2201.cpp | 87 +++++++++++++++++++++++++++++++++++++++++---------- sc/sc2201.h | 2 +- 2 files changed, 71 insertions(+), 18 deletions(-) diff --git a/sc/sc2201.cpp b/sc/sc2201.cpp index d62a03648..8a13b5461 100755 --- a/sc/sc2201.cpp +++ b/sc/sc2201.cpp @@ -71,7 +71,7 @@ void TSelection_ext_mask::reset_sheets() reset(SC_PCONCODTO3); } -void TSelection_ext_mask::select_pcon_range(const char* des,int grt, int cot, long sot) +void TSelection_ext_mask::select_pcon_range(TString& desfr, TString& desto) { TCursor_sheet& c = cur_sheet(); const long items = c.items(); @@ -79,20 +79,17 @@ void TSelection_ext_mask::select_pcon_range(const char* des,int grt, int cot, lo TCursor* crs = c.cursor(); TRectype& rec = crs->file().curr(); - TString desl; rec.zero(); - rec.put(PCN_DESCR,des); + rec.put(PCN_DESCR,desfr); + const TRecnotype start = crs->read(_isgteq); int grf = rec.get_int(PCN_GRUPPO); int cof = rec.get_int(PCN_CONTO); long sof = rec.get_long(PCN_SOTTOCONTO); + int grt, cot; + long sot; rec.zero(); - if (grt==0 && cot==0 && sot==0) - { - TToken_string& t = c.row(items-1); - desl = t.get_int(1); - } - rec.put(PCN_DESCR,desl); + rec.put(PCN_DESCR,desto); TRectype recx(rec); TRecnotype end = crs->read(_isgteq); if (rec != recx) @@ -121,6 +118,7 @@ void TSelection_ext_mask::select_pcon_range(int grf, int cof,long sof,int grt,in TCursor_sheet& c = cur_sheet(); const long items = c.items(); const int key = get_key(); + TString desfr,desto; TCursor* crs = c.cursor(); TRectype& rec = crs->file().curr(); @@ -128,6 +126,7 @@ void TSelection_ext_mask::select_pcon_range(int grf, int cof,long sof,int grt,in rec.put(PCN_GRUPPO,grf); rec.put(PCN_CONTO,cof); rec.put(PCN_SOTTOCONTO,sof); + const TRecnotype start = crs->read(_isgteq); grf = rec.get_int(PCN_GRUPPO); cof = rec.get_int(PCN_CONTO); @@ -140,9 +139,9 @@ void TSelection_ext_mask::select_pcon_range(int grf, int cof,long sof,int grt,in cot = t.get_int(key+1); sot = t.get_long(key+2); } - rec.put("GRUPPO",grt); - rec.put("CONTO",cot); - rec.put("SOTTOCONTO",sot); + rec.put(PCN_GRUPPO,grt); + rec.put(PCN_CONTO,cot); + rec.put(PCN_SOTTOCONTO,sot); TRectype recx(rec); TRecnotype end = crs->read(_isgteq); if (rec != recx) @@ -242,7 +241,16 @@ bool TSelection_ext_mask::bfrompcon_handler(TMask_field& f, KEY k) m.set(SC_PCONCODFR2, cof); m.set(SC_PCONCODFR3, sof); if (m.get_key() == 2) - m.select_pcon_range(t.get(1),grt,cot,sot); + { + TLocalisamfile pcon(LF_PCON); + pcon.zero(); + pcon.put(PCN_GRUPPO,grf); + pcon.put(PCN_CONTO,cof); + pcon.put(PCN_SOTTOCONTO,sof); + pcon.read(); + TString d1(t.get(1)),d2(pcon.get(PCN_DESCR)); + m.select_pcon_range(d1,d2); + } else m.select_pcon_range(grf,cof,sof,grt,cot,sot); } @@ -272,8 +280,17 @@ bool TSelection_ext_mask::btopcon_handler(TMask_field& f, KEY k) m.set(SC_PCONCODTO1, grt); m.set(SC_PCONCODTO2, cot); m.set(SC_PCONCODTO3, sot); - if (m.get_key() == 2) - m.select_pcon_range(t.get(1),grt,cot,sot); + if (m.get_key() == 2) + { + TLocalisamfile pcon(LF_PCON); + pcon.zero(); + pcon.put(PCN_GRUPPO,grf); + pcon.put(PCN_CONTO,cof); + pcon.put(PCN_SOTTOCONTO,sof); + pcon.read(); + TString d1(pcon.get(PCN_DESCR)),d2(t.get(1)); + m.select_pcon_range(d1,d2); + } else m.select_pcon_range(grf,cof,sof,grt,cot,sot); } @@ -295,7 +312,25 @@ bool TSelection_ext_mask::ffrompcon_handler(TMask_field& f, KEY k) grt = m.get_int(SC_PCONCODTO1); cot = m.get_int(SC_PCONCODTO2); sot = m.get_long(SC_PCONCODTO3); - m.select_pcon_range(grf,cof,sof,grt,cot,sot); + if (m.get_key() == 2) + { + TLocalisamfile pcon(LF_PCON); + TString dfr,dto; + pcon.zero(); + pcon.put(PCN_GRUPPO,grf); + pcon.put(PCN_CONTO,cof); + pcon.put(PCN_SOTTOCONTO,sof); + pcon.read(); + dfr = pcon.get(PCN_DESCR); + pcon.put(PCN_GRUPPO,grf); + pcon.put(PCN_CONTO,cof); + pcon.put(PCN_SOTTOCONTO,sof); + pcon.read(); + dto = pcon.get(PCN_DESCR); + m.select_pcon_range(dfr,dto); + } + else + m.select_pcon_range(grf,cof,sof,grt,cot,sot); } else if (k == K_F9) @@ -321,7 +356,25 @@ bool TSelection_ext_mask::ftopcon_handler(TMask_field& f, KEY k) grt = m.get_int(SC_PCONCODTO1); cot = m.get_int(SC_PCONCODTO2); sot = m.get_long(SC_PCONCODTO3); - m.select_pcon_range(grf,cof,sof,grt,cot,sot); + if (m.get_key() == 2) + { + TLocalisamfile pcon(LF_PCON); + TString dfr,dto; + pcon.zero(); + pcon.put(PCN_GRUPPO,grf); + pcon.put(PCN_CONTO,cof); + pcon.put(PCN_SOTTOCONTO,sof); + pcon.read(); + dfr = pcon.get(PCN_DESCR); + pcon.put(PCN_GRUPPO,grf); + pcon.put(PCN_CONTO,cof); + pcon.put(PCN_SOTTOCONTO,sof); + pcon.read(); + dto = pcon.get(PCN_DESCR); + m.select_pcon_range(dfr,dto); + } + else + m.select_pcon_range(grf,cof,sof,grt,cot,sot); } else if (k == K_F9) diff --git a/sc/sc2201.h b/sc/sc2201.h index 14d836c39..3eab78876 100755 --- a/sc/sc2201.h +++ b/sc/sc2201.h @@ -16,7 +16,7 @@ class TSelection_ext_mask : public TSelection_mask protected: void select_pcon_range(int grf, int cof,long sof,int grt,int cot, long sot); - void select_pcon_range(const char* des,int grt,int cot, long sot); + void select_pcon_range(TString& desfr, TString& desto); void set_pcon_limits(); virtual void reset_sheets();