noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 145/162: Currency : purchase, save all detail


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 145/162: Currency : purchase, save all detail also in currency, fix problem with the advance payment
Date: Sat, 11 Jul 2020 13:24:07 -0400 (EDT)

sparkyx pushed a commit to annotated tag E-4
in repository noalyss.

commit 2601b09570195d2643ed6c0b90acd62fafb0bcb4
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Sun Jan 6 15:22:36 2019 +0100

    Currency : purchase, save all detail also in currency, fix problem with
    the advance payment
---
 include/class/acc_ledger_purchase.class.php | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/include/class/acc_ledger_purchase.class.php 
b/include/class/acc_ledger_purchase.class.php
index 90911de..f93bbae 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -788,7 +788,14 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
             }
             $let_client=$acc_operation->insert_jrnx();
 
-
+             // --- insert also the currency amount for the customer 
+            $operation_currency=new Operation_currency_SQL($this->db);
+            $operation_currency->oc_amount=$tot_amount_cur;
+            $operation_currency->oc_vat_amount=0;
+            $operation_currency->oc_price_unit=0;
+            $operation_currency->j_id=$let_client ;
+            $operation_currency->insert();
+                
             if ( $g_parameter->MY_TVA_USE=='Y')
             {
                 /* save all vat
@@ -933,9 +940,9 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
                 $cust_amount=bcsub($cust_amount, $tot_tva_reversed);
 
                 // Convert paid amount in EUR
-                $acompte=bcdiv($acompte, $p_currency_rate);   
+                $acompte_defcur=bcdiv($acompte, $p_currency_rate);   
 
-                $famount=bcsub($cust_amount,$acompte);
+                $famount=bcsub($cust_amount,$acompte_defcur);
                 
                 $acc_pay->poste=$poste_val;
                 $acc_pay->qcode=$fqcode;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]