From a7c82fa894bd4344ce99a44edfc67721fce4ceb4 Mon Sep 17 00:00:00 2001 From: Mattia Tollari Date: Thu, 28 Feb 2019 11:11:45 +0000 Subject: [PATCH] Revert "Patch level : 12.0 714" This reverts commit 13d62fd1ac03f296465b0a44cc96bf3516d0dd69 --- src/cg/cg0800.cpp | 1 - src/cg/cg4300.cpp | 31 ++++--------------------------- src/cg/cg4300.h | 1 - src/cg/cg4300a.uml | 6 ++---- src/cg/cg4301.cpp | 6 +----- src/cg/cg4302.cpp | 10 ++-------- src/cg/cg4304.cpp | 6 ------ src/cg/cg4400a.uml | 6 ++---- src/cg/cg4b00.cpp | 2 -- src/cg/cglib05.cpp | 34 +++++----------------------------- src/cg/cglib05.h | 9 +++------ 11 files changed, 19 insertions(+), 93 deletions(-) diff --git a/src/cg/cg0800.cpp b/src/cg/cg0800.cpp index 8b2a68824..7aebf1db4 100644 --- a/src/cg/cg0800.cpp +++ b/src/cg/cg0800.cpp @@ -79,7 +79,6 @@ void TRiepilogoIVA_app::main_loop() { damese = 1; amese = 12; - recset->set_annuale(true); } const TDate da(1, damese, anno); diff --git a/src/cg/cg4300.cpp b/src/cg/cg4300.cpp index 842f2b6bf..a07935810 100755 --- a/src/cg/cg4300.cpp +++ b/src/cg/cg4300.cpp @@ -586,15 +586,10 @@ bool TLiquidazione_app::ch_year_handler(TMask_field& f, KEY key) (wht)f.mask().get_int(CG43_RDB_VERS) : all); TMask& msk = f.mask(); const int vers = msk.get_int(CG43_RDB_VERS); - int m = (vers == 3) ? msk.get_int(CG43_LST_TRIM) : msk.get_int(CG43_LST_MESE); - - app()._is_liq_acconto = (m == 20); - if (app()._is_liq_acconto) - m = 12; - + const int m = (vers == 3) ? msk.get_int(CG43_LST_TRIM) : msk.get_int(CG43_LST_MESE); const TRectype & lim = app().get_lim(m); const bool def = lim.get_bool("B1"); - const bool calc = app()._is_liq_acconto || (!def && (lim.empty() || lim.get_bool("B0"))); + const bool calc = !def && (lim.empty() || lim.get_bool("B0")); msk.set(CG43_CHK_CALCULATE, app()._lim_cleared && calc, 0x3); msk.set(CG43_CHK_FINAL, app()._lim_cleared && def, 0x3); @@ -695,11 +690,6 @@ bool TLiquidazione_app::what_freq_handler(TMask_field& f, KEY key) if (key == K_SPACE) { int month = f.mask().get_int(CG43_LST_MESE); - - app()._is_liq_acconto = (month == 20); - if (app()._is_liq_acconto) - month = 12; - if (f.get()[0] == '3') // trimestre intelligente { if (month > 3) @@ -788,11 +778,7 @@ bool TLiquidazione_app::chk_calculate_handler(TMask_field& f, KEY key) TMask& m = f.mask(); // Abilita solo se il mese di ricalcolo e' != 13 (annuale) e non e' checkkato il campo const int vers = m.get_int(CG43_RDB_VERS); - int mese = vers == 3 ? m.get_int(CG43_LST_TRIM) : m.get_int(CG43_LST_MESE); - - app()._is_liq_acconto = (mese == 20); - if (app()._is_liq_acconto) - mese = 12; + const int mese = vers == 3 ? m.get_int(CG43_LST_TRIM) : m.get_int(CG43_LST_MESE); const bool abilita = m.get_bool(CG43_CHK_CALCULATE) && mese != 13; m.enable(CG43_LST_CALC, abilita); } @@ -907,19 +893,10 @@ bool TLiquidazione_app::set_liquidazione() // handlers have set everything _month = _what == trimestre ? m.get_int(CG43_LST_TRIM) : m.get_int(CG43_LST_MESE); - app()._is_liq_acconto = (_month == 20); - if (app()._is_liq_acconto) - { - _month = 12; - _recalc = one; - } - else - _recalc = m.get_bool(CG43_CHK_CALCULATE) ? one : never; - - _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); diff --git a/src/cg/cg4300.h b/src/cg/cg4300.h index b9f35ef5c..cddfe7c78 100755 --- a/src/cg/cg4300.h +++ b/src/cg/cg4300.h @@ -304,7 +304,6 @@ class TLiquidazione_app : public TPrint_application int _monthinatt; // mese inizio attivita' (serve per differita) bool _lim_cleared; bool _definitiva; - bool _is_liq_acconto; bool _end_cassa; real _diff_ven_ap, _diff_ven_ap_iva, _diff_acq_ap, _diff_acq_ap_iva; diff --git a/src/cg/cg4300a.uml b/src/cg/cg4300a.uml index 36aba7a53..4b896ee9e 100755 --- a/src/cg/cg4300a.uml +++ b/src/cg/cg4300a.uml @@ -27,16 +27,15 @@ BEGIN CHECKTYPE REQUIRED END -LIST CG43_LST_MESE 20 +LIST CG43_LST_MESE 15 BEGIN PROMPT 28 3 "Periodo " HELP "Mese per cui effettuare il calcolo liquidazione" ITEM "13|13a liquid." - ITEM "20|Acconto Dicembre" FLAGS "MP" END -LIST CG43_LST_TRIM 20 +LIST CG43_LST_TRIM 15 BEGIN PROMPT 28 3 "Periodo " HELP "Trimestre di cui effettuare il calcolo liquidazione" @@ -45,7 +44,6 @@ BEGIN ITEM "9|3 Trimestre " ITEM "12|4 Trimestre" ITEM "13|13a liquid." - ITEM "20|Acconto Dicembre" END BOOLEAN CG43_CHK_CALCULATE diff --git a/src/cg/cg4301.cpp b/src/cg/cg4301.cpp index 1a0adccbe..a9fb93283 100755 --- a/src/cg/cg4301.cpp +++ b/src/cg/cg4301.cpp @@ -4170,12 +4170,8 @@ void TLiquidazione_app::write_liq(int month, const char* codatts) if (risul > ZERO) { if (gestione_manuale_credito_compensabile) - { credito_utilizzato_iva = lim.get_real("R15"); - credito_utilizzato_iva = min(risul, credito_utilizzato_iva); - } - else - credito_utilizzato_iva = min(risul, credito_utilizzabile); + credito_utilizzato_iva = min(risul, credito_utilizzato_iva); res_cred += credito_utilizzato_iva; risultato -= credito_utilizzato_iva; } diff --git a/src/cg/cg4302.cpp b/src/cg/cg4302.cpp index ba6bee792..6494e6ac9 100755 --- a/src/cg/cg4302.cpp +++ b/src/cg/cg4302.cpp @@ -57,8 +57,7 @@ bool TLiquidazione_app::is_month_ok(int x, int mtocalc) const { // per l'annuale ritorna true per tutti i mesi da liquidare ret = x <= 13; - } - + } return ret; } @@ -139,12 +138,7 @@ bool TLiquidazione_app::is_date_ok(const TDate& d, int month, int liqmonth, int else // Nuova selezione dal 1998 in poi { if (month <= 12) - { - if (_is_liq_acconto) - return (regyear == year) && ((regmonth == month && liqmonth == 0) || (liqmonth == month)) && (d.day() <= _ver->giorno_acc()); - else - return (regyear == year) && ((regmonth == month && liqmonth == 0) || (liqmonth == month)); - } + return (regyear == year) && ((regmonth == month && liqmonth == 0) || (liqmonth == month)); else // Annuale, month == 13 return (regyear == year && liqmonth != 12) || (regyear == year + 1 && liqmonth == 12); } diff --git a/src/cg/cg4304.cpp b/src/cg/cg4304.cpp index 5fcddd4b9..178473231 100755 --- a/src/cg/cg4304.cpp +++ b/src/cg/cg4304.cpp @@ -1440,9 +1440,6 @@ void TLiquidazione_app::set_firm(_DescrItem& d) if (d._s2 == "T") tim_title << format(FR(" del %d° Trimestre %s"), d._f1/3, (const char*) _year); else - if (_is_liq_acconto) - tim_title << format(FR(" al %d %s %s"), _ver->giorno_acc(), itom(d._f1), (const char*)_year); - else tim_title << format(FR(" del mese di %s %s"), itom(d._f1), (const char*)_year); } @@ -1504,9 +1501,6 @@ void TLiquidazione_app::set_att(_DescrItem& d) if (d._s4 == "T") tim_title << format(FR(" del %d° Trimestre %s"), d._f1 / 3, (const char*)_year); else - if (_is_liq_acconto) - tim_title << format(FR(" al %d %s %s"), _ver->giorno_acc(), itom(d._f1), (const char*)_year); - else tim_title << format(FR(" del mese di %s %s"), itom(d._f1), (const char*)_year); } diff --git a/src/cg/cg4400a.uml b/src/cg/cg4400a.uml index 6aff78fc7..8961e2c40 100755 --- a/src/cg/cg4400a.uml +++ b/src/cg/cg4400a.uml @@ -158,20 +158,18 @@ BEGIN GROUP 3 END -LISTBOX FINO_A_MESE 20 +LISTBOX FINO_A_MESE 10 BEGIN PROMPT 3 9 "Fino al mese " HELP "Mese fino al quale eseguire la stampa" - ITEM "20|Acconto di dicembre" FLAGS "M" GROUP 1 END -LISTBOX MESE 20 +LISTBOX MESE 10 BEGIN PROMPT 3 9 "Mese " HELP "Mese di cui eseguire la stampa" - ITEM "20|Acconto di dicembre" FLAGS "M" GROUP 2 END diff --git a/src/cg/cg4b00.cpp b/src/cg/cg4b00.cpp index e35ac5c07..d8ee42f44 100644 --- a/src/cg/cg4b00.cpp +++ b/src/cg/cg4b00.cpp @@ -125,8 +125,6 @@ void TRiepilogoIVA_app::main_loop() recset->set_registrazioneIVAritardo(m.get_bool(F_REGRIT)); recset->set_from(m.get_date(F_DADATA)); recset->set_to(m.get_date(F_ADATA)); - recset->set_annuale((m.get_date(F_DADATA).month() == 1) && (m.get_date(F_ADATA).month() == 12) - ); recset->set_from_conto(m.get_long(F_DAGRUPPO), m.get_long(F_DACONTO), m.get_long(F_DASOTTOC)); if (m.get_long(F_DAGRUPPO) != 0) diff --git a/src/cg/cglib05.cpp b/src/cg/cglib05.cpp index adee1cddf..8e249deab 100644 --- a/src/cg/cglib05.cpp +++ b/src/cg/cglib05.cpp @@ -1,16 +1,4 @@ #include "cglib05.h" -#include - -enum tiporeg { - vendita = 1, - acquisto = 2, - riepilogativo = 3, - incassi = 4, - giornale = 5, - sociale = 6, - cespiti = 7 -}; - /////////////////////////////////////////////////////////// // TRiepilogoIVA_recordset /////////////////////////////////////////////////////////// @@ -63,7 +51,7 @@ void TRiepilogoIVA_recordset::requery() TAssoc_array work_array; TString16 reg_fieldname; reg_fieldname << LF_MOV << "." << MOV_REG; TString16 datareg_fieldname; datareg_fieldname << LF_MOV << "." << MOV_DATAREG; - TString16 datadoc_fieldname; datadoc_fieldname << LF_MOV << "." << MOV_DATADOC; + TString16 datacomp_fieldname; datacomp_fieldname << LF_MOV << "." << MOV_MESELIQ; TString16 meseliq_fieldname; meseliq_fieldname << LF_MOV << "." << MOV_MESELIQ; int p = wrk.find("FROMDATE"); @@ -126,19 +114,7 @@ void TRiepilogoIVA_recordset::requery() } if (registrazioneIVAritardo()) { - const TDate datadoc = recset.get(datadoc_fieldname).as_date(); - const TString4 codreg = recset.get(reg_fieldname).as_string(); - const TRegistro reg(codreg); - const TipoIVA tipo = reg.iva(); // 1=Vendite; 2=Acquisti - - const bool fatt_rit_2018 = recset.get(TOSTRING(LF_MOV) "." MOV_DATAREG).as_bool() && (data.year() >= 2018); - const int year_diff = data.year() - datadoc.year(); - const bool fattritind = ((tipo == iva_acquisti) && fatt_rit_2018) && - ((year_diff > 2) || ((year_diff >= 1) && data.month() >= 5)); - const bool fattrit = ((tipo == iva_acquisti) && !fattritind && fatt_rit_2018) && (year_diff >= 1); - - if (fattrit && !annuale() && _to_date.year() == datadoc.year()) - continue; + TDate datacomp = recset.get(datacomp_fieldname).as_date(); } if (senzacompetenzaIVA() && (data < _from_date || data > _to_date)) continue; @@ -299,9 +275,9 @@ const TVariant& TRiepilogoIVA_recordset::get(unsigned int column) const } TRiepilogoIVA_recordset::TRiepilogoIVA_recordset() : TRecordset(), _pos(0), _from_date(botime), _to_date(eotime), -_from_gruppo(0), _from_conto(0), _from_sottoconto(0L), -_to_gruppo(999), _to_conto(999), _to_sottoconto(999999L), _freezed(false), _annuale(false) - + _from_gruppo(0), _from_conto(0), _from_sottoconto(0L), + _to_gruppo(999), _to_conto(999), _to_sottoconto(999999L), + _freezed(false) { add_field(_alfafld, 101, 4, COD); add_field(_alfafld, 102, 50, DESC); diff --git a/src/cg/cglib05.h b/src/cg/cglib05.h index 2c80c89e7..6db91dcc9 100644 --- a/src/cg/cglib05.h +++ b/src/cg/cglib05.h @@ -32,7 +32,6 @@ class TRiepilogoIVA_recordset : public TRecordset long _to_sottoconto; TArray _info; bool _freezed; - bool _annuale; protected: virtual const TVariant& get_field(int num, const char* field) const; @@ -60,11 +59,9 @@ public: virtual bool set_senzacompetenzaIVA(bool on) { return true; } virtual bool set_competenzadiversaIVA(bool on) { return false; } virtual bool set_registrazioneIVAritardo(bool on) { return false; } - virtual bool set_annuale(bool on) { _annuale = on; return _annuale; } - virtual bool senzacompetenzaIVA() const { return true; } - virtual bool competenzadiversaIVA() const { return false; } - virtual bool registrazioneIVAritardo() const { return false; } - virtual bool annuale() const { return _annuale; } + virtual bool senzacompetenzaIVA() { return true; } + virtual bool competenzadiversaIVA() { return false; } + virtual bool registrazioneIVAritardo() { return false; } TRiepilogoIVA_recordset(); virtual ~TRiepilogoIVA_recordset() { }