[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 09/33: Rounded for currency
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 09/33: Rounded for currency |
Date: |
Thu, 11 Nov 2021 06:02:44 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit d8dffdf690e1752dfbd4034e3667f48d98271abf
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Fri Oct 1 17:43:27 2021 +0200
Rounded for currency
---
include/class/acc_ledger_purchase.class.php | 6 +++---
include/class/acc_ledger_sale.class.php | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/class/acc_ledger_purchase.class.php
b/include/class/acc_ledger_purchase.class.php
index 394654f..aee5aeb 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -589,7 +589,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$acc_amount=new Acc_Compute();
$acc_amount->check=false;
- $acc_amount->set_parameter('amount',$amount);
+ $acc_amount->set_parameter('amount',$amount_4);
// Set the currency rate
$acc_amount->set_parameter("currency_rate", $p_currency_rate);
$acc_amount->convert_euro();
@@ -764,8 +764,8 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$operation_currency->oc_price_unit=${'e_march'.$i.'_price'};
$operation_currency->j_id=$j_id;
$operation_currency->insert();
-
$tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_currency),2);
-
$tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_vat_currency),2);
+
$tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_currency,4),4);
+
$tot_amount_cur=round(bcadd($tot_amount_cur,$acc_amount->amount_vat_currency,4),4);
if ( DEBUGNOALYSS > 1 ) {
echo __LINE__." insert into operation currency
oc_amount:{$acc_amount->amount_currency} oc_vat_amount
{$acc_amount->amount_vat_currency} <br>";
}
diff --git a/include/class/acc_ledger_sale.class.php
b/include/class/acc_ledger_sale.class.php
index b8e579c..7437a2b 100644
--- a/include/class/acc_ledger_sale.class.php
+++ b/include/class/acc_ledger_sale.class.php
@@ -453,8 +453,8 @@ class Acc_Ledger_Sale extends Acc_Ledger {
$operation_currency->oc_price_unit=${'e_march'.$i.'_price'};
$operation_currency->j_id=$j_id;
$operation_currency->insert();
-
$tot_amount_cur=round(bcadd($tot_amount_cur,$amount_currency),2);
-
$tot_amount_cur=round(bcadd($tot_amount_cur,$tva_item_currency),2);
+
$tot_amount_cur=round(bcadd($tot_amount_cur,$amount_currency,4),4);
+
$tot_amount_cur=round(bcadd($tot_amount_cur,$tva_item_currency,4),4);
}// end loop : save all items
/* save total customer */
- [Noalyss-commit] [noalyss] branch master updated (8b28b18 -> 2b1bcd5), Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 04/33: Sale & Purchase Quantity with 2 dec., Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 01/33: Cosmetic : move dialog horizontally and vertically, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 02/33: Cosmetic : add button close for filter, dialog box search operation, TVA, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 09/33: Rounded for currency,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 08/33: Operation details : calcul correctement la différence avec les opérations extournées, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 12/33: Button close for new card, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 06/33: Bug rounded : show amount in currency with 4 dec., Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 10/33: For Misc Operation in currency , show the currency amount / row, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 11/33: Bug for reversed operation when currency are used, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 03/33: Improve HttpInput::extract , the array is set and not passed anymore, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 05/33: Bug : pour non-assujetti , pas de calcul en devise, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 07/33: Bug for reversed operation when currency are used, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 14/33: Typo, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 13/33: Compute.php it happens that the argument are not numeric, Dany De Bontridder, 2021/11/11