[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 01/01: Printtva , under some circumstance tva
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 01/01: Printtva , under some circumstance tva_summary::check fails |
Date: |
Sat, 12 Oct 2019 17:27:05 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit eeec4a547396bf470f9ab42f55e7daf074e6098b
Author: Dany De Bontridder <address@hidden>
Date: Sat Oct 12 23:25:48 2019 +0200
Printtva , under some circumstance tva_summary::check fails
---
include/class/tax_summary.class.php | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/include/class/tax_summary.class.php
b/include/class/tax_summary.class.php
index 8c482b2..ce95070 100644
--- a/include/class/tax_summary.class.php
+++ b/include/class/tax_summary.class.php
@@ -104,31 +104,34 @@ class Tax_Summary
/*-------------SALE ---------------------------------*/
$sql="select count(*)
from
- jrnx
- join quant_sold on (quant_sold.j_id = jrnx.j_id)
+ quant_sold
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')
+ 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')
+ 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) {
- throw new Exception(_("Aucune Donnée"));
+ throw new Exception(_("Données manquantes"));
}
/*-------------Purchase ---------------------------------*/
$sql="select count(*)
from
- jrnx
- join quant_purchase as qp on (jrnx.j_id = qp.j_id)
+ quant_purchase
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')
+ 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')
+ 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) {
- throw new Exception(_("Aucune Donnée"));
-
+ if ($cnt > 0) {
+ throw new Exception(_("Données manquantes"));
}
}