From b5595776720a3770d97e2e670285fd1d0f61ca1c Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 28 Nov 2011 11:56:34 +0000 Subject: [PATCH] Patch level : 10.0 1174 Files correlati : ha2.exe Ricompilazione Demo : [ ] Commento : Corretta percentuale di sconto Esselunga git-svn-id: svn://10.65.10.50/branches/R_10_00@22507 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ha/ha2200.cpp | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/ha/ha2200.cpp b/ha/ha2200.cpp index c7f162c97..defb07bc5 100755 --- a/ha/ha2200.cpp +++ b/ha/ha2200.cpp @@ -510,19 +510,6 @@ void THardy_esselunga_fat::add_rec_testata(TFatture_recordset& fat, TDocumento& void THardy_esselunga_fat::add_rec_sommario(TFatture_recordset& fat, TDocumento& doc) { - //fat.new_rec("FTT"); non ci sono note nel documento! - // se c'e' sconto scrivo il record corrispondente - /* - real r; - TString80 s; - bool sconto = scontoexpr2perc(doc.get(DOC_SCONTOPERC), FALSE, s, r); - if (sconto && r != ZERO) - { - fat.new_rec("ALT"); - fat.set("ALT.IMPORTO", r); - fat.set("ALT.PERC", s); - } - */ TAssoc_array& tabella_iva = doc.tabella_iva(); TRiepilogo_iva* ri; for (ri = (TRiepilogo_iva*) tabella_iva.first_item(); ri != NULL; ri = (TRiepilogo_iva*) tabella_iva.succ_item()) @@ -594,7 +581,7 @@ void THardy_esselunga_fat::add_recs_dettaglio(TFatture_recordset& fat, TDocument //fat.new_rec("RFN"); // solo per note di debito e di credito (chiedere a Robbi) fat.new_rec("TAX"); - const TString8 aliquota = real(rigadoc->iva().percentuale()*10000).string(7,0,0); + const TString8 aliquota = real(rigadoc->iva().percentuale()*10000).string(7,0,'0'); fat.set("TAX.ALIQIVA", aliquota); fat.set("TAX.DESCRIZ", rigadoc->iva().descrizione()); fat.set("TAX.IMPORTO", rigadoc->imposta()); @@ -617,10 +604,9 @@ void THardy_esselunga_fat::add_recs_dettaglio(TFatture_recordset& fat, TDocument fat.set("ALD.IMPORTO", sconto); TString80 str; - real perc; - scontoexpr2perc(rigadoc->get(RDOC_SCONTO), false, str, perc); - str = perc.string(8,4,'0'); - str.strip("." ); + real quota; scontoexpr2perc(rigadoc->get(RDOC_SCONTO), false, str, quota); + const real perc = (UNO - quota)*1000000; + str = perc.string(7,0,'0'); fat.set("ALD.PERC", str); } fat.new_rec("NAD");