From 061974bc798be431267ddb8cf6460b22090c1492 Mon Sep 17 00:00:00 2001 From: villa Date: Fri, 19 Jan 1996 11:49:17 +0000 Subject: [PATCH] Corretti arrotondamenti per check a IVA_NOTIFY Modifiche notifica ricalcolo liquidazione per Enrica Aggiunto mese ultima liquidazione a TRegistro git-svn-id: svn://10.65.10.50/trunk@2473 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg2101.cpp | 6 +++--- cg/cg2102.cpp | 9 ++++++--- cg/cg2103.h | 1 + cg/pagament.h | 4 +++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/cg/cg2101.cpp b/cg/cg2101.cpp index 3e3316977..65f02c532 100755 --- a/cg/cg2101.cpp +++ b/cg/cg2101.cpp @@ -129,13 +129,13 @@ bool TMovimentoPN::controlla_liquidazione(const TDate& data, TRegistro& registro lim.setkey(1); lim.put("CODTAB", key); if (lim.read() == NOERR) - calcolata = lim.get_bool("B1"); // Controlla se calcolata in definitivo + calcolata = data.month() <= registro.mese_stampa_ultima_liq(); // Controlla se progressivi ricalcolati (registri) - if (reset && lim.get_bool("B0")) + if (reset) { // Resetta i flag di calcolato sulla liquidazione IVA del mese di registrazione lim.zero("B0"); // calcolato - lim.zero("B1"); // definitivo + lim.zero("B1"); // progressivi ricalcolati lim.rewrite(); } diff --git a/cg/cg2102.cpp b/cg/cg2102.cpp index c4cab45ce..3dff9b08d 100755 --- a/cg/cg2102.cpp +++ b/cg/cg2102.cpp @@ -1250,7 +1250,6 @@ bool TPrimanota_application::iva_notify(TSheet_field& iva, int r, KEY k) if (app().is_fattura() && m.insert_mode()) { - bool rec = TRUE; TPagamento& pag = app().pagamento(); real imposta, imponibile; if (pag.in_valuta()) @@ -1263,8 +1262,12 @@ bool TPrimanota_application::iva_notify(TSheet_field& iva, int r, KEY k) imposta = m.get_real(F_IMPOSTE); imponibile = m.get_real(F_TOTALE) - imposta; } - rec = (pag.imposta() != imposta || pag.imponibile() != imponibile); - if (rec) app().set_scadenze(m); // Ricalcola rate + imposta.round(pag.round()); imponibile.round(pag.round()); + real pimposta(pag.imposta()); real pimponibile(pag.imponibile()); + pimposta.round(pag.round()); pimponibile.round(pag.round()); + + if (pimposta != imposta || pimponibile != imponibile) + app().set_scadenze(m); // Ricalcola rate } } return TRUE; diff --git a/cg/cg2103.h b/cg/cg2103.h index 775abd4d5..3fb149b91 100755 --- a/cg/cg2103.h +++ b/cg/cg2103.h @@ -55,6 +55,7 @@ public: int year() const; TDate last_reg() const { return _rec.get_date("D2"); } TDate last_print() const { return _rec.get_date("D3"); } + long mese_stampa_ultima_liq() const { return _rec.get_long("I4"); } long protocol() const { return _rec.get_long("I5"); } const TString& attivita() const { return _rec.get("S8"); } diff --git a/cg/pagament.h b/cg/pagament.h index 8b1e521d7..dd3078a20 100755 --- a/cg/pagament.h +++ b/cg/pagament.h @@ -85,7 +85,7 @@ protected: public: // pregasi notare la straordinaria dovizia di const - int n_rate() const { return _rate.items(); } + const int n_rate() const { return _rate.items(); } bool is_new() const { return _new; } bool dirty() const { return _dirty; } @@ -93,6 +93,8 @@ public: real imposta() const { return _imposta; } real spese() const { return _spese; } + const int round() const { return _round; } + int scad_rata(int n) const { return _rata_ifield(n,0);} real perc_rata(int n) const { return _rata_rfield(n,1);} int tipo_rata(int n) const { return _rata_ifield(n,2);}