noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 06/09: Fix bug for Reconcilied


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 06/09: Fix bug for Reconcilied
Date: Mon, 17 Jan 2022 14:58:30 -0500 (EST)

sparkyx pushed a commit to branch devel
in repository noalyss.

commit 36110ca0864f76a83e5e542e9d5b8cce68eb924b
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Wed Jan 5 17:40:55 2022 +0100

    Fix bug for Reconcilied
---
 include/class/acc_reconciliation.class.php | 29 ++++++++++++++++++++++-------
 sql/upgrade.sql                            |  3 +--
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/include/class/acc_reconciliation.class.php 
b/include/class/acc_reconciliation.class.php
index 91f83478..e1c31ab5 100644
--- a/include/class/acc_reconciliation.class.php
+++ b/include/class/acc_reconciliation.class.php
@@ -365,13 +365,21 @@ j1.j_poste as poste
         $this->prepare_query_detail_quant();
         for ($i=0;$i<count($array);$i++)
         {
+            
              
$retdb=$this->db->execute("detail_quant",array($array[$i]['first']['jr_id']));
             if ( Database::num_row($retdb) != 0)
             {
-                // then second_amount takes in account the vat_sided
-                $row=Database::fetch_array($retdb, 0);
-                $total_price=bcadd($row['price'],$row['vat_amount']);
-                $total_price=bcsub($total_price,$row['vat_sided']);
+                  // then second_amount takes in account the vat_sided
+                $a_row=Database::fetch_all($retdb);
+                $total_price=0;
+                foreach ($a_row as $row) {
+                    $total_price=bcadd($total_price,$row['price']);
+                    $total_price=bcadd($total_price,$row['vat_amount']);
+                    $total_price=bcsub($total_price,$row['vat_sided']);
+                    $total_price=bcadd($total_price,$row['nd_amount']);
+                    $total_price=bcadd($total_price,$row['nd_tva_recup']);
+                    
+                }
                 $first_amount=$total_price;
 
             } else {
@@ -386,9 +394,16 @@ j1.j_poste as poste
                 if ( Database::num_row($retdb) != 0)
                 {
                     // then second_amount takes in account the vat_sided
-                    $row=Database::fetch_array($retdb, 0);
-                    $total_price=bcadd($row['price'],$row['vat_amount']);
-                    $total_price=bcsub($total_price,$row['vat_sided']);
+                   $a_row=Database::fetch_all($retdb);
+                    $total_price=0;
+                    foreach ($a_row as $row) {
+                        $total_price=bcadd($total_price,$row['price']);
+                        $total_price=bcadd($total_price,$row['vat_amount']);
+                        $total_price=bcsub($total_price,$row['vat_sided']);
+                        $total_price=bcadd($total_price,$row['nd_amount']);
+                        $total_price=bcadd($total_price,$row['nd_tva_recup']);
+                    
+                     }
                     $second_amount=bcadd($second_amount,$total_price);
                     
                 } else {
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index f865fd5d..510baa99 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -1,2 +1 @@
-set search_path=public,comptaproc;
-update parm_periode set p_exercice_label =p_exercice ;
\ No newline at end of file
+select * from v_quant_detail vqd where jr_id=6462;
\ No newline at end of file



reply via email to

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