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