[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 45/54: fixup! Printtva , under some circumsta
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 45/54: fixup! Printtva , under some circumstance tva_summary::check fails |
Date: |
Sat, 11 Jul 2020 13:26:59 -0400 (EDT) |
sparkyx pushed a commit to annotated tag entreprise-0500
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] 44/54: gitlab #5 Achat propose l'anc pour toutes les lignes, (continued)
- [Noalyss-commit] [noalyss] 44/54: gitlab #5 Achat propose l'anc pour toutes les lignes, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 36/54: documentation + traduction, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 37/54: Merge branch 'accept7100' into entreprise, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 41/54: Merge branch 'bug-printtva' into entreprise, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 42/54: If currency not given then supposed to be the default one (id=0), Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 43/54: Save_form_plan must use the array, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 49/54: Adapt printtva to entreprise, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 52/54: test : find the accounting with the biggest number of records, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 47/54: Merge branch 'dev7102' into entreprise, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 48/54: Acc_Ledger : problem with acc_ledger::load(), Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 45/54: fixup! Printtva , under some circumstance tva_summary::check fails,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 46/54: indent, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 50/54: improve test for fiche get_row, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 51/54: test : compute min et max periode, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 53/54: test : use the accounting with the biggest number of records, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 54/54: Improve Scenario Test, Dany De Bontridder, 2020/07/11