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