From 18f266696be681bf002f663bc0a664103b8951e2 Mon Sep 17 00:00:00 2001 From: villa Date: Thu, 1 Jun 1995 14:59:53 +0000 Subject: [PATCH] Aggiustati riepiloghi quater da stampa registri Kaciatella visualizzazione git-svn-id: svn://10.65.10.50/trunk@1426 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg4300.h | 2 +- cg/cg4301.cpp | 37 +++++++++++++++++++++++++------------ cg/cg4303.cpp | 7 ++++--- cg/cg4304.cpp | 2 +- cg/cg5500.cpp | 5 +++++ 5 files changed, 36 insertions(+), 17 deletions(-) diff --git a/cg/cg4300.h b/cg/cg4300.h index 15f3b4d18..4271f5684 100755 --- a/cg/cg4300.h +++ b/cg/cg4300.h @@ -351,7 +351,7 @@ public: void zero_annual (int month); void recalc_att (int month, const char* codatt); void recalc_annual (const char* codatt); - _DescrItem* recalc_rimborso(int month, const char* codatts); + _DescrItem* recalc_rimborso(int month, const char* codatts, bool print); // ricalcolo liquidazioni dai progressivi mensili void write_liq (int month, const char* atts); diff --git a/cg/cg4301.cpp b/cg/cg4301.cpp index 610e01f33..3a5a9066c 100755 --- a/cg/cg4301.cpp +++ b/cg/cg4301.cpp @@ -175,6 +175,10 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) // azzera rimborsi zero_firm(month); + // casini per stampa minchie in coda ai registri + bool riepliq = FALSE; + bool stliq = FALSE; + _nditte->save_status(); if (_nditte->is_first_match(LF_ATTIV)) { @@ -204,7 +208,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) { _vend_arr.destroy(); _corr_arr.destroy(); - } + } cattivs = ""; @@ -250,15 +254,23 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) _pla->put("S3","0"); _pla->rewrite(); } - - for (_reg->first(); !_isvent && _reg->good(); _reg->next()) + + + for (_reg->first(); _reg->good(); _reg->next()) { if (codatt == _reg->get("S8") && _reg->get_int("I0") == 2) - _isvent = _reg->get_bool("B3"); + { + if (!_isvent) _isvent = _reg->get_bool("B3"); + if (!riepliq) riepliq = _reg->get_bool("B6"); + if (!stliq) stliq = _reg->get_bool("B7"); + } } - + + if (!_isregis) + stliq = riepliq = TRUE; + if (calc || !recalc) - if (!update_att(month, cattiv)) + if (!update_att(month, cattiv) && stliq) describe_error("Attivita' non ricalcolate: possibili errori", codatt); @@ -271,21 +283,22 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) !_plm->get_real("R1").is_zero(); } - if (month == _month) - describe_att(month,cattiv,gheravergot, '0' + (_mixed ? tipoatt : 0)); + if (month == _month && riepliq) + describe_att(month, cattiv, gheravergot, + '0' + (_mixed ? tipoatt : 0)); atts.add(cattiv); cattivs.add(cattiv); } // for tipoatt // se attivita' mista stampa riepilogo - if (_mixed && month == _month) + if (_mixed && month == _month && riepliq) describe_att(month,cattivs, TRUE, 'M'); } while (_nditte->next_match(LF_ATTIV)); // se quater stampa riepilogo - if (quater && month == _month) + if (quater && month == _month && riepliq) describe_att(month,atts, TRUE, 'Q'); // occorre poterla chiamare altre volte con mesi diversi @@ -303,10 +316,10 @@ bool TLiquidazione_app::update_firm(int month, bool recalc) // unica nel suo genere, recalc_rimborso ritorna // un bel descritem (NULL se non si rimborsa un cas) // da passare a describe_liq - rimb_d = recalc_rimborso(month,atts); + rimb_d = recalc_rimborso(month,atts, stliq); } - if (month == _month) + if (month == _month && stliq) { describe_firm(month); describe_liq(_month, atts, _isregis ? NULL : rimb_d); diff --git a/cg/cg4303.cpp b/cg/cg4303.cpp index 9584310f5..b01570d49 100755 --- a/cg/cg4303.cpp +++ b/cg/cg4303.cpp @@ -264,7 +264,8 @@ public: }; -_DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts) +_DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts, + bool stliq) { // calcola condizioni per il diritto al rimborso infracazzuale // chiamata soltanto per i trimestri anche se annuale @@ -292,7 +293,7 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts) } // condizione 1 - if (!vol_aff.is_zero() && (es_ni/vol_aff) > MIN_PARTE_ESENTE) + if (stliq && !vol_aff.is_zero() && (es_ni/vol_aff) > MIN_PARTE_ESENTE) { rimborsami = TRUE; d = new _DescrItem(RIMBORSO); @@ -462,7 +463,7 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts) alv = ivav/vtot; alv.round(2); ala = ivaa/atot; ala.round(2); - if ((ala - alv) > SOGLIA_MAGGIORE_ALIQUOTA_DEL_CAZZO_PER_AVER_DIRITTO_AL_RIMBORSO) + if (stliq && (ala - alv) > SOGLIA_MAGGIORE_ALIQUOTA_DEL_CAZZO_PER_AVER_DIRITTO_AL_RIMBORSO) { rimborsami = TRUE; if (d == NULL) d = new _DescrItem(RIMBORSO); diff --git a/cg/cg4304.cpp b/cg/cg4304.cpp index 1c37b9adf..63d393b5e 100755 --- a/cg/cg4304.cpp +++ b/cg/cg4304.cpp @@ -1412,7 +1412,7 @@ bool TLiquidazione_app::set_annual(_DescrItem& d) int row = get_maxrow()+1; if (d._f0 & IS_PRORATA) { - set_bookmark("Calcolo pro-rata", _firm_bookmark); + set_bookmark("Calcolo pro-rata", _att_bookmark); ret = TRUE; set_print_zero(TRUE); diff --git a/cg/cg5500.cpp b/cg/cg5500.cpp index f4c9ba26a..8872b8752 100755 --- a/cg/cg5500.cpp +++ b/cg/cg5500.cpp @@ -425,6 +425,11 @@ bool Visliq_app::vis_liq() select_butt(m); else if (k == K_ENTER) { + if (m.get(F_CODDITTA).empty() || m.get(F_RAGSOC).empty()) + { + beep(); + continue; + } long dtt = m.get_long(F_CODDITTA); set_firm(dtt);