From 41dcdb0818ddaae7e95efe700b21fab08f4533fc Mon Sep 17 00:00:00 2001 From: bonazzi Date: Wed, 21 Dec 2016 20:42:08 +0000 Subject: [PATCH] Patch level : 12.0 310 316 Files correlati : cg0.exe cg4.exe cg4300a.msk Eliminate le richieste di ricalcolo della liquidazione. Aggiunto il flag di definitiva modificabile dalla liquidazione. Due campi nuovi in liquidazione Calcola e Definitiva impostati dai flags sul mese. Da verificare, visto che le richieste erano molte (potrebbero esserne sfuggite), progressivi IVA, Liquidazione, Stampa registri e Visualizzazione liquidazione. git-svn-id: svn://10.65.10.50/branches/R_10_00@23473 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/cg/cg4300.cpp | 32 ++++++++++++++++---------------- src/cg/cg4300.h | 2 ++ src/cg/cg4301.cpp | 26 ++++++++++++++++++++++++-- src/cg/cg4302.cpp | 7 +++---- 4 files changed, 45 insertions(+), 22 deletions(-) diff --git a/src/cg/cg4300.cpp b/src/cg/cg4300.cpp index d7e52c4c3..3d3bdbb65 100755 --- a/src/cg/cg4300.cpp +++ b/src/cg/cg4300.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include @@ -516,6 +517,7 @@ bool TLiquidazione_app::set_print(int) _errors.destroy(); _reg_arr.destroy(); _codiva_arr.destroy(); + _lim_cleared = ini_get_bool(CONFIG_DITTA, "CG", "LimCleared"); switch(_menu) { @@ -622,8 +624,8 @@ bool TLiquidazione_app::ch_year_handler(TMask_field& f, KEY key) const bool def = lim.get_bool("B1"); const bool calc = !def && (lim.empty() || lim.get_bool("B0")); - msk.set(CG43_CHK_CALCULATE, calc, 0x3); - msk.set(CG43_CHK_FINAL, def, 0x3); + msk.set(CG43_CHK_CALCULATE, app()._lim_cleared && calc, 0x3); + msk.set(CG43_CHK_FINAL, app()._lim_cleared && def, 0x3); } return true; } @@ -757,8 +759,8 @@ bool TLiquidazione_app::lst_tm_handler(TMask_field& f, KEY key) const bool def = lim.get_bool("B1"); const bool calc = !def && (lim.empty() || lim.get_bool("B0")); - msk.set(CG43_CHK_CALCULATE, calc, 0x3); - msk.set(CG43_CHK_FINAL, def, 0x3); + msk.set(CG43_CHK_CALCULATE, app()._lim_cleared && calc, 0x3); + msk.set(CG43_CHK_FINAL, app()._lim_cleared && def, 0x3); // Abilita il ricalcolo solo se non e' richiesta esplicitamente la sola stampa if (msk.get_bool(CG43_CHK_CALCULATE)) msk.field(CG43_LST_CALC).enable(); @@ -896,7 +898,7 @@ void TLiquidazione_app::build_ditte_sheet(wht what) bool TLiquidazione_app::set_liquidazione() { TMask m("cg4300a"); - TRectype & lim = (TRectype &) get_lim(_month); + const TRectype & lim = get_lim(_month); const bool def = lim.get_bool("B1"); const bool calc = !def && (lim.empty() || lim.get_bool("B0")); @@ -913,8 +915,8 @@ bool TLiquidazione_app::set_liquidazione() m.set(CG43_FLD_ANNO, _year); m.set(CG43_LST_MESE, _month); m.set(CG43_CHK_STAMPA,"X"); // stampa abilitata per default - m.set(CG43_CHK_CALCULATE, calc, 0x3); - m.set(CG43_CHK_FINAL, def, 0x3); + m.set(CG43_CHK_CALCULATE, _lim_cleared && calc, 0x3); + m.set(CG43_CHK_FINAL, _lim_cleared && def, 0x3); m.set(CG43_RDB_VERS, _what); const KEY k = m.run(); @@ -925,16 +927,14 @@ bool TLiquidazione_app::set_liquidazione() _month = _what == trimestre ? m.get_int(CG43_LST_TRIM) : m.get_int(CG43_LST_MESE); - _year = m.get(CG43_FLD_ANNO); - _date = m.get(CG43_FLD_DATA); - _isprint = m.get_bool(CG43_CHK_STAMPA); - _recalc = m.get_bool(CG43_CHK_CALCULATE) ? one : never; - _printonly = !m.get_bool(CG43_CHK_CALCULATE); + _year = m.get(CG43_FLD_ANNO); + _date = m.get(CG43_FLD_DATA); + _isprint = m.get_bool(CG43_CHK_STAMPA); + _recalc = m.get_bool(CG43_CHK_CALCULATE) ? one : never; + _printonly = !m.get_bool(CG43_CHK_CALCULATE); + _definitiva = m.get_bool(CG43_CHK_FINAL); - if (_isprint) printer().setdate(_date); - lim.zero("B0"); - lim.put("B1", m.get_bool(CG43_CHK_FINAL)); - put_lim(lim); + if (_isprint) printer().setdate(_date); } return k == K_ENTER; } diff --git a/src/cg/cg4300.h b/src/cg/cg4300.h index 6acdcfceb..92bca6d83 100755 --- a/src/cg/cg4300.h +++ b/src/cg/cg4300.h @@ -301,6 +301,8 @@ class TLiquidazione_app : public TPrint_application bool _is_interactive; // lanciata da menu o da altro prog bool _is_visliq; // lanciata da visualizzazione liquidazione int _monthinatt; // mese inizio attivita' (serve per differita) + bool _lim_cleared; + bool _definitiva; real _diff_ven_ap, _diff_ven_ap_iva, _diff_acq_ap, _diff_acq_ap_iva; diff --git a/src/cg/cg4301.cpp b/src/cg/cg4301.cpp index d83831e54..d311e6a01 100755 --- a/src/cg/cg4301.cpp +++ b/src/cg/cg4301.cpp @@ -86,8 +86,30 @@ bool TLiquidazione_app::recalc_all() _isannual = _isriepilogo = _month == 13; TApplication::set_firm(codditta); - - // Imposta metodo arrotondamento imposte + + if (!_lim_cleared) + { + TCursor c(new TRelation("LIM")); + const int items = c.items(); + + for (c = 0L; c.pos() < items; ++c) + { + TRectype & rec = c.curr(); + + rec.zero("B0"); + rec.zero("B1"); + rec.rewrite(c.file()); + } + ini_set_bool(CONFIG_DITTA, "CG", "LimCleared", true); + } + + TRectype & lim = (TRectype &) get_lim(_month); + + lim.zero("B0"); + lim.put("B1", _definitiva); + put_lim(lim); + + // Imposta metodo arrotondamento imposte TIva_round ir; ir.set_default_iva_mode(atoi(_year), _isannual, codditta); diff --git a/src/cg/cg4302.cpp b/src/cg/cg4302.cpp index 79ae1755d..a7f657c88 100755 --- a/src/cg/cg4302.cpp +++ b/src/cg/cg4302.cpp @@ -483,10 +483,9 @@ const TRectype & TLiquidazione_app::get_lim(int month, bool create) if (lim.empty() && create) { - TRectype l(lim); - - l.put("CODTAB", key); - put_lim(l, false); + lim.zero(); + lim.put("CODTAB", key); + put_lim(lim, false); } // crea o posiziona la tabella gemella LAM