From 0a868c34696a280c5ac5de212a8b9789968dcaa6 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 19 Oct 1994 10:01:06 +0000 Subject: [PATCH] Corretti errori 1214 e MI036 Modificato il cursore sui movimenti usando la chiave 2 Corretta la lettura del tipo attivita' git-svn-id: svn://10.65.10.50/trunk@399 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg4300.cpp | 65 +++++++++++++++++++++++++++++++++++++-------------- cg/cg4301.cpp | 21 ++++++++++------- 2 files changed, 59 insertions(+), 27 deletions(-) diff --git a/cg/cg4300.cpp b/cg/cg4300.cpp index fc78097da..834fdf1c7 100755 --- a/cg/cg4300.cpp +++ b/cg/cg4300.cpp @@ -6,6 +6,7 @@ #include "cg4300.h" #include "cg4300a.h" +#include inline CG4300_App& app() { return (CG4300_App&)main_app(); } @@ -44,7 +45,7 @@ void CG4300_App::user_create() _rel = new TRelation(LF_MOV); _rel->add(LF_RMOVIVA,"NUMREG=NUMREG"); - _cur = new TCursor(_rel); + _cur = new TCursor(_rel, "", 2); (*_cur) = 0; _pim = new TTable("PIM"); @@ -151,8 +152,6 @@ void CG4300_App::user_destroy() bool CG4300_App::set_print(int n) { - TString yy = _year; - _descr_arr.destroy(); switch(n) @@ -163,11 +162,21 @@ bool CG4300_App::set_print(int n) { if (_selected.ones() > 0l) { - if (_year != yy) - { - TString cond(format("ANNOES=%s",(const char*)_year)); - _cur->setfilter(cond); - } + /* if (_year != yy) + { + TString cond(format("ANNOES=%s",(const char*)_year)); + _cur->setfilter(cond); + }*/ + TRectype & mov = _cur->curr(); + TRectype from(_cur->curr()); from.zero(); + TRectype to(mov); + TDate f(1, _recalc == one ? _month : 1, atoi(_year)); + TDate t(1, _month, atoi(_year)); + + t.set_end_month(); + from.put(MOV_DATAREG, f); + to.put(MOV_DATAREG, t); + _cur->setregion(from, to); recalc_all(); return _isprint; } @@ -178,11 +187,21 @@ bool CG4300_App::set_print(int n) _isprint = FALSE; if (set_deleghe()) { - if (_year != yy) - { - TString cond(format("ANNOES=%s",(const char*)_year)); - _cur->setfilter(cond); - } + /* if (_year != yy) + { + TString cond(format("ANNOES=%s",(const char*)_year)); + _cur->setfilter(cond); + } */ + TRectype & mov = _cur->curr(); + TRectype from(_cur->curr()); from.zero(); + TRectype to(mov); + TDate f(1, _recalc == one ? _month : 1, atoi(_year)); + TDate t(1, _month, atoi(_year)); + + t.set_end_month(); + from.put(MOV_DATAREG, f); + to.put(MOV_DATAREG, t); + _cur->setregion(from, to); extract_deleghe(); return FALSE; } @@ -191,11 +210,21 @@ bool CG4300_App::set_print(int n) _isprint = TRUE; if (set_acconto()) { - if (_year != yy) - { - TString cond(format("ANNOES=%s",(const char*)_year)); - _cur->setfilter(cond); - } + /* if (_year != yy) + { + TString cond(format("ANNOES=%s",(const char*)_year)); + _cur->setfilter(cond); + }*/ + TRectype & mov = _cur->curr(); + TRectype from(_cur->curr()); from.zero(); + TRectype to(mov); + TDate f(1, _recalc == one ? _month : 1, atoi(_year)); + TDate t(1, _month, atoi(_year)); + + t.set_end_month(); + from.put(MOV_DATAREG, f); + to.put(MOV_DATAREG, t); + _cur->setregion(from, to); recalc_acconti(); return _isprint; } diff --git a/cg/cg4301.cpp b/cg/cg4301.cpp index de2d338c8..9e8ceb5d9 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -96,18 +96,21 @@ bool CG4300_App::update_firm(int month, bool recalc) TString cattiv(codatt); cattiv << tipoatt; - look_pla(cattiv, TRUE); - - _p8 = _pla->get_real("R5"); - _p8b = _pla->get_real("R6"); - _p9 = _pla->get_real("R7"); - _prorata = _pla->get_real("R8"); - _isplafond = !(_p8.is_zero() && _p8b.is_zero() && - _p9.is_zero()); + if (look_pla(cattiv, FALSE)) + { + _p8 = _pla->get_real("R5"); + _p8b = _pla->get_real("R6"); + _p9 = _pla->get_real("R7"); + _prorata = _pla->get_real("R8"); + _isplafond = !(_p8.is_zero() && _p8b.is_zero() && + _p9.is_zero()); + _isservizio = _pla->get("S7") == "S"; + } + else + _isservizio = _nditte->curr(LF_ATTIV).get("TIPOATT") == "S"; _isviaggio = _nditte->curr(LF_ATTIV).get_bool("REG74TER"); _isagricolo = _nditte->curr(LF_ATTIV).get_bool("REGAGR"); _isbenzinaro = _nditte->curr(LF_ATTIV).get_bool("ART74/4"); - _isservizio = _nditte->curr(LF_ATTIV).get("TIPOATT") == "S"; _freqviva = look_lia() ? _lia->get("S7") : _nditte->curr().get("FREQVIVA"); bool mens = _freqviva == "M"; _isannual = (_month == 12 && !mens && !_isbenzinaro) ||