noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
error_message.class.php
Go to the documentation of this file.
1<?php
2namespace Noalyss\XMLDocument;
3
4/*
5 * This file is part of NOALYSS.
6 *
7 * NOALYSS is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * NOALYSS is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with NOALYSS; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21// Copyright Author Dany De Bontridder danydb@aevalys.eu 22/10/23
22
23
24/**
25 * @file
26 * @brief Give the error message thanks the code for FacturX and UBL21
27 *
28 */
29
30/**
31 * @class
32 * @brief Give the error message thanks the code for FacturX and UBL21
33 *
34 property $a_error (double array)
35 keys :
36 - general ,
37 - customer,
38 - ATTR_DEF_NAME=>'CUST_NAME'
39 - ATTR_DEF_ADRESS=>'CUST_ADDR'
40 - ATTR_DEF_POSTCODE=>'CUST_POSTCD'
41 - ATTR_DEF_CITY=>'CUST_CITY'
42 - ATTR_DEF_COUNTRY_CODE=>'CUST_CDCOUNTRY'
43 - ATTR_DEF_NUMTVA=>'CUST_VAT'
44 - ATTR_DEF_PEPPOLID=>'CUST_PEPPOLID'
45
46 - company,
47 - "INVOICE_EMAIL_COMPANY" company's email
48 - 'INVOICE_CONTACT_NAME' contact name
49 - 'COMPANY_LEGAL_ENTITY' legal form of company
50 - 'COMPANY_LEGAL_REGISTRATION' full name
51 - 'COMPANY_BANK_IBAN' IBAN bank account
52 - 'COMPANY_BANK_BIC' BIC bank account
53 - 'COMPANY_PEPPOL_ID' PEPPOL id ==> normalement c'est BE0999999999
54 - 'MY_COUNTRY_CODE' country code (normally BE)
55 - 'MY_NAME' short company name
56 - 'MY_STREET' address
57 - 'MY_CITY' address
58 - 'MY_TVA' VAT number
59 * - 'SIREN'
60 *
61 */
63{
64
65 private $a_error;
68
69 /**
70 * @brief constructo
71 * @param $a_error (double array)
72 */
73 public function __construct($a_error)
74 {
75 $this->a_error = $a_error;
76 $this->a_message_company = array(
77 "INVOICE_EMAIL_COMPANY" => _("L'email de la société ")
78 , 'INVOICE_CONTACT_NAME' => _("Nom du contact")
79 , 'COMPANY_LEGAL_ENTITY' => _("Type de société (SRL,ASBL,...)")
80 , 'COMPANY_LEGAL_REGISTRATION' => _("Nom complet de la société")
81 , 'COMPANY_BANK_IBAN' => _("Compte en banque (IBAN) de la société")
82 , 'COMPANY_BANK_BIC' => _("Code BIC de compte en banque")
83 , 'COMPANY_PEPPOL_ID' => _("Identifiant PEPPOL")
84 , 'MY_COUNTRY_CODE' => _('Code Pays')
85 , 'MY_NAME' => _("Nom de la société")
86 , 'MY_STREET' => _("Adresse de la société")
87 , 'MY_CITY' => _("Ville")
88 , 'MY_TVA' => _("Numéro de TVA, vide ou invalide, il doit commencer par les 2 lettres du code pays")
89 , 'SIREN'=> 'SIREN'
90 // , 'SIRET'=> 'SIRET'
91 );
92 $this->a_message_customer = array(
93 'name' => _("Nom")
94 , 'street' => _("Adresse")
95 , 'postalzone' => _("Code postal")
96 , 'city' => _("Ville")
97 , 'country'=>_("Code pays")
98 , 'customer_vat_id' => _("Numéro de TVA, vide ou invalide, il doit commencer par les 2 lettres du code pays")
99 , 'endpoint_id' => _('Identifiant PEPPOL') // here 9925:BE....
100
101 );
102
103 }
104
105 public function get_a_error()
106 {
107 return $this->a_error;
108 }
109
110 public function set_a_error($a_error)
111 {
112 $this->a_error = $a_error;
113 return $this;
114 }
115
116 /**
117 * @brief returns the text of an error
118 * @param $code (string or number)
119 * @param $type (string) customer , general or company
120 */
122 {
123 if ($type == "customer")
124 {
125 $a_error = $this->a_error['customer'];
126 $a_message = $this->a_message_customer;
127 } else if ($type == "company")
128 {
129 $a_error = $this->a_error['company'];
130 $a_message = $this->a_message_company;
131 } else
132 {
133 throw new \Exception("EM116: unknow type");
134 }
135
136 return $a_message[$code];
137 }
138}
_("actif, passif,charge,...")
Give the error message thanks the code for FacturX and UBL21.
get_message_error($code, $type)
returns the text of an error