dolibarr  18.0.0
supplier_invoice.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2013 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 <https://www.gnu.org/licenses/>.
22  */
23 
30 // Load Dolibarr environment
31 require '../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
37 
38 // Load translation files required by the page
39 $langs->loadLangs(array("admin", "other", "orders"));
40 
41 $action = GETPOST('action', 'aZ09');
42 
43 $type = GETPOST('type', 'alpha');
44 $value = GETPOST('value', 'alpha');
45 $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
46 
47 $label = GETPOST('label', 'alpha');
48 $scandir = GETPOST('scan_dir', 'alpha');
49 
50 $specimenthirdparty = new Societe($db);
51 $specimenthirdparty->initAsSpecimen();
52 
53 $error = 0;
54 
55 if (!$user->admin) {
57 }
58 
59 
60 /*
61  * Actions
62  */
63 
64 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
65 
66 if ($action == 'updateMask') {
67  $maskconstinvoice = GETPOST('maskconstinvoice', 'aZ09');
68  $maskconstcredit = GETPOST('maskconstcredit', 'aZ09');
69  $maskconstdeposit = GETPOST('maskconstdeposit', 'aZ09');
70  $maskinvoice = GETPOST('maskinvoice', 'alpha');
71  $maskcredit = GETPOST('maskcredit', 'alpha');
72  $maskdeposit = GETPOST('maskdeposit', 'alpha');
73 
74  if ($maskconstinvoice && preg_match('/_MASK$/', $maskconstinvoice)) {
75  $res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity);
76  }
77  if ($maskconstcredit && preg_match('/_MASK$/', $maskconstcredit)) {
78  $res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity);
79  }
80  if ($maskconstdeposit && preg_match('/_MASK$/', $maskconstdeposit)) {
81  $res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity);
82  }
83 
84  if (!($res > 0)) {
85  $error++;
86  }
87 
88  if (!$error) {
89  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
90  } else {
91  setEventMessages($langs->trans("Error"), null, 'errors');
92  }
93 }
94 
95 if ($action == 'specimen') { // For invoices
96  $modele = GETPOST('module', 'alpha');
97 
98  $facture = new FactureFournisseur($db);
99  $facture->initAsSpecimen();
100  $facture->thirdparty = $specimenthirdparty; // Define who should has build the invoice (so the supplier)
101 
102  // Search template files
103  $file = '';
104  $classname = '';
105  $filefound = 0;
106  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
107  foreach ($dirmodels as $reldir) {
108  $file = dol_buildpath($reldir."core/modules/supplier_invoice/doc/pdf_".$modele.".modules.php", 0);
109  if (file_exists($file)) {
110  $filefound = 1;
111  $classname = "pdf_".$modele;
112  break;
113  }
114  }
115 
116  if ($filefound) {
117  require_once $file;
118 
119  $module = new $classname($db, $facture);
120 
121  if ($module->write_file($facture, $langs) > 0) {
122  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");
123  return;
124  } else {
125  setEventMessages($module->error, $module->errors, 'errors');
126  dol_syslog($module->error, LOG_ERR);
127  }
128  } else {
129  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
130  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
131  }
132 } elseif ($action == 'set') {
133  // Activate a model
134  $ret = addDocumentModel($value, $type, $label, $scandir);
135 } elseif ($action == 'del') {
136  $ret = delDocumentModel($value, $type);
137  if ($ret > 0) {
138  if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$value") {
139  dolibarr_del_const($db, 'INVOICE_SUPPLIER_ADDON_PDF', $conf->entity);
140  }
141  }
142 } elseif ($action == 'setdoc') {
143  // Set default model
144  if (dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
145  // La constante qui a ete lue en avant du nouveau set
146  // on passe donc par une variable pour avoir un affichage coherent
147  $conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value;
148  }
149 
150  // On active le modele
151  $ret = delDocumentModel($value, $type);
152  if ($ret > 0) {
153  $ret = addDocumentModel($value, $type, $label, $scandir);
154  }
155 } elseif ($action == 'unsetdoc') {
156  dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
157 }
158 
159 if ($action == 'setmod') {
160  // TODO Verifier si module numerotation choisi peut etre active
161  // par appel methode canBeActivated
162 
163  dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
164 }
165 
166 if ($action == 'addcat') {
167  $fourn = new Fournisseur($db);
168  $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml'));
169 }
170 
171 if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') {
172  $freetext = GETPOST('SUPPLIER_INVOICE_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
173 
174  $res = dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
175 
176  if (!($res > 0)) {
177  $error++;
178  }
179 
180  if (!$error) {
181  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
182  } else {
183  setEventMessages($langs->trans("Error"), null, 'errors');
184  }
185 }
186 
187 
188 /*
189  * View
190  */
191 
192 $form = new Form($db);
193 
194 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
195 
196 llxHeader("", "");
197 
198 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
199 print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
200 
201 print "<br>";
202 
204 
205 print dol_get_fiche_head($head, 'invoice', $langs->trans("Suppliers"), -1, 'company');
206 
207 
208 // Supplier invoice numbering module
209 
210 print load_fiche_titre($langs->trans("SuppliersInvoiceNumberingModel"), '', '');
211 
212 print '<div class="div-table-responsive-no-min">';
213 print '<table class="noborder centpercent">';
214 print '<tr class="liste_titre">';
215 print '<td width="100">'.$langs->trans("Name").'</td>';
216 print '<td>'.$langs->trans("Description").'</td>';
217 print '<td>'.$langs->trans("Example").'</td>';
218 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
219 print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
220 print "</tr>\n";
221 
222 clearstatcache();
223 
224 foreach ($dirmodels as $reldir) {
225  $dir = dol_buildpath($reldir."core/modules/supplier_invoice");
226 
227  if (is_dir($dir)) {
228  $handle = opendir($dir);
229  if (is_resource($handle)) {
230  while (($file = readdir($handle)) !== false) {
231  if (substr($file, 0, 24) == 'mod_facture_fournisseur_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
232  $file = substr($file, 0, dol_strlen($file) - 4);
233 
234  require_once $dir.'/'.$file.'.php';
235 
236  $module = new $file;
237 
238  if ($module->isEnabled()) {
239  // Show modules according to features level
240  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
241  continue;
242  }
243  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
244  continue;
245  }
246 
247 
248  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
249  print $module->info();
250  print '</td>';
251 
252  // Show example of numbering module
253  print '<td class="nowrap">';
254  $tmp = $module->getExample();
255  if (preg_match('/^Error/', $tmp)) {
256  $langs->load("errors");
257  print '<div class="error">'.$langs->trans($tmp).'</div>';
258  } elseif ($tmp == 'NotConfigured') {
259  print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
260  } else {
261  print $tmp;
262  }
263  print '</td>'."\n";
264 
265  print '<td class="center">';
266  if ($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER == "$file") {
267  print img_picto($langs->trans("Activated"), 'switch_on');
268  } else {
269  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>';
270  }
271  print '</td>';
272 
273  $invoice = new FactureFournisseur($db);
274  $invoice->initAsSpecimen();
275 
276  // Info
277  $htmltooltip = '';
278  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
279  $nextval = $module->getNextValue($mysoc, $invoice);
280  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
281  $htmltooltip .= ''.$langs->trans("NextValue").': ';
282  if ($nextval) {
283  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
284  $nextval = $langs->trans($nextval);
285  }
286  $htmltooltip .= $nextval.'<br>';
287  } else {
288  $htmltooltip .= $langs->trans($module->error).'<br>';
289  }
290  }
291 
292  print '<td class="center">';
293  print $form->textwithpicto('', $htmltooltip, 1, 0);
294  print '</td>';
295 
296  print '</tr>';
297  }
298  }
299  }
300  closedir($handle);
301  }
302  }
303 }
304 
305 print '</table></div><br>';
306 
307 
308 
309 
310 /*
311  * Documents models for supplier invoices
312  */
313 
314 print load_fiche_titre($langs->trans("BillsPDFModules"), '', '');
315 
316 // Defini tableau def de modele
317 $def = array();
318 
319 $sql = "SELECT nom";
320 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
321 $sql .= " WHERE type = 'invoice_supplier'";
322 $sql .= " AND entity = ".$conf->entity;
323 
324 $resql = $db->query($sql);
325 if ($resql) {
326  $i = 0;
327  $num_rows = $db->num_rows($resql);
328  while ($i < $num_rows) {
329  $array = $db->fetch_array($resql);
330  array_push($def, $array[0]);
331  $i++;
332  }
333 } else {
334  dol_print_error($db);
335 }
336 
337 print '<div class="div-table-responsive-no-min">';
338 print '<table class="noborder centpercent">'."\n";
339 print '<tr class="liste_titre">'."\n";
340 print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
341 print '<td>'.$langs->trans("Description").'</td>'."\n";
342 print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
343 print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
344 print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
345 print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
346 print '</tr>'."\n";
347 
348 clearstatcache();
349 
350 foreach ($dirmodels as $reldir) {
351  $realpath = $reldir."core/modules/supplier_invoice/doc";
352  $dir = dol_buildpath($realpath);
353 
354  if (is_dir($dir)) {
355  $handle = opendir($dir);
356 
357 
358  if (is_resource($handle)) {
359  while (($file = readdir($handle)) !== false) {
360  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
361  $name = substr($file, 4, dol_strlen($file) - 16);
362  $classname = substr($file, 0, dol_strlen($file) - 12);
363 
364  require_once $dir.'/'.$file;
365  $module = new $classname($db, new FactureFournisseur($db));
366 
367 
368  print "<tr class=\"oddeven\">\n";
369  print "<td>";
370  print (empty($module->name) ? $name : $module->name);
371  print "</td>\n";
372  print "<td>\n";
373  require_once $dir.'/'.$file;
374  $module = new $classname($db, $specimenthirdparty);
375  if (method_exists($module, 'info')) {
376  print $module->info($langs);
377  } else {
378  print $module->description;
379  }
380 
381  print "</td>\n";
382 
383  // Active
384  if (in_array($name, $def)) {
385  print '<td class="center">'."\n";
386  //if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
387  //{
388  // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
389  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&amp;type=invoice_supplier">';
390  print img_picto($langs->trans("Enabled"), 'switch_on');
391  print '</a>';
392  /*}
393  else
394  {
395  print img_picto($langs->trans("Enabled"),'switch_on');
396  }*/
397  print "</td>";
398  } else {
399  print '<td class="center">'."\n";
400  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&amp;type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
401  print "</td>";
402  }
403 
404  // Default
405  print '<td class="center">';
406  if (getDolGlobalString("INVOICE_SUPPLIER_ADDON_PDF") == "$name") {
407  //print img_picto($langs->trans("Default"),'on');
408  // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
409  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
410  } else {
411  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
412  }
413  print '</td>';
414 
415  // Info
416  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
417  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
418  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
419  $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
420 
421  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
422  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
423  $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
424  $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
425  print '<td class="center">';
426  print $form->textwithpicto('', $htmltooltip, 1, 0);
427  print '</td>';
428  print '<td class="center">';
429  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
430  print '</td>';
431 
432  print "</tr>\n";
433  }
434  }
435 
436  closedir($handle);
437  }
438  }
439 }
440 
441 print '</table></div><br>';
442 
443 /*
444  * Other options
445  */
446 
447 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
448 print '<input type="hidden" name="token" value="'.newToken().'">';
449 print '<input type="hidden" name="action" value="set_SUPPLIER_INVOICE_FREE_TEXT">';
450 
451 print load_fiche_titre($langs->trans("OtherOptions"), '', '');
452 
453 print '<div class="div-table-responsive-no-min">';
454 print '<table class="noborder centpercent">';
455 print '<tr class="liste_titre">';
456 print '<td>'.$langs->trans("Parameter").'</td>';
457 print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
458 print '<td width="80">&nbsp;</td>';
459 print "</tr>\n";
460 
461 $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
462 $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
463 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
464 foreach ($substitutionarray as $key => $val) {
465  $htmltext .= $key.'<br>';
466 }
467 $htmltext .= '</i>';
468 
469 print '<tr class="oddeven"><td colspan="2">';
470 print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
471 $variablename = 'SUPPLIER_INVOICE_FREE_TEXT';
472 if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
473  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
474 } else {
475  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
476  $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
477  print $doleditor->Create();
478 }
479 print '</td><td class="right">';
480 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
481 print "</td></tr>\n";
482 
483 print '</table></div><br>';
484 
485 print '</form>';
486 
487 
488 /*
489  * Notifications
490  */
491 
492 print load_fiche_titre($langs->trans("Notifications"), '', '');
493 
494 print '<div class="div-table-responsive-no-min">';
495 print '<table class="noborder centpercent">';
496 print '<tr class="liste_titre">';
497 print '<td>'.$langs->trans("Parameter").'</td>';
498 print '<td align="center" width="60"></td>';
499 print '<td width="80">&nbsp;</td>';
500 print "</tr>\n";
501 
502 print '<tr class="oddeven"><td colspan="2">';
503 print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
504 print '</td><td class="right">';
505 print "</td></tr>\n";
506 
507 print '</table>';
508 print '</div>';
509 
510 // End of page
511 llxFooter();
512 $db->close();
Societe
Class to manage third parties objects (customers, suppliers, prospects...)
Definition: societe.class.php:51
yn
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Definition: functions.lib.php:6824
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:70
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:562
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5477
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:609
FactureFournisseur
Class to manage suppliers invoices.
Definition: fournisseur.facture.class.php:51
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:5107
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1158
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:4135
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
delDocumentModel
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1949
Fournisseur
Class to manage suppliers.
Definition: fournisseur.class.php:34
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1741
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
Definition: functions.lib.php:8673
$sql
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->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') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
Definition: index.php:746
dol_strlen
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
Definition: functions.lib.php:3997
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:11654
supplierorder_admin_prepare_head
supplierorder_admin_prepare_head()
Return array head with list of tabs to view object informations.
Definition: fourn.lib.php:251
dol_get_fiche_head
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.
Definition: functions.lib.php:1979
getDolGlobalString
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:142
dolibarr_set_const
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:638
addDocumentModel
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1918
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:53
img_object
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
Definition: functions.lib.php:4473
pdf_getSubstitutionArray
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:753
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
Definition: security.lib.php:1164
DolEditor
Class to manage a WYSIWYG editor.
Definition: doleditor.class.php:30