[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 24/162: Task #448 : rounded value for VEN
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 24/162: Task #448 : rounded value for VEN |
Date: |
Sat, 11 Jul 2020 13:23:24 -0400 (EDT) |
sparkyx pushed a commit to annotated tag E-4
in repository noalyss.
commit e7228b0a8503d28d1307af74753bc9e3656395ed
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Fri May 11 00:05:59 2018 +0200
Task #448 : rounded value for VEN
---
include/class/acc_ledger_sold.class.php | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/include/class/acc_ledger_sold.class.php
b/include/class/acc_ledger_sold.class.php
index b28e3ab..1cea78c 100644
--- a/include/class/acc_ledger_sold.class.php
+++ b/include/class/acc_ledger_sold.class.php
@@ -298,7 +298,8 @@ class Acc_Ledger_Sold extends Acc_Ledger {
// convert amount to currency
$amount=bcmul($amount_currency,$p_currency_rate);
- $tot_amount = bcadd($tot_amount, $amount);
+ $tot_amount = bcadd($tot_amount, $amount,2);
+ echo "tot_amount $tot_amount<br>";
$acc_operation = new Acc_Operation($this->db);
$acc_operation->date = $e_date;
$sposte = $fiche->strAttribut(ATTR_DEF_ACCOUNT);
@@ -329,7 +330,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$acc_operation->qcode = ${"e_march" . $i};
if ($amount<0)
{
- $tot_debit=bcadd($tot_debit, abs($amount));
+ $tot_debit=round(bcadd($tot_debit, abs($amount)),2);
}
$j_id = $acc_operation->insert_jrnx();
@@ -348,23 +349,23 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$l->load();
$tva_item_currency = bcmul($amount,
$l->get_parameter('rate'));
}
- $tva_item=bcmul($tva_item_currency,$p_currency_rate);
+ $tva_item=bcmul($tva_item_currency,$p_currency_rate,2);
if (isset($tva[$idx_tva]))
{
- $tva[$idx_tva]=bcadd($tva_item,$tva[$idx_tva]);
+ $tva[$idx_tva]=bcadd($tva_item,$tva[$idx_tva],2);
}
else
{
$tva[$idx_tva]=$tva_item;
}
if ($oTva->get_parameter("both_side") == 0) {
- $tot_tva = round(bcadd($tva_item, $tot_tva), 2);
+ $tot_tva = bcadd($tva_item, $tot_tva, 2);
} else {
$n_both = $tva_item;
if ($n_both<0)
{
- $tot_debit=bcadd($tot_debit, abs($n_both));
+ $tot_debit=round(bcadd($tot_debit,
abs($n_both)),2);
}
}
}
@@ -435,7 +436,9 @@ class Acc_Ledger_Sold extends Acc_Ledger {
}// end loop : save all items
/* save total customer */
- $cust_amount = bcadd($tot_amount, $tot_tva);
+ $cust_amount = bcadd($tot_amount, $tot_tva,2);
+ echo "cust_amount $cust_amount<br>";
+
$acc_operation = new Acc_Operation($this->db);
$acc_operation->date = $e_date;
$acc_operation->poste = $poste;
@@ -447,7 +450,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$acc_operation->qcode = ${"e_client"};
if ($cust_amount>0)
{
- $tot_debit=bcadd($tot_debit, $cust_amount);
+ $tot_debit=bcadd($tot_debit, $cust_amount,2);
}
$let_tiers = $acc_operation->insert_jrnx();
@@ -475,7 +478,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$acc_operation->periode = $tperiode;
if ($value<0)
{
- $tot_debit=bcadd($tot_debit, abs($value));
+ $tot_debit=bcadd($tot_debit, abs($value),2);
}
$acc_operation->insert_jrnx();
@@ -492,7 +495,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$acc_operation->type = 'd';
$acc_operation->periode = $tperiode;
$acc_operation->insert_jrnx();
- $tot_debit = bcadd($tot_debit, $value);
+ $tot_debit = bcadd($tot_debit, $value,2);
$n_both = $value;
}
}
- [Noalyss-commit] [noalyss] 19/162: Task #448 : currency : cosmetic operation detail, (continued)
- [Noalyss-commit] [noalyss] 19/162: Task #448 : currency : cosmetic operation detail, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 23/162: Display the balance difference, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 25/162: Task #448 : payment method VEN, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 27/162: Task #448 : delete unused currency, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 30/162: remove debug info, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 32/162: Task #448 : SQL integrated into upgrade128, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 09/162: Currency : add security for setting, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 11/162: Currency : SQL menu change, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 20/162: Task #448 : check currency rate > 0 and payment in eur, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 22/162: Task #448 : identical operation with currency, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 24/162: Task #448 : rounded value for VEN,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 26/162: Task #448 : rounded problem add debug info, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 28/162: Task #448 : currency , EUR cannot be changed and not display, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 29/162: Task #448 : currency_id = 0 for the default currency + display currency rate in confirm operation, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 31/162: task #448 : currency always used and remove parameter 'use_currency' from parameters, add SQL script, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 35/162: Task #448 : correct bug when saving into quant_purchase, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 36/162: Bug in QUANT_PURCHASE , dp_dep_priv is not saved, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 21/162: Task #448 : issue with reconciliation amount, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 33/162: Task #448 : correct bug if VAT Rate = 0 , amount was reset, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 41/162: Fix bug quant_purchase , private fee not saved, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 42/162: remove debug, Dany De Bontridder, 2020/07/11