noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 66/73: Devise correct autoliquidation not tak


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 66/73: Devise correct autoliquidation not taken into account for currency
Date: Fri, 28 May 2021 05:26:49 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 185325a3b400d1dc25cdb9f65ae46cc60293d15b
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Mon May 24 14:08:04 2021 +0200

    Devise correct autoliquidation  not taken into account for currency
---
 include/class/acc_ledger_purchase.class.php | 3 +--
 include/class/acc_ledger_sold.class.php     | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/class/acc_ledger_purchase.class.php 
b/include/class/acc_ledger_purchase.class.php
index b6164ca..aeb2269 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -566,7 +566,6 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
             /* Save all the items without vat and no deductible vat and 
expense*/
             for ($i=0;$i< $nb_item;$i++)
             {
-               $n_both=0;
                 if ( empty(${'e_march'.$i}) || empty(${'e_quant'.$i}) ) 
continue;
 
                 /* First we save all the items without vat */
@@ -768,7 +767,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
                  */
                 $operation_currency=new Operation_currency_SQL($this->db);
                 $operation_currency->oc_amount=$acc_amount->amount_currency;
-                
$operation_currency->oc_vat_amount=$acc_amount->amount_vat_currency;
+                
$operation_currency->oc_vat_amount=($tva_both==0)?$acc_amount->amount_vat_currency:0;
                 $operation_currency->oc_price_unit=${'e_march'.$i.'_price'};
                 $operation_currency->j_id=$j_id;
                 $operation_currency->insert();
diff --git a/include/class/acc_ledger_sold.class.php 
b/include/class/acc_ledger_sold.class.php
index ad362e7..7c766d7 100644
--- a/include/class/acc_ledger_sold.class.php
+++ b/include/class/acc_ledger_sold.class.php
@@ -382,6 +382,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
                         $tot_tva = round($tot_tva, 2);
                     } else {
                         $n_both = $tva_item;
+                         $tva_item_currency = 0;
                         if ($n_both<0)
                         {
                             $tot_debit=round(bcadd($tot_debit, 
abs($n_both)),2);



reply via email to

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