noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 234/238: fixup! Printtva , under some circums


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 234/238: fixup! Printtva , under some circumstance tva_summary::check fails
Date: Sat, 26 Oct 2019 04:41:13 -0400 (EDT)

sparkyx pushed a commit to annotated tag rel7110
in repository noalyss.

commit 4496ad5d4ebc3a9ef165af4bf7a6c565836d7f12
Author: Dany De Bontridder <address@hidden>
Date:   Fri Oct 25 14:54:20 2019 +0200

    fixup! Printtva , under some circumstance tva_summary::check fails
---
 include/class/acc_ledger.class.php     |  1 -
 include/class/tax_summary.class.php    |  4 ++--
 include/export/export_printtva_csv.php | 10 +++++++++-
 include/tax_summary.inc.php            | 10 +++++++++-
 4 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/include/class/acc_ledger.class.php 
b/include/class/acc_ledger.class.php
index ee30e8b..1121207 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -81,7 +81,6 @@ class Acc_Ledger extends jrn_def_sql
         $this->row=null;
         $this->nb=MAX_ARTICLE;
          parent::__construct($p_cn, $p_id);
-        parent::__construct($p_cn, $p_id);
     }
     /**
      * retrieve currency_id from database
diff --git a/include/class/tax_summary.class.php 
b/include/class/tax_summary.class.php
index ce95070..7de4c8d 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..dfdfb11 100644
--- a/include/export/export_printtva_csv.php
+++ b/include/export/export_printtva_csv.php
@@ -30,7 +30,15 @@ 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..0623edd 100644
--- a/include/tax_summary.inc.php
+++ b/include/tax_summary.inc.php
@@ -47,7 +47,15 @@ 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();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]