[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 09/21: FIX : Tax_Summary->check fails when th
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 09/21: FIX : Tax_Summary->check fails when there is no data, check was not correct |
Date: |
Sun, 15 Dec 2024 09:51:38 -0500 (EST) |
sparkyx pushed a commit to branch unstable
in repository noalyss.
commit 86321e5666e8ca39c29cf54cb814777a0255dac7
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Dec 7 10:02:01 2024 +0100
FIX : Tax_Summary->check fails when there is no data, check was not correct
---
include/class/tax_summary.class.php | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/include/class/tax_summary.class.php
b/include/class/tax_summary.class.php
index 7417034ff..aae844bcd 100644
--- a/include/class/tax_summary.class.php
+++ b/include/class/tax_summary.class.php
@@ -136,26 +136,43 @@ class Tax_Summary
)
";
$cnt=$this->db->get_value($sql, [$this->date_start, $this->date_end]);
- if ($cnt==0)
+ $cnt_ledger=$this->db->get_value("
+ select count(*) from jrnx
+ where
+ jrnx.j_jrn_def in (select jrn_def_id from jrn_def
where jrn_def_type = 'VEN')
+ and j_date >= to_date($1,'DD.MM.YYYY')
+ and j_date <= to_date($2,'DD.MM.YYYY')
+ ", [$this->date_start, $this->date_end]);
+ if ($cnt==0 && $cnt_ledger !=0)
{
- throw new Exception(_("Données manquantes"),100);
+ throw new Exception('TX148:'_("Données manquantes"),100);
}
/* -------------Purchase --------------------------------- */
+
$sql="select count(*)
from
quant_purchase
where
j_id in (select j_id from jrnx
where
- jrnx.j_jrn_def in (select jrn_def_id from jrn_def
where jrn_def_type = 'VEN')
+ jrnx.j_jrn_def in (select jrn_def_id from jrn_def
where jrn_def_type = 'ACH')
and j_date >= to_date($1,'DD.MM.YYYY')
and j_date <= to_date($2,'DD.MM.YYYY')
)
";
$cnt=$this->db->get_value($sql, [$this->date_start, $this->date_end]);
- if ($cnt>0)
+
+ $cnt_ledger=$this->db->get_value("
+ select count(*) from jrnx
+ where
+ jrnx.j_jrn_def in (select jrn_def_id from jrn_def
where jrn_def_type = 'ACH')
+ and j_date >= to_date($1,'DD.MM.YYYY')
+ and j_date <= to_date($2,'DD.MM.YYYY')
+ ", [$this->date_start, $this->date_end]);
+
+ if ($cnt ==0 && $cnt_ledger !=0)
{
- throw new Exception(_("Données manquantes"),100);
+ throw new Exception('TX175'._("Données manquantes"),100);
}
}
private function build_exigibility()
- [Noalyss-commit] [noalyss] 03/21: Improve Code Documentation, (continued)
- [Noalyss-commit] [noalyss] 03/21: Improve Code Documentation, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 13/21: New : label cannot be empty, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 02/21: Merge branch '241104-correct' into unstable, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 15/21: improve Operation detail : show Analytic imputation for VAT Not Deductible, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 04/21: css : font size rem or % , remove all fixed font-size in px, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 20/21: VAT ND Analytic : fix bug, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 07/21: NEW #0002395: C0TVA : pouvoir choisir la contrepartie pour l'autoliquidation, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 06/21: FIX : some doc in comment, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 21/21: Esthetic, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 11/21: FIX : javascript id$ function, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 09/21: FIX : Tax_Summary->check fails when there is no data, check was not correct,
dwm <=
- [Noalyss-commit] [noalyss] 05/21: WIP : CSS : use variables, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 08/21: Convert upgrade.sql to upgrade202.sql, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 16/21: Operation Analytic : save_form_plan_vat_nd , check that the total is the same as the VAT ND amount, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 14/21: improve doc, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 19/21: Integrate stash, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 10/21: FIX : Tax_Summary->check fails when there is no data, check was not correct, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 17/21: Documentation, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 18/21: Code improve Todo List to finish , allow a empty date, dwm, 2024/12/15