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