From 78f39e04aeb2e1d95c1f3878d25f8497b4f41d28 Mon Sep 17 00:00:00 2001 From: bonazzi Date: Fri, 13 Oct 2017 06:53:37 +0000 Subject: [PATCH] Patch level 60 Files correlati : 770.exe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le schede percipienti non calcolavano più la ritenuta a partire dal compenso. git-svn-id: svn://10.65.10.50/branches/R_10_00@24142 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/m770/770100.cpp | 35 +++++++++++++++++++++++++++++------ src/m770/770102.cpp | 18 +++++++++++++++--- src/m770/770102.h | 3 ++- 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/m770/770100.cpp b/src/m770/770100.cpp index bb6111523..3ad894335 100755 --- a/src/m770/770100.cpp +++ b/src/m770/770100.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "scperc.h" #include "rver.h" @@ -1251,6 +1252,15 @@ void TSchedaPercipienti::mask2rel(const TMask& m) const real h_PercInps = m.get_real(F_PERC_INPS); const real h_PercAssImpInps = m.get_real(F_PERC_ASS_INPS); const real h_PercCommitInps = m.get_real(F_PERC_COMMIT_INPS); + const TString& codcau = m.get(F_CODCAUS); + TTable cau("%ca7"); + cau.zero(); + cau.put("CODTAB", codcau); + if (cau.read() != NOERR) + warning_box("Causale non presente in tabella"); + + const int h_CodNonSogg = cau.get_int("I1"); + // istanza struttura di comodo per calcolo riga pagamenti Pag_struct c; @@ -1308,7 +1318,8 @@ void TSchedaPercipienti::mask2rel(const TMask& m) h_PercRitenuta, h_PercInps, h_PercAssImpInps, - h_PercCommitInps); + h_PercCommitInps, + h_CodNonSogg); // compilo restanti campi r.put("DATAPAG", s.datapag); @@ -1495,6 +1506,17 @@ bool TSchedaPercipienti::activate_pag_sheet(TMask& m) const real h_PercInps = m.get_real(F_PERC_INPS); const real h_PercAssImpInps = m.get_real(F_PERC_ASS_INPS); const real h_PercCommitInps = m.get_real(F_PERC_COMMIT_INPS); + + const TString& codcau = m.get(F_CODCAUS); + TTable cau("%ca7"); + cau.zero(); + cau.put("CODTAB", codcau); + if (cau.read() != NOERR) + warning_box("Causale non presente in tabella"); + + const int h_CodNonSogg = cau.get_int("I1"); + + // istanza strutture per calcolo Pag_struct c; Pag_struct s; @@ -1513,7 +1535,8 @@ bool TSchedaPercipienti::activate_pag_sheet(TMask& m) h_PercRitenuta, h_PercInps, h_PercAssImpInps, - h_PercCommitInps); + h_PercCommitInps, + h_CodNonSogg); from_struct_to_sheet(s, t); } } @@ -2170,7 +2193,8 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s, const real& h_PercRitenuta, const real& h_PercInps, const real& h_PercAssImpInps, - const real& h_PercCommitInps) const + const real& h_PercCommitInps, + const int h_CodNonSogg) const { const int fdec = TCurrency::get_firm_dec(); @@ -2186,9 +2210,8 @@ Pag_struct& TSchedaPercipienti::calcola_riga_pag(Pag_struct& s, // calcolo imponibile c.imponibile = (s.compenso - s.impcpa) * h_PercAssImp / CENTO; c.imponibile.round(fdec); - //if (s.imponibile.is_zero() || force) // 18-02-2016 imponibile nullo ammissibile per minimi -// if (force) - s.imponibile = c.imponibile; + if ((s.imponibile.is_zero() && s.perc > ZERO && h_CodNonSogg == 0) || force) // 18-02-2016 imponibile nullo ammissibile per minimi + s.imponibile = c.imponibile; // 13-10-2017 testati i minimi con la causale s.perc > ZERO && h_CodNonSogg == 0 non è un minimo // percentuale ritenuta acconto if (s.perc.is_zero() || force) diff --git a/src/m770/770102.cpp b/src/m770/770102.cpp index 94c7857a4..1ebb4bf34 100755 --- a/src/m770/770102.cpp +++ b/src/m770/770102.cpp @@ -55,6 +55,7 @@ void TSchedaPercipienti::init_mask(TMask& m, bool inserimento) const real h_PercInps = cau.get_real("R1"); const real h_PercAssImpInps = cau.get_real("R2"); const real h_PercCommitInps = cau.get_real("R3"); + const int h_CodNonSogg = cau.get_int("I1"); Pag_struct c; Pag_struct s; TToken_string& t = pags.row(0); @@ -67,7 +68,8 @@ void TSchedaPercipienti::init_mask(TMask& m, bool inserimento) h_PercRitenuta, h_PercInps, h_PercAssImpInps, - h_PercCommitInps); + h_PercCommitInps, + h_CodNonSogg); from_struct_to_sheet(s, t); // forzo ridisegno sheet pags.force_update(); @@ -790,7 +792,16 @@ bool TSchedaPercipienti::pag_standard_handler(TMask_field& f, KEY k) const real h_PercInps = mm.get_real(F_PERC_INPS); const real h_PercAssImpInps = mm.get_real(F_PERC_ASS_INPS); const real h_PercCommitInps = mm.get_real(F_PERC_COMMIT_INPS); - + + const TString& codcau = mm.get(F_CODCAUS); + TTable cau("%ca7"); + cau.zero(); + cau.put("CODTAB", codcau); + if (cau.read() != NOERR) + warning_box("Causale non presente in tabella"); + + const int h_CodNonSogg = cau.get_int("I1"); + // inizializzo struttura calcolati a.clear_struct(c); @@ -810,7 +821,8 @@ bool TSchedaPercipienti::pag_standard_handler(TMask_field& f, KEY k) h_PercRitenuta, h_PercInps, h_PercAssImpInps, - h_PercCommitInps); + h_PercCommitInps, + h_CodNonSogg); // riporto valori a maschera a.from_struct_to_mask(s, f.mask()); diff --git a/src/m770/770102.h b/src/m770/770102.h index 6fcf1ad18..31e9bb666 100755 --- a/src/m770/770102.h +++ b/src/m770/770102.h @@ -159,7 +159,8 @@ class TSchedaPercipienti : public TRelation_application const real& h_PercRitenuta, const real& h_PercInps, const real& h_PercAssImpInps, - const real& h_PercCommitInps) const; + const real& h_PercCommitInps, + const int h_CodNonSogg) const; void calcola_riga_pag (TRectype& rec, const real& h_PercAssImp, const real& h_PercCassaPrev,