[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 114/173: fixup! Printtva , under some circums
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 114/173: fixup! Printtva , under some circumstance tva_summary::check fails |
Date: |
Mon, 22 Mar 2021 12:59:03 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 4496ad5d4ebc3a9ef165af4bf7a6c565836d7f12
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: 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();
- [Noalyss-commit] [noalyss] 116/173: Merge branch 'dev7102' into entreprise, (continued)
- [Noalyss-commit] [noalyss] 116/173: Merge branch 'dev7102' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 119/173: improve test for fiche get_row, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 134/173: Merge branch 'dev7202' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 135/173: Merge branch 'dev7220' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 137/173: Fiche.Test : add test cmp_name and get_row, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 145/173: Merge branch 'entreprise' into next-release-8, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 138/173: Test Unit Acc_Account_Legder , rounded value fixed, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 139/173: Fix cosmetic and typo, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 147/173: Error : duplicate function update_row, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 151/173: htmlspecialchars use HTML5 and UTF8, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 114/173: fixup! Printtva , under some circumstance tva_summary::check fails,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 131/173: Merge branch 'dev-7201' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 142/173: Merge commit 'db9d4c53d1325b1ab3c8a3fcae6ddd201799fb42' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 146/173: Merge branch 'pre7300' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 150/173: Include Bootstrap, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 154/173: create dossier, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 169/173: Task #1907: Gestion : événement ajout de lien hyperlnk, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 101/173: task #0001698: Problème affichage historique fiches Prevent direct use of http_request translation Cosmetic, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 152/173: Bug : filter of the search and tag, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 160/173: typo, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 159/173: Merge branch 'master' into entreprise, Dany De Bontridder, 2021/03/22