29 require
'../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
36 require_once
'./lib/replenishment.lib.php';
39 $langs->loadLangs(array(
'products',
'stocks',
'orders'));
43 $socid = $user->socid;
48 $hookmanager->initHooks(array(
'stockatdate'));
52 $action =
GETPOST(
'action',
'aZ09');
54 $mode =
GETPOST(
'mode',
'alpha');
63 $search_ref =
GETPOST(
'search_ref',
'alphanohtml');
64 $search_nom =
GETPOST(
'search_nom',
'alphanohtml');
68 $productid =
GETPOST(
'productid',
'int');
69 $fk_warehouse =
GETPOST(
'fk_warehouse',
'int');
71 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
72 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
74 if (empty($page) || $page == -1) {
77 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
78 $offset = $limit * $page;
86 $parameters = array();
87 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
93 if ($mode ==
'future') {
94 if ($date && $date < $now) {
99 if ($date && $date > $now) {
100 setEventMessages($langs->trans(
"ErrorDateMustBeBeforeToday"), null,
'errors');
101 $dateIsValid =
false;
110 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
118 $warehouseStatus = array();
119 if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
126 $stock_prod_warehouse = array();
127 $stock_prod = array();
128 if ($date && $dateIsValid) {
129 $sql =
"SELECT ps.fk_product, ps.fk_entrepot as fk_warehouse,";
130 $sql .=
" SUM(ps.reel) AS stock";
131 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product_stock as ps";
132 $sql .=
", ".MAIN_DB_PREFIX.
"entrepot as w";
133 $sql .=
" WHERE w.entity IN (".getEntity(
'stock').
")";
134 $sql .=
" AND w.rowid = ps.fk_entrepot";
135 if (!empty($conf->global->ENTREPOT_EXTRA_STATUS) && count($warehouseStatus)) {
136 $sql .=
" AND w.statut IN (".$db->sanitize(implode(
',', $warehouseStatus)).
")";
138 if ($productid > 0) {
139 $sql .=
" AND ps.fk_product = ".((int) $productid);
141 if ($fk_warehouse > 0) {
142 $sql .=
" AND ps.fk_entrepot = ".((int) $fk_warehouse);
144 $sql .=
" GROUP BY fk_product, fk_entrepot";
147 $resql = $db->query($sql);
149 $num = $db->num_rows(
$resql);
153 $obj = $db->fetch_object(
$resql);
155 $tmp_fk_product = $obj->fk_product;
156 $tmp_fk_warehouse = $obj->fk_warehouse;
157 $stock = $obj->stock;
159 $stock_prod_warehouse[$tmp_fk_product][$tmp_fk_warehouse] = $stock;
160 $stock_prod[$tmp_fk_product] = (isset($stock_prod[$tmp_fk_product]) ? $stock_prod[$tmp_fk_product] : 0) + $stock;
170 } elseif ($action ==
'filter') {
171 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Date")), null,
'errors');
175 $movements_prod_warehouse = array();
176 $movements_prod = array();
177 $movements_prod_warehouse_nb = array();
178 $movements_prod_nb = array();
179 if ($date && $dateIsValid) {
180 $sql =
"SELECT sm.fk_product, sm.fk_entrepot, SUM(sm.value) AS stock, COUNT(sm.rowid) AS nbofmovement";
181 $sql .=
" FROM ".MAIN_DB_PREFIX.
"stock_mouvement as sm";
182 $sql .=
", ".MAIN_DB_PREFIX.
"entrepot as w";
183 $sql .=
" WHERE w.entity IN (".getEntity(
'stock').
")";
184 $sql .=
" AND w.rowid = sm.fk_entrepot";
185 if (!empty($conf->global->ENTREPOT_EXTRA_STATUS) && count($warehouseStatus)) {
186 $sql .=
" AND w.statut IN (".$db->sanitize(implode(
',', $warehouseStatus)).
")";
188 if ($mode ==
'future') {
189 $sql .=
" AND sm.datem <= '".$db->idate($dateendofday).
"'";
191 $sql .=
" AND sm.datem >= '".$db->idate($dateendofday).
"'";
193 if ($productid > 0) {
194 $sql .=
" AND sm.fk_product = ".((int) $productid);
196 if ($fk_warehouse > 0) {
197 $sql .=
" AND sm.fk_entrepot = ".((int) $fk_warehouse);
199 $sql .=
" GROUP BY sm.fk_product, sm.fk_entrepot";
200 $resql = $db->query($sql);
203 $num = $db->num_rows(
$resql);
207 $obj = $db->fetch_object(
$resql);
208 $fk_product = $obj->fk_product;
209 $fk_entrepot = $obj->fk_entrepot;
210 $stock = $obj->stock;
211 $nbofmovement = $obj->nbofmovement;
214 $movements_prod_warehouse[$fk_product][$fk_entrepot] = $stock;
215 $movements_prod_warehouse_nb[$fk_product][$fk_entrepot] = $nbofmovement;
218 $movements_prod[$fk_product] += $stock;
219 $movements_prod_nb[$fk_product] += $nbofmovement;
243 $title = $langs->trans(
'StockAtDate');
245 $sql =
'SELECT p.rowid, p.ref, p.label, p.description, p.price,';
246 $sql .=
' p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,';
247 $sql .=
' p.tms as datem, p.duration, p.tobuy, p.stock, ';
248 if ($fk_warehouse > 0) {
249 $sql .=
" SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue";
250 $sql .=
', SUM(ps.reel) as stock_reel';
252 $sql .=
" SUM(p.pmp * p.stock) as estimatedvalue, SUM(p.price * p.stock) as sellvalue";
255 $parameters = array();
256 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
257 $sql .= $hookmanager->resPrint;
259 $sql .=
' FROM '.MAIN_DB_PREFIX.
'product as p';
260 if ($fk_warehouse > 0) {
261 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '.((int) $fk_warehouse);
264 $parameters = array();
265 $reshook = $hookmanager->executeHooks(
'printFieldListJoin', $parameters);
266 $sql .= $hookmanager->resPrint;
267 $sql .=
' WHERE p.entity IN ('.getEntity(
'product').
')';
268 if ($productid > 0) {
269 $sql .=
" AND p.rowid = ".((int) $productid);
271 if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
272 $sql .=
" AND p.fk_product_type = 0";
274 if (!empty($canvas)) {
275 $sql .=
" AND p.canvas = '".$db->escape($canvas).
"'";
277 if ($fk_warehouse > 0) {
278 $sql .=
' GROUP BY p.rowid, p.ref, p.label, p.description, p.price, p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,';
279 $sql .=
' p.tms, p.duration, p.tobuy, p.stock';
281 $sql .=
' GROUP BY p.rowid, p.ref, p.label, p.description, p.price, p.price_ttc, p.price_base_type, p.fk_product_type, p.desiredstock, p.seuil_stock_alerte,';
282 $sql .=
' p.tms, p.duration, p.tobuy, p.stock';
285 $parameters = array();
286 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
287 $sql .= $hookmanager->resPrint;
289 if ($sortfield ==
'stock_reel' && $fk_warehouse <= 0) {
290 $sortfield =
'stock';
292 if ($sortfield ==
'stock' && $fk_warehouse > 0) {
293 $sortfield =
'stock_reel';
295 $sql .= $db->order($sortfield, $sortorder);
297 $nbtotalofrecords = 0;
298 if ($date && $dateIsValid) {
299 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
300 $result = $db->query($sql);
301 $nbtotalofrecords = $db->num_rows($result);
302 if (($page * $limit) > $nbtotalofrecords) {
308 $sql .= $db->plimit($limit + 1, $offset);
311 $resql = $db->query($sql);
317 $num = $db->num_rows(
$resql);
323 $helpurl =
'EN:Module_Stocks_En|FR:Module_Stock|';
324 $helpurl .=
'ES:Módulo_Stocks';
330 $head[0][0] = DOL_URL_ROOT.
'/product/stock/stockatdate.php';
331 $head[0][1] = $langs->trans(
"StockAtDateInPast");
332 $head[0][2] =
'stockatdatepast';
334 $head[1][0] = DOL_URL_ROOT.
'/product/stock/stockatdate.php?mode=future';
335 $head[1][1] = $langs->trans(
"StockAtDateInFuture");
336 $head[1][2] =
'stockatdatefuture';
341 print
dol_get_fiche_head($head, ($mode ==
'future' ?
'stockatdatefuture' :
'stockatdatepast'),
'', -1,
'');
343 $desc = $langs->trans(
"StockAtDatePastDesc");
344 if ($mode ==
'future') {
345 $desc = $langs->trans(
"StockAtDateFutureDesc");
347 print
'<span class="opacitymedium">'.$desc.
'</span><br>'.
"\n";
350 print
'<form name="formFilterWarehouse" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
351 print
'<input type="hidden" name="token" value="'.newToken().
'">';
352 print
'<input type="hidden" name="action" value="filter">';
353 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
355 print
'<div class="inline-block valignmiddle" style="padding-right: 20px;">';
356 print
'<span class="fieldrequired">'.$langs->trans(
'Date').
'</span> '.
$form->selectDate(($date ? $date : -1),
'date');
358 print
' <span class="clearbothonsmartphone marginleftonly paddingleftonly marginrightonly paddingrightonly"> </span> ';
359 print
img_picto(
'',
'product',
'class="pictofiwedwidth"').
' ';
361 print
$form->select_produits($productid,
'productid',
'', 0, 0, -1, 2,
'', 0, array(), 0, $langs->trans(
'Product'), 0,
'maxwidth300', 0,
'', null, 1);
363 print
' <span class="clearbothonsmartphone marginleftonly paddingleftonly marginrightonly paddingrightonly"> </span> ';
364 print
img_picto(
'',
'stock',
'class="pictofiwedwidth"');
366 print $formproduct->selectWarehouses((
GETPOSTISSET(
'fk_warehouse') ? $fk_warehouse :
'ifonenodefault'),
'fk_warehouse',
'', 1, 0, 0, $langs->trans(
'Warehouse'), 0, 0, null,
'', null, 1,
false,
'e.ref');
369 $parameters = array();
370 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
371 if (empty($reshook)) {
372 print $hookmanager->resPrint;
375 print
'<div class="inline-block valignmiddle">';
376 print
'<input type="submit" class="button" name="valid" value="'.$langs->trans(
'Refresh').
'">';
382 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
383 $param .=
'&contextpage='.urlencode($contextpage);
385 if ($limit > 0 && $limit != $conf->liste_limit) {
386 $param .=
'&limit='.urlencode($limit);
388 $param .=
'&mode='.$mode;
389 if ($fk_warehouse > 0) {
390 $param .=
'&fk_warehouse='.$fk_warehouse;
392 if ($productid > 0) {
393 $param .=
'&productid='.$productid;
395 if (
GETPOST(
'dateday',
'int') > 0) {
396 $param .=
'&dateday='.GETPOST(
'dateday',
'int');
398 if (
GETPOST(
'datemonth',
'int') > 0) {
399 $param .=
'&datemonth='.GETPOST(
'datemonth',
'int');
401 if (
GETPOST(
'dateyear',
'int') > 0) {
402 $param .=
'&dateyear='.GETPOST(
'dateyear',
'int');
406 print_barre_liste(
'', $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'stock', 0,
'',
'', $limit, 0, 0, 1);
408 print
'<div class="div-table-responsive">';
409 print
'<table class="liste centpercent">';
411 $stocklabel = $langs->trans(
'StockAtDate');
412 if ($mode ==
'future') {
413 $stocklabel = $langs->trans(
"VirtualStockAtDate");
417 print
'<input type="hidden" name="token" value="'.newToken().
'">';
418 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
419 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
420 print
'<input type="hidden" name="type" value="'.$type.
'">';
421 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
424 print
'<tr class="liste_titre_filter">';
425 print
'<td class="liste_titre"><input class="flat" type="text" name="search_ref" size="8" value="'.dol_escape_htmltag($search_ref).
'"></td>';
426 print
'<td class="liste_titre"><input class="flat" type="text" name="search_nom" size="8" value="'.dol_escape_htmltag($search_nom).
'"></td>';
427 print
'<td class="liste_titre"></td>';
428 print
'<td class="liste_titre"></td>';
429 print
'<td class="liste_titre"></td>';
430 if ($mode ==
'future') {
431 print
'<td class="liste_titre"></td>';
433 print
'<td class="liste_titre"></td>';
434 print
'<td class="liste_titre"></td>';
437 $parameters = array(
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
438 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
439 print $hookmanager->resPrint;
441 print
'<td class="liste_titre maxwidthsearch">';
442 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
447 $fieldtosortcurrentstock =
'stock';
448 if ($fk_warehouse > 0) {
449 $fieldtosortcurrentstock =
'stock_reel';
453 print
'<tr class="liste_titre">';
457 if ($mode ==
'future') {
458 print_liste_field_titre(
'CurrentStock', $_SERVER[
"PHP_SELF"], $fieldtosortcurrentstock, $param,
'',
'', $sortfield, $sortorder,
'right ');
460 print_liste_field_titre($stocklabel, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'right ',
'VirtualStockAtDateDesc');
461 print_liste_field_titre(
'VirtualStock', $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'right ',
'VirtualStockDesc');
463 print_liste_field_titre($stocklabel, $_SERVER[
"PHP_SELF"],
'', $param,
'',
'', $sortfield, $sortorder,
'right ');
464 print_liste_field_titre(
"EstimatedStockValue", $_SERVER[
"PHP_SELF"],
"estimatedvalue",
'', $param,
'', $sortfield, $sortorder,
'right ', $langs->trans(
"AtDate"), 1);
465 print_liste_field_titre(
"EstimatedStockValueSell", $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'right ', $langs->trans(
"AtDate"), 1);
467 print_liste_field_titre(
'CurrentStock', $_SERVER[
"PHP_SELF"], $fieldtosortcurrentstock, $param,
'',
'', $sortfield, $sortorder,
'right ');
472 $parameters = array(
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
473 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
474 print $hookmanager->resPrint;
478 $totalbuyingprice = 0;
479 $totalcurrentstock = 0;
480 $totalvirtualstock = 0;
483 while ($i < ($limit ? min($num, $limit) : $num)) {
484 $objp = $db->fetch_object(
$resql);
486 if (!empty($conf->global->STOCK_SUPPORTS_SERVICES) || $objp->fk_product_type == 0) {
487 $prod->fetch($objp->rowid);
508 if ($fk_warehouse > 0) {
510 $currentstock = $stock_prod_warehouse[$objp->rowid][$fk_warehouse];
516 $currentstock = $stock_prod[$objp->rowid];
522 if ($mode ==
'future') {
523 $prod->load_stock(
'warehouseopen, warehouseinternal', 0);
529 $stock =
'<span class="opacitymedium">'.$langs->trans(
"FeatureNotYetAvailable").
'</span>';
530 $virtualstock = $prod->stock_theorique;
532 if ($fk_warehouse > 0) {
533 $stock = $currentstock - $movements_prod_warehouse[$objp->rowid][$fk_warehouse];
534 $nbofmovement = $movements_prod_warehouse_nb[$objp->rowid][$fk_warehouse];
536 $stock = $currentstock - $movements_prod[$objp->rowid];
537 $nbofmovement = $movements_prod_nb[$objp->rowid];
542 print
'<tr class="oddeven">';
545 print
'<td class="nowrap">'.$prod->getNomUrl(1,
'').
'</td>';
548 print
'<td>'.$objp->label;
549 print
'<input type="hidden" name="desc'.$i.
'" value="'.
dol_escape_htmltag($objp->description).
'">';
552 if ($mode ==
'future') {
554 print
'<td class="right">'.$currentstock.
'</td>';
555 $totalcurrentstock += $currentstock;
557 print
'<td class="right"></td>';
560 print
'<td class="right">'.$stock.
'</td>';
563 print
'<td class="right">'.$virtualstock.
'</td>';
564 $totalvirtualstock += $virtualstock;
567 print
'<td class="right">'.($stock ? $stock :
'<span class="opacitymedium">'.$stock.
'</span>').
'</td>';
570 print
'<td class="right">';
571 if (
price2num($objp->estimatedvalue,
'MT')) {
572 print
'<span class="amount">'.price(
price2num($objp->estimatedvalue,
'MT'), 1).
'</span>';
576 $totalbuyingprice += $objp->estimatedvalue;
580 print
'<td class="right">';
581 if (empty($conf->global->PRODUIT_MULTIPRICES)) {
584 $htmltext = $langs->trans(
"OptionMULTIPRICESIsOn");
585 print
$form->textwithtooltip(
'<span class="opacitymedium">'.$langs->trans(
"Variable").
'</span>', $htmltext);
589 print
'<td class="right">';
590 if ($nbofmovement > 0) {
591 print
'<a href="'.DOL_URL_ROOT.
'/product/stock/movement_list.php?idproduct='.$objp->rowid.($fk_warehouse > 0 ?
'&search_warehouse='.$fk_warehouse :
'').
'">'.$langs->trans(
"Movements").
'</a>';
592 print
' <span class="tabs"><span class="badge">'.$nbofmovement.
'</span></span>';
597 print
'<td class="right">'.($currentstock ? $currentstock :
'<span class="opacitymedium">0</span>').
'</td>';
598 $totalcurrentstock += $currentstock;
602 print
'<td class="right"></td>';
605 $parameters = array(
'objp'=>$objp);
606 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
607 print $hookmanager->resPrint;
614 $parameters = array(
'sql'=>$sql);
615 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
616 print $hookmanager->resPrint;
619 if ($mode ==
'future') {
624 if (empty($date) || !$dateIsValid) {
625 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"EnterADateCriteria").
'</span></td></tr>';
627 print
'<tr class="liste_total">';
628 print
'<td>'.$langs->trans(
"Totalforthispage").
'</td>';
630 if ($mode ==
'future') {
631 print
'<td class="right">'.price(
price2num($totalcurrentstock,
'MS')).
'</td>';
634 print
'<td class="right">'.price(
price2num($totalvirtualstock,
'MS')).
'</td>';
637 print
'<td class="right">'.price(
price2num($totalbuyingprice,
'MT')).
'</td>';
640 print
'<td class="right">'.($productid > 0 ?
price(
price2num($totalcurrentstock,
'MS')) :
'').
'</td>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
const STATUS_OPEN_ALL
Warehouse open and operations for customer shipping, supplier dispatch, internal stock transfers/corr...
Class to manage products or services.
dol_now($mode= 'auto')
Return date for now.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
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...
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
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.
const STATUS_OPEN_INTERNAL
Warehouse open and operations for stock transfers/corrections allowed (not for customer shipping and ...
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
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.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.