dolibarr 21.0.0-beta
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
49// Load translation files required by the page
50$langs->loadLangs(array("admin", "other", "orders", "stocks"));
51
52$action = GETPOST('action', 'aZ09');
53
54$type = GETPOST('type', 'alpha');
55$value = GETPOST('value', 'alpha');
56$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
57
58$label = GETPOST('label', 'alpha');
59$scandir = GETPOST('scan_dir', 'alpha');
60
61$specimenthirdparty = new Societe($db);
62$specimenthirdparty->initAsSpecimen();
63
64$error = 0;
65
66if (!$user->admin) {
68}
69
70
71/*
72 * Actions
73 */
74
75include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
76
77if ($action == 'updateMask') {
78 $maskconstorder = GETPOST('maskconstorder', 'aZ09');
79 $maskvalue = GETPOST('maskorder', 'alpha');
80
81 $res = 0;
82
83 if ($maskconstorder && preg_match('/_MASK$/', $maskconstorder)) {
84 $res = dolibarr_set_const($db, $maskconstorder, $maskvalue, 'chaine', 0, '', $conf->entity);
85 }
86
87 if (!($res > 0)) {
88 $error++;
89 }
90
91 if (!$error) {
92 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
93 } else {
94 setEventMessages($langs->trans("Error"), null, 'errors');
95 }
96}
97
98if ($action == 'specimen') { // For orders
99 $modele = GETPOST('module', 'alpha');
100
101 $commande = new CommandeFournisseur($db);
102 $commande->initAsSpecimen();
103 $commande->thirdparty = $specimenthirdparty;
104
105 // Search template files
106 $file = '';
107 $classname = '';
108 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
109 foreach ($dirmodels as $reldir) {
110 $file = dol_buildpath($reldir."core/modules/supplier_order/doc/pdf_".$modele.".modules.php", 0);
111 if (file_exists($file)) {
112 $classname = "pdf_".$modele;
113 break;
114 }
115 }
116
117 if ($classname !== '') {
118 require_once $file;
119
120 $module = new $classname($db, $commande);
121 '@phan-var-force ModelePDFSuppliersOrders $module';
122
123 if ($module->write_file($commande, $langs) > 0) {
124 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");
125 return;
126 } else {
127 setEventMessages($module->error, $module->errors, 'errors');
128 dol_syslog($module->error, LOG_ERR);
129 }
130 } else {
131 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
132 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
133 }
134} elseif ($action == 'set') {
135 // Activate a model
136 $ret = addDocumentModel($value, $type, $label, $scandir);
137} elseif ($action == 'del') {
138 $ret = delDocumentModel($value, $type);
139 if ($ret > 0) {
140 if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$value") {
141 dolibarr_del_const($db, 'COMMANDE_SUPPLIER_ADDON_PDF', $conf->entity);
142 }
143 }
144} elseif ($action == 'setdoc') {
145 // Set default model
146 if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
147 // La constante qui a ete lue en avant du nouveau set
148 // on passe donc par une variable pour avoir un affichage coherent
149 $conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value;
150 }
151
152 // On active le modele
153 $ret = delDocumentModel($value, $type);
154 if ($ret > 0) {
155 $ret = addDocumentModel($value, $type, $label, $scandir);
156 }
157} elseif ($action == 'unsetdoc') {
158 dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity);
159} elseif ($action == 'setmod') {
160 // TODO Verify if the chosen numbering module can be activated
161 // by calling method canBeActivated
162
163 dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
164} elseif ($action == 'addcat') {
165 $fourn = new Fournisseur($db);
166 $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml'));
167} elseif ($action == 'set_SUPPLIER_ORDER_OTHER') {
168 $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
169 $doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED', 'alpha');
170 $doubleapproval = price2num($doubleapproval);
171
172 $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
173 $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity);
174
175 // TODO We add/delete permission here until permission can have a condition on a global var
176 include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
177 $newmodule = new modFournisseur($db);
178
179 if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) {
180 // clear default rights array
181 $newmodule->rights = array();
182 // add new right
183 $r = 0;
184 $newmodule->rights[$r][0] = 1190;
185 $newmodule->rights[$r][1] = $langs->trans("Permission1190");
186 $newmodule->rights[$r][2] = 'w';
187 $newmodule->rights[$r][3] = 0;
188 $newmodule->rights[$r][4] = 'commande';
189 $newmodule->rights[$r][5] = 'approve2';
190
191 // Insert
192 $newmodule->insert_permissions(1);
193 } else {
194 // Remove all rights with Permission1190
195 $newmodule->delete_permissions();
196
197 // Add all right without Permission1190
198 $newmodule->insert_permissions(1);
199 }
200} elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') {
201 // Activate ask for payment bank
202 $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER", $value, 'chaine', 0, '', $conf->entity);
203
204 if (!($res > 0)) {
205 $error++;
206 }
207
208 if (!$error) {
209 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
210 } else {
211 setEventMessages($langs->trans("Error"), null, 'errors');
212 }
213}
214
215
216/*
217* View
218*/
219
220$form = new Form($db);
221
222$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
223
224llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-supplier_order');
225
226$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
227print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
228
229print "<br>";
230
232
233print dol_get_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company');
234
235
236// Supplier order numbering module
237
238print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', '');
239
240print '<div class="div-table-responsive-no-min">';
241print '<table class="noborder centpercent">';
242print '<tr class="liste_titre">';
243print '<td width="100">'.$langs->trans("Name").'</td>';
244print '<td>'.$langs->trans("Description").'</td>';
245print '<td>'.$langs->trans("Example").'</td>';
246print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
247print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
248print "</tr>\n";
249
250clearstatcache();
251
252foreach ($dirmodels as $reldir) {
253 $dir = dol_buildpath($reldir."core/modules/supplier_order/");
254
255 if (is_dir($dir)) {
256 $handle = opendir($dir);
257 if (is_resource($handle)) {
258 while (($file = readdir($handle)) !== false) {
259 if (substr($file, 0, 25) == 'mod_commande_fournisseur_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
260 $file = substr($file, 0, dol_strlen($file) - 4);
261
262 require_once $dir.$file.'.php';
263
264 $module = new $file();
265
266 '@phan-var-force ModeleNumRefSuppliersOrders $module';
267
268 if ($module->isEnabled()) {
269 // Show modules according to features level
270 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
271 continue;
272 }
273 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
274 continue;
275 }
276
277
278 print '<tr class="oddeven"><td>'.$module->getName($langs)."</td><td>\n";
279 print $module->info($langs);
280 print '</td>';
281
282 // Show example of numbering module
283 print '<td class="nowrap">';
284 $tmp = $module->getExample();
285 if (preg_match('/^Error/', $tmp)) {
286 $langs->load("errors");
287 print '<div class="error">'.$langs->trans($tmp).'</div>';
288 } elseif ($tmp == 'NotConfigured') {
289 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
290 } else {
291 print $tmp;
292 }
293 print '</td>'."\n";
294
295 print '<td class="center">';
296 if ($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER == "$file") {
297 print img_picto($langs->trans("Activated"), 'switch_on');
298 } else {
299 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>';
300 }
301 print '</td>';
302
303 $commande = new CommandeFournisseur($db);
304 $commande->initAsSpecimen();
305
306 // Info
307 $htmltooltip = '';
308 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
309 $nextval = $module->getNextValue($mysoc, $commande);
310 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
311 $htmltooltip .= ''.$langs->trans("NextValue").': ';
312 if ($nextval) {
313 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
314 $nextval = $langs->trans($nextval);
315 }
316 $htmltooltip .= $nextval.'<br>';
317 } else {
318 $htmltooltip .= $langs->trans($module->error).'<br>';
319 }
320 }
321
322 print '<td class="center">';
323 print $form->textwithpicto('', $htmltooltip, 1, 0);
324 print '</td>';
325
326 print '</tr>';
327 }
328 }
329 }
330 closedir($handle);
331 }
332 }
333}
334
335print '</table></div><br>';
336
337
338/*
339 * Documents models for supplier orders
340 */
341
342print load_fiche_titre($langs->trans("OrdersModelModule"), '', '');
343
344// Defini tableau def de modele
345$def = array();
346
347$sql = "SELECT nom";
348$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
349$sql .= " WHERE type = 'order_supplier'";
350$sql .= " AND entity = ".$conf->entity;
351
352$resql = $db->query($sql);
353if ($resql) {
354 $i = 0;
355 $num_rows = $db->num_rows($resql);
356 while ($i < $num_rows) {
357 $array = $db->fetch_array($resql);
358 if (is_array($array)) {
359 array_push($def, $array[0]);
360 }
361 $i++;
362 }
363} else {
364 dol_print_error($db);
365}
366
367print '<div class="div-table-responsive-no-min">';
368print '<table class="noborder centpercent">'."\n";
369print '<tr class="liste_titre">'."\n";
370print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
371print '<td>'.$langs->trans("Description").'</td>'."\n";
372print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
373print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
374print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
375print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
376print '</tr>'."\n";
377
378clearstatcache();
379
380foreach ($dirmodels as $reldir) {
381 $realpath = $reldir."core/modules/supplier_order/doc";
382 $dir = dol_buildpath($realpath);
383
384 if (is_dir($dir)) {
385 $handle = opendir($dir);
386 if (is_resource($handle)) {
387 while (($file = readdir($handle)) !== false) {
388 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
389 $name = substr($file, 4, dol_strlen($file) - 16);
390 $classname = substr($file, 0, dol_strlen($file) - 12);
391
392 require_once $dir.'/'.$file;
393 $module = new $classname($db, new CommandeFournisseur($db));
394
395 '@phan-var-force ModelePDFSuppliersOrders $module';
396
397 print "<tr class=\"oddeven\">\n";
398 print "<td>";
399 print(empty($module->name) ? $name : $module->name);
400 print "</td>\n";
401 print "<td>\n";
402 require_once $dir.'/'.$file;
403 $module = new $classname($db, $specimenthirdparty);
404 '@phan-var-force ModelePDFSuppliersOrders $module';
405 if (method_exists($module, 'info')) {
406 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
407 } else {
408 print $module->description;
409 }
410 print "</td>\n";
411
412 // Active
413 if (in_array($name, $def)) {
414 print '<td class="center">'."\n";
415 if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") {
416 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">';
417 print img_picto($langs->trans("Enabled"), 'switch_on');
418 print '</a>';
419 } else {
420 print img_picto($langs->trans("Enabled"), 'switch_on');
421 }
422 print "</td>";
423 } else {
424 print '<td class="center">'."\n";
425 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>';
426 print "</td>";
427 }
428
429 // Default
430 print '<td class="center">';
431 if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
432 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>';
433 } else {
434 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>';
435 }
436 print '</td>';
437
438 // Info
439 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
440 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
441 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
442 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
443
444 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
445 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
446 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
447 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
448 print '<td class="center">';
449 print $form->textwithpicto('', $htmltooltip, 1, 0);
450 print '</td>';
451 print '<td class="center">';
452 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
453 print '</td>';
454
455 print "</tr>\n";
456 }
457 }
458
459 closedir($handle);
460 }
461 }
462}
463
464print '</table></div><br>';
465
466/*
467 * Other options
468 */
469
470print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
471print '<input type="hidden" name="token" value="'.newToken().'">';
472print '<input type="hidden" name="action" value="set_SUPPLIER_ORDER_OTHER">';
473
474print load_fiche_titre($langs->trans("OtherOptions"), '', '');
475
476print '<div class="div-table-responsive-no-min">';
477print '<table class="noborder centpercent">';
478print '<tr class="liste_titre">';
479print '<td>'.$langs->trans("Parameter").'</td>';
480print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
481print '<td width="80">&nbsp;</td>';
482print "</tr>\n";
483
484print '<tr class="oddeven"><td>';
485print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'<br>';
486print $langs->trans("IfSetToYesDontForgetPermission");
487print '</td><td>';
488print '<input type="text" size="6" name="SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED" value="'.getDolGlobalString("SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED").'">';
489print '</td><td class="right">';
490print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
491print "</td></tr>\n";
492
493
494// Ask for payment bank during supplier order
495/* Kept as hidden for the moment
496if (isModEnabled('banque')) {
497
498print '<tr class="oddeven"><td>';
499print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td>&nbsp;</td><td align="center">';
500if (!empty($conf->use_javascript_ajax))
501{
502print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER');
503}
504else
505{
506if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER))
507{
508print '<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>';
509}
510else
511{
512print '<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>';
513}
514}
515print '</td></tr>';
516}
517else
518{
519
520print '<tr class="oddeven"><td>';
521print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
522}
523*/
524
525$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
526$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
527$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
528foreach ($substitutionarray as $key => $val) {
529 $htmltext .= $key.'<br>';
530}
531$htmltext .= '</i>';
532
533print '<tr class="oddeven"><td colspan="2">';
534print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
535$variablename = 'SUPPLIER_ORDER_FREE_TEXT';
536if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
537 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
538} else {
539 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
540 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
541 print $doleditor->Create();
542}
543print '</td><td class="right">';
544print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
545print "</td></tr>\n";
546
547// Option to add a quality/validation step, on products, after reception.
548print '<tr class="oddeven">';
549print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
550print '<td></td>';
551print '<td class="center">';
552if (isModEnabled('reception')) {
553 print '<span class="opacitymedium">'.$langs->trans("FeatureNotAvailableWithReceptionModule").'</span>';
554} else {
555 if ($conf->use_javascript_ajax) {
556 print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
557 } else {
558 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
559 print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS);
560 }
561}
562print "</td>\n";
563print "</tr>\n";
564
565
566// Disallow to classify billed a supplier order without invoice
567print '<tr class="oddeven"><td>'.$langs->trans("SupplierOrderClassifyBilledWithoutInvoice"). '&nbsp;' ;
568print $form->textwithpicto('', $langs->trans("SupplierOrderClassifyBilledWithoutInvoiceHelp"), 1, 'help') . '</td>';
569print '<td class="left" colspan="2">';
570print ajax_constantonoff('SUPPLIER_ORDER_DISABLE_CLASSIFY_BILLED_FROM_SUPPLIER_ORDER');
571print '</td></tr>';
572
573print '</table></div><br>';
574
575print '</form>';
576
577
578/*
579* Notifications
580*/
581
582print load_fiche_titre($langs->trans("Notifications"), '', '');
583
584print '<div class="div-table-responsive-no-min">';
585print '<table class="noborder centpercent">';
586print '<tr class="liste_titre">';
587print '<td>'.$langs->trans("Parameter").'</td>';
588print '<td align="center" width="60"></td>';
589print '<td width="80">&nbsp;</td>';
590print "</tr>\n";
591
592print '<tr class="oddeven"><td colspan="2">';
593print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
594print '</td><td class="right">';
595print "</td></tr>\n";
596
597print '</table>';
598print '</div>';
599
600// End of page
601llxFooter();
602$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:71
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)
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'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
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:765
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:152
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.