35require
'../../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/modules/supplier_order/modules_commandefournisseur.php';
37require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/fourn.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.dispatch.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/mouvementstock.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
45if (isModEnabled(
'project')) {
46 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
50$langs->loadLangs(array(
"bills",
"orders",
"sendings",
"companies",
"deliveries",
"products",
"stocks",
"receptions"));
52if (isModEnabled(
'productbatch')) {
53 $langs->load(
'productbatch');
60$action =
GETPOST(
'action',
'aZ09');
61$fk_default_warehouse =
GETPOSTINT(
'fk_default_warehouse');
62$cancel =
GETPOST(
'cancel',
'alpha');
63$confirm =
GETPOST(
'confirm',
'alpha');
66 $socid = $user->socid;
69$hookmanager->initHooks(array(
'ordersupplierdispatch'));
73if (GETPOSTISSET(
"projectid")) {
79if ($id > 0 || !empty($ref)) {
80 $result =
$object->fetch($id, $ref);
84 $result =
$object->fetch_thirdparty();
90if (empty($conf->reception->enabled)) {
91 $permissiontoreceive = $user->hasRight(
"fournisseur",
"commande",
"receptionner");
92 $permissiontocontrol = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"fournisseur",
"commande",
"receptionner")) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"fournisseur",
"commande_advance",
"check")));
94 $permissiontoreceive = $user->hasRight(
"reception",
"creer");
95 $permissiontocontrol = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"reception",
"creer")) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"reception",
"reception_advance",
"validate")));
99$result =
restrictedArea($user,
'fournisseur', $object,
'commande_fournisseur',
'commande');
101if (!isModEnabled(
'stock')) {
105$usercancreate = ($user->hasRight(
"fournisseur",
"commande",
"creer") || $user->hasRight(
"supplier_order",
"creer"));
106$permissiontoadd = $usercancreate;
113$parameters = array();
114$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
119if ($action ==
'checkdispatchline' && $permissiontocontrol) {
125 $result = $supplierorderdispatch->fetch($lineid);
128 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
133 $result = $supplierorderdispatch->setStatut(1);
135 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
142 $result =
$object->calcAndSetStatusDispatch($user);
156if ($action ==
'uncheckdispatchline' && $permissiontocontrol) {
162 $result = $supplierorderdispatch->fetch($lineid);
165 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
170 $result = $supplierorderdispatch->setStatut(0);
172 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
178 $result =
$object->calcAndSetStatusDispatch($user);
192if ($action ==
'denydispatchline' && $permissiontocontrol) {
198 $result = $supplierorderdispatch->fetch($lineid);
201 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
206 $result = $supplierorderdispatch->setStatut(2);
208 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
214 $result =
$object->calcAndSetStatusDispatch($user);
228$saveprice =
"savepriceIsNotSet";
229if ($action ==
'dispatch' && $permissiontoreceive) {
236 foreach ($_POST as $key => $value) {
239 if (preg_match(
'/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
244 $prod =
"product_".$reg[1].
'_'.$reg[2];
245 $qty =
"qty_".$reg[1].
'_'.$reg[2];
246 $ent =
"entrepot_".$reg[1].
'_'.$reg[2];
248 $ent = $fk_default_warehouse;
250 $pu =
"pu_".$reg[1].
'_'.$reg[2];
251 $fk_commandefourndet =
"fk_commandefourndet_".$reg[1].
'_'.$reg[2];
254 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
255 $dto =
GETPOSTINT(
"dto_".$reg[1].
'_'.$reg[2]);
257 $unit_price =
price2num((
float)
GETPOST(
"pu_".$reg[1]) * (100 - $dto) / 100,
'MU');
259 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
266 if ($qtytomove != 0) {
268 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
269 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline);
270 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
275 $result =
$object->dispatchProduct($user,
GETPOSTINT($prod), $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'),
'',
'',
'',
GETPOSTINT($fk_commandefourndet), $notrigger);
281 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
282 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
289 if (GETPOSTISSET($saveprice)) {
291 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
292 $sql .=
" SET unitprice='".price2num(
GETPOST($pu),
'MU').
"'";
293 $sql .=
", price=".price2num(
GETPOST($pu),
'MU').
"*quantity";
294 $sql .=
", remise_percent = ".((float) $dto);
295 $sql .=
" WHERE fk_soc=".((int)
$object->socid);
296 $sql .=
" AND fk_product=".(GETPOSTINT($prod));
298 $resql = $db->query($sql);
306 if (preg_match(
'/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
312 $prod =
'product_batch_'.$reg[1].
'_'.$reg[2];
313 $qty =
'qty_'.$reg[1].
'_'.$reg[2];
314 $ent =
'entrepot_'.$reg[1].
'_'.$reg[2];
315 $pu =
'pu_'.$reg[1].
'_'.$reg[2];
316 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
317 $lot =
'lot_number_'.$reg[1].
'_'.$reg[2];
321 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
324 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
325 $dto =
GETPOSTINT(
"dto_".$reg[1].
'_'.$reg[2]);
327 $unit_price =
price2num((
float)
GETPOST(
"pu_".$reg[1]) * (100 - $dto) / 100,
'MU');
329 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
336 if ($qtytomove > 0) {
340 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
341 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.((
int) $reg[1] + 1);
342 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
355 if (!
GETPOST($lot,
'alpha') && !$dDLUO && !$dDLC) {
356 dol_syslog(
'No dispatch for line '.$key.
' as serial/eat-by/sellby date are not set');
357 $text = $langs->transnoentities(
'atleast1batchfield').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.((
int) $reg[1] + 1);
358 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
363 $result =
$object->dispatchProduct($user, $productId, $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'), $dDLUO, $dDLC,
GETPOST($lot,
'alpha'),
GETPOSTINT($fk_commandefourndet), $notrigger);
369 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
370 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
371 $dto =
GETPOSTINT(
"dto_".$reg[1].
'_'.$reg[2]);
373 if (GETPOSTISSET($saveprice)) {
375 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
376 $sql .=
" SET unitprice = ".price2num(
GETPOST($pu),
'MU', 2);
377 $sql .=
", price = ".price2num(
GETPOST($pu),
'MU', 2).
" * quantity";
378 $sql .=
", remise_percent = ".price2num((empty($dto) ? 0 : $dto), 3, 2).
"'";
379 $sql .=
" WHERE fk_soc = ".((int)
$object->socid);
380 $sql .=
" AND fk_product=".((int) $productId);
382 $resql = $db->query($sql);
392 $result =
$object->calcAndSetStatusDispatch($user,
GETPOST(
'closeopenorder') ? 1 : 0,
GETPOST(
'comment'));
399 if ($result >= 0 && !$error) {
404 header(
"Location: dispatch.php?id=".$id);
419if ($action ==
'confirm_deleteline' && $confirm ==
'yes' && $permissiontoreceive) {
423 $result = $supplierorderdispatch->fetch($lineid);
425 $qty = $supplierorderdispatch->qty;
426 $entrepot = $supplierorderdispatch->fk_entrepot;
427 $product = $supplierorderdispatch->fk_product;
429 $comment = $supplierorderdispatch->comment;
430 $eatby = $supplierorderdispatch->eatby;
431 $sellby = $supplierorderdispatch->sellby;
432 $batch = $supplierorderdispatch->batch;
434 $result = $supplierorderdispatch->delete($user);
441 if ($entrepot > 0 && isModEnabled(
'stock') &&
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') && empty($supplierorderdispatch->fk_reception)) {
446 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment,
'', $eatby, $sellby, $batch);
448 $errors = $mouv->errors;
463if ($action ==
'updateline' && $permissiontoreceive && empty($cancel)) {
468 $result = $supplierorderdispatch->fetch($lineid);
470 $qty = $supplierorderdispatch->qty;
471 $entrepot = $supplierorderdispatch->fk_entrepot;
472 $product = $supplierorderdispatch->fk_product;
474 $comment = $supplierorderdispatch->comment;
475 $eatby = $supplierorderdispatch->eatby;
476 $sellby = $supplierorderdispatch->sellby;
477 $batch = $supplierorderdispatch->batch;
479 $supplierorderdispatch->qty =
GETPOSTFLOAT(
'qty',
'MS');
480 $supplierorderdispatch->fk_entrepot =
GETPOSTINT(
'fk_entrepot');
481 $result = $supplierorderdispatch->update($user);
485 $errors = $supplierorderdispatch->errors;
488 if ($entrepot > 0 && isModEnabled(
'stock') &&
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER')) {
493 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment,
'', $eatby, $sellby, $batch);
495 $errors = $mouv->errors;
499 $result = $mouv->reception($user, $product, $supplierorderdispatch->fk_entrepot, $supplierorderdispatch->qty, $price, $comment, $eatby, $sellby, $batch);
501 $errors = $mouv->errors;
523$form =
new Form($db);
525$warehouse_static =
new Entrepot($db);
528$title =
$object->ref.
" - ".$langs->trans(
'OrderDispatch');
529$help_url =
'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
530$morejs = array(
'/fourn/js/lib_dispatch.js.php');
532llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs,
'',
'',
'mod-supplier-order page-card_dispatch');
534if ($id > 0 || !empty($ref)) {
538 $author =
new User($db);
539 $author->fetch(
$object->user_author_id);
543 $title = $langs->trans(
"SupplierOrder");
549 if ($action ==
'ask_deleteline') {
550 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
554 $parameters = array(
'lineid' => $lineid);
556 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
557 if (empty($reshook)) {
558 $formconfirm .= $hookmanager->resPrint;
559 } elseif ($reshook > 0) {
560 $formconfirm = $hookmanager->resPrint;
568 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fourn/commande/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
570 $morehtmlref =
'<div class="refidno">';
572 $morehtmlref .= $form->editfieldkey(
"RefSupplier",
'ref_supplier',
$object->ref_supplier, $object, 0,
'string',
'', 0, 1);
573 $morehtmlref .= $form->editfieldval(
"RefSupplier",
'ref_supplier',
$object->ref_supplier, $object, 0,
'string',
'',
null,
null,
'', 1);
575 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1);
577 if (isModEnabled(
'project')) {
578 $langs->load(
"projects");
579 $morehtmlref .=
'<br>';
581 $caneditproject =
false;
582 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
583 if ($action !=
'classify' && $caneditproject) {
584 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
586 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, (!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ?
$object->socid : -1),
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
588 if (!empty(
$object->fk_project)) {
590 $proj->fetch(
$object->fk_project);
591 $morehtmlref .= $proj->getNomUrl(1);
593 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
598 $morehtmlref .=
'</div>';
601 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
604 print
'<div class="fichecenter">';
605 print
'<div class="underbanner clearboth"></div>';
607 print
'<table class="border tableforfield" width="100%">';
610 if (
$object->methode_commande_id > 0) {
611 print
'<tr><td class="titlefield">'.$langs->trans(
"Date").
'</td><td>';
617 if (
$object->methode_commande) {
618 print
'<tr><td>'.$langs->trans(
"Method").
'</td><td>'.
$object->getInputMethod().
'</td></tr>';
623 print
'<tr><td class="titlefield">'.$langs->trans(
"AuthorRequest").
'</td>';
624 print
'<td>'.$author->getNomUrl(1,
'', 0, 0, 0).
'</td>';
627 $parameters = array();
628 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
645 print
'<br><span class="opacitymedium">'.$langs->trans(
"OrderStatusNotReadyToDispatch").
'</span>';
651 $listwarehouses = array();
656 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
658 $formproduct->loadWarehouses();
660 $listwarehouses = $entrepot->list_array(1);
663 if (empty($conf->reception->enabled)) {
664 print
'<form method="POST" action="dispatch.php?id='.$object->id.
'">';
666 print
'<form method="post" action="'.dol_buildpath(
'/reception/card.php', 1).
'?originid='.
$object->id.
'&origin=supplierorder">';
669 print
'<input type="hidden" name="token" value="'.newToken().
'">';
670 if (empty($conf->reception->enabled)) {
671 print
'<input type="hidden" name="action" value="dispatch">';
673 print
'<input type="hidden" name="action" value="create">';
676 print
'<div class="div-table-responsive-no-min">';
677 print
'<table class="noborder centpercent">';
680 $products_dispatched = array();
681 $sql =
"SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty";
682 $sql .=
" FROM ".MAIN_DB_PREFIX.
"receptiondet_batch as cfd";
683 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l on l.rowid = cfd.fk_elementdet";
684 $sql .=
" WHERE cfd.fk_element = ".((int)
$object->id);
685 $sql .=
" GROUP BY l.rowid, cfd.fk_product";
687 $resql = $db->query($sql);
689 $num = $db->num_rows($resql);
694 $objd = $db->fetch_object($resql);
695 $products_dispatched[$objd->rowid] =
price2num($objd->qty,
'MS');
703 $sql =
"SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty,";
704 $sql .=
" p.ref, p.label, p.tobatch, p.fk_default_warehouse";
707 $parameters = array();
708 $reshook = $hookmanager->executeHooks(
709 'printFieldListSelect',
717 $sql .= $hookmanager->resPrint;
719 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l";
720 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON l.fk_product=p.rowid";
721 $sql .=
" WHERE l.fk_commande = ".((int)
$object->id);
723 $sql .=
" AND l.product_type = 0";
727 $parameters = array();
728 $reshook = $hookmanager->executeHooks(
729 'printFieldListWhere',
737 $sql .= $hookmanager->resPrint;
740 $sql .=
" ORDER BY l.rang, p.ref, p.label";
746 $resql = $db->query($sql);
748 $num = $db->num_rows($resql);
752 print
'<tr class="liste_titre">';
754 print
'<td>'.$langs->trans(
"Description").
'</td>';
755 if (isModEnabled(
'productbatch')) {
756 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
758 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
761 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
768 print
'<td class="right">'.$langs->trans(
"SupplierRef").
'</td>';
769 print
'<td class="right">'.$langs->trans(
"QtyOrdered").
'</td>';
770 print
'<td class="right">'.$langs->trans(
"QtyDispatchedShort").
'</td>';
771 print
' <td class="right">'.$langs->trans(
"QtyToDispatchShort");
772 print
'<br><a href="#" id="autoreset">'.img_picto($langs->trans(
"Reset"),
'eraser',
'class="pictofixedwidth opacitymedium"').$langs->trans(
"Reset").
'</a></td>';
773 print
'<td width="32"></td>';
776 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
777 print
'<td class="right">'.$langs->trans(
"Price").
'</td>';
778 print
'<td class="right">'.$langs->trans(
"ReductionShort").
' (%)</td>';
779 print
'<td class="right">'.$langs->trans(
"UpdatePrice").
'</td>';
783 print
'<td align="right">'.$langs->trans(
"Warehouse");
786 if (count($listwarehouses) > 1) {
787 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, $langs->trans(
"ForceTo"), 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
788 } elseif (count($listwarehouses) == 1) {
789 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
795 $parameters = array();
796 $reshook = $hookmanager->executeHooks(
797 'printFieldListTitle',
805 print $hookmanager->resPrint;
812 $conf->cache[
'product'] = array();
816 $objp = $db->fetch_object($resql);
819 if (!$objp->fk_product > 0) {
822 $alreadydispatched = isset($products_dispatched[$objp->rowid]) ? $products_dispatched[$objp->rowid] : 0;
823 $remaintodispatch =
price2num($objp->qty - ((
float) $alreadydispatched), 5);
824 if ($remaintodispatch < 0 && !
getDolGlobalString(
'SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN')) {
825 $remaintodispatch = 0;
828 if ($remaintodispatch || !
getDolGlobalString(
'SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
837 print
'<!-- Line to dispatch '.$suffix.
' -->'.
"\n";
839 print
'<input id="qty_ordered'.$suffix.
'" type="hidden" value="'.$objp->qty.
'">';
840 print
'<input id="qty_dispatched'.$suffix.
'" type="hidden" value="'.(float) $alreadydispatched.
'">';
841 print
'<tr class="oddeven">';
843 if (empty($conf->cache[
'product'][$objp->fk_product])) {
844 $tmpproduct =
new Product($db);
845 $tmpproduct->fetch($objp->fk_product);
846 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
848 $tmpproduct = $conf->cache[
'product'][$objp->fk_product];
851 $linktoprod = $tmpproduct->getNomUrl(1);
852 $linktoprod .=
' - '.$objp->label.
"\n";
854 if (isModEnabled(
'productbatch')) {
855 if ($objp->tobatch) {
860 print
'<td class="dispatch_batch_number"></td>';
862 print
'<td class="dispatch_dlc"></td>';
865 print
'<td class="dispatch_dluo"></td>';
872 print
'<td class="dispatch_batch_number">';
873 print
'<span class="opacitymedium small">'.$langs->trans(
"ProductDoesNotUseBatchSerial").
'</small>';
876 print
'<td class="dispatch_dlc"></td>';
879 print
'<td class="dispatch_dluo"></td>';
883 print
'<td colspan="4">';
889 $up_ht_disc = $objp->subprice;
890 if (!empty($objp->remise_percent) && !
getDolGlobalString(
'STOCK_EXCLUDE_DISCOUNT_FOR_PMP')) {
891 $up_ht_disc =
price2num($up_ht_disc * (100 - $objp->remise_percent) / 100,
'MU');
895 print
'<td class="right">'.$objp->sref.
'</td>';
898 print
'<td class="right">'.$objp->qty.
'</td>';
901 print
'<td class="right">'.$alreadydispatched.
'</td>';
903 if (isModEnabled(
'productbatch') && $objp->tobatch > 0) {
905 print
'<td class="right">';
915 'is_information_row' =>
true,
920 $reshook = $hookmanager->executeHooks(
921 'printFieldListValue',
929 print $hookmanager->resPrint;
933 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
935 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
936 print
'<input name="product_batch'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
938 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
940 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
942 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
948 print
'<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.
'" name="lot_number'.$suffix.
'" value="'.
GETPOST(
'lot_number'.$suffix).
'">';
951 print
'<td class="nowraponall">';
953 print $form->selectDate($dlcdatesuffix,
'dlc'.$suffix, 0, 0, 1,
'');
957 print
'<td class="nowraponall">';
959 print $form->selectDate($dluodatesuffix,
'dluo'.$suffix, 0, 0, 1,
'');
962 print
'<td colspan="3"> </td>';
968 print
'<td class="right">';
978 'is_information_row' =>
true,
983 $reshook = $hookmanager->executeHooks(
984 'printFieldListValue',
992 print $hookmanager->resPrint;
996 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
997 print
'<td colspan="'.$colspan.
'">';
998 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
999 print
'<input name="product'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
1001 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
1003 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
1005 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
1012 print
'<td class="right nowrap">';
1013 if ($remaintodispatch > 0) {
1014 $btnLabel = $langs->trans(
"Fill").
' : '.$remaintodispatch;
1015 print
'<button class="auto-fill-qty btn-low-emphasis --btn-icon" data-rowname="qty'.$suffix.
'" data-value="'.$remaintodispatch.
'" title="'.
dol_escape_htmltag($btnLabel).
'" aria-label="'.
dol_escape_htmltag($btnLabel).
'" >'.
img_picto($btnLabel,
'fa-arrow-right',
'aria-hidden="true"', 0, 0, 1).
'</button>';
1017 print
'<input id="qty'.$suffix.
'" name="qty'.$suffix.
'" type="number" step="any" class="width50 right qtydispatchinput" value="'.(GETPOSTISSET(
'qty'.$suffix) ?
GETPOSTINT(
'qty'.$suffix) : (!
getDolGlobalString(
'SUPPLIER_ORDER_DISPATCH_FORCE_QTY_INPUT_TO_ZERO') ? $remaintodispatch : 0)).
'">';
1018 print
'<button class="resetline btn-low-emphasis --btn-icon" id="reset'.$suffix.
'" title="'.
dol_escape_htmltag($langs->trans(
"Reset")).
'" >'.
img_picto($langs->trans(
"Reset"),
'eraser',
'aria-hidden="true"', 0, 0, 1).
'</button>';
1022 if (isModEnabled(
'productbatch') && $objp->tobatch > 0) {
1024 print
img_picto($langs->trans(
'AddStockLocationLine'),
'split.png',
'class="splitbutton" onClick="addDispatchLine('.$i.
', \''.$type.
'\')
"');
1027 print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton
" onClick="addDispatchLine(
'.$i.', \
''.$type.
'\')
"');
1031 if (getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
1032 if (!isModEnabled("multicurrency
") && empty($conf->dynamicprices->enabled)) {
1034 print '<td class="right
">';
1035 print '<input id="pu
'.$suffix.'" name="pu
'.$suffix.'" type="text
" size="8
" value="'.price((GETPOST('pu
'.$suffix) != '' ? price2num(GETPOST('pu
'.$suffix)) : $up_ht_disc)).'">';
1039 print '<td class="right
">';
1040 print '<input id="dto
'.$suffix.'" name="dto
'.$suffix.'" type="text
" size="8
" value="'.(GETPOST('dto
'.$suffix) != '' ? GETPOST('dto
'.$suffix) : '').'">';
1044 print '<td class="center
">';
1045 print '<input class="flat checkformerge
" type="checkbox
" name="saveprice
'.$suffix.'" value="'.(GETPOST('saveprice
'.$suffix) != '' ? GETPOST('saveprice
'.$suffix) : '').'">';
1051 print '<td class="right
">';
1052 if (count($listwarehouses) > 1) {
1053 print $formproduct->selectWarehouses(GETPOST("entrepot
".$suffix) ? GETPOST("entrepot
".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot
".$suffix, '', 1, 0, $objp->fk_product, '', 1, 0, array(), 'csswarehouse'.$suffix);
1054 } elseif (count($listwarehouses) == 1) {
1055 print $formproduct->selectWarehouses(GETPOST("entrepot
".$suffix) ? GETPOST("entrepot
".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot
".$suffix, '', 0, 0, $objp->fk_product, '', 1, 0, array(), 'csswarehouse'.$suffix);
1057 $langs->load("errors
");
1058 print $langs->trans("ErrorNoWarehouseDefined
");
1062 // Enable hooks to append additional columns
1063 $parameters = array(
1064 'is_information_row' => false, // this is a dispatch form row
1066 'suffix' => $suffix,
1069 $reshook = $hookmanager->executeHooks(
1070 'printFieldListValue',
1076 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1078 print $hookmanager->resPrint;
1087 dol_print_error($db);
1094 $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically
", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
1096 print '<div class="center
">';
1097 $parameters = array();
1098 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
1100 if (empty($reshook)) {
1101 if (empty($conf->reception->enabled)) {
1102 print $langs->trans("Comment").' : ';
1103 print '<input type="text
" class="minwidth400
" maxlength="128
" name="comment
" value="';
1104 print GETPOSTISSET("comment") ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
1105 // print ' /
'.$object->ref_supplier; // Not yet available
1106 print '" class="flat
"><br>';
1108 print '<input type="checkbox
" checked="checked
" name="closeopenorder
"> '.$checkboxlabel;
1111 $dispatchBt = empty($conf->reception->enabled) ? $langs->trans("Receive
") : $langs->trans("CreateReception
");
1114 print '<input type="hidden
" name="backtopageforcancel
" value="'.$_SERVER["PHP_SELF"].'?
id=
'.$object->id.'">';
1115 print '<input type="submit
" class="button" name="dispatch
" value="'.dol_escape_htmltag($dispatchBt).'"';
1117 if (!$permissiontoreceive) {
1120 if (count($listwarehouses) <= 0) {
1132 // Message if nothing to dispatch
1135 if (!getDolGlobalString('SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
1136 print '<div class="opacitymedium
">'.$langs->trans("NoPredefinedProductToDispatch
").'</div>'; // No predefined line at all
1138 print '<div class="opacitymedium
">'.$langs->trans("NoMorePredefinedProductToDispatch
").'</div>'; // No predefined line that remain to be dispatched.
1145 print dol_get_fiche_end();
1147 // traitement entrepot par défaut
1148 print '<script type="text/javascript
">
1149 $(document).ready(function () {
1150 $("select[
name=fk_default_warehouse]
").change(function() {
1151 var fk_default_warehouse = $("option:selected
", this).val();
1152 $("select[
name^=entrepot_]
").val(fk_default_warehouse).change();
1155 $(".auto-fill-qty
").on("click touchstart
", function(e){
1157 $("input[
name=
"+$(this).data("rowname
")+"]
").val($(this).data("value
")).trigger("change
");
1160 $("#autoreset
").click(function() {
1161 $(".qtydispatchinput
").each(function(){
1162 id = $(this).attr("id");
1163 idtab = id.split("_
");
1167 $("#qty_dispatched_0_
"+idtab[2]).val("0
");
1169 obj = $(this).parent().parent();
1170 nameobj = obj.attr("name");
1171 nametab = nameobj.split("_
");
1173 $("tr[
name^=\
'"+nametab[0]+"_\'][name$=\'_"+nametab[2]+"\']:last .splitbutton").show();
1178 $(".resetline").click(function(e){
1180 id = $(this).attr("id");
1181 id = id.split("reset_");
1182 console.log("Reset trigger for id = qty_"+id[1]);
1183 $("#qty_"+id[1]).val("");
1189 $sql =
"SELECT p.rowid as pid, p.ref, p.label,";
1190 $sql .=
" e.rowid as warehouse_id, e.ref as entrepot,";
1191 $sql .=
" cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec";
1192 $sql .=
" ,cd.rowid, cd.subprice";
1193 if (isModEnabled(
'reception')) {
1194 $sql .=
" ,cfd.fk_reception, r.date_delivery";
1196 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product as p,";
1197 $sql .=
" ".MAIN_DB_PREFIX.
"receptiondet_batch as cfd";
1198 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as cd ON cd.rowid = cfd.fk_elementdet";
1199 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"entrepot as e ON cfd.fk_entrepot = e.rowid";
1200 if (isModEnabled(
'reception')) {
1201 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"reception as r ON cfd.fk_reception = r.rowid";
1203 $sql .=
" WHERE cfd.fk_element = ".((int)
$object->id);
1204 $sql .=
" AND cfd.fk_product = p.rowid";
1205 $sql .=
" ORDER BY cfd.rowid ASC";
1207 $resql = $db->query($sql);
1209 $num = $db->num_rows($resql);
1217 print
'<div class="div-table-responsive">';
1218 print
'<table id="dispatch_received_products" class="noborder centpercent">';
1220 print
'<tr class="liste_titre">';
1222 if ($conf->reception->enabled) {
1223 print
'<td>'.$langs->trans(
"Reception").
'</td>';
1226 print
'<td>'.$langs->trans(
"Product").
'</td>';
1227 print
'<td class="center">'.$langs->trans(
"DateCreation").
'</td>';
1228 print
'<td class="center">'.$langs->trans(
"DateDeliveryPlanned").
'</td>';
1229 if (isModEnabled(
'productbatch')) {
1230 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
1232 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
1235 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
1238 print
'<td class="right">'.$langs->trans(
"QtyDispatched").
'</td>';
1239 print
'<td>'.$langs->trans(
"Warehouse").
'</td>';
1240 print
'<td>'.$langs->trans(
"Comment").
'</td>';
1243 if (
getDolGlobalString(
'SUPPLIER_ORDER_USE_DISPATCH_STATUS') && $reception !==
null && empty($reception->rowid)) {
1244 print
'<td class="center" colspan="2">'.$langs->trans(
"Status").
'</td>';
1245 } elseif (isModEnabled(
"reception")) {
1246 print
'<td class="center"></td>';
1249 print
'<td class="center" colspan="2"></td>';
1258 $objp = $db->fetch_object($resql);
1260 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1261 print
'<form name="editdispatchedlines" id="editdispatchedlines" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'#line_'.
GETPOSTINT(
'lineid').
'" method="POST">
1262 <input type="hidden" name="token" value="'.
newToken().
'">
1263 <input type="hidden" name="action" value="updateline">
1264 <input type="hidden" name="mode" value="">
1265 <input type="hidden" name="lineid" value="'.$objp->dispatchlineid.
'">';
1268 print
'<tr class="oddeven" id="line_'.$objp->dispatchlineid.
'" >';
1272 if (isModEnabled(
"reception")) {
1273 print
'<td class="nowraponall">';
1274 if (!empty($objp->fk_reception)) {
1276 $reception->fetch($objp->fk_reception);
1277 print $reception->getNomUrl(1);
1284 print
'<td class="tdoverflowmax150">';
1285 if (empty($conf->cache[
'product'][$objp->fk_product])) {
1286 $tmpproduct =
new Product($db);
1287 $tmpproduct->fetch($objp->fk_product);
1288 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
1290 $tmpproduct = $conf->cache[
'product'][$objp->fk_product];
1292 print $tmpproduct->getNomUrl(1);
1293 print
' - '.$objp->label;
1297 print
'<td class="center">'.dol_print_date($db->jdate($objp->datec),
'day').
'</td>';
1300 print
'<td class="center">'.dol_print_date($db->jdate($objp->date_delivery),
'day').
'</td>';
1303 if (isModEnabled(
'productbatch')) {
1305 include_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
1307 $lot->fetch(0, $objp->pid, $objp->batch);
1308 print
'<td class="dispatch_batch_number">'.$lot->getNomUrl(1).
'</td>';
1310 print
'<td class="dispatch_dlc">'.dol_print_date($lot->sellby,
'day').
'</td>';
1313 print
'<td class="dispatch_dluo">'.dol_print_date($lot->eatby,
'day').
'</td>';
1316 print
'<td class="dispatch_batch_number"></td>';
1318 print
'<td class="dispatch_dlc"></td>';
1321 print
'<td class="dispatch_dluo"></td>';
1327 print
'<td class="right">';
1328 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1329 print
'<input style="width: 50px;" type="text" min="1" name="qty" value="'.$objp->qty.
'" />';
1333 print
'<input type="hidden" name="price" value="'.$objp->subprice.
'" />';
1336 print
'<td class="tdoverflowmax150">';
1337 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1338 $warehouse_id =
GETPOSTINT(
"fk_entrepot") ?
GETPOSTINT(
"fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id :
'');
1339 if (count($listwarehouses) > 1) {
1340 print $formproduct->selectWarehouses($warehouse_id,
"fk_entrepot",
'', 1, 0, $objp->fk_product,
'', 1, 1, array(),
'csswarehouse');
1341 } elseif (count($listwarehouses) == 1) {
1342 print $formproduct->selectWarehouses($warehouse_id,
"fk_entrepot",
'', 0, 0, $objp->fk_product,
'', 1, 1, array(),
'csswarehouse');
1344 $langs->load(
"errors");
1345 print $langs->trans(
"ErrorNoWarehouseDefined");
1348 $warehouse_static->id = $objp->warehouse_id;
1349 $warehouse_static->label = $objp->entrepot;
1350 print $warehouse_static->getNomUrl(1);
1355 print
'<td class="tdoverflowmax300" style="white-space: pre;">'.$objp->comment.
'</td>';
1358 if (
getDolGlobalString(
'SUPPLIER_ORDER_USE_DISPATCH_STATUS') && ($reception ===
null || empty($reception->rowid))) {
1359 print
'<td class="right">';
1360 $supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status);
1362 print $supplierorderdispatch->getLibStatut(5);
1366 print
'<td class="center">';
1367 if (!$permissiontocontrol) {
1368 if (empty($objp->status)) {
1369 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Approve").
'</a>';
1370 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1372 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Disapprove").
'</a>';
1373 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1380 if (empty($objp->status)) {
1381 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=checkdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1382 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=denydispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1384 if ($objp->status == 1) {
1385 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1386 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=denydispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1388 if ($objp->status == 2) {
1389 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1390 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=checkdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1394 } elseif (isModEnabled(
"reception")) {
1395 print
'<td class="right">';
1396 if ($reception !==
null && !empty($reception->id)) {
1397 print $reception->getLibStatut(5);
1403 if ($action !=
'editline' || $lineid != $objp->dispatchlineid) {
1404 if (($reception ===
null) || empty($reception->id) || ($reception->statut == Reception::STATUS_DRAFT)) {
1405 print
'<td class="linecoledit center">';
1406 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editline&token='.
newToken().
'&lineid='.$objp->dispatchlineid.
'#line_'.$objp->dispatchlineid.
'">';
1411 print
'<td class="linecoldelete center">';
1412 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=ask_deleteline&token='.
newToken().
'&lineid='.$objp->dispatchlineid.
'#dispatch_received_products">';
1417 print
'<td></td><td></td>';
1420 print
'<td class="center valignmiddle">';
1421 print
'<input type="submit" class="button button-save" id="savelinebutton" name="save" value="'.$langs->trans(
"Save").
'" />';
1423 print
'<td class="center valignmiddle">';
1424 print
'<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans(
"Cancel").
'" />';
1430 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage table ReceptionLineBatch.
Class to manage predefined suppliers products.
const STATUS_RECEIVED_PARTIALLY
Received partially.
const STATUS_CANCELED
Order canceled.
const STATUS_RECEIVED_COMPLETELY
Received completely.
const STATUS_ACCEPTED
Accepted.
const STATUS_ORDERSENT
Order sent, shipment on process.
Class to manage warehouses.
Class to manage stock movements.
Class to manage products or services.
Class with list of lots and properties.
Class to manage projects.
Class to manage receptions.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
ordersupplier_prepare_head(CommandeFournisseur $object)
Prepare array with list of tabs.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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_now($mode='auto')
Return date for now.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='')
Return the value of a $_GET or $_POST supervariable, converted into float.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
treeview li table
No Email.
ui state ui widget content ui state ui widget header ui state a ui button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
$conf db name
Only used if Module[ID]Name translation string is not found.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.