[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
- [Noalyss-commit] [noalyss] branch devel updated (82808d24 -> 55f9dd9a), Dany De Bontridder, 2022/01/17
- [Noalyss-commit] [noalyss] 05/09: PHPUNIT : adapt test, Dany De Bontridder, 2022/01/17
- [Noalyss-commit] [noalyss] 06/09: Fix bug for Reconcilied,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 02/09: Bug #2118 Manage User problem, Dany De Bontridder, 2022/01/17
- [Noalyss-commit] [noalyss] 03/09: New #0002117: Lettrage : montre l'opération liée, Dany De Bontridder, 2022/01/17
- [Noalyss-commit] [noalyss] 07/09: Critical : password issue, Dany De Bontridder, 2022/01/17
- [Noalyss-commit] [noalyss] 08/09: Adapt to security change, Dany De Bontridder, 2022/01/17
- [Noalyss-commit] [noalyss] 09/09: Task #0002126: Fiche : amélioration, Dany De Bontridder, 2022/01/17
- [Noalyss-commit] [noalyss] 04/09: Give error with PHPUNIT, Dany De Bontridder, 2022/01/17
- [Noalyss-commit] [noalyss] 01/09: TVA : cannot load when tva_id is empty, Dany De Bontridder, 2022/01/17