dolibarr  16.0.5
reassort.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2018 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
6  * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
7  * Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
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 
29 require '../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
34 
35 // Load translation files required by the page
36 $langs->loadLangs(array('products', 'stocks'));
37 
38 $action = GETPOST('action', 'aZ09');
39 $sref = GETPOST("sref", 'alpha');
40 $snom = GETPOST("snom", 'alpha');
41 $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
42 $type = GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT;
43 $search_barcode = GETPOST("search_barcode", 'alpha');
44 $toolowstock = GETPOST('toolowstock');
45 $tosell = GETPOST("tosell");
46 $tobuy = GETPOST("tobuy");
47 $fourn_id = GETPOST("fourn_id", 'int');
48 $sbarcode = GETPOST("sbarcode", 'int');
49 $search_stock_physique = GETPOST('search_stock_physique', 'alpha');
50 
51 $sortfield = GETPOST('sortfield', 'aZ09comma');
52 $sortorder = GETPOST('sortorder', 'aZ09comma');
53 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
54 if (empty($page) || $page < 0) {
55  $page = 0;
56 }
57 if (!$sortfield) {
58  $sortfield = "p.ref";
59 }
60 if (!$sortorder) {
61  $sortorder = "ASC";
62 }
63 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
64 if (empty($page) || $page == -1) {
65  $page = 0;
66 } // If $page is not defined, or '' or -1
67 $offset = $limit * $page;
68 
69 // Load sale and categ filters
70 $search_sale = GETPOST("search_sale");
71 if (GETPOSTISSET('catid')) {
72  $search_categ = GETPOST('catid', 'int');
73 } else {
74  $search_categ = GETPOST('search_categ', 'int');
75 }
76 
77 // Get object canvas (By default, this is not defined, so standard usage of dolibarr)
78 $canvas = GETPOST("canvas");
79 $objcanvas = null;
80 if (!empty($canvas)) {
81  require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
82  $objcanvas = new Canvas($db, $action);
83  $objcanvas->getCanvas('product', 'list', $canvas);
84 }
85 
86 // Define virtualdiffersfromphysical
87 $virtualdiffersfromphysical = 0;
88 if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
89  || !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
90  || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)
91  || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)
92  || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)
93  || !empty($conf->mrp->enabled)) {
94  $virtualdiffersfromphysical = 1; // According to increase/decrease stock options, virtual and physical stock may differs.
95 }
96 
97 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
98 $hookmanager->initHooks(array('productreassortlist'));
99 
100 if ($user->socid) {
101  $socid = $user->socid;
102 }
103 $result = restrictedArea($user, 'produit|service', 0, 'product&product');
104 
105 $object = new Product($db);
106 
107 /*
108  * Actions
109  */
110 
111 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
112  $sref = "";
113  $snom = "";
114  $sall = "";
115  $tosell = "";
116  $tobuy = "";
117  $search_sale = "";
118  $search_categ = "";
119  $toolowstock = '';
120  $fourn_id = '';
121  $sbarcode = '';
122  $search_stock_physique = '';
123 }
124 
125 
126 
127 /*
128  * View
129  */
130 
131 $helpurl = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
132 
133 $form = new Form($db);
134 $htmlother = new FormOther($db);
135 
136 $sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
137 $sql .= ' p.fk_product_type, p.tms as datem,';
138 $sql .= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
139 $sql .= ' SUM(s.reel) as stock_physique';
140 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
141  $sql .= ', u.short_label as unit_short';
142 }
143 // Add fields from hooks
144 $parameters = array();
145 $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
146 $sql .= $hookmanager->resPrint;
147 $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
148 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
149 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
150  $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid';
151 }
152 $sql .= " WHERE p.entity IN (".getEntity('product').")";
153 if (!empty($search_categ) && $search_categ != '-1') {
154  $sql .= " AND ";
155  if ($search_categ == -2) {
156  $sql .= " NOT EXISTS ";
157  } else {
158  $sql .= " EXISTS ";
159  }
160  $sql .= "(";
161  $sql .= " SELECT cp.fk_categorie, cp.fk_product";
162  $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_product as cp";
163  $sql .= " WHERE cp.fk_product = p.rowid"; // Join for the needed table to filter by categ
164  if ($search_categ > 0) {
165  $sql .= " AND cp.fk_categorie = " . ((int) $search_categ);
166  }
167  $sql .= ")";
168 }
169 $sql .= " AND EXISTS (SELECT e.rowid FROM ".MAIN_DB_PREFIX."entrepot as e WHERE e.rowid = s.fk_entrepot AND e.entity IN (".getEntity('stock')."))";
170 if ($sall) {
171  $sql .= natural_search(array('p.ref', 'p.label', 'p.description', 'p.note'), $sall);
172 }
173 // if the type is not 1, we show all products (type = 0,2,3)
174 if (dol_strlen($type)) {
175  if ($type == 1) {
176  $sql .= " AND p.fk_product_type = '1'";
177  } else {
178  $sql .= " AND p.fk_product_type <> '1'";
179  }
180 }
181 if ($sref) {
182  $sql .= natural_search('p.ref', $sref);
183 }
184 if ($search_barcode) {
185  $sql .= natural_search('p.barcode', $search_barcode);
186 }
187 if ($snom) {
188  $sql .= natural_search('p.label', $snom);
189 }
190 if (!empty($tosell)) {
191  $sql .= " AND p.tosell = ".((int) $tosell);
192 }
193 if (!empty($tobuy)) {
194  $sql .= " AND p.tobuy = ".((int) $tobuy);
195 }
196 if (!empty($canvas)) {
197  $sql .= " AND p.canvas = '".$db->escape($canvas)."'";
198 }
199 if ($fourn_id > 0) {
200  $sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".((int) $fourn_id);
201 }
202 // Add where from hooks
203 $parameters = array();
204 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
205 $sql .= $hookmanager->resPrint;
206 $sql .= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,";
207 $sql .= " p.fk_product_type, p.tms, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock";
208 // Add fields from hooks
209 $parameters = array();
210 $reshook = $hookmanager->executeHooks('printFieldSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
211 $sql .= $hookmanager->resPrint;
212 $sql_having = '';
213 if ($toolowstock) {
214  $sql_having .= " HAVING SUM(".$db->ifsql('s.reel IS NULL', '0', 's.reel').") < p.seuil_stock_alerte";
215 }
216 if ($search_stock_physique != '') {
217  //$natural_search_physique = natural_search('HAVING SUM(' . $db->ifsql('s.reel IS NULL', '0', 's.reel') . ')', $search_stock_physique, 1, 1);
218  $natural_search_physique = natural_search('SUM(' . $db->ifsql('s.reel IS NULL', '0', 's.reel') . ')', $search_stock_physique, 1, 1);
219  $natural_search_physique = " " . substr($natural_search_physique, 1, -1); // remove first "(" and last ")" characters
220  if (!empty($sql_having)) {
221  $sql_having .= " AND";
222  } else {
223  $sql_having .= " HAVING";
224  }
225  $sql_having .= $natural_search_physique;
226 }
227 if (!empty($sql_having)) {
228  $sql .= $sql_having;
229 }
230 $sql .= $db->order($sortfield, $sortorder);
231 
232 // Count total nb of records
233 $nbtotalofrecords = '';
234 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
235  $result = $db->query($sql);
236  $nbtotalofrecords = $db->num_rows($result);
237  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
238  $page = 0;
239  $offset = 0;
240  }
241 }
242 
243 $sql .= $db->plimit($limit + 1, $offset);
244 
245 $resql = $db->query($sql);
246 if ($resql) {
247  $num = $db->num_rows($resql);
248 
249  $i = 0;
250 
251  if ($num == 1 && GETPOST('autojumpifoneonly') && ($sall || $snom || $sref)) {
252  $objp = $db->fetch_object($resql);
253  header("Location: card.php?id=$objp->rowid");
254  exit;
255  }
256 
257  if (isset($type)) {
258  if ($type == 1) {
259  $texte = $langs->trans("Services");
260  } else {
261  $texte = $langs->trans("Products");
262  }
263  } else {
264  $texte = $langs->trans("ProductsAndServices");
265  }
266  $texte .= ' ('.$langs->trans("MenuStocks").')';
267 
268  $param = '';
269  if ($limit > 0 && $limit != $conf->liste_limit) {
270  $param .= '&limit='.urlencode($limit);
271  }
272  if ($sall) {
273  $param .= "&sall=".urlencode($sall);
274  }
275  if ($tosell) {
276  $param .= "&tosell=".urlencode($tosell);
277  }
278  if ($tobuy) {
279  $param .= "&tobuy=".urlencode($tobuy);
280  }
281  if ($type != '') {
282  $param .= "&type=".urlencode($type);
283  }
284  if ($fourn_id) {
285  $param .= "&fourn_id=".urlencode($fourn_id);
286  }
287  if ($snom) {
288  $param .= "&snom=".urlencode($snom);
289  }
290  if ($sref) {
291  $param .= "&sref=".urlencode($sref);
292  }
293  if ($search_sale) {
294  $param .= "&search_sale=".urlencode($search_sale);
295  }
296  if ($search_categ > 0) {
297  $param .= "&search_categ=".urlencode($search_categ);
298  }
299  if ($toolowstock) {
300  $param .= "&toolowstock=".urlencode($toolowstock);
301  }
302  if ($sbarcode) {
303  $param .= "&sbarcode=".urlencode($sbarcode);
304  }
305  if ($search_stock_physique) {
306  $param .= '&search_stock_physique=' . urlencode($search_stock_physique);
307  }
308 
309  llxHeader("", $texte, $helpurl);
310 
311  print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
312  print '<input type="hidden" name="token" value="'.newToken().'">';
313  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
314  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
315  print '<input type="hidden" name="page" value="'.$page.'">';
316  print '<input type="hidden" name="type" value="'.$type.'">';
317 
318  print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'product', 0, '', '', $limit);
319 
320  if ($search_categ > 0) {
321  print "<div id='ways'>";
322  $c = new Categorie($db);
323  $c->fetch($search_categ);
324  $ways = $c->print_all_ways(' &gt; ', 'product/reassort.php');
325  print " &gt; ".$ways[0]."<br>\n";
326  print "</div><br>";
327  }
328 
329  // Filter on categories
330  $moreforfilter = '';
331  if (!empty($conf->categorie->enabled)) {
332  $moreforfilter .= '<div class="divsearchfield">';
333  $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
334  $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1);
335  $moreforfilter .= '</div>';
336  }
337 
338  $moreforfilter .= '<div class="divsearchfield">';
339  $moreforfilter .= $langs->trans("StockTooLow").' <input type="checkbox" name="toolowstock" value="1"'.($toolowstock ? ' checked' : '').'>';
340  $moreforfilter .= '</div>';
341 
342  if (!empty($moreforfilter)) {
343  print '<div class="liste_titre liste_titre_bydiv centpercent">';
344  print $moreforfilter;
345  $parameters = array();
346  $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
347  print $hookmanager->resPrint;
348  print '</div>';
349  }
350 
351  $formProduct = new FormProduct($db);
352  $formProduct->loadWarehouses();
353  $warehouses_list = $formProduct->cache_warehouses;
354  $nb_warehouse = count($warehouses_list);
355  $colspan_warehouse = 1;
356  if (!empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) {
357  $colspan_warehouse = $nb_warehouse > 1 ? $nb_warehouse + 1 : 1;
358  }
359 
360  print '<div class="div-table-responsive">';
361  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">';
362 
363  // Fields title search
364  print '<tr class="liste_titre_filter">';
365  print '<td class="liste_titre">';
366  print '<input class="flat" type="text" name="sref" size="6" value="'.$sref.'">';
367  print '</td>';
368  print '<td class="liste_titre">';
369  print '<input class="flat" type="text" name="snom" size="8" value="'.$snom.'">';
370  print '</td>';
371  // Duration
372  if (!empty($conf->service->enabled) && $type == 1) {
373  print '<td class="liste_titre">';
374  print '&nbsp;';
375  print '</td>';
376  }
377  // Stock limit
378  print '<td class="liste_titre">&nbsp;</td>';
379  print '<td class="liste_titre right">&nbsp;</td>';
380  // Physical stock
381  print '<td class="liste_titre right">';
382  print '<input class="flat" type="text" size="5" name="search_stock_physique" value="'.dol_escape_htmltag($search_stock_physique).'">';
383  print '</td>';
384  if ($virtualdiffersfromphysical) {
385  print '<td class="liste_titre">&nbsp;</td>';
386  }
387  print '<td class="liste_titre">&nbsp;</td>';
388  print '<td class="liste_titre" colspan="'.$colspan_warehouse.'">&nbsp;</td>';
389  print '<td class="liste_titre"></td>';
390  $parameters = array();
391  $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
392  print $hookmanager->resPrint;
393  print '<td class="liste_titre maxwidthsearch">';
394  $searchpicto = $form->showFilterAndCheckAddButtons(0);
395  print $searchpicto;
396  print '</td>';
397  print '</tr>';
398 
399  //Line for column titles
400  print "<tr class=\"liste_titre\">";
401  print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder);
402  print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", '', $param, "", $sortfield, $sortorder);
403  if (!empty($conf->service->enabled) && $type == 1) {
404  print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration", '', $param, "", $sortfield, $sortorder, 'center ');
405  }
406  print_liste_field_titre("StockLimit", $_SERVER["PHP_SELF"], "p.seuil_stock_alerte", '', $param, "", $sortfield, $sortorder, 'right ');
407  print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock", '', $param, "", $sortfield, $sortorder, 'right ');
408  print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", '', $param, "", $sortfield, $sortorder, 'right ');
409  // Details per warehouse
410  if (!empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) { // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context)
411  if ($nb_warehouse > 1) {
412  foreach ($warehouses_list as &$wh) {
413  print_liste_field_titre($wh['label'], '', '', '', '', '', '', '', 'right ');
414  }
415  }
416  }
417  if ($virtualdiffersfromphysical) {
418  print_liste_field_titre("VirtualStock", $_SERVER["PHP_SELF"], "", '', $param, "", $sortfield, $sortorder, 'right ', 'VirtualStockDesc');
419  }
420  // Units
421  if (!empty($conf->global->PRODUCT_USE_UNITS)) {
422  print_liste_field_titre("Unit", $_SERVER["PHP_SELF"], "unit_short", '', $param, 'align="right"', $sortfield, $sortorder);
423  }
425  print_liste_field_titre("ProductStatusOnSell", $_SERVER["PHP_SELF"], "p.tosell", '', $param, "", $sortfield, $sortorder, 'right ');
426  print_liste_field_titre("ProductStatusOnBuy", $_SERVER["PHP_SELF"], "p.tobuy", '', $param, "", $sortfield, $sortorder, 'right ');
427  // Hook fields
428  $parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
429  $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
430  print $hookmanager->resPrint;
432  print "</tr>\n";
433 
434  while ($i < min($num, $limit)) {
435  $objp = $db->fetch_object($resql);
436 
437  $product = new Product($db);
438  $product->fetch($objp->rowid);
439  $product->load_stock();
440 
441  print '<tr>';
442  print '<td class="nowrap">';
443  print $product->getNomUrl(1, '', 16);
444  //if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow"));
445  print '</td>';
446  print '<td>'.$product->label.'</td>';
447 
448  if (!empty($conf->service->enabled) && $type == 1) {
449  print '<td class="center">';
450  if (preg_match('/([0-9]+)y/i', $objp->duration, $regs)) {
451  print $regs[1].' '.$langs->trans("DurationYear");
452  } elseif (preg_match('/([0-9]+)m/i', $objp->duration, $regs)) {
453  print $regs[1].' '.$langs->trans("DurationMonth");
454  } elseif (preg_match('/([0-9]+)d/i', $objp->duration, $regs)) {
455  print $regs[1].' '.$langs->trans("DurationDay");
456  } else {
457  print $objp->duration;
458  }
459  print '</td>';
460  }
461  //print '<td class="right">'.$objp->stock_theorique.'</td>';
462  print '<td class="right">'.$objp->seuil_stock_alerte.'</td>';
463  print '<td class="right">'.$objp->desiredstock.'</td>';
464  // Real stock
465  print '<td class="right">';
466  if ($objp->seuil_stock_alerte != '' && ($objp->stock_physique < $objp->seuil_stock_alerte)) {
467  print img_warning($langs->trans("StockTooLow")).' ';
468  }
469  print price2num($objp->stock_physique, 'MS');
470  print '</td>';
471 
472  // Details per warehouse
473  if (!empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) { // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context)
474  if ($nb_warehouse > 1) {
475  foreach ($warehouses_list as &$wh) {
476  print '<td class="right">';
477  print empty($product->stock_warehouse[$wh['id']]->real) ? '0' : $product->stock_warehouse[$wh['id']]->real;
478  print '</td>';
479  }
480  }
481  }
482 
483  // Virtual stock
484  if ($virtualdiffersfromphysical) {
485  print '<td class="right">';
486  if ($objp->seuil_stock_alerte != '' && ($product->stock_theorique < $objp->seuil_stock_alerte)) {
487  print img_warning($langs->trans("StockTooLow")).' ';
488  }
489  print price2num($product->stock_theorique, 'MS');
490  print '</td>';
491  }
492  // Units
493  if (!empty($conf->global->PRODUCT_USE_UNITS)) {
494  print '<td class="left">'.$objp->unit_short.'</td>';
495  }
496  print '<td class="center">';
497  print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
498  print '<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?idproduct='.$product->id.'">'.$langs->trans("Movements").'</a>';
499  print '</td>';
500  print '<td class="right nowrap">'.$product->LibStatut($objp->statut, 5, 0).'</td>';
501  print '<td class="right nowrap">'.$product->LibStatut($objp->tobuy, 5, 1).'</td>';
502  // Fields from hook
503  $parameters = array('obj'=>$objp);
504  $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $product); // Note that $action and $object may have been modified by hook
505  print $hookmanager->resPrint;
506  print '<td></td>';
507  print "</tr>\n";
508  $i++;
509  }
510 
511  print "</table>";
512  print '</div>';
513 
514  print '</form>';
515 
516  $db->free($resql);
517 } else {
518  dol_print_error($db);
519 }
520 
521 // End of page
522 llxFooter();
523 $db->close();
restrictedArea
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
Definition: security.lib.php:234
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
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
FormOther
Classe permettant la generation de composants html autre Only common components are here.
Definition: html.formother.class.php:39
Categorie
Class to manage categories.
Definition: categorie.class.php:47
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5661
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:3880
getEntity
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
Definition: functions.lib.php:148
print_barre_liste
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
Definition: functions.lib.php:5257
Canvas
Class to manage canvas.
Definition: canvas.class.php:29
dol_strlen
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
Definition: functions.lib.php:3747
FormProduct
Class with static methods for building HTML components related to products Only components common to ...
Definition: html.formproduct.class.php:30
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
print_liste_field_titre
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
Definition: functions.lib.php:5026
natural_search
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
Definition: functions.lib.php:9420
Product
Class to manage products or services.
Definition: product.class.php:46
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
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