From b89e3389527ff655440e490137097bde8b40acff Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 14 May 2015 13:10:45 +0000 Subject: [PATCH] git-svn-id: svn://10.65.10.50/branches/R_10_00@23084 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg2102.cpp | 7 ++++--- cg/cglib01.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cg/cg2102.cpp b/cg/cg2102.cpp index cc2a69b3e..b96ba854a 100755 --- a/cg/cg2102.cpp +++ b/cg/cg2102.cpp @@ -91,7 +91,7 @@ real TPrimanota_application::totale_documento() tot += ritfis; // Somma ritenute fiscali const real ritsoc = m.get(F_RITSOC); - const real revcha = m.get(F_REVCHARGE); + const real revcha = m.efield(F_REVCHARGE).active() ? m.get_real(F_REVCHARGE) : ZERO; const bool swapt = test_swap(false); // Totale invertito ? const bool swaps = test_swap(true); // Ritenute sociali invertite ? @@ -3278,7 +3278,7 @@ bool TPrimanota_application::ritsoc_handler(TMask_field& f, KEY key) // Certified 100% bool TPrimanota_application::revcharge_handler(TMask_field& f, KEY key) { - if (key == K_TAB && f.focusdirty()) + if (key == K_TAB && f.focusdirty() && f.active()) app().add_cgs_ritenute('V'); return true; } @@ -3512,7 +3512,8 @@ bool TPrimanota_application::solaiva_handler(TMask_field& f, KEY key) a.add_cgs_tot(m); // Genera totale documento if (!m.efield(F_RITFIS).empty()) a.add_cgs_ritenute('F'); // Genera ritenute fiscali if (!m.efield(F_RITSOC).empty()) a.add_cgs_ritenute('S'); // Genera ritenute sociali - if (!m.efield(F_REVCHARGE).empty()) a.add_cgs_ritenute('V'); // Genera reverse charge + if (!m.efield(F_REVCHARGE).empty() && !m.efield(F_REVCHARGE).active()) + a.add_cgs_ritenute('V'); // Genera reverse charge TToken_string oldrow(128); for (int i = 0; i < righe; i++) diff --git a/cg/cglib01.h b/cg/cglib01.h index b8511bfb9..ed1179b07 100755 --- a/cg/cglib01.h +++ b/cg/cglib01.h @@ -150,7 +150,7 @@ public: // TObject const TString& descrizione() const { return get("S0"); } const real percentuale() const { return get_real("R0"); } const TString& tipo() const { return get("S1"); } - int detraibilita() const { return get_int("I1"); } + int detraibilita() const { return get_int("I2"); } int allegato(char tipocf) const { return get_int(tipocf == 'F' ? "S8" : "S7"); } bool has_plafond() const { return get_int("S3") > 0; }