dolibarr  20.0.0-beta
bank.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
4  * Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
5  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
6  * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
7  * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  */
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/bank.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
36 
37 // Load translation files required by the page
38 $langs->loadLangs(array("admin", "companies", "bills", "other", "banks"));
39 
40 $action = GETPOST('action', 'aZ09');
41 $actionsave = GETPOST('save', 'alpha');
42 $value = GETPOST('value', 'alpha');
43 $label = GETPOST('label', 'alpha');
44 $scandir = GETPOST('scan_dir', 'alpha');
45 $type = 'bankaccount';
46 
47 if (!$user->admin) {
49 }
50 
51 $error = 0;
52 
53 
54 /*
55  * Actions
56  */
57 
58 if (in_array($action, array('setBANK_DISABLE_DIRECT_INPUT'))) {
59  $constname = preg_replace('/^set/', '', $action);
60  $constvalue = GETPOSTINT('value');
61  $res = dolibarr_set_const($db, $constname, $constvalue, 'yesno', 0, '', $conf->entity);
62  if (!($res > 0)) {
63  $error++;
64  }
65 
66  if (!$error) {
67  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
68  } else {
69  setEventMessages($langs->trans("Error"), null, 'mesgs');
70  }
71 }
72 
73 // Order display of bank account
74 if ($action == 'setbankorder') {
75  if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) {
76  } else {
77  dol_print_error($db);
78  }
79 }
80 
81 // Auto report last num releve on conciliate
82 if ($action == 'setreportlastnumreleve') {
83  if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, '', $conf->entity) > 0) {
84  } else {
85  dol_print_error($db);
86  }
87 } elseif ($action == 'unsetreportlastnumreleve') {
88  if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 0, 'chaine', 0, '', $conf->entity) > 0) {
89  } else {
90  dol_print_error($db);
91  }
92 }
93 
94 // Colorize movements
95 if ($action == 'setbankcolorizemovement') {
96  if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 1, 'chaine', 0, '', $conf->entity) > 0) {
97  } else {
98  dol_print_error($db);
99  }
100 } elseif ($action == 'unsetbankcolorizemovement') {
101  if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 0, 'chaine', 0, '', $conf->entity) > 0) {
102  } else {
103  dol_print_error($db);
104  }
105 }
106 
107 if ($actionsave) {
108  $db->begin();
109 
110  $i = 1;
111  $errorsaved = 0;
112  $error = 0;
113 
114  // Save colors
115  while ($i <= 2) {
116  $color = GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha');
117  if ($color == '-1') {
118  $color = '';
119  }
120 
121  $res = dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity);
122  if (!($res > 0)) {
123  $error++;
124  }
125  $i++;
126  }
127 
128  if (!$error) {
129  $db->commit();
130  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
131  } else {
132  $db->rollback();
133  if (empty($errorsaved)) {
134  setEventMessages($langs->trans("Error"), null, 'errors');
135  }
136  }
137 }
138 
139 
140 if ($action == 'specimen') {
141  $modele = GETPOST('module', 'alpha');
142 
143  if ($modele == 'sepamandate') {
144  $object = new CompanyBankAccount($db);
145  } else {
146  $object = new Account($db);
147  }
148  $object->initAsSpecimen();
149 
150  // Search template files
151  $file = '';
152  $classname = '';
153  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
154  foreach ($dirmodels as $reldir) {
155  $file = dol_buildpath($reldir."core/modules/bank/doc/pdf_".$modele.".modules.php", 0);
156  if (file_exists($file)) {
157  $classname = "pdf_".$modele;
158  break;
159  }
160  }
161 
162  if ($classname !== '') {
163  require_once $file;
164 
165  $module = new $classname($db);
166  '@phan-var-force ModeleBankAccountDoc $module';
167 
168  if ($module->write_file($object, $langs) > 0) {
169  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bank&file=SPECIMEN.pdf");
170  return;
171  } else {
172  setEventMessages($module->error, null, 'errors');
173  dol_syslog($module->error, LOG_ERR);
174  }
175  } else {
176  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
177  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
178  }
179 }
180 
181 // Activate a model
182 if ($action == 'set') {
183  $ret = addDocumentModel($value, $type, $label, $scandir);
184 } elseif ($action == 'del') {
185  $ret = delDocumentModel($value, $type);
186  if ($ret > 0) {
187  if ($conf->global->BANKADDON_PDF == "$value") {
188  dolibarr_del_const($db, 'BANKADDON_PDF', $conf->entity);
189  }
190  }
191 } elseif ($action == 'setdoc') {
192  // Set default model
193  if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
194  // The constant that was read before the new set
195  // We therefore requires a variable to have a coherent view
196  $conf->global->BANKADDON_PDF = $value;
197  }
198 
199  // On active le modele
200  $ret = delDocumentModel($value, $type);
201  if ($ret > 0) {
202  $ret = addDocumentModel($value, $type, $label, $scandir);
203  }
204 }
205 
206 
207 
208 /*
209  * View
210  */
211 
212 $form = new Form($db);
213 $formother = new FormOther($db);
214 
215 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
216 
217 llxHeader("", $langs->trans("BankSetupModule"));
218 
219 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
220 print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup');
221 
222 print '<form name="bankmovementcolorconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
223 print '<input type="hidden" name="token" value="'.newToken().'">';
224 print '<input type="hidden" name="action" value="save">';
225 
226 $head = bank_admin_prepare_head(null);
227 print dol_get_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account');
228 
229 //Show bank account order
230 print load_fiche_titre($langs->trans("BankOrderShow"), '', '');
231 
232 print '<div class="div-table-responsive-no-min">';
233 print '<table class="noborder centpercent">';
234 print '<tr class="liste_titre">';
235 print '<td>'.$langs->trans("Name").'</td>';
236 print '<td class="minwidth100">'.$langs->trans("Description").'</td>';
237 print '<td>'.$langs->trans("Example").'</td>';
238 print '<td class="center">'.$langs->trans("Status").'</td>';
239 print "</tr>\n";
240 
241 $bankorder = array();
242 $bankorder[0][0] = $langs->trans("BankOrderGlobal");
243 $bankorder[0][1] = $langs->trans("BankOrderGlobalDesc");
244 $bankorder[0][2] = 'BankCode DeskCode BankAccountNumber BankAccountNumberKey';
245 $bankorder[1][0] = $langs->trans("BankOrderES");
246 $bankorder[1][1] = $langs->trans("BankOrderESDesc");
247 $bankorder[1][2] = 'BankCode DeskCode BankAccountNumberKey BankAccountNumber';
248 
249 $i = 0;
250 
251 $nbofbank = count($bankorder);
252 while ($i < $nbofbank) {
253  print '<tr class="oddeven">';
254  print '<td>'.$bankorder[$i][0]."</td><td>\n";
255  print $bankorder[$i][1];
256  print '</td>';
257  print '<td class="nowrap">';
258  $tmparray = explode(' ', $bankorder[$i][2]);
259  foreach ($tmparray as $key => $val) {
260  if ($key > 0) {
261  print ', ';
262  }
263  print $langs->trans($val);
264  }
265  print "</td>\n";
266 
267  if (getDolGlobalInt('BANK_SHOW_ORDER_OPTION') == $i) {
268  print '<td class="center">';
269  print img_picto($langs->trans("Activated"), 'on');
270  print '</td>';
271  } else {
272  print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbankorder&token='.newToken().'&value='.((int) $i).'">';
273  print img_picto($langs->trans("Disabled"), 'off');
274  print '</a></td>';
275  }
276  print '</tr>'."\n";
277  $i++;
278 }
279 
280 print '</table>'."\n";
281 print "</div>";
282 
283 print '<br><br>';
284 
285 
286 /*
287  * Document templates generators
288  */
289 
290 print load_fiche_titre($langs->trans("BankAccountModelModule"), '', '');
291 
292 // Load array def with activated templates
293 $def = array();
294 $sql = "SELECT nom";
295 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
296 $sql .= " WHERE type = '".$db->escape($type)."'";
297 $sql .= " AND entity = ".$conf->entity;
298 $resql = $db->query($sql);
299 if ($resql) {
300  $i = 0;
301  $num_rows = $db->num_rows($resql);
302  while ($i < $num_rows) {
303  $array = $db->fetch_array($resql);
304  if (is_array($array)) {
305  array_push($def, $array[0]);
306  }
307  $i++;
308  }
309 } else {
310  dol_print_error($db);
311 }
312 
313 print '<div class="div-table-responsive-no-min">';
314 print '<table class="noborder centpercent">'."\n";
315 print '<tr class="liste_titre">'."\n";
316 print '<td>'.$langs->trans("Name").'</td>';
317 print '<td class="minwidth100">'.$langs->trans("Description").'</td>';
318 print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
319 print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
320 print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
321 print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
322 print '</tr>'."\n";
323 
324 clearstatcache();
325 
326 foreach ($dirmodels as $reldir) {
327  foreach (array('', '/doc') as $valdir) {
328  $dir = dol_buildpath($reldir."core/modules/bank".$valdir);
329 
330  if (is_dir($dir)) {
331  $handle = opendir($dir);
332  if (is_resource($handle)) {
333  $filelist = array();
334  while (($file = readdir($handle)) !== false) {
335  $filelist[] = $file;
336  }
337  closedir($handle);
338  arsort($filelist);
339 
340  foreach ($filelist as $file) {
341  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
342  if (file_exists($dir.'/'.$file)) {
343  $name = substr($file, 4, dol_strlen($file) - 16);
344  $classname = substr($file, 0, dol_strlen($file) - 12);
345 
346  require_once $dir.'/'.$file;
347  $module = new $classname($db);
348 
349  $modulequalified = 1;
350  if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
351  $modulequalified = 0;
352  }
353  if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
354  $modulequalified = 0;
355  }
356 
357  if ($modulequalified) {
358  print '<tr class="oddeven"><td width="100">';
359  print(empty($module->name) ? $name : $module->name);
360  print "</td><td>\n";
361  if (method_exists($module, 'info')) {
362  print $module->info($langs);
363  } else {
364  print $module->description;
365  }
366  print '</td>';
367 
368  // Active
369  if (in_array($name, $def)) {
370  print '<td class="center">'."\n";
371  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.$name.'">';
372  print img_picto($langs->trans("Enabled"), 'switch_on');
373  print '</a>';
374  print '</td>';
375  } else {
376  print '<td class="center">'."\n";
377  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&token='.newToken().'&can_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
378  print "</td>";
379  }
380 
381  // Default
382  print '<td class="center">';
383  if ($conf->global->BANKADDON_PDF == $name) {
384  print img_picto($langs->trans("Default"), 'on');
385  } else {
386  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
387  }
388  print '</td>';
389 
390  // Info
391  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
392  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
393  if ($module->type == 'pdf') {
394  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
395  }
396  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
397  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
398  //$htmltooltip .= '<br>' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1);
399  //$htmltooltip .= '<br>' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1);
400  $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
401  // $htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
402  // $htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
403  //$htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
404 
405  print '<td class="center">';
406  print $form->textwithpicto('', $htmltooltip, 1, 0);
407  print '</td>';
408 
409  // Preview
410  print '<td class="center">';
411  if ($module->type == 'pdf') {
412  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
413  } else {
414  print img_object($langs->trans("PreviewNotAvailable"), 'generic');
415  }
416  print '</td>';
417 
418  print "</tr>\n";
419  }
420  }
421  }
422  }
423  }
424  }
425  }
426 }
427 print '</table>';
428 print '</div>';
429 
430 print '<br><br>';
431 
432 print load_fiche_titre($langs->trans("BankColorizeMovement"), '', '');
433 
434 print '<div class="div-table-responsive-no-min">';
435 print '<table class="noborder centpercent">'."\n";
436 print '<tr class="liste_titre">'."\n";
437 print '<td colspan="4">'.$langs->trans("Name").'</td>';
438 print '<td align="center" width="75">'.$langs->trans("Value").'</td>'."\n";
439 print "</tr>\n";
440 
441 print '<tr class="oddeven"><td colspan="4">';
442 print $langs->trans('BankColorizeMovementDesc');
443 print "</td>";
444 // Active
445 if (getDolGlobalInt('BANK_COLORIZE_MOVEMENT')) {
446  print '<td class="center">'."\n";
447  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=unsetbankcolorizemovement&token='.newToken().'">';
448  print img_picto($langs->trans("Enabled"), 'switch_on');
449  print '</a>';
450  print '</td>';
451 } else {
452  print '<td class="center">'."\n";
453  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setbankcolorizemovement&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
454  print "</td>";
455 }
456 
457 print "</tr>\n";
458 
459 if (getDolGlobalInt('BANK_COLORIZE_MOVEMENT')) {
460  $i = 1;
461  while ($i <= 2) {
462  $key = $i;
463  $color = 'BANK_COLORIZE_MOVEMENT_COLOR'.$key;
464 
465  print '<tr class="oddeven">';
466 
467  // Label
468  print '<td colspan="4" width="180" class="nowrap">'.$langs->trans("BankColorizeMovementName".$key)."</td>";
469  // Color
470  print '<td class="nowrap right">';
471  print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) ? GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) : getDolGlobalString($color)), "BANK_COLORIZE_MOVEMENT_COLOR".$key, 'bankmovementcolorconfig', 1, '', 'right hideifnotset');
472  print '</td>';
473  print "</tr>";
474  $i++;
475  }
476 }
477 print '</table>';
478 print '</div>';
479 
480 print '<br><br>';
481 
482 
483 /*
484  * Document templates generators
485  */
486 
487 print load_fiche_titre($langs->trans("Other"), '', '');
488 
489 print '<div class="div-table-responsive-no-min">';
490 print '<table class="noborder centpercent">'."\n";
491 print '<tr class="liste_titre">'."\n";
492 print '<td>'.$langs->trans("Name").'</td>';
493 print '<td>'.$langs->trans("Description").'</td>';
494 print '<td class="center width75">'.$langs->trans("Status")."</td>\n";
495 print "</tr>\n";
496 
497 print '<tr class="oddeven">';
498 print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td><td></td>';
499 if (getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) {
500  print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
501  print img_picto($langs->trans("Activated"), 'switch_on');
502  print '</a></td>';
503 } else {
504  print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
505  print img_picto($langs->trans("Disabled"), 'switch_off');
506  print '</a></td>';
507 }
508 print '</tr>';
509 
510 print '<tr class="oddeven"><td>';
511 print $langs->trans('AccountStatement');
512 print "</td><td>\n";
513 print $langs->trans('AutoReportLastAccountStatement');
514 print '</td>';
515 // Active
516 if (getDolGlobalString('BANK_REPORT_LAST_NUM_RELEVE')) {
517  print '<td class="center">'."\n";
518  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=unsetreportlastnumreleve&token='.newToken().'">';
519  print img_picto($langs->trans("Enabled"), 'switch_on');
520  print '</a>';
521  print '</td>';
522 } else {
523  print '<td class="center">'."\n";
524  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setreportlastnumreleve&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
525  print "</td>";
526 }
527 print "</tr>\n";
528 
529 // Allow SEPA Mandate OnLine Sign
530 if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT')) {
531  print '<tr class="oddeven">';
532  print '<td>'.$langs->trans("AllowOnLineSign").'</td>';
533  print '<td>'.$langs->trans("AllowOnLineSignDesc").'</td>';
534  print '<td class="center">';
535  print ajax_constantonoff('SOCIETE_RIB_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1);
536  print '</td></tr>';
537 }
538 
539 print '</table>';
540 print '</div>';
541 
542 print dol_get_fiche_end();
543 
544 print $form->buttonsSaveCancel("Save", '');
545 
546 print "</form>\n";
547 
548 // End of page
549 llxFooter();
550 $db->close();
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition: card.php:58
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1940
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:656
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:580
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1971
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='inline-block')
On/off button for constant.
Definition: ajax.lib.php:641
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:55
llxFooter()
Empty footer.
Definition: wrapper.php:69
bank_admin_prepare_head($object)
Prepare array with list of tabs.
Definition: bank.lib.php:134
Class to manage bank accounts.
Class to manage bank accounts description of third parties.
Class to manage generation of HTML components Only common components must be here.
Class permettant la generation de composants html autre Only common components are here.
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
Definition: index.php:745
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.