dolibarr  16.0.5
limits.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2007-2022 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2009-2018 Regis Houssin <regis.houssin@inodbox.com>
4  * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
25 require '../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
28 
29 // Load translation files required by the page
30 $langs->loadLangs(array('companies', 'products', 'admin'));
31 
32 $action = GETPOST('action', 'aZ09');
33 $cancel = GETPOST('cancel', 'aZ09');
34 $currencycode = GETPOST('currencycode', 'alpha');
35 
36 if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
37  // When MULTICURRENCY_USE_LIMIT_BY_CURRENCY is on, we use always a defined currency code instead of '' even for default.
38  $currencycode = (!empty($currencycode) ? $currencycode : $conf->currency);
39 }
40 
41 $mainmaxdecimalsunit = 'MAIN_MAX_DECIMALS_UNIT'.(!empty($currencycode) ? '_'.$currencycode : '');
42 $mainmaxdecimalstot = 'MAIN_MAX_DECIMALS_TOT'.(!empty($currencycode) ? '_'.$currencycode : '');
43 $mainmaxdecimalsshown = 'MAIN_MAX_DECIMALS_SHOWN'.(!empty($currencycode) ? '_'.$currencycode : '');
44 $mainroundingruletot = 'MAIN_ROUNDING_RULE_TOT'.(!empty($currencycode) ? '_'.$currencycode : '');
45 
46 $valmainmaxdecimalsunit = GETPOST($mainmaxdecimalsunit, 'int');
47 $valmainmaxdecimalstot = GETPOST($mainmaxdecimalstot, 'int');
48 $valmainmaxdecimalsshown = GETPOST($mainmaxdecimalsshown, 'alpha'); // Can be 'x.y' but also 'x...'
49 $valmainroundingruletot = price2num(GETPOST($mainroundingruletot, 'alphanohtml'), '', 2);
50 
51 if (!$user->admin) {
53 }
54 
55 
56 /*
57  * Actions
58  */
59 
60 if ($action == 'update' && !$cancel) {
61  $error = 0;
62  $MAXDEC = 8;
63  if ($valmainmaxdecimalsunit > $MAXDEC
64  || $valmainmaxdecimalstot > $MAXDEC
65  || $valmainmaxdecimalsshown > $MAXDEC) {
66  $error++;
67  setEventMessages($langs->trans("ErrorDecimalLargerThanAreForbidden", $MAXDEC), null, 'errors');
68  $action = 'edit';
69  }
70 
71  if ($valmainmaxdecimalsunit < 0
72  || $valmainmaxdecimalstot < 0
73  || $valmainmaxdecimalsshown < 0) {
74  $langs->load("errors");
75  $error++;
76  setEventMessages($langs->trans("ErrorNegativeValueNotAllowed"), null, 'errors');
77  $action = 'edit';
78  }
79 
80  if ($valmainroundingruletot) {
81  if ($valmainroundingruletot * pow(10, $valmainmaxdecimalstot) < 1) {
82  $langs->load("errors");
83  $error++;
84  setEventMessages($langs->trans("ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT"), null, 'errors');
85  $action = 'edit';
86  }
87  }
88 
89  if ((float) $valmainmaxdecimalsshown == 0) {
90  $langs->load("errors");
91  $error++;
92  setEventMessages($langs->trans("ErrorValueCantBeNull", dol_trunc(dol_string_nohtmltag($langs->transnoentitiesnoconv("MAIN_MAX_DECIMALS_SHOWN")), 40)), null, 'errors');
93  $action = 'edit';
94  }
95  if (! $error && ((float) $valmainmaxdecimalsshown < $valmainmaxdecimalsunit || (float) $valmainmaxdecimalsshown < $valmainmaxdecimalstot)) {
96  $langs->load("errors");
97  $error++;
98  setEventMessages($langs->trans("ErrorValueForTooLow", dol_trunc(dol_string_nohtmltag($langs->transnoentitiesnoconv("MAIN_MAX_DECIMALS_SHOWN")), 40)), null, 'errors');
99  $action = 'edit';
100  }
101 
102  if (!$error) {
103  dolibarr_set_const($db, $mainmaxdecimalsunit, $valmainmaxdecimalsunit, 'chaine', 0, '', $conf->entity);
104  dolibarr_set_const($db, $mainmaxdecimalstot, $valmainmaxdecimalstot, 'chaine', 0, '', $conf->entity);
105  dolibarr_set_const($db, $mainmaxdecimalsshown, $valmainmaxdecimalsshown, 'chaine', 0, '', $conf->entity);
106 
107  dolibarr_set_const($db, $mainroundingruletot, $valmainroundingruletot, 'chaine', 0, '', $conf->entity);
108 
109  header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".(!empty($currencycode) ? '&currencycode='.$currencycode : ''));
110  exit;
111  }
112 }
113 
114 
115 /*
116  * View
117  */
118 
119 $form = new Form($db);
120 
121 $title = $langs->trans("LimitsSetup");
122 $help_url = '';
123 
124 llxHeader('', $title, $help_url);
125 
126 print load_fiche_titre($title, '', 'title_setup');
127 
128 $aCurrencies = array($conf->currency); // Default currency always first position
129 
130 if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
131  require_once DOL_DOCUMENT_ROOT.'/core/lib/multicurrency.lib.php';
132 
133  $sql = "SELECT rowid, code FROM ".MAIN_DB_PREFIX."multicurrency";
134  $sql .= " WHERE entity = ".((int) $conf->entity);
135  $sql .= " AND code <> '".$db->escape($conf->currency)."'"; // Default currency always first position
136  $resql = $db->query($sql);
137  if ($resql) {
138  while ($obj = $db->fetch_object($resql)) {
139  $aCurrencies[] = $obj->code;
140  }
141  }
142 
143  if (!empty($aCurrencies) && count($aCurrencies) > 1) {
144  $head = multicurrencyLimitPrepareHead($aCurrencies);
145 
146  print dol_get_fiche_head($head, $currencycode, '', -1, '');
147  }
148 }
149 
150 print '<span class="opacitymedium">'.$langs->trans("LimitsDesc")."</span><br>\n";
151 print "<br>\n";
152 
153 if ($action == 'edit') {
154  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
155  print '<input type="hidden" name="token" value="'.newToken().'">';
156  print '<input type="hidden" name="action" value="update">';
157  if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
158  print '<input type="hidden" name="currencycode" value="'.$currencycode.'">';
159  }
160 
161  clearstatcache();
162 
163  print '<table class="noborder centpercent">';
164  print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td></tr>';
165 
166  print '<tr class="oddeven"><td>';
167  print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly"));
168  print '</td><td><input class="flat right" name="'.$mainmaxdecimalsunit.'" size="3" value="'.(GETPOSTISSET($mainmaxdecimalsunit) ? GETPOST($mainmaxdecimalsunit) : getDolGlobalInt('MAIN_MAX_DECIMALS_UNIT', 0)).'"></td></tr>';
169 
170  print '<tr class="oddeven"><td>';
171  print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
172  print '</td><td><input class="flat right" name="'.$mainmaxdecimalstot.'" size="3" value="'.(GETPOSTISSET($mainmaxdecimalstot) ? GETPOST($mainmaxdecimalstot) : getDolGlobalInt('MAIN_MAX_DECIMALS_TOT', 0)).'"></td></tr>';
173 
174  print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'</td>';
175  print '<td><input class="flat right" name="'.$mainmaxdecimalsshown.'" size="3" value="'.(GETPOSTISSET($mainmaxdecimalsshown) ? GETPOST($mainmaxdecimalsshown) : getDolGlobalString('MAIN_MAX_DECIMALS_SHOWN')).'"></td></tr>';
176 
177  print '<tr class="oddeven"><td>';
178  print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
179  print '</td><td><input class="flat right" name="'.$mainroundingruletot.'" size="3" value="'.(GETPOSTISSET($mainroundingruletot) ? GETPOST($mainroundingruletot) : getDolGlobalString('MAIN_ROUNDING_RULE_TOT')).'"></td></tr>';
180 
181  print '</table>';
182 
183  print '<div class="center">';
184  print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
185  print ' &nbsp; ';
186  print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
187  print '</div>';
188  print '<br>';
189 
190  print '</form>';
191  print '<br>';
192 } else {
193  print '<div class="div-table-responsive-no-min">';
194  print '<table class="noborder centpercent">';
195  print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="right">'.$langs->trans("Value").'</td></tr>';
196 
197  print '<tr class="oddeven"><td>';
198  print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly"));
199  print '</td><td align="right">'.(isset($conf->global->$mainmaxdecimalsunit) ? $conf->global->$mainmaxdecimalsunit : $conf->global->MAIN_MAX_DECIMALS_UNIT).'</td></tr>';
200 
201  print '<tr class="oddeven"><td>';
202  print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
203  print '</td><td align="right">'.(isset($conf->global->$mainmaxdecimalstot) ? $conf->global->$mainmaxdecimalstot : $conf->global->MAIN_MAX_DECIMALS_TOT).'</td></tr>';
204 
205  print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'</td>';
206  print '<td align="right">'.(isset($conf->global->$mainmaxdecimalsshown) ? $conf->global->$mainmaxdecimalsshown : $conf->global->MAIN_MAX_DECIMALS_SHOWN).'</td></tr>';
207 
208  print '<tr class="oddeven"><td>';
209  print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
210  print '</td><td align="right">'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : (!empty($conf->global->MAIN_ROUNDING_RULE_TOT) ? $conf->global->MAIN_ROUNDING_RULE_TOT : '')).'</td></tr>';
211 
212  print '</table>';
213  print '</div>';
214 
215  print '<div class="tabsAction">';
216  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().(!empty($currencycode) ? '&currencycode='.$currencycode : '').'">'.$langs->trans("Modify").'</a>';
217  print '</div>';
218 }
219 
220 if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
221  if (!empty($aCurrencies) && count($aCurrencies) > 1) {
222  print dol_get_fiche_end();
223  }
224 }
225 
226 if (empty($mysoc->country_code)) {
227  $langs->load("errors");
228  $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"));
229  print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>';
230 } else {
231  // Show examples
232  print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', '');
233 
234  print '<span class="opacitymedium">'.$langs->trans("Format").':</span> '.price(price2num(1234.56789, 'MT'), 0, $langs, 1, -1, -1, $currencycode)."<br>\n";
235 
236  // Always show vat rates with vat 0
237  $s = 2 / 3; $qty = 1; $vat = 0;
238  $tmparray = calcul_price_total(1, $qty * price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
239  print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
240  print " x ".$langs->trans("Quantity").": ".$qty;
241  print " - ".$langs->trans("VAT").": ".$vat.'%';
242  print ' &nbsp; -> &nbsp; <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
243 
244  $s = 10 / 3; $qty = 1; $vat = 0;
245  $tmparray = calcul_price_total(1, $qty * price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
246  print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
247  print " x ".$langs->trans("Quantity").": ".$qty;
248  print " - ".$langs->trans("VAT").": ".$vat.'%';
249  print ' &nbsp; -> &nbsp; <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
250 
251  $s = 10 / 3; $qty = 2; $vat = 0;
252  $tmparray = calcul_price_total(1, $qty * price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc);
253  print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
254  print " x ".$langs->trans("Quantity").": ".$qty;
255  print " - ".$langs->trans("VAT").": ".$vat.'%';
256  print ' &nbsp; -> &nbsp; <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
257 
258  // Add vat rates examples specific to country
259  $vat_rates = array();
260 
261  $sql = "SELECT taux as vat_rate, t.code as vat_code, t.localtax1 as localtax_rate1, t.localtax2 as localtax_rate2";
262  $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
263  $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($mysoc->country_code)."' AND (t.taux <> 0 OR t.localtax1 <> '0' OR t.localtax2 <> '0')";
264  $sql .= " ORDER BY t.taux ASC";
265  $resql = $db->query($sql);
266  if ($resql) {
267  $num = $db->num_rows($resql);
268  if ($num) {
269  for ($i = 0; $i < $num; $i++) {
270  $obj = $db->fetch_object($resql);
271  $vat_rates[] = array('vat_rate'=>$obj->vat_rate, 'code'=>$obj->vat_code, 'localtax_rate1'=>$obj->localtax_rate1, 'locltax_rate2'=>$obj->localtax_rate2);
272  }
273  }
274  } else {
275  dol_print_error($db);
276  }
277 
278  if (count($vat_rates)) {
279  foreach ($vat_rates as $vatarray) {
280  $vat = $vatarray['vat_rate'];
281  for ($qty = 1; $qty <= 2; $qty++) {
282  $vattxt = $vat.($vatarray['code'] ? ' ('.$vatarray['code'].')' : '');
283 
284  $localtax_array = getLocalTaxesFromRate($vattxt, 0, $mysoc, $mysoc);
285 
286  $s = 10 / 3;
287  $tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
288  print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
289  print " x ".$langs->trans("Quantity").": ".$qty;
290  print " - ".$langs->trans("VAT").": ".$vat.'%';
291  print ($vatarray['code'] ? ' ('.$vatarray['code'].')' : '');
292  print ' &nbsp; -> &nbsp; <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ";
293  print $tmparray[0].' / '.$tmparray[1].($tmparray[9] ? '+'.$tmparray[9] : '').($tmparray[10] ? '+'.$tmparray[10] : '').' / '.$tmparray[2];
294  print "<br>\n";
295  }
296  }
297  } else {
298  // More examples if not specific vat rate found
299  // This example must be kept for test purpose with current value because value used (2/7, 10/3, and vat 0, 10)
300  // were calculated to show all possible cases of rounding. If we change this, examples becomes useless or show the same rounding rule.
301 
302  $localtax_array = array();
303 
304  $s = 10 / 3; $qty = 1; $vat = 10;
305  $tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
306  print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
307  print " x ".$langs->trans("Quantity").": ".$qty;
308  print " - ".$langs->trans("VAT").": ".$vat.'%';
309  print ' &nbsp; -> &nbsp; <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
310 
311  $s = 10 / 3; $qty = 2; $vat = 10;
312  $tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array);
313  print '<span class="opacitymedium">'.$langs->trans("UnitPriceOfProduct").":</span> ".price2num($s, 'MU');
314  print " x ".$langs->trans("Quantity").": ".$qty;
315  print " - ".$langs->trans("VAT").": ".$vat.'%';
316  print ' &nbsp; -> &nbsp; <span class="opacitymedium">'.$langs->trans("TotalPriceAfterRounding").":</span> ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."<br>\n";
317  }
318 }
319 
320 // End of page
321 llxFooter();
322 $db->close();
getLocalTaxesFromRate
getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0)
Get type and rate of localtaxes for a particular vat rate/country of a thirdparty.
Definition: functions.lib.php:6097
dol_trunc
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
Definition: functions.lib.php:3805
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
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:484
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:4844
img_warning
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
Definition: functions.lib.php:4521
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
$help_url
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:116
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5661
calcul_price_total
calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller='', $localtaxes_array='', $progress=100, $multicurrency_tx=1, $pu_devise=0, $multicurrency_code='')
Calculate totals (net, vat, ...) of a line.
Definition: price.lib.php:86
multicurrencyLimitPrepareHead
multicurrencyLimitPrepareHead($aCurrencies)
Prepare array with list of currency tabs.
Definition: multicurrency.lib.php:61
dol_string_nohtmltag
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
Definition: functions.lib.php:6694
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:1822
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:80
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
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:627
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:386
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->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->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
price
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
Definition: functions.lib.php:5541
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
getDolGlobalInt
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
Definition: functions.lib.php:93
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59