[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 02/02: Task #1211 - Achat Arrondi avec 4 déc
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 02/02: Task #1211 - Achat Arrondi avec 4 décimales #1211 : problème d'arrondi , du au bscale(2) dans la partie analytique qui changeait celle du calcul qui devait être à 4 + traduction |
Date: |
Fri, 06 Nov 2015 00:03:19 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit df090f0fa26856e8a8b3ef80e6519c8fe2cbd633
Author: Dany De Bontridder <address@hidden>
Date: Fri Nov 6 00:56:58 2015 +0100
Task #1211 - Achat Arrondi avec 4 décimales
#1211 : problème d'arrondi , du au bscale(2) dans la partie analytique qui
changeait celle du calcul qui devait être à 4 + traduction
---
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 616f616..54ce01c 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 <address@hidden>\n"
"Language-Team: American English <address@hidden>\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 1221cf3..8639b80 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 52daf3d..39b99c8 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);