[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 03/03: Fix bug : Montant incorrect si paieme
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 03/03: Fix bug : Montant incorrect si paiement encodé en même temps que facture achat pour un achat utilisant une TVA autoliquidée |
Date: |
Mon, 6 Mar 2017 15:36:13 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 7e13a863db3d19265d643ac40cc33661973522e0
Author: Dany De Bontridder <address@hidden>
Date: Mon Mar 6 21:35:36 2017 +0100
Fix bug : Montant incorrect si paiement encodé en même temps que
facture achat pour un achat utilisant une TVA autoliquidée
---
include/class/class_acc_ledger_purchase.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/class/class_acc_ledger_purchase.php
b/include/class/class_acc_ledger_purchase.php
index 150c914..9906792 100644
--- a/include/class/class_acc_ledger_purchase.php
+++ b/include/class/class_acc_ledger_purchase.php
@@ -709,7 +709,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$acc_operation=new Acc_Operation($this->db);
$acc_operation->date=$e_date;
$acc_operation->poste=$poste;
- $acc_operation->amount=$cust_amount-$tot_tva_reversed;
+ $acc_operation->amount=bcsub($cust_amount,$tot_tva_reversed);
$acc_operation->grpt=$seq;
$acc_operation->jrn=$p_jrn;
$acc_operation->type='c';
@@ -748,8 +748,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
if ( $oTva->get_parameter("both_side")==1)
{
$poste_vat=$oTva->get_side('c');
- $cust_amount=bcadd($tot_amount,$tot_tva);
- $cust_amount=bcsub($tot_amount,$tot_tva_reversed);
+
$acc_operation=new Acc_Operation($this->db);
$acc_operation->date=$e_date;
$acc_operation->poste=$poste_vat;
@@ -847,7 +846,8 @@ class Acc_Ledger_Purchase extends Acc_Ledger
{
$poste_val=$sposte;
}
-
+ // remove the VAT autoliquidation
+ $cust_amount=bcsub($cust_amount, $tot_tva_reversed);
$famount=bcsub($cust_amount,$acompte);
$acc_pay->poste=$poste_val;
$acc_pay->qcode=$fqcode;