Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 785 lines (665 sloc) 27.491 kb
d18ecc4 changement de <?PHPen <?php
opensides authored
1 <?php
37cca42 Fix: uniform and clean code
Regis Houssin authored
2 /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
45ff7bd New: Check if there is external models to do asked by plugins
Regis Houssin authored
5 * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
37cca42 Fix: uniform and clean code
Regis Houssin authored
6 * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
2e7ce76 Juanjo Menent Fix: Sanizite data
simnandez authored
7 * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
d476daa Rodolphe Quiédeville Nouveau fichier
rodo authored
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
e2c0073 Laurent Destailleur Fix: Avoid errors into rpm packages
eldy authored
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
d476daa Rodolphe Quiédeville Nouveau fichier
rodo authored
21 */
4f3d253 Laurent Destailleur Optim: Les fichiers modules de mod�les de num�rotation de factures ont �...
eldy authored
22
0d3affa Laurent Destailleur Gestion d'affichage de specimen sur propale
eldy authored
23 /**
fba4488 Laurent Destailleur New: Add clone feature on invoices.
eldy authored
24 * \file htdocs/admin/facture.php
25 * \ingroup facture
d5d9291 Laurent Destailleur Qual: Uniformize code
eldy authored
26 * \brief Page to setup invoice module
8e770f9 Laurent Destailleur Minor change
eldy authored
27 */
4f3d253 Laurent Destailleur Optim: Les fichiers modules de mod�les de num�rotation de factures ont �...
eldy authored
28
68c1571 Qual: First change to remove pre.inc.php
Regis Houssin authored
29 require("../main.inc.php");
63d60a3 [task #216] Move lib in core directory
Regis Houssin authored
30 require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
c418128 Philippe Grand according to new tree directory
grandoc authored
31 require_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php');
767b1b6 Rodolphe Quiédeville R�organise le code en rapport au test admin, security update
rodo authored
32
f9ac2ae Laurent Destailleur Fix: Toutes les pages de l'espace admin sont prot�g�es par "if (!$user->...
eldy authored
33 $langs->load("admin");
d6abe49 Laurent Destailleur Fix: Show error message
eldy authored
34 $langs->load("errors");
237d7b7 Marcos García Including other.lang in files using FeaturesSupported string, also remov...
marcosgdf authored
35 $langs->load('other');
f9ac2ae Laurent Destailleur Fix: Toutes les pages de l'espace admin sont prot�g�es par "if (!$user->...
eldy authored
36
37cca42 Fix: uniform and clean code
Regis Houssin authored
37 if (! $user->admin) accessforbidden();
3186884 Laurent Destailleur Remplacer du code par la nouvelle fonction set_dolibarr_const
eldy authored
38
45ff7bd New: Check if there is external models to do asked by plugins
Regis Houssin authored
39 $action = GETPOST('action','alpha');
40 $value = GETPOST('value','alpha');
247fd29 Laurent Destailleur For the "default" field, we keep usa of standard on and off button becau...
eldy authored
41
d6b11b2 Laurent Destailleur New: Am�lioration de la gestion des erreurs sur la g�n�ration des factur...
eldy authored
42
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
43 /*
44 * Actions
45 */
f74d4d6 Laurent Destailleur Work on odt generation
eldy authored
46
0a51265 Juanjo Menent Uniformize code
simnandez authored
47 if ($action == 'updateMask')
68595e0 Laurent Destailleur Le modèle de numérotation de facture générique mercure est opérationnel ...
eldy authored
48 {
2e7ce76 Juanjo Menent Fix: Sanizite data
simnandez authored
49 $maskconstinvoice=GETPOST('maskconstinvoice','alpha');
50 $maskconstcredit=GETPOST('maskconstcredit','alpha');
51 $maskinvoice=GETPOST('maskinvoice','alpha');
52 $maskcredit=GETPOST('maskcredit','alpha');
0a51265 Juanjo Menent Uniformize code
simnandez authored
53 if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskinvoice,'chaine',0,'',$conf->entity);
54 if ($maskconstcredit) $res = dolibarr_set_const($db,$maskconstcredit,$maskcredit,'chaine',0,'',$conf->entity);
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
55
0a51265 Juanjo Menent Uniformize code
simnandez authored
56 if (! $res > 0) $error++;
57
58 if (! $error)
59 {
60 $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
61 }
62 else
63 {
64 $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
65 }
68595e0 Laurent Destailleur Le modèle de numérotation de facture générique mercure est opérationnel ...
eldy authored
66 }
67
0a51265 Juanjo Menent Uniformize code
simnandez authored
68 if ($action == 'specimen')
b89b5f8 Laurent Destailleur New: Sur page config choix module g�n�ration facture, un clic sur info a...
eldy authored
69 {
2e7ce76 Juanjo Menent Fix: Sanizite data
simnandez authored
70 $modele=GETPOST('module','alpha');
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
71
72 $facture = new Facture($db);
73 $facture->initAsSpecimen();
51fb1b2 Laurent Destailleur Fix: Code was sharing loop for custom dir and loop for subdir modules.
eldy authored
74
75 // Search template files
76 $file=''; $classname=''; $filefound=0;
ddedb68 Fix: php unit test warning
Regis Houssin authored
77 $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
51fb1b2 Laurent Destailleur Fix: Code was sharing loop for custom dir and loop for subdir modules.
eldy authored
78 foreach($dirmodels as $reldir)
79 {
80 $file=dol_buildpath($reldir."core/modules/facture/doc/pdf_".$modele.".modules.php",0);
79c0369 Fix: possibility to use models of external modules
Regis Houssin authored
81 if (file_exists($file))
82 {
83 $filefound=1;
84 $classname = "pdf_".$modele;
85 break;
86 }
87 }
51fb1b2 Laurent Destailleur Fix: Code was sharing loop for custom dir and loop for subdir modules.
eldy authored
88
79c0369 Fix: possibility to use models of external modules
Regis Houssin authored
89 if ($filefound)
90 {
91 require_once($file);
51fb1b2 Laurent Destailleur Fix: Code was sharing loop for custom dir and loop for subdir modules.
eldy authored
92
79c0369 Fix: possibility to use models of external modules
Regis Houssin authored
93 $module = new $classname($db);
51fb1b2 Laurent Destailleur Fix: Code was sharing loop for custom dir and loop for subdir modules.
eldy authored
94
79c0369 Fix: possibility to use models of external modules
Regis Houssin authored
95 if ($module->write_file($facture,$langs) > 0)
96 {
97 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture&file=SPECIMEN.pdf");
98 return;
99 }
100 else
101 {
102 $mesg='<font class="error">'.$module->error.'</font>';
103 dol_syslog($module->error, LOG_ERR);
104 }
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
105 }
106 else
107 {
79c0369 Fix: possibility to use models of external modules
Regis Houssin authored
108 $mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
109 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
110 }
b89b5f8 Laurent Destailleur New: Sur page config choix module g�n�ration facture, un clic sur info a...
eldy authored
111 }
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
112
f74d4d6 Laurent Destailleur Work on odt generation
eldy authored
113 // define constants for models generator that need parameters
0a51265 Juanjo Menent Uniformize code
simnandez authored
114 if ($action == 'setModuleOptions')
f74d4d6 Laurent Destailleur Work on odt generation
eldy authored
115 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
116 $post_size=count($_POST);
117 for($i=0;$i < $post_size;$i++)
f74d4d6 Laurent Destailleur Work on odt generation
eldy authored
118 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
119 if (array_key_exists('param'.$i,$_POST))
120 {
2e7ce76 Juanjo Menent Fix: Sanizite data
simnandez authored
121 $param=GETPOST("param".$i,'alpha');
122 $value=GETPOST("value".$i,'alpha');
0a51265 Juanjo Menent Uniformize code
simnandez authored
123 if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
124 }
f74d4d6 Laurent Destailleur Work on odt generation
eldy authored
125 }
0a51265 Juanjo Menent Uniformize code
simnandez authored
126 if (! $res > 0) $error++;
127
128 if (! $error)
129 {
130 $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
131 }
132 else
133 {
134 $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
135 }
f74d4d6 Laurent Destailleur Work on odt generation
eldy authored
136 }
137
0a51265 Juanjo Menent Uniformize code
simnandez authored
138 if ($action == 'set')
d476daa Rodolphe Quiédeville Nouveau fichier
rodo authored
139 {
2e7ce76 Juanjo Menent Fix: Sanizite data
simnandez authored
140 $label = GETPOST('label','alpha');
141 $scandir = GETPOST('scandir','alpha');
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
142
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
143 $type='invoice';
0560de9 Laurent Destailleur Work on ODT generation
eldy authored
144 $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
0a51265 Juanjo Menent Uniformize code
simnandez authored
145 $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
146 $sql.= ($label?"'".$db->escape($label)."'":'null').", ";
147 $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
0560de9 Laurent Destailleur Work on ODT generation
eldy authored
148 $sql.= ")";
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
149 if ($db->query($sql))
150 {
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
151
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
152 }
439f1d3 Rodolphe Quiédeville Ajout option pour la date de facture lors de la validation
rodo authored
153 }
154
0a51265 Juanjo Menent Uniformize code
simnandez authored
155 if ($action == 'del')
96fb2f9 Rodolphe Quiédeville Ajout rib_number sur les factures
rodo authored
156 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
157 $type='invoice';
158 $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
247fd29 Laurent Destailleur For the "default" field, we keep usa of standard on and off button becau...
eldy authored
159 $sql.= " WHERE nom = '".$db->escape($value)."'";
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
160 $sql.= " AND type = '".$type."'";
161 $sql.= " AND entity = ".$conf->entity;
86625da Laurent Destailleur Predefined invoices are now always enabled
eldy authored
162
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
163 if ($db->query($sql))
164 {
247fd29 Laurent Destailleur For the "default" field, we keep usa of standard on and off button becau...
eldy authored
165 if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF',$conf->entity);
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
166 }
96fb2f9 Rodolphe Quiédeville Ajout rib_number sur les factures
rodo authored
167 }
168
0a51265 Juanjo Menent Uniformize code
simnandez authored
169 if ($action == 'setdoc')
a8abba9 Rodolphe Quiédeville Ajout du mod�le de facture pdf
rodo authored
170 {
2e7ce76 Juanjo Menent Fix: Sanizite data
simnandez authored
171 $label = GETPOST('label','alpha');
172 $scandir = GETPOST('scandir','alpha');
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
173
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
174 $db->begin();
0d3affa Laurent Destailleur Gestion d'affichage de specimen sur propale
eldy authored
175
0a51265 Juanjo Menent Uniformize code
simnandez authored
176 if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
177 {
0a51265 Juanjo Menent Uniformize code
simnandez authored
178 $conf->global->FACTURE_ADDON_PDF = $value;
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
179 }
40b3889 Laurent Destailleur Fix: Usage of alternate document root works with invoice numbering modul...
eldy authored
180
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
181 // On active le modele
182 $type='invoice';
807fad4 Laurent Destailleur Fix: More log to hunt a bug
eldy authored
183
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
184 $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
0a51265 Juanjo Menent Uniformize code
simnandez authored
185 $sql_del.= " WHERE nom = '".$db->escape($value)."'";
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
186 $sql_del.= " AND type = '".$type."'";
187 $sql_del.= " AND entity = ".$conf->entity;
e6cd400 Laurent Destailleur Qual: List of elements must be into a page called "list.php".
eldy authored
188 dol_syslog("Delete from model table ".$sql_del);
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
189 $result1=$db->query($sql_del);
807fad4 Laurent Destailleur Fix: More log to hunt a bug
eldy authored
190
0560de9 Laurent Destailleur Work on ODT generation
eldy authored
191 $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
0a51265 Juanjo Menent Uniformize code
simnandez authored
192 $sql.= " VALUES ('".$value."', '".$type."', ".$conf->entity.", ";
193 $sql.= ($label?"'".$db->escape($label)."'":'null').", ";
194 $sql.= (! empty($scandir)?"'".$scandir."'":"null");
0560de9 Laurent Destailleur Work on ODT generation
eldy authored
195 $sql.= ")";
e6cd400 Laurent Destailleur Qual: List of elements must be into a page called "list.php".
eldy authored
196 dol_syslog("Insert into model table ".$sql);
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
197 $result2=$db->query($sql);
198 if ($result1 && $result2)
199 {
200 $db->commit();
201 }
202 else
203 {
e6cd400 Laurent Destailleur Qual: List of elements must be into a page called "list.php".
eldy authored
204 dol_syslog("Error ".$db->lasterror(), LOG_ERR);
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
205 $db->rollback();
206 }
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
207 }
208
0a51265 Juanjo Menent Uniformize code
simnandez authored
209 if ($action == 'setmod')
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
210 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
211 // TODO Verifier si module numerotation choisi peut etre active
212 // par appel methode canBeActivated
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
213
0a51265 Juanjo Menent Uniformize code
simnandez authored
214 dolibarr_set_const($db, "FACTURE_ADDON",$value,'chaine',0,'',$conf->entity);
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
215 }
216
0a51265 Juanjo Menent Uniformize code
simnandez authored
217 if ($action == 'setribchq')
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
218 {
2e7ce76 Juanjo Menent Fix: Sanizite data
simnandez authored
219 $rib = GETPOST('rib','alpha');
220 $chq = GETPOST('chq','alpha');
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
221
0a51265 Juanjo Menent Uniformize code
simnandez authored
222 $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$rib,'chaine',0,'',$conf->entity);
223 $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$chq,'chaine',0,'',$conf->entity);
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
224
0a51265 Juanjo Menent Uniformize code
simnandez authored
225 if (! $res > 0) $error++;
226
227 if (! $error)
228 {
229 $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
230 }
231 else
232 {
233 $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
234 }
a8abba9 Rodolphe Quiédeville Ajout du mod�le de facture pdf
rodo authored
235 }
236
0a51265 Juanjo Menent Uniformize code
simnandez authored
237 if ($action == 'set_FACTURE_DRAFT_WATERMARK')
394b337 Laurent Destailleur [Task #7349] Patch + Correction mise en page adresse contact sur PDF
eldy authored
238 {
2e7ce76 Juanjo Menent Fix: Sanizite data
simnandez authored
239 $draft = GETPOST('FACTURE_DRAFT_WATERMARK','alpha');
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
240
0a51265 Juanjo Menent Uniformize code
simnandez authored
241 $res = dolibarr_set_const($db, "FACTURE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
242
0a51265 Juanjo Menent Uniformize code
simnandez authored
243 if (! $res > 0) $error++;
244
245 if (! $error)
246 {
247 $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
248 }
249 else
250 {
251 $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
252 }
394b337 Laurent Destailleur [Task #7349] Patch + Correction mise en page adresse contact sur PDF
eldy authored
253 }
254
0a51265 Juanjo Menent Uniformize code
simnandez authored
255 if ($action == 'set_FACTURE_FREE_TEXT')
77e831d Laurent Destailleur New: Ajout champ mention l�gal
eldy authored
256 {
2e7ce76 Juanjo Menent Fix: Sanizite data
simnandez authored
257 $free = GETPOST('FACTURE_FREE_TEXT','alpha');
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
258
0a51265 Juanjo Menent Uniformize code
simnandez authored
259 $res = dolibarr_set_const($db, "FACTURE_FREE_TEXT",$free,'chaine',0,'',$conf->entity);
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
260
0a51265 Juanjo Menent Uniformize code
simnandez authored
261 if (! $res > 0) $error++;
262
263 if (! $error)
264 {
265 $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
266 }
267 else
268 {
269 $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
270 }
77e831d Laurent Destailleur New: Ajout champ mention l�gal
eldy authored
271 }
272
0a51265 Juanjo Menent Uniformize code
simnandez authored
273 if ($action == 'setforcedate')
79f51e1 Laurent Destailleur Fix: parametre width non quot�s.
eldy authored
274 {
2e7ce76 Juanjo Menent Fix: Sanizite data
simnandez authored
275 $forcedate = GETPOST('forcedate','alpha');
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
276
0a51265 Juanjo Menent Uniformize code
simnandez authored
277 $res = dolibarr_set_const($db, "FAC_FORCE_DATE_VALIDATION",$forcedate,'chaine',0,'',$conf->entity);
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
278
0a51265 Juanjo Menent Uniformize code
simnandez authored
279 if (! $res > 0) $error++;
280
281 if (! $error)
282 {
283 $mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
284 }
285 else
286 {
287 $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
288 }
034c7bd Laurent Destailleur *** empty log message ***
eldy authored
289 }
290
1b3da4a Laurent Destailleur Am�lioration de la gestion des modules de num�rotation.
eldy authored
291
292 /*
ee47cf1 Laurent Destailleur Qual: Uniformize code and remove useless function
eldy authored
293 * View
1b3da4a Laurent Destailleur Am�lioration de la gestion des modules de num�rotation.
eldy authored
294 */
295
ddedb68 Fix: php unit test warning
Regis Houssin authored
296 $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
7c4e908 Laurent Destailleur models_modules isn't enough so we use same facture_invoice,
eldy authored
297
8e770f9 Laurent Destailleur Minor change
eldy authored
298 llxHeader("",$langs->trans("BillsSetup"),'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura');
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
299
f0c327c Fix: uniform code
Regis Houssin authored
300 $form=new Form($db);
1503627 Laurent Destailleur New: Ajout option pour d�sactiver les notifications
eldy authored
301
d146e10 Laurent Destailleur Look: Modif esth�tique mineure
eldy authored
302
a81f652 Laurent Destailleur New: Ajout lien "Retour liste des modules" dans page config modules
eldy authored
303 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
8e770f9 Laurent Destailleur Minor change
eldy authored
304 print_fiche_titre($langs->trans("BillsSetup"),$linkback,'setup');
d146e10 Laurent Destailleur Look: Modif esth�tique mineure
eldy authored
305 print '<br>';
306
8e770f9 Laurent Destailleur Minor change
eldy authored
307
1d8e995 Laurent Destailleur Pr�paration pour le d�placement des param�tres FACxxx dans la page de co...
eldy authored
308 /*
8e770f9 Laurent Destailleur Minor change
eldy authored
309 * Numbering module
1d8e995 Laurent Destailleur Pr�paration pour le d�placement des param�tres FACxxx dans la page de co...
eldy authored
310 */
8e770f9 Laurent Destailleur Minor change
eldy authored
311
312 print_titre($langs->trans("BillsNumberingModule"));
313
79f51e1 Laurent Destailleur Fix: parametre width non quot�s.
eldy authored
314 print '<table class="noborder" width="100%">';
d6b11b2 Laurent Destailleur New: Am�lioration de la gestion des erreurs sur la g�n�ration des factur...
eldy authored
315 print '<tr class="liste_titre">';
4188598 Laurent Destailleur New: Gestion du FAC_PDF_LOGO dans le mod�le de facture crabe.
eldy authored
316 print '<td>'.$langs->trans("Name").'</td>';
317 print '<td>'.$langs->trans("Description").'</td>';
1b3da4a Laurent Destailleur Am�lioration de la gestion des modules de num�rotation.
eldy authored
318 print '<td nowrap>'.$langs->trans("Example").'</td>';
d5d9291 Laurent Destailleur Qual: Uniformize code
eldy authored
319 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
59e7c49 Laurent Destailleur Trad: Traduction infos
eldy authored
320 print '<td align="center" width="16">'.$langs->trans("Infos").'</td>';
1b3da4a Laurent Destailleur Am�lioration de la gestion des modules de num�rotation.
eldy authored
321 print '</tr>'."\n";
d476daa Rodolphe Quiédeville Nouveau fichier
rodo authored
322
323 clearstatcache();
324
0b945f0 Fix: use dol_buildpath
Regis Houssin authored
325 foreach ($dirmodels as $reldir)
d476daa Rodolphe Quiédeville Nouveau fichier
rodo authored
326 {
7c4e908 Laurent Destailleur models_modules isn't enough so we use same facture_invoice,
eldy authored
327 $dir = dol_buildpath($reldir."core/modules/facture/");
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
328 if (is_dir($dir))
329 {
330 $handle = opendir($dir);
331 if (is_resource($handle))
332 {
0b945f0 Fix: use dol_buildpath
Regis Houssin authored
333 $var=true;
7c4e908 Laurent Destailleur models_modules isn't enough so we use same facture_invoice,
eldy authored
334
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
335 while (($file = readdir($handle))!==false)
336 {
337 if (! is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS'))
338 {
339 $filebis = $file;
340 $classname = preg_replace('/\.php$/','',$file);
341 // For compatibility
342 if (! is_file($dir.$filebis))
343 {
344 $filebis = $file."/".$file.".modules.php";
345 $classname = "mod_facture_".$file;
346 }
347 if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php')
348 {
349 // Chargement de la classe de numerotation
350 require_once($dir.$filebis);
351
352 $module = new $classname($db);
353
354 // Show modules according to features level
355 if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
356 if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
357
358 if ($module->isEnabled())
359 {
360 $var = !$var;
361 print '<tr '.$bc[$var].'><td width="100">';
362 echo preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file));
363 print "</td><td>\n";
364
365 print $module->info();
366
367 print '</td>';
368
d6abe49 Laurent Destailleur Fix: Show error message
eldy authored
369 // Show example of numbering module
370 print '<td nowrap="nowrap">';
371 $tmp=$module->getExample();
237d7b7 Marcos García Including other.lang in files using FeaturesSupported string, also remov...
marcosgdf authored
372 if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
8d46ae1 Laurent Destailleur Qual: Better error managment on numbering setup
eldy authored
373 elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
d6abe49 Laurent Destailleur Fix: Show error message
eldy authored
374 else print $tmp;
375 print '</td>'."\n";
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
376
377 print '<td align="center">';
378 //print "> ".$conf->global->FACTURE_ADDON." - ".$file;
379 if ($conf->global->FACTURE_ADDON == $file || $conf->global->FACTURE_ADDON.'.php' == $file)
380 {
247fd29 Laurent Destailleur For the "default" field, we keep usa of standard on and off button becau...
eldy authored
381 print img_picto($langs->trans("Activated"),'switch_on');
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
382 }
383 else
384 {
df45c51 Laurent Destailleur Fix: Solve error Method Not Implemented
eldy authored
385 print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
386 }
387 print '</td>';
388
389 $facture=new Facture($db);
390 $facture->initAsSpecimen();
391
392 // Example for standard invoice
393 $htmltooltip='';
394 $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
395 $facture->type=0;
396 $nextval=$module->getNextValue($mysoc,$facture);
397 if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
398 {
399 $htmltooltip.=$langs->trans("NextValueForInvoices").': ';
400 if ($nextval)
401 {
402 $htmltooltip.=$nextval.'<br>';
403 }
404 else
405 {
406 $htmltooltip.=$langs->trans($module->error).'<br>';
407 }
408 }
409 // Example for credit invoice
410 $facture->type=2;
411 $nextval=$module->getNextValue($mysoc,$facture);
412 if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
413 {
414 $htmltooltip.=$langs->trans("NextValueForCreditNotes").': ';
415 if ($nextval)
416 {
417 $htmltooltip.=$nextval;
418 }
419 else
420 {
421 $htmltooltip.=$langs->trans($module->error);
422 }
423 }
424
425 print '<td align="center">';
f0c327c Fix: uniform code
Regis Houssin authored
426 print $form->textwithpicto('',$htmltooltip,1,0);
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
427
428 if ($conf->global->FACTURE_ADDON.'.php' == $file) // If module is the one used, we show existing errors
429 {
337f41c Laurent Destailleur Uniformize code
eldy authored
430 if (! empty($module->error)) dol_htmloutput_mesg($module->error,'','error',1);
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
431 }
432
433 print '</td>';
434
435 print "</tr>\n";
436
437 }
438 }
439 }
440 }
441 closedir($handle);
442 }
443 }
d476daa Rodolphe Quiédeville Nouveau fichier
rodo authored
444 }
445
446 print '</table>';
1d8e995 Laurent Destailleur Pr�paration pour le d�placement des param�tres FACxxx dans la page de co...
eldy authored
447
439f1d3 Rodolphe Quiédeville Ajout option pour la date de facture lors de la validation
rodo authored
448
a8abba9 Rodolphe Quiédeville Ajout du mod�le de facture pdf
rodo authored
449 /*
82dcb86 Laurent Destailleur Work on ODT templates
eldy authored
450 * Document templates generators
a8abba9 Rodolphe Quiédeville Ajout du mod�le de facture pdf
rodo authored
451 */
1d8e995 Laurent Destailleur Pr�paration pour le d�placement des param�tres FACxxx dans la page de co...
eldy authored
452 print '<br>';
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
453 print_titre($langs->trans("BillsPDFModules"));
454
82dcb86 Laurent Destailleur Work on ODT templates
eldy authored
455 // Load array def with activated templates
2093b3f Laurent Destailleur New: Allow to use ODT templates for prososal like it's done for invoices
eldy authored
456 $type='invoice';
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
457 $def = array();
458 $sql = "SELECT nom";
459 $sql.= " FROM ".MAIN_DB_PREFIX."document_model";
2093b3f Laurent Destailleur New: Allow to use ODT templates for prososal like it's done for invoices
eldy authored
460 $sql.= " WHERE type = '".$type."'";
b866848 New: early development of multi-company module
Regis Houssin authored
461 $sql.= " AND entity = ".$conf->entity;
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
462 $resql=$db->query($sql);
463 if ($resql)
464 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
465 $i = 0;
466 $num_rows=$db->num_rows($resql);
467 while ($i < $num_rows)
468 {
469 $array = $db->fetch_array($resql);
470 array_push($def, $array[0]);
471 $i++;
472 }
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
473 }
474 else
475 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
476 dol_print_error($db);
ad4c4e7 Laurent Destailleur Uniformisation du code: Tous les modules de g�n�ration de document PDF s...
eldy authored
477 }
a8abba9 Rodolphe Quiédeville Ajout du mod�le de facture pdf
rodo authored
478
79f51e1 Laurent Destailleur Fix: parametre width non quot�s.
eldy authored
479 print '<table class="noborder" width="100%">';
3186884 Laurent Destailleur Remplacer du code par la nouvelle fonction set_dolibarr_const
eldy authored
480 print '<tr class="liste_titre">';
4188598 Laurent Destailleur New: Gestion du FAC_PDF_LOGO dans le mod�le de facture crabe.
eldy authored
481 print '<td>'.$langs->trans("Name").'</td>';
482 print '<td>'.$langs->trans("Description").'</td>';
d5d9291 Laurent Destailleur Qual: Uniformize code
eldy authored
483 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
79f51e1 Laurent Destailleur Fix: parametre width non quot�s.
eldy authored
484 print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
59e7c49 Laurent Destailleur Trad: Traduction infos
eldy authored
485 print '<td align="center" width="32" colspan="2">'.$langs->trans("Infos").'</td>';
3186884 Laurent Destailleur Remplacer du code par la nouvelle fonction set_dolibarr_const
eldy authored
486 print "</tr>\n";
a8abba9 Rodolphe Quiédeville Ajout du mod�le de facture pdf
rodo authored
487
488 clearstatcache();
489
64c9991 Laurent Destailleur Fix: Translation of currency works better now.
eldy authored
490 $var=true;
0b945f0 Fix: use dol_buildpath
Regis Houssin authored
491 foreach ($dirmodels as $reldir)
a8abba9 Rodolphe Quiédeville Ajout du mod�le de facture pdf
rodo authored
492 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
493 foreach (array('','/doc') as $valdir)
494 {
0b945f0 Fix: use dol_buildpath
Regis Houssin authored
495 $dir = dol_buildpath($reldir."core/modules/facture".$valdir);
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
496
497 if (is_dir($dir))
498 {
499 $handle=opendir($dir);
500 if (is_resource($handle))
501 {
502 while (($file = readdir($handle))!==false)
503 {
77031ca Laurent Destailleur New: odt templates usage for invoices are now visible
eldy authored
504 $filelist[]=$file;
505 }
506 closedir($handle);
2093b3f Laurent Destailleur New: Allow to use ODT templates for prososal like it's done for invoices
eldy authored
507 arsort($filelist);
77031ca Laurent Destailleur New: odt templates usage for invoices are now visible
eldy authored
508
509 foreach($filelist as $file)
510 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
511 if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
512 {
488938c Fix: compatibility with custom path
Regis Houssin authored
513 if (file_exists($dir.'/'.$file))
514 {
515 $name = substr($file, 4, dol_strlen($file) -16);
516 $classname = substr($file, 0, dol_strlen($file) -12);
3cf65ac Laurent Destailleur Uniformize code
eldy authored
517
488938c Fix: compatibility with custom path
Regis Houssin authored
518 require_once($dir.'/'.$file);
519 $module = new $classname($db);
3cf65ac Laurent Destailleur Uniformize code
eldy authored
520
488938c Fix: compatibility with custom path
Regis Houssin authored
521 $modulequalified=1;
522 if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
523 if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
3cf65ac Laurent Destailleur Uniformize code
eldy authored
524
488938c Fix: compatibility with custom path
Regis Houssin authored
525 if ($modulequalified)
526 {
527 $var = !$var;
528 print '<tr '.$bc[$var].'><td width="100">';
529 print (empty($module->name)?$name:$module->name);
530 print "</td><td>\n";
531 if (method_exists($module,'info')) print $module->info($langs);
532 else print $module->description;
533 print '</td>';
3cf65ac Laurent Destailleur Uniformize code
eldy authored
534
488938c Fix: compatibility with custom path
Regis Houssin authored
535 // Active
536 if (in_array($name, $def))
537 {
37cca42 Fix: uniform and clean code
Regis Houssin authored
538 print '<td align="center">'."\n";
df45c51 Laurent Destailleur Fix: Solve error Method Not Implemented
eldy authored
539 print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
37cca42 Fix: uniform and clean code
Regis Houssin authored
540 print img_picto($langs->trans("Enabled"),'switch_on');
541 print '</a>';
542 print '</td>';
488938c Fix: compatibility with custom path
Regis Houssin authored
543 }
544 else
545 {
546 print "<td align=\"center\">\n";
df45c51 Laurent Destailleur Fix: Solve error Method Not Implemented
eldy authored
547 print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
488938c Fix: compatibility with custom path
Regis Houssin authored
548 print "</td>";
549 }
3cf65ac Laurent Destailleur Uniformize code
eldy authored
550
488938c Fix: compatibility with custom path
Regis Houssin authored
551 // Defaut
552 print "<td align=\"center\">";
553 if ($conf->global->FACTURE_ADDON_PDF == "$name")
554 {
555 print img_picto($langs->trans("Default"),'on');
556 }
557 else
558 {
df45c51 Laurent Destailleur Fix: Solve error Method Not Implemented
eldy authored
559 print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
488938c Fix: compatibility with custom path
Regis Houssin authored
560 }
561 print '</td>';
3cf65ac Laurent Destailleur Uniformize code
eldy authored
562
488938c Fix: compatibility with custom path
Regis Houssin authored
563 // Info
564 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
565 $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
566 if ($module->type == 'pdf')
567 {
1aaf65c Laurent Destailleur PDF works with us letter format
eldy authored
568 $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
488938c Fix: compatibility with custom path
Regis Houssin authored
569 }
570 $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
571 $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
572 $htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
573 $htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
574 $htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1);
575 $htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
576 $htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
577 $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftInvoices").': '.yn($module->option_draft_watermark,1,1);
3cf65ac Laurent Destailleur Uniformize code
eldy authored
578
579
488938c Fix: compatibility with custom path
Regis Houssin authored
580 print '<td align="center">';
f0c327c Fix: uniform code
Regis Houssin authored
581 print $form->textwithpicto('',$htmltooltip,1,0);
488938c Fix: compatibility with custom path
Regis Houssin authored
582 print '</td>';
3cf65ac Laurent Destailleur Uniformize code
eldy authored
583
488938c Fix: compatibility with custom path
Regis Houssin authored
584 // Preview
585 print '<td align="center">';
586 if ($module->type == 'pdf')
587 {
588 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
589 }
590 else
591 {
592 print img_object($langs->trans("PreviewNotAvailable"),'generic');
593 }
594 print '</td>';
3cf65ac Laurent Destailleur Uniformize code
eldy authored
595
488938c Fix: compatibility with custom path
Regis Houssin authored
596 print "</tr>\n";
597 }
598 }
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
599 }
600 }
601 }
602 }
603 }
a8abba9 Rodolphe Quiédeville Ajout du mod�le de facture pdf
rodo authored
604 }
605 print '</table>';
606
d476daa Rodolphe Quiédeville Nouveau fichier
rodo authored
607
96fb2f9 Rodolphe Quiédeville Ajout rib_number sur les factures
rodo authored
608 /*
b866848 New: early development of multi-company module
Regis Houssin authored
609 * Modes de reglement
96fb2f9 Rodolphe Quiédeville Ajout rib_number sur les factures
rodo authored
610 *
611 */
1d8e995 Laurent Destailleur Pr�paration pour le d�placement des param�tres FACxxx dans la page de co...
eldy authored
612 print '<br>';
e82125b Laurent Destailleur *** empty log message ***
eldy authored
613 print_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"));
614
37cca42 Fix: uniform and clean code
Regis Houssin authored
615 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
616 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
96fb2f9 Rodolphe Quiédeville Ajout rib_number sur les factures
rodo authored
617
79f51e1 Laurent Destailleur Fix: parametre width non quot�s.
eldy authored
618 print '<table class="noborder" width="100%">';
d6b11b2 Laurent Destailleur New: Am�lioration de la gestion des erreurs sur la g�n�ration des factur...
eldy authored
619 $var=True;
d3b6f42 Laurent Destailleur La configuration du module facture permettais de choisir le compte � uti...
eldy authored
620
621 print '<tr class="liste_titre">';
f74d4d6 Laurent Destailleur Work on odt generation
eldy authored
622 print '<td>';
623 print '<input type="hidden" name="action" value="setribchq">';
624 print $langs->trans("PaymentMode").'</td>';
6620222 Laurent Destailleur On d�place l'option qui d�finit si soci�t� assujeti � TVA dans configura...
eldy authored
625 print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
d3b6f42 Laurent Destailleur La configuration du module facture permettais de choisir le compte � uti...
eldy authored
626 print "</tr>\n";
d6b11b2 Laurent Destailleur New: Am�lioration de la gestion des erreurs sur la g�n�ration des factur...
eldy authored
627 $var=!$var;
628 print '<tr '.$bc[$var].'>';
77e831d Laurent Destailleur New: Ajout champ mention l�gal
eldy authored
629 print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
c6e91b2 Laurent Destailleur Ajout d'un test sur la pr�sence de compte. En cas d'absence, plutot que ...
eldy authored
630 print "<td>";
e82125b Laurent Destailleur *** empty log message ***
eldy authored
631 if ($conf->banque->enabled)
96fb2f9 Rodolphe Quiédeville Ajout rib_number sur les factures
rodo authored
632 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
633 $sql = "SELECT rowid, label";
634 $sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
635 $sql.= " WHERE clos = 0";
636 $sql.= " AND courant = 1";
637 $sql.= " AND entity = ".$conf->entity;
638 $resql=$db->query($sql);
639 if ($resql)
640 {
641 $num = $db->num_rows($resql);
642 $i = 0;
37cca42 Fix: uniform and clean code
Regis Houssin authored
643 if ($num > 0)
644 {
645 print '<select name="rib" class="flat" id="rib">';
646 print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
647 while ($i < $num)
648 {
649 $row = $db->fetch_row($resql);
650
651 print '<option value="'.$row[0].'"';
652 print $conf->global->FACTURE_RIB_NUMBER == $row[0] ? ' selected="selected"':'';
653 print '>'.$row[1].'</option>';
654
655 $i++;
656 }
657 print "</select>";
37cca42 Fix: uniform and clean code
Regis Houssin authored
658 }
659 else
660 {
661 print "<i>".$langs->trans("NoActiveBankAccountDefined")."</i>";
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
662 }
663 }
e82125b Laurent Destailleur *** empty log message ***
eldy authored
664 }
665 else
666 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
667 print $langs->trans("BankModuleNotActive");
96fb2f9 Rodolphe Quiédeville Ajout rib_number sur les factures
rodo authored
668 }
c6e91b2 Laurent Destailleur Ajout d'un test sur la pr�sence de compte. En cas d'absence, plutot que ...
eldy authored
669 print "</td></tr>";
d6b11b2 Laurent Destailleur New: Am�lioration de la gestion des erreurs sur la g�n�ration des factur...
eldy authored
670 $var=!$var;
671 print '<tr '.$bc[$var].'>';
77e831d Laurent Destailleur New: Ajout champ mention l�gal
eldy authored
672 print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>";
c6e91b2 Laurent Destailleur Ajout d'un test sur la pr�sence de compte. En cas d'absence, plutot que ...
eldy authored
673 print "<td>";
a0c475e Laurent Destailleur Fix: Use correct css
eldy authored
674 print '<select class="flat" name="chq" id="chq">';
e82125b Laurent Destailleur *** empty log message ***
eldy authored
675 print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
371c4a6 Laurent Destailleur Qual: Remove usage of deprecated properties
eldy authored
676 print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER?' selected="selected"':'').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name?$mysoc->name:$langs->trans("NotDefined")).')</option>';
e82125b Laurent Destailleur *** empty log message ***
eldy authored
677
a7791af Laurent Destailleur Fix: N'affiche pas les comptes caisse dans la liste des comptes pour pai...
eldy authored
678 $sql = "SELECT rowid, label";
679 $sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
b866848 New: early development of multi-company module
Regis Houssin authored
680 $sql.= " WHERE clos = 0";
681 $sql.= " AND courant = 1";
682 $sql.= " AND entity = ".$conf->entity;
3186884 Laurent Destailleur Remplacer du code par la nouvelle fonction set_dolibarr_const
eldy authored
683 $var=True;
e82125b Laurent Destailleur *** empty log message ***
eldy authored
684 $resql=$db->query($sql);
685 if ($resql)
d3b6f42 Laurent Destailleur La configuration du module facture permettais de choisir le compte � uti...
eldy authored
686 {
808cd3b Laurent Destailleur Fix: Better error place
eldy authored
687 $num = $db->num_rows($resql);
688 $i = 0;
689 while ($i < $num)
690 {
691 $var=!$var;
692 $row = $db->fetch_row($resql);
693
694 print '<option value="'.$row[0].'"';
695 print $conf->global->FACTURE_CHQ_NUMBER == $row[0] ? ' selected="selected"':'';
696 print '>'.$langs->trans("OwnerOfBankAccount",$row[1]).'</option>';
697
698 $i++;
699 }
d3b6f42 Laurent Destailleur La configuration du module facture permettais de choisir le compte � uti...
eldy authored
700 }
e82125b Laurent Destailleur *** empty log message ***
eldy authored
701 print "</select>";
c6e91b2 Laurent Destailleur Ajout d'un test sur la pr�sence de compte. En cas d'absence, plutot que ...
eldy authored
702 print "</td></tr>";
d3b6f42 Laurent Destailleur La configuration du module facture permettais de choisir le compte � uti...
eldy authored
703 print "</table>";
e82125b Laurent Destailleur *** empty log message ***
eldy authored
704 print "</form>";
e81e80a Rodolphe Quiédeville Commit for release
rodo authored
705
7521caa Laurent Destailleur Permet l'�dition de l'option fiscale de TVA (mention "TVA non applicable...
eldy authored
706
a0b1f89 Laurent Destailleur Look: Modif esth�tique mineure
eldy authored
707 print "<br>";
79f51e1 Laurent Destailleur Fix: parametre width non quot�s.
eldy authored
708 print_titre($langs->trans("OtherOptions"));
709
710 print '<table class="noborder" width="100%">';
711 print '<tr class="liste_titre">';
712 print '<td>'.$langs->trans("Parameter").'</td>';
713 print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
714 print '<td width="80">&nbsp;</td>';
715 print "</tr>\n";
9d73097 Laurent Destailleur *** empty log message ***
eldy authored
716 $var=true;
79f51e1 Laurent Destailleur Fix: parametre width non quot�s.
eldy authored
717
034c7bd Laurent Destailleur *** empty log message ***
eldy authored
718 // Force date validation
9d73097 Laurent Destailleur *** empty log message ***
eldy authored
719 $var=! $var;
37cca42 Fix: uniform and clean code
Regis Houssin authored
720 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
721 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
722 print '<input type="hidden" name="action" value="setforcedate" />';
79f51e1 Laurent Destailleur Fix: parametre width non quot�s.
eldy authored
723 print '<tr '.$bc[$var].'><td>';
034c7bd Laurent Destailleur *** empty log message ***
eldy authored
724 print $langs->trans("ForceInvoiceDate");
79f51e1 Laurent Destailleur Fix: parametre width non quot�s.
eldy authored
725 print '</td><td width="60" align="center">';
f0c327c Fix: uniform code
Regis Houssin authored
726 print $form->selectyesno("forcedate",$conf->global->FAC_FORCE_DATE_VALIDATION,1);
034c7bd Laurent Destailleur *** empty log message ***
eldy authored
727 print '</td><td align="right">';
37cca42 Fix: uniform and clean code
Regis Houssin authored
728 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
034c7bd Laurent Destailleur *** empty log message ***
eldy authored
729 print "</td></tr>\n";
730 print '</form>';
1503627 Laurent Destailleur New: Ajout option pour d�sactiver les notifications
eldy authored
731
77e831d Laurent Destailleur New: Ajout champ mention l�gal
eldy authored
732 $var=! $var;
37cca42 Fix: uniform and clean code
Regis Houssin authored
733 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
734 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
735 print '<input type="hidden" name="action" value="set_FACTURE_FREE_TEXT" />';
77e831d Laurent Destailleur New: Ajout champ mention l�gal
eldy authored
736 print '<tr '.$bc[$var].'><td colspan="2">';
d4a3038 Laurent Destailleur Restore changes after 27 may due to from savannah Crash.
eldy authored
737 print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')<br>';
1dfeaed Laurent Destailleur Remove the trim to allow user to use spaces in its free text. This allow...
eldy authored
738 print '<textarea name="FACTURE_FREE_TEXT" class="flat" cols="120">'.$conf->global->FACTURE_FREE_TEXT.'</textarea>';
77e831d Laurent Destailleur New: Ajout champ mention l�gal
eldy authored
739 print '</td><td align="right">';
37cca42 Fix: uniform and clean code
Regis Houssin authored
740 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
77e831d Laurent Destailleur New: Ajout champ mention l�gal
eldy authored
741 print "</td></tr>\n";
742 print '</form>';
743
394b337 Laurent Destailleur [Task #7349] Patch + Correction mise en page adresse contact sur PDF
eldy authored
744 $var=!$var;
37cca42 Fix: uniform and clean code
Regis Houssin authored
745 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
746 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
747 print '<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />';
394b337 Laurent Destailleur [Task #7349] Patch + Correction mise en page adresse contact sur PDF
eldy authored
748 print '<tr '.$bc[$var].'><td colspan="2">';
749 print $langs->trans("WatermarkOnDraftBill").'<br>';
37cca42 Fix: uniform and clean code
Regis Houssin authored
750 print '<input size="50" class="flat" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.$conf->global->FACTURE_DRAFT_WATERMARK.'" />';
394b337 Laurent Destailleur [Task #7349] Patch + Correction mise en page adresse contact sur PDF
eldy authored
751 print '</td><td align="right">';
37cca42 Fix: uniform and clean code
Regis Houssin authored
752 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
394b337 Laurent Destailleur [Task #7349] Patch + Correction mise en page adresse contact sur PDF
eldy authored
753 print "</td></tr>\n";
754 print '</form>';
755
79f51e1 Laurent Destailleur Fix: parametre width non quot�s.
eldy authored
756 print '</table>';
757
758
40f388e Laurent Destailleur Fix: Un avoir est en fait une facture n�gative. Les avoirs on le meme mo...
eldy authored
759 /*
760 * Repertoire
761 */
762 print '<br>';
763 print_titre($langs->trans("PathToDocuments"));
764
37cca42 Fix: uniform and clean code
Regis Houssin authored
765 print '<table class="noborder" width="100%">'."\n";
766 print '<tr class="liste_titre">'."\n";
767 print '<td>'.$langs->trans("Name").'</td>'."\n";
768 print '<td>'.$langs->trans("Value").'</td>'."\n";
40f388e Laurent Destailleur Fix: Un avoir est en fait une facture n�gative. Les avoirs on le meme mo...
eldy authored
769 print "</tr>\n";
37cca42 Fix: uniform and clean code
Regis Houssin authored
770 print '<tr '.$bc[false].'>'."\n";
771 print '<td width="140">'.$langs->trans("PathDirectory").'</td>'."\n";
772 print '<td>'.$conf->facture->dir_output.'</td>'."\n";
773 print '</tr>'."\n";
40f388e Laurent Destailleur Fix: Un avoir est en fait une facture n�gative. Les avoirs on le meme mo...
eldy authored
774 print "</table>\n";
775
776
3cf65ac Laurent Destailleur Uniformize code
eldy authored
777 //dol_fiche_end();
40f388e Laurent Destailleur Fix: Un avoir est en fait une facture n�gative. Les avoirs on le meme mo...
eldy authored
778
0a51265 Juanjo Menent Uniformize code
simnandez authored
779 dol_htmloutput_mesg($mesg);
40f388e Laurent Destailleur Fix: Un avoir est en fait une facture n�gative. Les avoirs on le meme mo...
eldy authored
780
d6b11b2 Laurent Destailleur New: Am�lioration de la gestion des erreurs sur la g�n�ration des factur...
eldy authored
781 $db->close();
782
726d958 Fix: remove obsolete tags (in progress)
Regis Houssin authored
783 llxFooter();
d476daa Rodolphe Quiédeville Nouveau fichier
rodo authored
784 ?>
Something went wrong with that request. Please try again.