35require
'../../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.product.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productstockentrepot.class.php';
43if (isModEnabled(
'productbatch')) {
44 require_once DOL_DOCUMENT_ROOT.
'/product/class/productbatch.class.php';
46if (isModEnabled(
'project')) {
47 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
48 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
51if (isModEnabled(
'variants')) {
52 require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductAttribute.class.php';
53 require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductAttributeValue.class.php';
54 require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductCombination.class.php';
55 require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductCombination2ValuePair.class.php';
59$langs->loadlangs(array(
'products',
'suppliers',
'orders',
'bills',
'stocks',
'sendings',
'margins'));
60if (isModEnabled(
'productbatch')) {
61 $langs->load(
"productbatch");
64$backtopage =
GETPOST(
'backtopage',
'alpha');
65$action =
GETPOST(
'action',
'aZ09');
66$cancel =
GETPOST(
'cancel',
'alpha');
70$stocklimit =
GETPOST(
'seuil_stock_alerte');
71$desiredstock =
GETPOST(
'desiredstock');
72$cancel =
GETPOST(
'cancel',
'alpha');
73$fieldid = isset($_GET[
"ref"]) ?
'ref' :
'rowid';
76$pdluoid =
GETPOST(
'pdluoid',
'int');
77$batchnumber =
GETPOST(
'batch_number',
'san_alpha');
78if (!empty($batchnumber)) {
79 $batchnumber = trim($batchnumber);
81$cost_price =
GETPOST(
'cost_price',
'alpha');
85 $socid = $user->socid;
92$extrafields->fetch_name_optionals_label($object->table_element);
94if ($id > 0 || !empty($ref)) {
95 $result = $object->fetch($id, $ref);
98if (empty($id) && !empty($object->id)) {
102$modulepart =
'product';
105$canvas = !empty($object->canvas) ? $object->canvas :
GETPOST(
"canvas");
107if (!empty($canvas)) {
108 require_once DOL_DOCUMENT_ROOT.
'/core/class/canvas.class.php';
109 $objcanvas =
new Canvas($db, $action);
110 $objcanvas->getCanvas(
'stockproduct',
'card', $canvas);
114$hookmanager->initHooks(array(
'stockproductcard',
'globalcard'));
120$usercancreadprice =
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') ? $user->hasRight(
'product',
'product_advance',
'read_prices') : $user->hasRight(
'product',
'lire');
122if ($object->isService()) {
123 $label = $langs->trans(
'Service');
124 $usercancreadprice =
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') ? $user->hasRight(
'service',
'service_advance',
'read_prices') : $user->hasRight(
'service',
'lire');
127if ($object->id > 0) {
128 if ($object->type == $object::TYPE_PRODUCT) {
129 restrictedArea($user,
'produit', $object->id,
'product&product',
'',
'');
131 if ($object->type == $object::TYPE_SERVICE) {
132 restrictedArea($user,
'service', $object->id,
'product&product',
'',
'');
135 restrictedArea($user,
'produit|service', $id,
'product&product',
'',
'', $fieldid);
147$parameters = array(
'id'=>$id,
'ref'=>$ref,
'objcanvas'=>$objcanvas);
148$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
153if ($action ==
'setcost_price') {
155 $result = $object->fetch($id);
156 $object->cost_price =
price2num($cost_price);
157 $result = $object->update($object->id, $user);
168if ($action ==
'addlimitstockwarehouse' && $user->hasRight(
'produit',
'creer')) {
169 $seuil_stock_alerte =
GETPOST(
'seuil_stock_alerte');
170 $desiredstock =
GETPOST(
'desiredstock');
173 if ($seuil_stock_alerte ==
'') {
174 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"StockLimit")),
null,
'errors');
177 if ($desiredstock ==
'') {
178 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DesiredStock")),
null,
'errors');
184 if ($pse->fetch(0, $id,
GETPOST(
'fk_entrepot',
'int')) > 0) {
186 $pse->seuil_stock_alerte = $seuil_stock_alerte;
187 $pse->desiredstock = $desiredstock;
188 if ($pse->update($user) > 0) {
189 setEventMessages($langs->trans(
'ProductStockWarehouseUpdated'),
null,
'mesgs');
193 $pse->fk_entrepot =
GETPOST(
'fk_entrepot',
'int');
194 $pse->fk_product = $id;
195 $pse->seuil_stock_alerte =
GETPOST(
'seuil_stock_alerte');
196 $pse->desiredstock =
GETPOST(
'desiredstock');
197 if ($pse->create($user) > 0) {
198 setEventMessages($langs->trans(
'ProductStockWarehouseCreated'),
null,
'mesgs');
203 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$id);
207if ($action ==
'delete_productstockwarehouse' && $user->hasRight(
'produit',
'creer')) {
210 $pse->fetch(
GETPOST(
'fk_productstockwarehouse',
'int'));
211 if ($pse->delete($user) > 0) {
212 setEventMessages($langs->trans(
'ProductStockWarehouseDeleted'),
null,
'mesgs');
219if ($action ==
'setseuil_stock_alerte' && $user->hasRight(
'produit',
'creer')) {
221 $result = $object->fetch($id);
222 $object->seuil_stock_alerte = $stocklimit;
223 $result = $object->update($object->id, $user, 0,
'update');
233if ($action ==
'setdesiredstock' && $user->hasRight(
'produit',
'creer')) {
235 $result = $object->fetch($id);
236 $object->desiredstock = $desiredstock;
237 $result = $object->update($object->id, $user, 0,
'update');
246if ($action ==
"correct_stock" && !$cancel) {
247 if (!(
GETPOST(
"id_entrepot",
'int') > 0)) {
248 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Warehouse")),
null,
'errors');
250 $action =
'correction';
253 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"NumberOfUnit")),
null,
'errors');
255 $action =
'correction';
258 if (isModEnabled(
'productbatch')) {
260 $result = $object->fetch($id);
262 if ($object->hasbatch() && !$batchnumber) {
263 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"batch_number")),
null,
'errors');
265 $action =
'correction';
272 if (is_numeric($nbpiece) && $nbpiece != 0 && $id) {
273 $origin_element =
'';
276 if (
GETPOST(
'projectid',
'int')) {
277 $origin_element =
'project';
278 $origin_id =
GETPOST(
'projectid',
'int');
281 if (empty($object)) {
283 $result = $object->fetch($id);
286 $disablestockchangeforsubproduct = 0;
287 if (
GETPOST(
'disablesubproductstockchange')) {
288 $disablestockchangeforsubproduct = 1;
291 if ($object->hasbatch()) {
292 $result = $object->correct_stock_batch(
297 GETPOST(
"label",
'alphanohtml'),
302 GETPOST(
'inventorycode',
'alphanohtml'),
305 $disablestockchangeforsubproduct
308 $result = $object->correct_stock(
313 GETPOST(
"label",
'alphanohtml'),
315 GETPOST(
'inventorycode',
'alphanohtml'),
318 $disablestockchangeforsubproduct
324 header(
"Location: ".$backtopage);
327 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?id=".$object->id);
332 $action =
'correction';
339if ($action ==
"transfert_stock" && !$cancel) {
340 if (!(
GETPOST(
"id_entrepot",
'int') > 0) || !(
GETPOST(
"id_entrepot_destination",
'int') > 0)) {
341 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Warehouse")),
null,
'errors');
343 $action =
'transfert';
345 if (!
GETPOST(
"nbpiece",
'int')) {
346 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"NumberOfUnit")),
null,
'errors');
348 $action =
'transfert';
350 if (
GETPOST(
"id_entrepot",
'int') ==
GETPOST(
"id_entrepot_destination",
'int')) {
351 setEventMessages($langs->trans(
"ErrorSrcAndTargetWarehouseMustDiffers"),
null,
'errors');
353 $action =
'transfert';
355 if (isModEnabled(
'productbatch')) {
357 $result = $object->fetch($id);
359 if ($object->hasbatch() && !$batchnumber) {
360 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"batch_number")),
null,
'errors');
362 $action =
'transfert';
369 $result = $object->fetch($id);
373 $object->load_stock(
'novirtual');
377 if (isset($object->pmp)) {
378 $pricesrc = $object->pmp;
380 $pricedest = $pricesrc;
384 if ($object->hasbatch()) {
388 $result = $pdluo->fetch($pdluoid);
390 $srcwarehouseid = $pdluo->warehouseid;
391 $batch = $pdluo->batch;
392 $eatby = $pdluo->eatby;
393 $sellby = $pdluo->sellby;
399 $srcwarehouseid =
GETPOST(
'id_entrepot',
'int');
400 $batch = $batchnumber;
409 $result1 = $object->correct_stock_batch(
414 GETPOST(
"label",
'alphanohtml'),
419 GETPOST(
'inventorycode',
'alphanohtml')
427 $result2 = $object->correct_stock_batch(
429 GETPOST(
"id_entrepot_destination",
'int'),
432 GETPOST(
"label",
'alphanohtml'),
437 GETPOST(
'inventorycode',
'alphanohtml')
446 $result1 = $object->correct_stock(
451 GETPOST(
"label",
'alphanohtml'),
453 GETPOST(
'inventorycode',
'alphanohtml')
461 $result2 = $object->correct_stock(
463 GETPOST(
"id_entrepot_destination",
'int'),
466 GETPOST(
"label",
'alphanohtml'),
468 GETPOST(
'inventorycode',
'alphanohtml')
477 if (!$error && $result1 >= 0 && $result2 >= 0) {
481 header(
"Location: ".$backtopage);
484 header(
"Location: product.php?id=".$object->id);
490 $action =
'transfert';
497if ($action ==
'updateline' &&
GETPOST(
'save') == $langs->trans(
"Save")) {
499 $result = $pdluo->fetch(
GETPOST(
'pdluoid',
'int'));
503 if ((!
GETPOST(
"sellby")) && (!
GETPOST(
"eatby")) && (!$batchnumber)) {
504 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"atleast1batchfield")),
null,
'errors');
508 $pdluo->batch = $batchnumber;
509 $pdluo->eatby = $d_eatby;
510 $pdluo->sellby = $d_sellby;
511 $result = $pdluo->update($user);
517 setEventMessages($langs->trans(
'BatchInformationNotfound'),
null,
'errors');
522 header(
"Location: product.php?id=".$id);
532$form =
new Form($db);
534if (isModEnabled(
'project')) {
538if ($id > 0 || $ref) {
540 $result = $object->fetch($id, $ref);
542 $variants = $object->hasVariants();
544 $object->load_stock();
546 $title = $langs->trans(
'ProductServiceCard');
548 $shortlabel =
dol_trunc($object->label, 16);
550 $title = $langs->trans(
'Product').
" ".$shortlabel.
" - ".$langs->trans(
'Stock');
551 $helpurl =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
554 $title = $langs->trans(
'Service').
" ".$shortlabel.
" - ".$langs->trans(
'Stock');
555 $helpurl =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
560 if (!empty($conf->use_javascript_ajax)) {
562 <script
type=
"text/javascript">
563 $(document).ready(
function() {
564 $(
".collapse_batch").click(
function() {
565 console.log(
"We click on collapse_batch");
566 var id_entrepot = $(
this).attr(
'id').replace(
'ent',
'');
568 if($(
this).text().indexOf(
'+') > 0) {
569 $(
".batch_warehouse" + id_entrepot).show();
571 jQuery(
"#show_all").hide();
572 jQuery(
"#hide_all").show();
575 $(
".batch_warehouse" + id_entrepot).hide();
582 $(
"#show_all").click(
function() {
583 console.log(
"We click on show_all");
584 $(
"[class^=batch_warehouse]").show();
585 $(
"[class^=collapse_batch]").html(
'(-)');
586 jQuery(
"#show_all").hide();
587 jQuery(
"#hide_all").show();
591 $(
"#hide_all").click(
function() {
592 console.log(
"We click on hide_all");
593 $(
"[class^=batch_warehouse]").hide();
594 $(
"[class^=collapse_batch]").html(
'(+)');
595 jQuery(
"#hide_all").hide();
596 jQuery(
"#show_all").show();
607 $titre = $langs->trans(
"CardProduct".$object->type);
614 $linkback =
'<a href="'.DOL_URL_ROOT.
'/product/list.php?restore_lastsearch_values=1&type='.$object->type.
'">'.$langs->trans(
"BackToList").
'</a>';
617 if ($user->socid && !in_array(
'stock', explode(
',',
getDolGlobalString(
'MAIN_MODULES_FOR_EXTERNAL')))) {
624 print
'<div class="fichecenter">';
626 print
'<div class="fichehalfleft">';
627 print
'<div class="underbanner clearboth"></div>';
629 print
'<table class="border tableforfield centpercent">';
632 if (isModEnabled(
"product") && isModEnabled(
"service")) {
633 $typeformat =
'select;0:'.$langs->trans(
"Product").
',1:'.$langs->trans(
"Service");
634 print
'<tr><td class="">';
635 print (!
getDolGlobalString(
'PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey(
"Type",
'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans(
'Type');
637 print $form->editfieldval(
"Type",
'fk_product_type', $object->type, $object, 0, $typeformat);
641 if (isModEnabled(
'productbatch')) {
642 print
'<tr><td class="">'.$langs->trans(
"ManageLotSerial").
'</td><td>';
643 print $object->getLibStatut(0, 2);
649 $textdesc = $langs->trans(
"CostPriceDescription");
650 $textdesc .=
"<br>".$langs->trans(
"CostPriceUsage");
651 $text = $form->textwithpicto($langs->trans(
"CostPrice"), $textdesc, 1,
'help',
'');
652 if (!$usercancreadprice) {
653 print $form->editfieldkey($text,
'cost_price',
'', $object, 0,
'amount:6');
655 print $form->editfieldval($text,
'cost_price',
'', $object, 0,
'amount:6');
657 print $form->editfieldkey($text,
'cost_price', $object->cost_price, $object, $usercancreate,
'amount:6');
659 print $form->editfieldval($text,
'cost_price', $object->cost_price, $object, $usercancreate,
'amount:6');
666 print
'<tr><td class="titlefield">';
667 print $form->textwithpicto($langs->trans(
"AverageUnitPricePMPShort"), $langs->trans(
"AverageUnitPricePMPDesc"));
670 if ($object->pmp > 0 && $usercancreadprice) {
671 print
price($object->pmp).
' '.$langs->trans(
"HT");
677 print
'<tr><td>'.$langs->trans(
"BuyingPriceMin").
'</td>';
680 if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) {
681 if ($product_fourn->product_fourn_price_id > 0 && $usercancreadprice) {
682 print $product_fourn->display_price_product_fournisseur();
684 print $langs->trans(
"NotDefined");
691 print
'<tr><td>'.$langs->trans(
"SellingPrice").
'</td><td>';
692 if ($usercancreadprice) {
693 if ($object->price_base_type ==
'TTC') {
694 print
price($object->price_ttc).
' '.$langs->trans($object->price_base_type);
696 print
price($object->price).
' '.$langs->trans($object->price_base_type);
702 print
'<tr><td>'.$langs->trans(
"MinPrice").
'</td><td>';
703 if ($usercancreadprice) {
704 if ($object->price_base_type ==
'TTC') {
705 print
price($object->price_min_ttc).
' '.$langs->trans($object->price_base_type);
707 print
price($object->price_min).
' '.$langs->trans($object->price_base_type);
713 print
'<tr><td>'.$langs->trans(
"SellingPrice").
'</td><td>';
714 print
'<span class="opacitymedium">'.$langs->trans(
"Variable").
'</span>';
718 print
'<tr><td>'.$langs->trans(
"MinPrice").
'</td><td>';
719 print
'<span class="opacitymedium">'.$langs->trans(
"Variable").
'</span>';
724 $parameters = array();
725 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
726 print $hookmanager->resPrint;
731 print
'<div class="fichehalfright"><div class="underbanner clearboth"></div>';
733 print
'<table class="border tableforfield centpercent">';
736 print
'<tr><td>'.$form->editfieldkey($form->textwithpicto($langs->trans(
"StockLimit"), $langs->trans(
"StockLimitDesc"), 1),
'seuil_stock_alerte', $object->seuil_stock_alerte, $object, $user->hasRight(
'produit',
'creer')).
'</td><td>';
737 print $form->editfieldval(
"StockLimit",
'seuil_stock_alerte', $object->seuil_stock_alerte, $object, $user->hasRight(
'produit',
'creer'),
'string');
741 print
'<tr><td>'.$form->editfieldkey($form->textwithpicto($langs->trans(
"DesiredStock"), $langs->trans(
"DesiredStockDesc"), 1),
'desiredstock', $object->desiredstock, $object, $user->hasRight(
'produit',
'creer'));
743 print $form->editfieldval(
"DesiredStock",
'desiredstock', $object->desiredstock, $object, $user->hasRight(
'produit',
'creer'),
'string');
747 $text_stock_options = $langs->trans(
"RealStockDesc").
'<br>';
748 $text_stock_options .= $langs->trans(
"RealStockWillAutomaticallyWhen").
'<br>';
749 $text_stock_options .= (
getDolGlobalString(
'STOCK_CALCULATE_ON_SHIPMENT') ||
getDolGlobalString(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE') ?
'- '.$langs->trans(
"DeStockOnShipment").
'<br>' :
'');
750 $text_stock_options .= (
getDolGlobalString(
'STOCK_CALCULATE_ON_VALIDATE_ORDER') ?
'- '.$langs->trans(
"DeStockOnValidateOrder").
'<br>' :
'');
751 $text_stock_options .= (
getDolGlobalString(
'STOCK_CALCULATE_ON_BILL') ?
'- '.$langs->trans(
"DeStockOnBill").
'<br>' :
'');
752 $text_stock_options .= (
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_BILL') ?
'- '.$langs->trans(
"ReStockOnBill").
'<br>' :
'');
753 $text_stock_options .= (
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER') ?
'- '.$langs->trans(
"ReStockOnValidateOrder").
'<br>' :
'');
754 $text_stock_options .= (
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') ?
'- '.$langs->trans(
"ReStockOnDispatchOrder").
'<br>' :
'');
755 $text_stock_options .= (
getDolGlobalString(
'STOCK_CALCULATE_ON_RECEPTION') ||
getDolGlobalString(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE') ?
'- '.$langs->trans(
"StockOnReception").
'<br>' :
'');
756 $parameters = array();
757 $reshook = $hookmanager->executeHooks(
'physicalStockTextStockOptions', $parameters, $object, $action);
759 $text_stock_options = $hookmanager->resPrint;
760 } elseif ($reshook == 0) {
761 $text_stock_options .= $hookmanager->resPrint;
767 print $form->textwithpicto($langs->trans(
"PhysicalStock"), $text_stock_options, 1);
769 print
'<td>'.price2num($object->stock_reel,
'MS');
770 if ($object->seuil_stock_alerte !=
'' && ($object->stock_reel < $object->seuil_stock_alerte)) {
771 print
' '.img_warning($langs->trans(
"StockLowerThanLimit", $object->seuil_stock_alerte));
774 print
' <a href="'.DOL_URL_ROOT.
'/product/stock/stockatdate.php?productid='.$object->id.
'">'.$langs->trans(
"StockAtDate").
'</a>';
778 $stocktheo =
price2num($object->stock_theorique,
'MS');
781 $helpondiff =
'<strong>'.$langs->trans(
"StockDiffPhysicTeoric").
':</strong><br>';
783 if (isModEnabled(
'commande')) {
785 $helpondiff .=
'<br>';
789 $helpondiff .= $langs->trans(
"ProductQtyInCustomersOrdersRunning").
': '.$object->stats_commande[
'qty'];
790 $result = $object->load_stats_commande(0,
'0', 1);
794 $helpondiff .=
' <span class="opacitymedium">('.$langs->trans(
"ProductQtyInDraft").
': '.$object->stats_commande[
'qty'].
')</span>';
798 if (isModEnabled(
"expedition")) {
799 require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
800 $filterShipmentStatus =
'';
807 $helpondiff .=
'<br>';
811 $result = $object->load_stats_sending(0,
'2', 1, $filterShipmentStatus);
812 $helpondiff .= $langs->trans(
"ProductQtyInShipmentAlreadySent").
': '.$object->stats_expedition[
'qty'];
816 if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
818 $helpondiff .=
'<br>';
822 $result = $object->load_stats_commande_fournisseur(0,
'3,4', 1);
823 $helpondiff .= $langs->trans(
"ProductQtyInSuppliersOrdersRunning").
': '.$object->stats_commande_fournisseur[
'qty'];
824 $result = $object->load_stats_commande_fournisseur(0,
'0,1,2', 1);
828 $helpondiff .=
' <span class="opacitymedium">('.$langs->trans(
"ProductQtyInDraftOrWaitingApproved").
': '.$object->stats_commande_fournisseur[
'qty'].
')</span>';
832 if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
834 $helpondiff .=
'<br>';
838 $helpondiff .= $langs->trans(
"ProductQtyInSuppliersShipmentAlreadyRecevied").
': '.$object->stats_reception[
'qty'];
842 if (isModEnabled(
'mrp')) {
844 $helpondiff .=
'<br>';
848 $helpondiff .= $langs->trans(
"ProductQtyToConsumeByMO").
': '.$object->stats_mrptoconsume[
'qty'].
'<br>';
849 $helpondiff .= $langs->trans(
"ProductQtyToProduceByMO").
': '.$object->stats_mrptoproduce[
'qty'];
851 $parameters = array(
'found' => &$found,
'id' => $object->id,
'includedraftpoforvirtual' =>
null);
852 $reshook = $hookmanager->executeHooks(
'virtualStockHelpOnDiff', $parameters, $object, $action);
854 $helpondiff = $hookmanager->resPrint;
855 } elseif ($reshook == 0) {
856 $helpondiff .= $hookmanager->resPrint;
864 print $form->textwithpicto($langs->trans(
"VirtualStock"), $langs->trans(
"VirtualStockDesc"));
868 print $form->textwithpicto((empty($stocktheo) ? 0 : $stocktheo), $helpondiff);
869 if ($object->seuil_stock_alerte !=
'' && ($object->stock_theorique < $object->seuil_stock_alerte)) {
870 print
' '.img_warning($langs->trans(
"StockLowerThanLimit", $object->seuil_stock_alerte));
872 print
' <a href="'.DOL_URL_ROOT.
'/product/stock/stockatdate.php?mode=future&productid='.$object->id.
'">'.$langs->trans(
"VirtualStockAtDate").
'</a>';
877 if ($user->hasRight(
'stock',
'mouvement',
'lire')) {
878 $sql =
"SELECT max(m.datem) as datem";
879 $sql .=
" FROM ".MAIN_DB_PREFIX.
"stock_mouvement as m";
880 $sql .=
" WHERE m.fk_product = ".((int) $object->id);
881 $resqlbis = $db->query($sql);
883 $obj = $db->fetch_object($resqlbis);
884 $lastmovementdate = $db->jdate($obj->datem);
888 print
'<tr><td class="tdtop">'.$langs->trans(
"LastMovement").
'</td><td>';
889 if ($lastmovementdate) {
891 print
' ';
892 print
img_picto($langs->trans(
"StockMovement"),
'movement',
'class="pictofixedwidth"');
893 print
'<a href="'.DOL_URL_ROOT.
'/product/stock/movement_list.php?idproduct='.$object->id.
'">'.$langs->trans(
"FullList").
'</a>';
895 print
img_picto($langs->trans(
"StockMovement"),
'movement',
'class="pictofixedwidth"');
896 print
'<a href="'.DOL_URL_ROOT.
'/product/stock/movement_list.php?idproduct='.$object->id.
'">'.$langs->trans(
"None").
'</a>';
906 print
'<div class="clearboth"></div>';
913 if ($action ==
"correction") {
914 include DOL_DOCUMENT_ROOT.
'/product/stock/tpl/stockcorrection.tpl.php';
919 if ($action ==
"transfert") {
920 include DOL_DOCUMENT_ROOT.
'/product/stock/tpl/stocktransfer.tpl.php';
930$parameters = array();
932$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
933if (empty($reshook)) {
934 if (empty($action) && $object->id) {
935 print
"<div class=\"tabsAction\">\n";
937 if ($user->hasRight(
'stock',
'mouvement',
'creer')) {
938 if (!$variants ||
getDolGlobalString(
'VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT')) {
939 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=transfert">'.$langs->trans(
"TransferStock").
'</a>';
941 print
'<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"ActionAvailableOnVariantProductOnly").
'">'.$langs->trans(
"TransferStock").
'</a>';
944 print
'<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotEnoughPermissions").
'">'.$langs->trans(
"CorrectStock").
'</a>';
947 if ($user->hasRight(
'stock',
'mouvement',
'creer')) {
948 if (!$variants ||
getDolGlobalString(
'VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT')) {
949 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=correction">'.$langs->trans(
"CorrectStock").
'</a>';
951 print
'<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"ActionAvailableOnVariantProductOnly").
'">'.$langs->trans(
"CorrectStock").
'</a>';
954 print
'<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans(
"NotEnoughPermissions").
'">'.$langs->trans(
"CorrectStock").
'</a>';
962if (!$variants ||
getDolGlobalString(
'VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT')) {
967 print
'<div class="div-table-responsive">';
968 print
'<table class="noborder centpercent">';
970 print
'<tr class="liste_titre">';
971 print
'<td colspan="4">'.$langs->trans(
"Warehouse").
'</td>';
972 print
'<td class="right">'.$langs->trans(
"NumberOfUnit").
'</td>';
973 print
'<td class="right">'.$form->textwithpicto($langs->trans(
"AverageUnitPricePMPShort"), $langs->trans(
"AverageUnitPricePMPDesc")).
'</td>';
974 print
'<td class="right">'.$langs->trans(
"EstimatedStockValueShort").
'</td>';
975 print
'<td class="right">'.$langs->trans(
"SellPriceMin").
'</td>';
976 print
'<td class="right">'.$langs->trans(
"EstimatedStockValueSellShort").
'</td>';
981 if ((isModEnabled(
'productbatch')) && $object->hasbatch()) {
983 print
'<tr class="liste_titre"><td class="minwidth200">';
984 if (!empty($conf->use_javascript_ajax)) {
985 print
'<a id="show_all" href="#" class="hideobject">'.img_picto(
'',
'folder-open',
'class="paddingright"').$langs->trans(
"ShowAllLots").
'</a>';
987 print
'<a id="hide_all" href="#">'.img_picto(
'',
'folder',
'class="paddingright"').$langs->trans(
"HideLots").
'</a>';
991 print
'<td class="right">'.$langs->trans(
"batch_number").
'</td>';
994 print
'<td class="center width100">'.$langs->trans(
"SellByDate").
'</td>';
998 print
'<td class="center width100">'.$langs->trans(
"EatByDate").
'</td>';
1000 print
'<td colspan="'.$colspan.
'"></td>';
1010 $sql =
"SELECT e.rowid, e.ref, e.lieu, e.fk_parent, e.statut as status, ps.reel, ps.rowid as product_stock_id, p.pmp";
1011 $sql .=
" FROM ".MAIN_DB_PREFIX.
"entrepot as e,";
1012 $sql .=
" ".MAIN_DB_PREFIX.
"product_stock as ps";
1013 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON p.rowid = ps.fk_product";
1014 $sql .=
" WHERE ps.reel != 0";
1015 $sql .=
" AND ps.fk_entrepot = e.rowid";
1016 $sql .=
" AND e.entity IN (".getEntity(
'stock').
")";
1017 $sql .=
" AND ps.fk_product = ".((int) $object->id);
1018 $sql .=
" ORDER BY e.ref";
1020 $entrepotstatic =
new Entrepot($db);
1025 $totalvalue = $totalvaluesell = 0;
1028 $resql = $db->query($sql);
1030 $num = $db->num_rows($resql);
1031 $total = $totalwithpmp;
1035 $obj = $db->fetch_object($resql);
1037 $entrepotstatic->id = $obj->rowid;
1038 $entrepotstatic->ref = $obj->ref;
1039 $entrepotstatic->label = $obj->ref;
1040 $entrepotstatic->lieu = $obj->lieu;
1041 $entrepotstatic->fk_parent = $obj->fk_parent;
1042 $entrepotstatic->statut = $obj->status;
1043 $entrepotstatic->status = $obj->status;
1045 $stock_real =
price2num($obj->reel,
'MS');
1046 print
'<tr class="oddeven">';
1049 print
'<td colspan="4">';
1050 print $entrepotstatic->getNomUrl(1);
1051 if (!empty($conf->use_javascript_ajax) && isModEnabled(
'productbatch') && $object->hasbatch()) {
1052 print
'<a class="collapse_batch marginleftonly" id="ent' . $entrepotstatic->id .
'" href="#">';
1058 print
'<td class="right">'.$stock_real.($stock_real < 0 ?
' '.img_warning() :
'').
'</td>';
1061 print
'<td class="right nowraponall">'.(price2num($object->pmp) ?
price2num($object->pmp,
'MU') :
'').
'</td>';
1064 if ($usercancreadprice) {
1065 print
'<td class="right amount nowraponall">'.(price2num($object->pmp) ?
price(
price2num($object->pmp * $obj->reel,
'MT')) :
'').
'</td>';
1067 print
'<td class="right amount nowraponall"></td>';
1071 $minsellprice =
null;
1072 $maxsellprice =
null;
1073 print
'<td class="right nowraponall">';
1075 foreach ($object->multiprices as $priceforlevel) {
1076 if (is_numeric($priceforlevel)) {
1077 if (is_null($maxsellprice) || $priceforlevel > $maxsellprice) {
1078 $maxsellprice = $priceforlevel;
1080 if (is_null($minsellprice) || $priceforlevel < $minsellprice) {
1081 $minsellprice = $priceforlevel;
1085 print
'<span class="valignmiddle">';
1086 if ($usercancreadprice) {
1087 if ($minsellprice != $maxsellprice) {
1094 print $form->textwithpicto(
'', $langs->trans(
"Variable"));
1095 } elseif ($usercancreadprice) {
1101 print
'<td class="right amount nowraponall">';
1103 print
'<span class="valignmiddle">';
1104 if ($usercancreadprice) {
1105 if ($minsellprice != $maxsellprice) {
1112 print $form->textwithpicto(
'', $langs->trans(
"Variable"));
1114 if ($usercancreadprice) {
1122 $total += $obj->reel;
1124 $totalwithpmp += $obj->reel;
1126 $totalvalue = $totalvalue + ($object->pmp * $obj->reel);
1127 $totalvaluesell = $totalvaluesell + ($object->price * $obj->reel);
1129 if ((isModEnabled(
'productbatch')) && $object->hasbatch()) {
1134 foreach ($details as $pdluo) {
1135 $product_lot_static->id = $pdluo->lotid;
1136 $product_lot_static->batch = $pdluo->batch;
1137 $product_lot_static->eatby = $pdluo->eatby;
1138 $product_lot_static->sellby = $pdluo->sellby;
1140 if ($action ==
'editline' &&
GETPOST(
'lineid',
'int') == $pdluo->id) {
1142 print
'<td colspan="9">';
1143 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
1144 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1145 print
'<input type="hidden" name="pdluoid" value="'.$pdluo->id.
'"><input type="hidden" name="action" value="updateline"><input type="hidden" name="id" value="'.$id.
'"><table class="noborder centpercent"><tr><td width="10%"></td>';
1146 print
'<td class="right" width="10%"><input type="text" name="batch_number" value="'.$pdluo->batch.
'"></td>';
1148 print
'<td class="center" width="10%">';
1149 print $form->selectDate($pdluo->sellby,
'sellby',
'',
'', 1,
'', 1, 0);
1153 print
'<td class="center" width="10%">';
1154 print $form->selectDate($pdluo->eatby,
'eatby',
'',
'', 1,
'', 1, 0);
1157 print
'<td class="right" colspan="3">'.$pdluo->qty.($pdluo->qty < 0 ?
' '.img_warning() :
'').
'</td>';
1158 print
'<td colspan="4"><input type="submit" class="button button-save" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans(
"Save").
'">';
1159 print
'<input type="submit" class="button button-cancel" id="cancellinebutton" name="Cancel" value="'.$langs->trans(
"Cancel").
'"></td></tr>';
1167 print
"\n".
'<tr style="display:'.(!
getDolGlobalString(
'STOCK_SHOW_ALL_BATCH_BY_DEFAULT') ?
'none' :
'visible').
';" class="batch_warehouse'.$entrepotstatic->id.
'"><td class="left">';
1169 print
'<td class="right nowraponall">';
1170 if ($product_lot_static->id > 0) {
1171 print $product_lot_static->getNomUrl(1);
1173 print $product_lot_static->getNomUrl(1,
'nolink');
1179 print
'<td class="center">'.dol_print_date($pdluo->sellby,
'day').
'</td>';
1183 print
'<td class="center">'.dol_print_date($pdluo->eatby,
'day').
'</td>';
1185 print
'<td class="right" colspan="'.$colspan.
'">'.$pdluo->qty.($pdluo->qty < 0 ?
' '.img_warning() : (($pdluo->qty > 1 && $object->status_batch == 2) ?
' '.
img_warning($langs->trans(
'IlligalQtyForSerialNumbers')) :
'')).
'</td>';
1186 print
'<td colspan="4"></td>';
1187 print
'<td class="center tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans(
"TransferStock")).
'">';
1188 if ($entrepotstatic->status != $entrepotstatic::STATUS_CLOSED) {
1189 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&id_entrepot='.$entrepotstatic->id.
'&action=transfert&pdluoid='.$pdluo->id.
'">';
1190 print
img_picto($langs->trans(
"TransferStock"),
'add',
'class="hideonsmartphone paddingright" style="color: #a69944"');
1191 print $langs->trans(
"TransferStock");
1199 print
'<td class="center tdoverflowmax125" title="'.dol_escape_htmltag($langs->trans(
"CorrectStock")).
'">';
1200 if ($entrepotstatic->status != $entrepotstatic::STATUS_CLOSED) {
1201 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&id_entrepot='.$entrepotstatic->id.
'&action=correction&pdluoid='.$pdluo->id.
'">';
1202 print
img_picto($langs->trans(
"CorrectStock"),
'add',
'class="hideonsmartphone paddingright" style="color: #a69944"');
1203 print $langs->trans(
"CorrectStock");
1222 print
'<tr class="liste_total"><td class="right liste_total" colspan="4">'.$langs->trans(
"Total").
':</td>';
1223 print
'<td class="liste_total right">'.price2num($total,
'MS').
'</td>';
1224 print
'<td class="liste_total right">';
1225 if ($usercancreadprice) {
1226 print($totalwithpmp ?
price(
price2num($totalvalue / $totalwithpmp,
'MU')) :
' ');
1230 print
'<td class="liste_total right">';
1231 if ($usercancreadprice) {
1232 print $totalvalue ?
price(
price2num($totalvalue,
'MT'), 1) :
' ';
1235 print
'<td class="liste_total right">';
1238 print
'<span class="valignmiddle">';
1240 print $form->textwithpicto(
'', $langs->trans(
"Variable"));
1241 } elseif ($usercancreadprice) {
1242 print
price($totalvaluesell / $total, 1);
1249 print
'<td class="liste_total right amount">';
1251 print
'<span class="valignmiddle">';
1255 print $form->textwithpicto(
'', $langs->trans(
"Variable"));
1271 if ($user->hasRight(
'produit',
'creer')) {
1272 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
1273 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1274 print
'<input type="hidden" name="action" value="addlimitstockwarehouse">';
1275 print
'<input type="hidden" name="id" value="'.$id.
'">';
1277 print
'<table class="noborder centpercent">';
1278 if ($user->hasRight(
'produit',
'creer')) {
1279 print
'<tr class="liste_titre"><td>'.$formproduct->selectWarehouses(
'',
'fk_entrepot').
'</td>';
1280 print
'<td class="right"><input name="seuil_stock_alerte" type="text" placeholder="'.$langs->trans(
"StockLimit").
'" /></td>';
1281 print
'<td class="right"><input name="desiredstock" type="text" placeholder="'.$langs->trans(
"DesiredStock").
'" /></td>';
1282 print
'<td class="right"><input type="submit" value="'.$langs->trans(
"Save").
'" class="button button-save" /></td>';
1285 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Warehouse").
'</td>';
1286 print
'<td class="right">'.$langs->trans(
"StockLimit").
'</td>';
1287 print
'<td class="right">'.$langs->trans(
"DesiredStock").
'</td>';
1292 $lines = $pse->fetchAll($id);
1294 if (!empty($lines)) {
1296 foreach ($lines as $line) {
1298 $ent->fetch($line[
'fk_entrepot']);
1299 print
'<tr class="oddeven"><td>'.$ent->getNomUrl(3).
'</td>';
1300 print
'<td class="right">'.$line[
'seuil_stock_alerte'].
'</td>';
1301 print
'<td class="right">'.$line[
'desiredstock'].
'</td>';
1302 if ($user->hasRight(
'produit',
'creer')) {
1303 print
'<td class="right"><a href="'.$_SERVER[
'PHP_SELF'].
'?id='.$id.
'&fk_productstockwarehouse='.$line[
'id'].
'&action=delete_productstockwarehouse&token='.newToken().
'">'.
img_delete().
'</a></td>';
1311 if ($user->hasRight(
'produit',
'creer')) {
1317 include_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductCombination.class.php';
1318 include_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductCombination2ValuePair.class.php';
1319 $prodstatic =
new Product($db);
1322 $productCombinations = $prodcomb->fetchAllByFkProductParent($object->id);
1324 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
1325 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1326 print
'<input type="hidden" name="action" value="massaction">';
1327 print
'<input type="hidden" name="id" value="'.$id.
'">';
1328 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
1331 $title = $langs->trans(
"ProductCombinations");
1333 print_barre_liste($title, 0, $_SERVER[
"PHP_SELF"],
'', $sortfield, $sortorder,
'', 0);
1335 print
'<div class="div-table-responsive">'; ?>
1336 <table
class=
"liste">
1337 <tr
class=
"liste_titre">
1338 <td
class=
"liste_titre"><?php echo $langs->trans(
'Product') ?></td>
1339 <td
class=
"liste_titre"><?php echo $langs->trans(
'Combination') ?></td>
1340 <td
class=
"liste_titre center"><?php echo $langs->trans(
'OnSell') ?></td>
1341 <td
class=
"liste_titre center"><?php echo $langs->trans(
'OnBuy') ?></td>
1342 <td
class=
"liste_titre right"><?php echo $langs->trans(
'Stock') ?></td>
1343 <td
class=
"liste_titre"></td>
1347 if (count($productCombinations)) {
1349 foreach ($productCombinations as $currcomb) {
1350 $prodstatic->fetch($currcomb->fk_product_child);
1351 $prodstatic->load_stock();
1352 $stock_total += $prodstatic->stock_reel; ?>
1353 <tr
class=
"oddeven">
1354 <td><?php echo $prodstatic->getNomUrl(1) ?></td>
1358 $productCombination2ValuePairs = $comb2val->fetchByFkCombination($currcomb->id);
1359 $iMax = count($productCombination2ValuePairs);
1361 for ($i = 0; $i < $iMax; $i++) {
1364 if ($i !== ($iMax - 1)) {
1369 <td style=
"text-align: center;"><?php echo $prodstatic->getLibStatut(2, 0) ?></td>
1370 <td style=
"text-align: center;"><?php echo $prodstatic->getLibStatut(2, 1) ?></td>
1371 <td
class=
"right"><?php echo $prodstatic->stock_reel ?></td>
1373 <a
class=
"paddingleft paddingright editfielda" href=
"<?php echo dol_buildpath('/product/stock/product.php?id='.$currcomb->fk_product_child, 2) ?>"><?php echo
img_edit() ?></a>
1381 print
'<tr class="liste_total">';
1382 print
'<td colspan="4" class="left">'.$langs->trans(
"Total").
'</td>';
1383 print
'<td class="right">'.$stock_total.
'</td>';
1387 print
'<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage warehouses.
const STATUS_CLOSED
Closed status.
const STATUS_VALIDATED
Validated status.
Class ProductCombination2ValuePair Used to represent the relation between a product combination,...
Class ProductCombination Used to represent a product combination.
Class to manage predefined suppliers products.
Class to manage products or services.
const TYPE_PRODUCT
Regular product.
const TYPE_SERVICE
Service.
Class ProductStockEntrepot.
Manage record for batch number management.
static findAll($dbs, $fk_product_stock, $with_qty=0, $fk_product=0)
Return all batch detail records for a given product and warehouse.
Class with list of lots and properties.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
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...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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.
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_htmlentities($string, $flags=ENT_QUOTES|ENT_SUBSTITUTE, $encoding='UTF-8', $double_encode=false)
Replace htmlentities functions.
dol_htmloutput_events($disabledoutputofmessages=0)
Print formated messages to output (Used to show messages on html output).
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.
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.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
product_prepare_head($object)
Prepare array with list of tabs.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
restrictedArea(User $user, $features, $object=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.