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