[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 01/17: Fix : France saldo until end of exerci
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 01/17: Fix : France saldo until end of exercice in Gestion |
Date: |
Wed, 25 Sep 2024 06:44:33 -0400 (EDT) |
sparkyx pushed a commit to branch stable
in repository noalyss.
commit bd92d45847fb4ea6f58862223e8cb5d3c97f4b66
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Fri Sep 20 19:06:27 2024 +0200
Fix : France saldo until end of exercice in Gestion
---
include/class/fiche.class.php | 9 +++------
include/class/periode.class.php | 23 ++++++++++++-----------
2 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index e8a314a84..401763c11 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -1339,11 +1339,6 @@ class Fiche
// set a filter ?
$search=$p_sql;
- $exercice=$g_user->get_exercice();
- $tPeriode=new Periode($this->cn);
- list($max,$min)=$tPeriode->get_limit($exercice);
-
-
if ( noalyss_trim($p_search) != "" )
{
$search.=" and f_id in
@@ -1380,7 +1375,9 @@ class Fiche
/* Filter on the default year */
if ( $g_parameter->MY_REPORT == 'N') {
- $amount = $tiers->get_solde_detail();
+ list($l_from,$l_to)=(new
Periode($this->cn))->get_limit($g_user->get_exercice());
+ $condition = sprintf (" j_date <= to_date('%s','DD.MM.YYYY')
", $l_to->last_day());
+ $amount = $tiers->get_solde_detail($condition);
} else {
$amount=$tiers->get_solde_detail($filter_year);
}
diff --git a/include/class/periode.class.php b/include/class/periode.class.php
index 63ac4de06..dee39238e 100644
--- a/include/class/periode.class.php
+++ b/include/class/periode.class.php
@@ -318,28 +318,29 @@ EOF;
return 0;
}
- /*!\brief return the max and the min periode of the exercice given
+ /*!
+ * \brief return the max (to periode) and the min periode (from periode)
of the exercice given
* in parameter
- * \param $p_exercice is the exercice
+ * \param $p_exercice is the exercice (parm_periode.p_exercice)
* \return an array of Periode object
*/
function get_limit($p_exercice)
{
- $max=$this->cn->get_value("select p_id from parm_periode where
p_exercice=$1 order by p_start asc limit 1",
+ $from_periode_id=$this->cn->get_value("select p_id from parm_periode
where p_exercice=$1 order by p_start asc limit 1",
array($p_exercice));
- $min=$this->cn->get_value("select p_id from parm_periode where
p_exercice=$1 order by p_start desc limit 1",
+ $to_periode_id=$this->cn->get_value("select p_id from parm_periode
where p_exercice=$1 order by p_start desc limit 1",
array($p_exercice));
- $rMax=new Periode($this->cn);
- $rMax->p_id=$max;
- if ($rMax->load() == -1)
+ $periodeFrom=new Periode($this->cn);
+ $periodeFrom->p_id=$from_periode_id;
+ if ($periodeFrom->load() == -1)
throw new Exception('Periode n\'existe pas');
- $rMin=new Periode($this->cn);
- $rMin->p_id=$min;
- if ($rMin->load() == -1)
+ $periodeTo=new Periode($this->cn);
+ $periodeTo->p_id=$to_periode_id;
+ if ($periodeTo->load() == -1)
throw new Exception('Periode n\'existe pas');
- return array($rMax, $rMin);
+ return array($periodeFrom, $periodeTo);
}
/*!
- [Noalyss-commit] [noalyss] 13/17: MOD1: setting base TVA, (continued)
- [Noalyss-commit] [noalyss] 13/17: MOD1: setting base TVA, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 16/17: nav-level2.active and nav-level3 active: border color, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 15/17: Cosmetic : remove border, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 04/17: Bug : warning for ledger C0JRN when no category card is checked, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 08/17: Cosmetic menu, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 06/17: PHP Install check if curl present, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 17/17: REVERT 9bc780c62 SALE : by default invoice not checked, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 10/17: TVA show up , sorted by ID, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 03/17: Cosmetic, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 02/17: Fix Bug Cannot create new category of cards, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 01/17: Fix : France saldo until end of exercice in Gestion,
dwm <=
- [Noalyss-commit] [noalyss] 12/17: INSTALL: template must always use its own db structure, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 07/17: MOD2 : update, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 14/17: MOD2 : remove schema, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 11/17: VAT warning : update the VAT CODE, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 09/17: SALE : by default invoice not checked, dwm, 2024/09/25
- [Noalyss-commit] [noalyss] 05/17: Update MOD1, Belgian template add VAT, document, ..., dwm, 2024/09/25