[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 04/11: FIX : Tax_Summary->check fails when th
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 04/11: FIX : Tax_Summary->check fails when there is no data, check was not correct |
Date: |
Sun, 15 Dec 2024 09:51:25 -0500 (EST) |
sparkyx pushed a commit to branch stable
in repository noalyss.
commit 748da6cd81a0b29a39043c07fd5b1733de237253
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..7c8e16bf0 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] branch stable updated (87930cbe3 -> c64f356cf), dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 02/11: FIX : some doc in comment, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 01/11: NEW #0002395: C0TVA : pouvoir choisir la contrepartie pour l'autoliquidation, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 08/11: improve Operation detail : show Analytic imputation for VAT Not Deductible, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 07/11: improve doc, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 09/11: 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] 11/11: VAT ND Analytic : fix bug, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 05/11: FIX P0TVA when no data, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 10/11: Documentation, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 04/11: FIX : Tax_Summary->check fails when there is no data, check was not correct,
dwm <=
- [Noalyss-commit] [noalyss] 06/11: New : label cannot be empty, dwm, 2024/12/15
- [Noalyss-commit] [noalyss] 03/11: Convert upgrade.sql to upgrade202.sql, dwm, 2024/12/15