From 15af75c8239aa87e6e69dfe1ee15937072f741a2 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 9 Apr 2003 08:41:07 +0000 Subject: [PATCH] Patch level : 2.0 450 Files correlati : sc2.exe Ricompilazione Demo : [ ] Commento : CM701063 Nella stampa degli estratti conto con la selezione per agente fare in modo che vengano considerati anche i pagamenti non assegnati. git-svn-id: svn://10.65.10.50/trunk@10996 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- sc/sc2100.cpp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/sc/sc2100.cpp b/sc/sc2100.cpp index 5df99f742..46906168f 100755 --- a/sc/sc2100.cpp +++ b/sc/sc2100.cpp @@ -1249,12 +1249,13 @@ protected: // TSkeleton_application virtual void on_firm_change(); virtual void on_config_change(); + void find_agents_scads(TAssoc_array& agents); + void find_agents_unassigned_pags(TAssoc_array& agents); + public: static TStampaEC_application& app() { return (TStampaEC_application&)main_app(); } - long find_agents_games(TAssoc_array& agents); -public: TEC_mask& mask() { return *_msk; } TCursor_sheet& sheet() { return _msk->cur_sheet(); } TEC_form& form() { return *_form; } @@ -1321,7 +1322,7 @@ bool TStampaEC_application::print_selected() return TRUE; } -long TStampaEC_application::find_agents_games(TAssoc_array& agents) +void TStampaEC_application::find_agents_scads(TAssoc_array& agents) { const TString& fromage = mask().get(F_FROM_AGENT); const TString& toage = mask().get(F_TO_AGENT); @@ -1368,7 +1369,52 @@ long TStampaEC_application::find_agents_games(TAssoc_array& agents) } games->add_game(curr); } +} + +void TStampaEC_application::find_agents_unassigned_pags(TAssoc_array& agents) +{ + const TString& fromage = mask().get(F_FROM_AGENT); + const TString& toage = mask().get(F_TO_AGENT); + + TRelation rel(LF_PAGSCA); + TRectype& curr = rel.curr(); + curr.put(PAGSCA_TIPOC, mask().get(SC_CLIFO)); + + TString filter; + filter << '(' << PAGSCA_NRATA <<"==9999)"; + if (fromage.not_empty()) + filter << "&&(" << PAGSCA_CODAG << ">=" << fromage << ')'; + else + filter << "&&(" << PAGSCA_CODAG << ">0)"; + if (toage.not_empty()) + filter << "&&(" << PAGSCA_CODAG << "<=" << toage << ')'; + + TCursor cur(&rel, filter, 1, &curr, &curr); + const long items = cur.items(); + cur.freeze(); + + TProgind pi(items, "Ricerca oagamenti non assegnati per agente...", TRUE, TRUE); + for (cur = 0L; cur.pos() < items; ++cur) + { + pi.addstatus(1); + if (pi.iscancelled()) + break; + const char* codag = curr.get(PAGSCA_CODAG); + TEC_Game_list* games = (TEC_Game_list*)agents.objptr(codag); + if (games == NULL) + { + games = new TEC_Game_list; + agents.add(codag, (TObject*)games); + } + games->add_game(curr); + } +} + +long TStampaEC_application::find_agents_games(TAssoc_array& agents) +{ + find_agents_scads(agents); + find_agents_unassigned_pags(agents); return agents.items(); }