From 8cdfa060e88402fe813fc361fc227485f50b3f60 Mon Sep 17 00:00:00 2001 From: bonazzi Date: Thu, 26 Apr 2018 21:30:33 +0000 Subject: [PATCH] Patch level : 12.0 570 Files correlati : cg4.exe cg5300a.uml Modificata la liquidazione delle fatture in ritardo Modificata la liquidazione 13 con pro rata e IVA per cassa git-svn-id: svn://10.65.10.50/branches/R_10_00@24488 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/cg/cg4300.h | 1 + src/cg/cg4301.cpp | 11 ++++++----- src/cg/cg4304.cpp | 30 ++++++++++++++++++------------ 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/cg/cg4300.h b/src/cg/cg4300.h index 9aa2f0962..cddfe7c78 100755 --- a/src/cg/cg4300.h +++ b/src/cg/cg4300.h @@ -308,6 +308,7 @@ class TLiquidazione_app : public TPrint_application real _diff_ven_ap, _diff_ven_ap_iva, _diff_acq_ap, _diff_acq_ap_iva; real _imposta_inc_diff_ven, _imposta_inc_cassa_ven, _imposta_inc_diff_acq, _imposta_inc_cassa_acq; + real _perc_ind_annual; // main cursor TRelation* _rel; diff --git a/src/cg/cg4301.cpp b/src/cg/cg4301.cpp index fa7d04b18..f928618b5 100755 --- a/src/cg/cg4301.cpp +++ b/src/cg/cg4301.cpp @@ -4114,9 +4114,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts) // toglie credito precedente cred_prec = credito_prec(month+deltam); risultato -= cred_prec; - risultato -= cred_fattrit; +// risultato -= cred_fattrit; res_cred += cred_prec; - res_cred += cred_fattrit; +// res_cred += cred_fattrit; // vedi se c'era un debito precedente per debiti < 50.000 debt_precd = debt_prec(month+deltam); risultato += debt_precd; @@ -4284,8 +4284,9 @@ void TLiquidazione_app::write_liq(int month, const char* codatts) _plm->put("R33", new_r33); _plm->rewrite(); - fdiffinc_iva_acq = fdiffinc_iva_acq - old_r33 + new_r33; - } + // fdiffinc_iva_acq = fdiffinc_iva_acq - old_r33 + new_r33; + fdiffinc_iva_acq = fdiffinc_iva_acq - new_r33; + } } } @@ -4478,7 +4479,7 @@ void TLiquidazione_app::write_liq(int month, const char* codatts) res_cred += detrazioni; risultato = res_debt - res_cred; - risultato -= cred_fattrit; +// risultato -= cred_fattrit; // tut ricalcule', riscrivem _lam->put("R0", iva_vend); diff --git a/src/cg/cg4304.cpp b/src/cg/cg4304.cpp index f373c6d94..e38497daf 100755 --- a/src/cg/cg4304.cpp +++ b/src/cg/cg4304.cpp @@ -2271,16 +2271,22 @@ void TLiquidazione_app::set_grand_2000(_DescrItem& d, int &rw) real perc_prorata; - TString query = "USE PLM"; - query << "\nFROM CODTAB=" << _year << "\nTO CODTAB=" << _year; - TISAM_recordset ip(query); - const TRectype& recp = ip.cursor()->curr(); - for (bool ok = ip.move_first(); ok && perc_prorata == ZERO; ok = ip.move_next()) + if (_month == 13) + perc_prorata = _perc_ind_annual; + else { - int m = atoi(ip.get("CODTAB").as_string().mid(10)); - real p = ip.get("R12").as_real(); - if (m == _month && (p > ZERO && p <= CENTO)) - perc_prorata = p; + TString query = "USE PLM"; + query << "\nFROM CODTAB=" << _year << "\nTO CODTAB=" << _year; + TISAM_recordset ip(query); + const TRectype& recp = ip.cursor()->curr(); + + for (bool ok = ip.move_first(); ok && perc_prorata == ZERO; ok = ip.move_next()) + { + int m = atoi(ip.get("CODTAB").as_string().mid(10)); + real p = ip.get("R12").as_real(); + if (m == _month && (p > ZERO && p <= CENTO)) + perc_prorata = p; + } } if (perc_prorata > ZERO) @@ -2346,6 +2352,7 @@ void TLiquidazione_app::set_grand_2000(_DescrItem& d, int &rw) // Se sono in visualizzazione stampo i due importi separati, altrimenti li sommo if (!_is_visliq) iva_acq += rett_cred; + iva_acq -= cred_fattrit; set_row(rw++, FR("@11g@bIVA detraibile@r per il periodo@58g%r"), &iva_acq); if (!diffinc_iva_acq.is_zero()) set_row(rw++,FR("@11g a liquidazione differita@58g%r"), &diffinc_iva_acq); @@ -2357,9 +2364,7 @@ void TLiquidazione_app::set_grand_2000(_DescrItem& d, int &rw) real iva_deb_cred = iva_vend - iva_acq + diffinc_iva - diffinc_iva_acq + xcasinc_iva - xcasinc_iva_acq; if (_is_visliq) iva_deb_cred += rett_debt - rett_cred; - if (_isannual) - iva_deb_cred.round(0); - + print_importo(rw++, TR("IVA a debito o a credito per il periodo"), iva_deb_cred); rw++; @@ -2782,6 +2787,7 @@ bool TLiquidazione_app::set_annual(_DescrItem& d) set_row(row++,""); const real perc_det = CENTO - d._r2; + _perc_ind_annual = d._r2; const real vol_aff = d._r0; const TString16 s1 = perc_det.stringa(); const TString16 s2 = d._r2.stringa();