noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 68/73: Payment by bank : currency info was mi


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 68/73: Payment by bank : currency info was missing
Date: Fri, 28 May 2021 05:26:50 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit e7d0e34875d873cc608805ed5946e9d6f0fb1409
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Mon May 24 16:12:48 2021 +0200

    Payment by bank : currency info was missing
---
 include/class/acc_ledger_purchase.class.php | 12 ++++++++++--
 include/class/acc_ledger_sold.class.php     | 12 ++++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/include/class/acc_ledger_purchase.class.php 
b/include/class/acc_ledger_purchase.class.php
index aeb2269..b6590f1 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -963,7 +963,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
                 $acc_pay->jrn=$mp->get_parameter('ledger_target');
                 $acc_pay->periode=$tperiode;
                        $acc_pay->type=($famount>=0)?'c':'d';
-                $acc_pay->insert_jrnx();
+                $let_pay=$acc_pay->insert_jrnx();
 
                 /* Insert supplier  */
                 $acc_pay=new Acc_Operation($this->db);
@@ -984,7 +984,15 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
                 $operation_currency->oc_vat_amount=0;
                 $operation_currency->oc_price_unit=0;
                 $operation_currency->j_id=$let_other;
-                $operation_currency->insert();                
+                $operation_currency->insert();          
+                
+                // insert into operation_currency bank
+                $operation_currency=new Operation_currency_SQL($this->db);
+                $operation_currency->oc_amount=bcsub($tot_amount_cur,$acompte);
+                $operation_currency->oc_vat_amount=0;
+                $operation_currency->oc_price_unit=0;
+                $operation_currency->j_id=$let_pay;
+                $operation_currency->insert();         
                 
                 /* insert into jrn */
                 $acc_pay->mt=$mt;
diff --git a/include/class/acc_ledger_sold.class.php 
b/include/class/acc_ledger_sold.class.php
index 7c766d7..2b1cf37 100644
--- a/include/class/acc_ledger_sold.class.php
+++ b/include/class/acc_ledger_sold.class.php
@@ -647,7 +647,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
                 $acc_pay->jrn = $mp->get_parameter('ledger_target');
                 $acc_pay->periode = $tperiode;
                 $acc_pay->type = ($famount >= 0) ? 'd' : 'c';
-                $acc_pay->insert_jrnx();
+                $let_pay=$acc_pay->insert_jrnx();
 
                 /* Insert supplier  */
                 $acc_pay = new Acc_Operation($this->db);
@@ -662,7 +662,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
                 $acc_pay->type = ($famount >= 0) ? 'c' : 'd';
                 $let_other = $acc_pay->insert_jrnx();
 
-                // insert into operation_currency
+                // insert into operation_currency customer
                 $operation_currency=new Operation_currency_SQL($this->db);
                 $operation_currency->oc_amount=bcsub($tot_amount_cur,$acompte);
                 $operation_currency->oc_vat_amount=0;
@@ -670,6 +670,14 @@ class Acc_Ledger_Sold extends Acc_Ledger {
                 $operation_currency->j_id=$let_other;
                 $operation_currency->insert();                
                 
+                // insert into operation_currency bank
+                $operation_currency=new Operation_currency_SQL($this->db);
+                $operation_currency->oc_amount=bcsub($tot_amount_cur,$acompte);
+                $operation_currency->oc_vat_amount=0;
+                $operation_currency->oc_price_unit=0;
+                $operation_currency->j_id=$let_pay;
+                $operation_currency->insert();                
+                
                 // Add info for currency
                 $acc_pay->currency_id=$p_currency_code;
                 $acc_pay->currency_rate=$p_currency_rate;



reply via email to

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