[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 03/03: [PATCH 3/3] fixup! Printtva , under so
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 03/03: [PATCH 3/3] fixup! Printtva , under some circumstance |
Date: |
Fri, 25 Oct 2019 10:08:20 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 1710281c3d09189bbcb7331e29c5cc7bf846720f
Author: Dany De Bontridder <address@hidden>
Date: Fri Oct 25 16:07:53 2019 +0200
[PATCH 3/3] fixup! Printtva , under some circumstance
---
include/class/acc_ledger.class.php | 2 +-
include/class/tax_summary.class.php | 4 ++--
include/export/export_printtva_csv.php | 11 ++++++++++-
include/tax_summary.inc.php | 9 ++++++++-
4 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/include/class/acc_ledger.class.php
b/include/class/acc_ledger.class.php
index e1942a8..4e47505 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -80,7 +80,7 @@ class Acc_Ledger extends jrn_def_sql
$this->db=$p_cn;
$this->row=null;
$this->nb=MAX_ARTICLE;
- parent::__construct($p_cn, $p_id);
+ parent::__construct($p_cn, $p_id);
}
function get_last_pj()
diff --git a/include/class/tax_summary.class.php
b/include/class/tax_summary.class.php
index ce95070..9337516 100644
--- a/include/class/tax_summary.class.php
+++ b/include/class/tax_summary.class.php
@@ -115,7 +115,7 @@ class Tax_Summary
";
$cnt=$this->db->get_value($sql,[$this->date_start,$this->date_end]);
if ($cnt == 0) {
- throw new Exception(_("Données manquantes"));
+ throw new Exception(_("Données manquantes"),100);
}
/*-------------Purchase ---------------------------------*/
$sql="select count(*)
@@ -131,7 +131,7 @@ class Tax_Summary
";
$cnt=$this->db->get_value($sql,[$this->date_start,$this->date_end]);
if ($cnt > 0) {
- throw new Exception(_("Données manquantes"));
+ throw new Exception(_("Données manquantes"),100);
}
}
diff --git a/include/export/export_printtva_csv.php
b/include/export/export_printtva_csv.php
index c84ffe2..ebe8ddd 100644
--- a/include/export/export_printtva_csv.php
+++ b/include/export/export_printtva_csv.php
@@ -30,7 +30,16 @@ require_once NOALYSS_INCLUDE."/class/tax_summary.class.php";
require_once NOALYSS_INCLUDE."/lib/noalyss_csv.class.php";
$http=new HttpInput();
$tax_summary = new
Tax_Summary($cn,$http->get("date_start"),$http->get("date_end"));
-$tax_summary->check();
+try {
+ $tax_summary->check();
+}catch (Exception $e)
+{
+ if ($e->getCode() <> 100) {
+ echo $e->getMessage();
+ return;
+ }
+}
+
$csv=new Noalyss_Csv("summary_tva");
$csv->send_header();
diff --git a/include/tax_summary.inc.php b/include/tax_summary.inc.php
index 70d9c5d..7da2ad2 100644
--- a/include/tax_summary.inc.php
+++ b/include/tax_summary.inc.php
@@ -47,7 +47,14 @@ if ( $http->get("do","string","no") == "display")
{
$tax_summary=new
Tax_Summary($cn,$start_periode->value,$end_periode->value);
try {
- $tax_summary->check();
+ try {
+ $tax_summary->check();
+ }catch (Exception $e)
+ {
+ echo '<span class="warning">';
+ echo $e->getMessage();
+ echo '</span>';
+ }
echo '<ul class="aligned-block">';
echo '<li>';
echo $tax_summary->form_export_csv();