From df090f0fa26856e8a8b3ef80e6519c8fe2cbd633 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 6 Nov 2015 00:56:58 +0100 Subject: [PATCH] =?UTF-8?q?Task=20#1211=20-=20Achat=20Arrondi=20avec=204?= =?UTF-8?q?=20d=C3=A9cimales=20#1211=20:=20probl=C3=A8me=20d'arrondi=20,?= =?UTF-8?q?=20du=20au=20bscale(2)=20dans=20la=20partie=20analytique=20qui?= =?UTF-8?q?=20changeait=20celle=20du=20calcul=20qui=20devait=20=C3=AAtre?= =?UTF-8?q?=20=C3=A0=204=20+=20traduction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/lang/en_US/LC_MESSAGES/messages.po | 4 ++-- include/class/class_acc_ledger_purchase.php | 8 ++++---- include/class/class_anc_operation.php | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/html/lang/en_US/LC_MESSAGES/messages.po b/html/lang/en_US/LC_MESSAGES/messages.po index 616f61693..54ce01c43 100644 --- a/html/lang/en_US/LC_MESSAGES/messages.po +++ b/html/lang/en_US/LC_MESSAGES/messages.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: NOALYSS 672\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-11-02 19:12+0100\n" -"PO-Revision-Date: 2015-11-02 19:12+0100\n" +"PO-Revision-Date: 2015-11-06 00:07+0100\n" "Last-Translator: Dany De Bontridder \n" "Language-Team: American English \n" "Language: en_US\n" @@ -3365,7 +3365,7 @@ msgstr "Consideration for VAT not Ded." #: include/database.item.php:173 include/database.item.php:162 #: include/database.item.php:163 msgid "Contrepartie pour TVA récup par impot" -msgstr "Consideration for VAT tax by Recycling" +msgstr "Consideration for VAT tax recoverable" #: include/database.item.php:160 include/database.item.php:163 #: include/database.item.php:173 include/database.item.php:177 diff --git a/include/class/class_acc_ledger_purchase.php b/include/class/class_acc_ledger_purchase.php index 1221cf33c..8639b8061 100644 --- a/include/class/class_acc_ledger_purchase.php +++ b/include/class/class_acc_ledger_purchase.php @@ -516,9 +516,10 @@ class Acc_Ledger_Purchase extends Acc_Ledger else $tperiode=$oPeriode->find_periode($e_date); - bcscale(4); + try { + bcscale(4); $tot_amount=0; $tot_tva=0; $tot_debit=0; @@ -556,10 +557,9 @@ class Acc_Ledger_Purchase extends Acc_Ledger $acc_operation->type='d'; $acc_operation->periode=$tperiode; $acc_operation->qcode=""; - - + $amount_4=bcmul(${'e_march'.$i.'_price'},${'e_quant'.$i}); /* We have to compute all the amount thanks Acc_Compute */ - $amount=round(bcmul(${'e_march'.$i.'_price'},${'e_quant'.$i}),2); + $amount=round($amount_4,2); $acc_amount=new Acc_Compute(); $acc_amount->check=false; diff --git a/include/class/class_anc_operation.php b/include/class/class_anc_operation.php index 52daf3dad..39b99c894 100644 --- a/include/class/class_anc_operation.php +++ b/include/class/class_anc_operation.php @@ -707,12 +707,12 @@ class Anc_Operation $idx_pa_id++; } $nb_op=count($a_Anc_Operation); - bcscale(2); + bcscale(4); for ($i=0;$i<$nb_op;$i++) { $tot=bcadd($tot,$a_Anc_Operation[$i]->oa_amount); } - if ( $tot != $p_nd ) + if ( $tot != $p_nd && count($a_Anc_Operation) > 0 ) { $diff= bcsub($tot, $p_nd); $a_Anc_Operation[0]->oa_amount=bcsub($a_Anc_Operation[0]->oa_amount,$diff);