dolibarr 21.0.0-alpha
supplier_order.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
6 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
7 * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
8 * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
9 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
10 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <https://www.gnu.org/licenses/>.
24 */
25
32// Load Dolibarr environment
33require '../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
35require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
38require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
39
40// Load translation files required by the page
41$langs->loadLangs(array("admin", "other", "orders", "stocks"));
42
43$action = GETPOST('action', 'aZ09');
44
45$type = GETPOST('type', 'alpha');
46$value = GETPOST('value', 'alpha');
47$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
48
49$label = GETPOST('label', 'alpha');
50$scandir = GETPOST('scan_dir', 'alpha');
51
52$specimenthirdparty = new Societe($db);
53$specimenthirdparty->initAsSpecimen();
54
55$error = 0;
56
57if (!$user->admin) {
59}
60
61
62/*
63 * Actions
64 */
65
66include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
67
68if ($action == 'updateMask') {
69 $maskconstorder = GETPOST('maskconstorder', 'aZ09');
70 $maskvalue = GETPOST('maskorder', 'alpha');
71
72 $res = 0;
73
74 if ($maskconstorder && preg_match('/_MASK$/', $maskconstorder)) {
75 $res = dolibarr_set_const($db, $maskconstorder, $maskvalue, 'chaine', 0, '', $conf->entity);
76 }
77
78 if (!($res > 0)) {
79 $error++;
80 }
81
82 if (!$error) {
83 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
84 } else {
85 setEventMessages($langs->trans("Error"), null, 'errors');
86 }
87}
88
89if ($action == 'specimen') { // For orders
90 $modele = GETPOST('module', 'alpha');
91
92 $commande = new CommandeFournisseur($db);
93 $commande->initAsSpecimen();
94 $commande->thirdparty = $specimenthirdparty;
95
96 // Search template files
97 $file = '';
98 $classname = '';
99 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
100 foreach ($dirmodels as $reldir) {
101 $file = dol_buildpath($reldir."core/modules/supplier_order/doc/pdf_".$modele.".modules.php", 0);
102 if (file_exists($file)) {
103 $classname = "pdf_".$modele;
104 break;
105 }
106 }
107
108 if ($classname !== '') {
109 require_once $file;
110
111 $module = new $classname($db, $commande);
112 '@phan-var-force ModelePDFSuppliersOrders $module';
113
114 if ($module->write_file($commande, $langs) > 0) {
115 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");
116 return;
117 } else {
118 setEventMessages($module->error, $module->errors, 'errors');
119 dol_syslog($module->error, LOG_ERR);
120 }
121 } else {
122 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
123 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
124 }
125} elseif ($action == 'set') {
126 // Activate a model
127 $ret = addDocumentModel($value, $type, $label, $scandir);
128} elseif ($action == 'del') {
129 $ret = delDocumentModel($value, $type);
130 if ($ret > 0) {
131 if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$value") {
132 dolibarr_del_const($db, 'COMMANDE_SUPPLIER_ADDON_PDF', $conf->entity);
133 }
134 }
135} elseif ($action == 'setdoc') {
136 // Set default model
137 if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
138 // La constante qui a ete lue en avant du nouveau set
139 // on passe donc par une variable pour avoir un affichage coherent
140 $conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value;
141 }
142
143 // On active le modele
144 $ret = delDocumentModel($value, $type);
145 if ($ret > 0) {
146 $ret = addDocumentModel($value, $type, $label, $scandir);
147 }
148} elseif ($action == 'unsetdoc') {
149 dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity);
150} elseif ($action == 'setmod') {
151 // TODO Verify if the chosen numbering module can be activated
152 // by calling method canBeActivated
153
154 dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
155} elseif ($action == 'addcat') {
156 $fourn = new Fournisseur($db);
157 $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml'));
158} elseif ($action == 'set_SUPPLIER_ORDER_OTHER') {
159 $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
160 $doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED', 'alpha');
161 $doubleapproval = price2num($doubleapproval);
162
163 $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
164 $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity);
165
166 // TODO We add/delete permission here until permission can have a condition on a global var
167 include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
168 $newmodule = new modFournisseur($db);
169
170 if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) {
171 // clear default rights array
172 $newmodule->rights = array();
173 // add new right
174 $r = 0;
175 $newmodule->rights[$r][0] = 1190;
176 $newmodule->rights[$r][1] = $langs->trans("Permission1190");
177 $newmodule->rights[$r][2] = 'w';
178 $newmodule->rights[$r][3] = 0;
179 $newmodule->rights[$r][4] = 'commande';
180 $newmodule->rights[$r][5] = 'approve2';
181
182 // Insert
183 $newmodule->insert_permissions(1);
184 } else {
185 // Remove all rights with Permission1190
186 $newmodule->delete_permissions();
187
188 // Add all right without Permission1190
189 $newmodule->insert_permissions(1);
190 }
191} elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') {
192 // Activate ask for payment bank
193 $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER", $value, 'chaine', 0, '', $conf->entity);
194
195 if (!($res > 0)) {
196 $error++;
197 }
198
199 if (!$error) {
200 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
201 } else {
202 setEventMessages($langs->trans("Error"), null, 'errors');
203 }
204}
205
206
207/*
208* View
209*/
210
211$form = new Form($db);
212
213$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
214
215llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-supplier_order');
216
217$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
218print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
219
220print "<br>";
221
223
224print dol_get_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company');
225
226
227// Supplier order numbering module
228
229print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', '');
230
231print '<div class="div-table-responsive-no-min">';
232print '<table class="noborder centpercent">';
233print '<tr class="liste_titre">';
234print '<td width="100">'.$langs->trans("Name").'</td>';
235print '<td>'.$langs->trans("Description").'</td>';
236print '<td>'.$langs->trans("Example").'</td>';
237print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
238print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
239print "</tr>\n";
240
241clearstatcache();
242
243foreach ($dirmodels as $reldir) {
244 $dir = dol_buildpath($reldir."core/modules/supplier_order/");
245
246 if (is_dir($dir)) {
247 $handle = opendir($dir);
248 if (is_resource($handle)) {
249 while (($file = readdir($handle)) !== false) {
250 if (substr($file, 0, 25) == 'mod_commande_fournisseur_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
251 $file = substr($file, 0, dol_strlen($file) - 4);
252
253 require_once $dir.$file.'.php';
254
255 $module = new $file();
256
257 '@phan-var-force ModeleNumRefSuppliersOrders $module';
258
259 if ($module->isEnabled()) {
260 // Show modules according to features level
261 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
262 continue;
263 }
264 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
265 continue;
266 }
267
268
269 print '<tr class="oddeven"><td>'.$module->getName($langs)."</td><td>\n";
270 print $module->info($langs);
271 print '</td>';
272
273 // Show example of numbering module
274 print '<td class="nowrap">';
275 $tmp = $module->getExample();
276 if (preg_match('/^Error/', $tmp)) {
277 $langs->load("errors");
278 print '<div class="error">'.$langs->trans($tmp).'</div>';
279 } elseif ($tmp == 'NotConfigured') {
280 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
281 } else {
282 print $tmp;
283 }
284 print '</td>'."\n";
285
286 print '<td class="center">';
287 if ($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER == "$file") {
288 print img_picto($langs->trans("Activated"), 'switch_on');
289 } else {
290 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
291 }
292 print '</td>';
293
294 $commande = new CommandeFournisseur($db);
295 $commande->initAsSpecimen();
296
297 // Info
298 $htmltooltip = '';
299 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
300 $nextval = $module->getNextValue($mysoc, $commande);
301 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
302 $htmltooltip .= ''.$langs->trans("NextValue").': ';
303 if ($nextval) {
304 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
305 $nextval = $langs->trans($nextval);
306 }
307 $htmltooltip .= $nextval.'<br>';
308 } else {
309 $htmltooltip .= $langs->trans($module->error).'<br>';
310 }
311 }
312
313 print '<td class="center">';
314 print $form->textwithpicto('', $htmltooltip, 1, 0);
315 print '</td>';
316
317 print '</tr>';
318 }
319 }
320 }
321 closedir($handle);
322 }
323 }
324}
325
326print '</table></div><br>';
327
328
329/*
330 * Documents models for supplier orders
331 */
332
333print load_fiche_titre($langs->trans("OrdersModelModule"), '', '');
334
335// Defini tableau def de modele
336$def = array();
337
338$sql = "SELECT nom";
339$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
340$sql .= " WHERE type = 'order_supplier'";
341$sql .= " AND entity = ".$conf->entity;
342
343$resql = $db->query($sql);
344if ($resql) {
345 $i = 0;
346 $num_rows = $db->num_rows($resql);
347 while ($i < $num_rows) {
348 $array = $db->fetch_array($resql);
349 if (is_array($array)) {
350 array_push($def, $array[0]);
351 }
352 $i++;
353 }
354} else {
355 dol_print_error($db);
356}
357
358print '<div class="div-table-responsive-no-min">';
359print '<table class="noborder centpercent">'."\n";
360print '<tr class="liste_titre">'."\n";
361print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
362print '<td>'.$langs->trans("Description").'</td>'."\n";
363print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
364print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
365print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
366print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
367print '</tr>'."\n";
368
369clearstatcache();
370
371foreach ($dirmodels as $reldir) {
372 $realpath = $reldir."core/modules/supplier_order/doc";
373 $dir = dol_buildpath($realpath);
374
375 if (is_dir($dir)) {
376 $handle = opendir($dir);
377 if (is_resource($handle)) {
378 while (($file = readdir($handle)) !== false) {
379 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
380 $name = substr($file, 4, dol_strlen($file) - 16);
381 $classname = substr($file, 0, dol_strlen($file) - 12);
382
383 require_once $dir.'/'.$file;
384 $module = new $classname($db, new CommandeFournisseur($db));
385
386 '@phan-var-force ModelePDFSuppliersOrders $module';
387
388 print "<tr class=\"oddeven\">\n";
389 print "<td>";
390 print(empty($module->name) ? $name : $module->name);
391 print "</td>\n";
392 print "<td>\n";
393 require_once $dir.'/'.$file;
394 $module = new $classname($db, $specimenthirdparty);
395 '@phan-var-force ModelePDFSuppliersOrders $module';
396 if (method_exists($module, 'info')) {
397 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
398 } else {
399 print $module->description;
400 }
401 print "</td>\n";
402
403 // Active
404 if (in_array($name, $def)) {
405 print '<td class="center">'."\n";
406 if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") {
407 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier">';
408 print img_picto($langs->trans("Enabled"), 'switch_on');
409 print '</a>';
410 } else {
411 print img_picto($langs->trans("Enabled"), 'switch_on');
412 }
413 print "</td>";
414 } else {
415 print '<td class="center">'."\n";
416 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
417 print "</td>";
418 }
419
420 // Default
421 print '<td class="center">';
422 if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
423 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
424 } else {
425 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
426 }
427 print '</td>';
428
429 // Info
430 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
431 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
432 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
433 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
434
435 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
436 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
437 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
438 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
439 print '<td class="center">';
440 print $form->textwithpicto('', $htmltooltip, 1, 0);
441 print '</td>';
442 print '<td class="center">';
443 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
444 print '</td>';
445
446 print "</tr>\n";
447 }
448 }
449
450 closedir($handle);
451 }
452 }
453}
454
455print '</table></div><br>';
456
457/*
458 * Other options
459 */
460
461print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
462print '<input type="hidden" name="token" value="'.newToken().'">';
463print '<input type="hidden" name="action" value="set_SUPPLIER_ORDER_OTHER">';
464
465print load_fiche_titre($langs->trans("OtherOptions"), '', '');
466
467print '<div class="div-table-responsive-no-min">';
468print '<table class="noborder centpercent">';
469print '<tr class="liste_titre">';
470print '<td>'.$langs->trans("Parameter").'</td>';
471print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
472print '<td width="80">&nbsp;</td>';
473print "</tr>\n";
474
475print '<tr class="oddeven"><td>';
476print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'<br>';
477print $langs->trans("IfSetToYesDontForgetPermission");
478print '</td><td>';
479print '<input type="text" size="6" name="SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED" value="'.getDolGlobalString("SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED").'">';
480print '</td><td class="right">';
481print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
482print "</td></tr>\n";
483
484
485// Ask for payment bank during supplier order
486/* Kept as hidden for the moment
487if (isModEnabled('banque')) {
488
489print '<tr class="oddeven"><td>';
490print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td>&nbsp;</td><td align="center">';
491if (!empty($conf->use_javascript_ajax))
492{
493print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER');
494}
495else
496{
497if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER))
498{
499print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER&token='.newToken().'&value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
500}
501else
502{
503print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER&token='.newToken().'&value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
504}
505}
506print '</td></tr>';
507}
508else
509{
510
511print '<tr class="oddeven"><td>';
512print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
513}
514*/
515
516$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
517$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
518$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
519foreach ($substitutionarray as $key => $val) {
520 $htmltext .= $key.'<br>';
521}
522$htmltext .= '</i>';
523
524print '<tr class="oddeven"><td colspan="2">';
525print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
526$variablename = 'SUPPLIER_ORDER_FREE_TEXT';
527if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
528 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
529} else {
530 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
531 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
532 print $doleditor->Create();
533}
534print '</td><td class="right">';
535print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
536print "</td></tr>\n";
537
538// Option to add a quality/validation step, on products, after reception.
539print '<tr class="oddeven">';
540print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
541print '<td></td>';
542print '<td class="center">';
543if (isModEnabled('reception')) {
544 print '<span class="opacitymedium">'.$langs->trans("FeatureNotAvailableWithReceptionModule").'</span>';
545} else {
546 if ($conf->use_javascript_ajax) {
547 print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
548 } else {
549 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
550 print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS);
551 }
552}
553print "</td>\n";
554print "</tr>\n";
555
556
557// Disallow to classify billed a supplier order without invoice
558print '<tr class="oddeven"><td>'.$langs->trans("SupplierOrderClassifyBilledWithoutInvoice"). '&nbsp;' ;
559print $form->textwithpicto('', $langs->trans("SupplierOrderClassifyBilledWithoutInvoiceHelp"), 1, 'help') . '</td>';
560print '<td class="left" colspan="2">';
561print ajax_constantonoff('SUPPLIER_ORDER_DISABLE_CLASSIFY_BILLED_FROM_SUPPLIER_ORDER');
562print '</td></tr>';
563
564print '</table></div><br>';
565
566print '</form>';
567
568
569/*
570* Notifications
571*/
572
573print load_fiche_titre($langs->trans("Notifications"), '', '');
574
575print '<div class="div-table-responsive-no-min">';
576print '<table class="noborder centpercent">';
577print '<tr class="liste_titre">';
578print '<td>'.$langs->trans("Parameter").'</td>';
579print '<td align="center" width="60"></td>';
580print '<td width="80">&nbsp;</td>';
581print "</tr>\n";
582
583print '<tr class="oddeven"><td colspan="2">';
584print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
585print '</td><td class="right">';
586print "</td></tr>\n";
587
588print '</table>';
589print '</div>';
590
591// End of page
592llxFooter();
593$db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:70
Class to manage predefined suppliers products.
Class to manage a WYSIWYG editor.
Class to manage generation of HTML components Only common components must be here.
Class to manage suppliers.
Class to manage third parties objects (customers, suppliers, prospects...)
Description and activation class for module Fournisseur.
llxFooter()
Footer empty.
Definition document.php:107
supplierorder_admin_prepare_head()
Return array head with list of tabs to view object information.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
Definition pdf.lib.php:767
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:140
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.