[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 24/218: Task #448 : rounded value for VEN
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 24/218: Task #448 : rounded value for VEN |
Date: |
Thu, 12 Sep 2019 15:58:33 -0400 (EDT) |
sparkyx pushed a commit to branch entreprise
in repository noalyss.
commit e7228b0a8503d28d1307af74753bc9e3656395ed
Author: Dany De Bontridder <address@hidden>
Date: 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/218: Task #448 : currency : cosmetic operation detail, (continued)
- [Noalyss-commit] [noalyss] 19/218: Task #448 : currency : cosmetic operation detail, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 07/218: Currency : add menu for currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 11/218: Currency : SQL menu change, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 14/218: INum : add function onchange with inplace edit, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 10/218: Currency : add SQL constraint + doc, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 05/218: html_page_start : protect query, improve code, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 08/218: Currency = add a mode currency, possible to work without, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 04/218: Currency : add test file + database file + mtable, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 21/218: Task #448 : issue with reconciliation amount, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 22/218: Task #448 : identical operation with currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 24/218: Task #448 : rounded value for VEN,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 27/218: Task #448 : delete unused currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 28/218: Task #448 : currency , EUR cannot be changed and not display, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 31/218: task #448 : currency always used and remove parameter 'use_currency' from parameters, add SQL script, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 38/218: Task #448 : currency improve detail of operation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 09/218: Currency : add security for setting, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 13/218: indent, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 17/218: Currency : fix rounded bugs in detail operation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 18/218: task #448 : Currency : display currency info into operation detail, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 20/218: Task #448 : check currency rate > 0 and payment in eur, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 23/218: Display the balance difference, Dany De Bontridder, 2019/09/12