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);
228if ($action ==
'dispatch' && $permissiontoreceive) {
235 foreach ($_POST as $key => $value) {
238 if (preg_match(
'/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
243 $prod =
"product_".$reg[1].
'_'.$reg[2];
244 $qty =
"qty_".$reg[1].
'_'.$reg[2];
245 $ent =
"entrepot_".$reg[1].
'_'.$reg[2];
247 $ent = $fk_default_warehouse;
249 $pu =
"pu_".$reg[1].
'_'.$reg[2];
250 $fk_commandefourndet =
"fk_commandefourndet_".$reg[1].
'_'.$reg[2];
253 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
254 $dto =
GETPOSTINT(
"dto_".$reg[1].
'_'.$reg[2]);
256 $unit_price =
price2num((
float)
GETPOST(
"pu_".$reg[1]) * (100 - $dto) / 100,
'MU');
258 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
265 if ($qtytomove != 0) {
267 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
268 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline);
269 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
274 $result =
$object->dispatchProduct($user,
GETPOSTINT($prod), $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'),
'',
'',
'',
GETPOSTINT($fk_commandefourndet), $notrigger);
280 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
281 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
288 if (GETPOSTISSET($saveprice)) {
290 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
291 $sql .=
" SET unitprice='".price2num(
GETPOST($pu),
'MU').
"'";
292 $sql .=
", price=".price2num(
GETPOST($pu),
'MU').
"*quantity";
293 $sql .=
", remise_percent = ".((float) $dto);
294 $sql .=
" WHERE fk_soc=".((int)
$object->socid);
295 $sql .=
" AND fk_product=".(GETPOSTINT($prod));
297 $resql = $db->query($sql);
305 if (preg_match(
'/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
311 $prod =
'product_batch_'.$reg[1].
'_'.$reg[2];
312 $qty =
'qty_'.$reg[1].
'_'.$reg[2];
313 $ent =
'entrepot_'.$reg[1].
'_'.$reg[2];
314 $pu =
'pu_'.$reg[1].
'_'.$reg[2];
315 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
316 $lot =
'lot_number_'.$reg[1].
'_'.$reg[2];
320 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
323 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
324 $dto =
GETPOSTINT(
"dto_".$reg[1].
'_'.$reg[2]);
326 $unit_price =
price2num((
float)
GETPOST(
"pu_".$reg[1]) * (100 - $dto) / 100,
'MU');
328 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
335 if ($qtytomove > 0) {
339 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
340 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.((
int) $reg[1] + 1);
341 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
354 if (!
GETPOST($lot,
'alpha') && !$dDLUO && !$dDLC) {
355 dol_syslog(
'No dispatch for line '.$key.
' as serial/eat-by/sellby date are not set');
356 $text = $langs->transnoentities(
'atleast1batchfield').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.((
int) $reg[1] + 1);
357 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
362 $result =
$object->dispatchProduct($user, $productId, $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'), $dDLUO, $dDLC,
GETPOST($lot,
'alpha'),
GETPOSTINT($fk_commandefourndet), $notrigger);
368 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
369 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
370 $dto =
GETPOSTINT(
"dto_".$reg[1].
'_'.$reg[2]);
372 if (GETPOSTISSET($saveprice)) {
374 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
375 $sql .=
" SET unitprice = ".price2num(
GETPOST($pu),
'MU', 2);
376 $sql .=
", price = ".price2num(
GETPOST($pu),
'MU', 2).
" * quantity";
377 $sql .=
", remise_percent = ".price2num((empty($dto) ? 0 : $dto), 3, 2).
"'";
378 $sql .=
" WHERE fk_soc = ".((int)
$object->socid);
379 $sql .=
" AND fk_product=".((int) $productId);
381 $resql = $db->query($sql);
391 $result =
$object->calcAndSetStatusDispatch($user,
GETPOST(
'closeopenorder') ? 1 : 0,
GETPOST(
'comment'));
398 if ($result >= 0 && !$error) {
403 header(
"Location: dispatch.php?id=".$id);
411if ($action ==
'confirm_deleteline' && $confirm ==
'yes' && $permissiontoreceive) {
415 $result = $supplierorderdispatch->fetch($lineid);
417 $qty = $supplierorderdispatch->qty;
418 $entrepot = $supplierorderdispatch->fk_entrepot;
419 $product = $supplierorderdispatch->fk_product;
421 $comment = $supplierorderdispatch->comment;
422 $eatby = $supplierorderdispatch->eatby;
423 $sellby = $supplierorderdispatch->sellby;
424 $batch = $supplierorderdispatch->batch;
426 $result = $supplierorderdispatch->delete($user);
433 if ($entrepot > 0 && isModEnabled(
'stock') &&
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') && empty($supplierorderdispatch->fk_reception)) {
438 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment,
'', $eatby, $sellby, $batch);
440 $errors = $mouv->errors;
455if ($action ==
'updateline' && $permissiontoreceive && empty($cancel)) {
460 $result = $supplierorderdispatch->fetch($lineid);
462 $qty = $supplierorderdispatch->qty;
463 $entrepot = $supplierorderdispatch->fk_entrepot;
464 $product = $supplierorderdispatch->fk_product;
466 $comment = $supplierorderdispatch->comment;
467 $eatby = $supplierorderdispatch->eatby;
468 $sellby = $supplierorderdispatch->sellby;
469 $batch = $supplierorderdispatch->batch;
471 $supplierorderdispatch->qty =
GETPOSTFLOAT(
'qty',
'MS');
472 $supplierorderdispatch->fk_entrepot =
GETPOSTINT(
'fk_entrepot');
473 $result = $supplierorderdispatch->update($user);
477 $errors = $supplierorderdispatch->errors;
480 if ($entrepot > 0 && isModEnabled(
'stock') &&
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER')) {
485 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment,
'', $eatby, $sellby, $batch);
487 $errors = $mouv->errors;
491 $result = $mouv->reception($user, $product, $supplierorderdispatch->fk_entrepot, $supplierorderdispatch->qty, $price, $comment, $eatby, $sellby, $batch);
493 $errors = $mouv->errors;
515$form =
new Form($db);
517$warehouse_static =
new Entrepot($db);
520$title =
$object->ref.
" - ".$langs->trans(
'OrderDispatch');
521$help_url =
'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
522$morejs = array(
'/fourn/js/lib_dispatch.js.php');
524llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs,
'',
'',
'mod-supplier-order page-card_dispatch');
526if ($id > 0 || !empty($ref)) {
530 $author =
new User($db);
531 $author->fetch(
$object->user_author_id);
535 $title = $langs->trans(
"SupplierOrder");
541 if ($action ==
'ask_deleteline') {
542 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
546 $parameters = array(
'lineid' => $lineid);
548 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
549 if (empty($reshook)) {
550 $formconfirm .= $hookmanager->resPrint;
551 } elseif ($reshook > 0) {
552 $formconfirm = $hookmanager->resPrint;
560 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fourn/commande/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
562 $morehtmlref =
'<div class="refidno">';
564 $morehtmlref .= $form->editfieldkey(
"RefSupplier",
'ref_supplier',
$object->ref_supplier, $object, 0,
'string',
'', 0, 1);
565 $morehtmlref .= $form->editfieldval(
"RefSupplier",
'ref_supplier',
$object->ref_supplier, $object, 0,
'string',
'',
null,
null,
'', 1);
567 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1);
569 if (isModEnabled(
'project')) {
570 $langs->load(
"projects");
571 $morehtmlref .=
'<br>';
573 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
574 if ($action !=
'classify' && $caneditproject) {
575 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
577 $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');
579 if (!empty(
$object->fk_project)) {
581 $proj->fetch(
$object->fk_project);
582 $morehtmlref .= $proj->getNomUrl(1);
584 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
589 $morehtmlref .=
'</div>';
592 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
595 print
'<div class="fichecenter">';
596 print
'<div class="underbanner clearboth"></div>';
598 print
'<table class="border tableforfield" width="100%">';
601 if (
$object->methode_commande_id > 0) {
602 print
'<tr><td class="titlefield">'.$langs->trans(
"Date").
'</td><td>';
608 if (
$object->methode_commande) {
609 print
'<tr><td>'.$langs->trans(
"Method").
'</td><td>'.
$object->getInputMethod().
'</td></tr>';
614 print
'<tr><td class="titlefield">'.$langs->trans(
"AuthorRequest").
'</td>';
615 print
'<td>'.$author->getNomUrl(1,
'', 0, 0, 0).
'</td>';
618 $parameters = array();
619 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
636 print
'<br><span class="opacitymedium">'.$langs->trans(
"OrderStatusNotReadyToDispatch").
'</span>';
646 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
648 $formproduct->loadWarehouses();
650 $listwarehouses = $entrepot->list_array(1);
653 if (empty($conf->reception->enabled)) {
654 print
'<form method="POST" action="dispatch.php?id='.$object->id.
'">';
656 print
'<form method="post" action="'.dol_buildpath(
'/reception/card.php', 1).
'?originid='.
$object->id.
'&origin=supplierorder">';
659 print
'<input type="hidden" name="token" value="'.newToken().
'">';
660 if (empty($conf->reception->enabled)) {
661 print
'<input type="hidden" name="action" value="dispatch">';
663 print
'<input type="hidden" name="action" value="create">';
666 print
'<div class="div-table-responsive-no-min">';
667 print
'<table class="noborder centpercent">';
670 $products_dispatched = array();
671 $sql =
"SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty";
672 $sql .=
" FROM ".MAIN_DB_PREFIX.
"receptiondet_batch as cfd";
673 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l on l.rowid = cfd.fk_elementdet";
674 $sql .=
" WHERE cfd.fk_element = ".((int)
$object->id);
675 $sql .=
" GROUP BY l.rowid, cfd.fk_product";
677 $resql = $db->query($sql);
679 $num = $db->num_rows($resql);
684 $objd = $db->fetch_object($resql);
685 $products_dispatched[$objd->rowid] =
price2num($objd->qty,
'MS');
693 $sql =
"SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty,";
694 $sql .=
" p.ref, p.label, p.tobatch, p.fk_default_warehouse";
697 $parameters = array();
698 $reshook = $hookmanager->executeHooks(
699 'printFieldListSelect',
707 $sql .= $hookmanager->resPrint;
709 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l";
710 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON l.fk_product=p.rowid";
711 $sql .=
" WHERE l.fk_commande = ".((int)
$object->id);
713 $sql .=
" AND l.product_type = 0";
717 $parameters = array();
718 $reshook = $hookmanager->executeHooks(
719 'printFieldListWhere',
727 $sql .= $hookmanager->resPrint;
730 $sql .=
" ORDER BY l.rang, p.ref, p.label";
732 $resql = $db->query($sql);
734 $num = $db->num_rows($resql);
738 print
'<tr class="liste_titre">';
740 print
'<td>'.$langs->trans(
"Description").
'</td>';
741 if (isModEnabled(
'productbatch')) {
742 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
744 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
747 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
754 print
'<td class="right">'.$langs->trans(
"SupplierRef").
'</td>';
755 print
'<td class="right">'.$langs->trans(
"QtyOrdered").
'</td>';
756 print
'<td class="right">'.$langs->trans(
"QtyDispatchedShort").
'</td>';
757 print
' <td class="right">'.$langs->trans(
"QtyToDispatchShort");
758 print
'<br><a href="#" id="autoreset">'.img_picto($langs->trans(
"Reset"),
'eraser',
'class="pictofixedwidth opacitymedium"').$langs->trans(
"Reset").
'</a></td>';
759 print
'<td width="32"></td>';
762 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
763 print
'<td class="right">'.$langs->trans(
"Price").
'</td>';
764 print
'<td class="right">'.$langs->trans(
"ReductionShort").
' (%)</td>';
765 print
'<td class="right">'.$langs->trans(
"UpdatePrice").
'</td>';
769 print
'<td align="right">'.$langs->trans(
"Warehouse");
772 if (count($listwarehouses) > 1) {
773 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, $langs->trans(
"ForceTo"), 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
774 } elseif (count($listwarehouses) == 1) {
775 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
781 $parameters = array();
782 $reshook = $hookmanager->executeHooks(
783 'printFieldListTitle',
791 print $hookmanager->resPrint;
800 $conf->cache[
'product'] = array();
804 $objp = $db->fetch_object($resql);
807 if (!$objp->fk_product > 0) {
810 $alreadydispatched = isset($products_dispatched[$objp->rowid]) ? $products_dispatched[$objp->rowid] : 0;
811 $remaintodispatch =
price2num($objp->qty - ((
float) $alreadydispatched), 5);
812 if ($remaintodispatch < 0 && !
getDolGlobalString(
'SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN')) {
813 $remaintodispatch = 0;
816 if ($remaintodispatch || !
getDolGlobalString(
'SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
825 print
'<!-- Line to dispatch '.$suffix.
' -->'.
"\n";
827 print
'<input id="qty_ordered'.$suffix.
'" type="hidden" value="'.$objp->qty.
'">';
828 print
'<input id="qty_dispatched'.$suffix.
'" type="hidden" value="'.(float) $alreadydispatched.
'">';
829 print
'<tr class="oddeven">';
831 if (empty($conf->cache[
'product'][$objp->fk_product])) {
832 $tmpproduct =
new Product($db);
833 $tmpproduct->fetch($objp->fk_product);
834 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
836 $tmpproduct = $conf->cache[
'product'][$objp->fk_product];
839 $linktoprod = $tmpproduct->getNomUrl(1);
840 $linktoprod .=
' - '.$objp->label.
"\n";
842 if (isModEnabled(
'productbatch')) {
843 if ($objp->tobatch) {
848 print
'<td class="dispatch_batch_number"></td>';
850 print
'<td class="dispatch_dlc"></td>';
853 print
'<td class="dispatch_dluo"></td>';
860 print
'<td class="dispatch_batch_number">';
861 print
'<span class="opacitymedium small">'.$langs->trans(
"ProductDoesNotUseBatchSerial").
'</small>';
864 print
'<td class="dispatch_dlc"></td>';
867 print
'<td class="dispatch_dluo"></td>';
871 print
'<td colspan="4">';
877 $up_ht_disc = $objp->subprice;
878 if (!empty($objp->remise_percent) && !
getDolGlobalString(
'STOCK_EXCLUDE_DISCOUNT_FOR_PMP')) {
879 $up_ht_disc =
price2num($up_ht_disc * (100 - $objp->remise_percent) / 100,
'MU');
883 print
'<td class="right">'.$objp->sref.
'</td>';
886 print
'<td class="right">'.$objp->qty.
'</td>';
889 print
'<td class="right">'.$alreadydispatched.
'</td>';
891 if (isModEnabled(
'productbatch') && $objp->tobatch > 0) {
893 print
'<td class="right">';
903 'is_information_row' =>
true,
908 $reshook = $hookmanager->executeHooks(
909 'printFieldListValue',
917 print $hookmanager->resPrint;
921 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
923 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
924 print
'<input name="product_batch'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
926 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
928 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
930 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
936 print
'<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.
'" name="lot_number'.$suffix.
'" value="'.
GETPOST(
'lot_number'.$suffix).
'">';
939 print
'<td class="nowraponall">';
941 print $form->selectDate($dlcdatesuffix,
'dlc'.$suffix, 0, 0, 1,
'');
945 print
'<td class="nowraponall">';
947 print $form->selectDate($dluodatesuffix,
'dluo'.$suffix, 0, 0, 1,
'');
950 print
'<td colspan="3"> </td>';
956 print
'<td class="right">';
966 'is_information_row' =>
true,
971 $reshook = $hookmanager->executeHooks(
972 'printFieldListValue',
980 print $hookmanager->resPrint;
984 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
985 print
'<td colspan="'.$colspan.
'">';
986 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
987 print
'<input name="product'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
989 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
991 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
993 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
1000 print
'<td class="right nowrap">';
1001 if ($remaintodispatch>0) {
1002 $btnLabel = $langs->trans(
"Fill").
' : '.$remaintodispatch;
1003 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>';
1005 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)).
'">';
1006 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>';
1010 if (isModEnabled(
'productbatch') && $objp->tobatch > 0) {
1012 print
img_picto($langs->trans(
'AddStockLocationLine'),
'split.png',
'class="splitbutton" onClick="addDispatchLine('.$i.
', \''.$type.
'\')
"');
1015 print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton
" onClick="addDispatchLine(
'.$i.', \
''.$type.
'\')
"');
1019 if (getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
1020 if (!isModEnabled("multicurrency
") && empty($conf->dynamicprices->enabled)) {
1022 print '<td class="right
">';
1023 print '<input id="pu
'.$suffix.'" name="pu
'.$suffix.'" type="text
" size="8
" value="'.price((GETPOST('pu
'.$suffix) != '' ? price2num(GETPOST('pu
'.$suffix)) : $up_ht_disc)).'">';
1027 print '<td class="right
">';
1028 print '<input id="dto
'.$suffix.'" name="dto
'.$suffix.'" type="text
" size="8
" value="'.(GETPOST('dto
'.$suffix) != '' ? GETPOST('dto
'.$suffix) : '').'">';
1032 print '<td class="center
">';
1033 print '<input class="flat checkformerge
" type="checkbox
" name="saveprice
'.$suffix.'" value="'.(GETPOST('saveprice
'.$suffix) != '' ? GETPOST('saveprice
'.$suffix) : '').'">';
1039 print '<td class="right
">';
1040 if (count($listwarehouses) > 1) {
1041 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, null, 'csswarehouse'.$suffix);
1042 } elseif (count($listwarehouses) == 1) {
1043 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, null, 'csswarehouse'.$suffix);
1045 $langs->load("errors
");
1046 print $langs->trans("ErrorNoWarehouseDefined
");
1050 // Enable hooks to append additional columns
1051 $parameters = array(
1052 'is_information_row' => false, // this is a dispatch form row
1054 'suffix' => $suffix,
1057 $reshook = $hookmanager->executeHooks(
1058 'printFieldListValue',
1064 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1066 print $hookmanager->resPrint;
1075 dol_print_error($db);
1082 $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically
", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
1084 print '<div class="center
">';
1085 $parameters = array();
1086 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
1088 if (empty($reshook)) {
1089 if (empty($conf->reception->enabled)) {
1090 print $langs->trans("Comment").' : ';
1091 print '<input type="text
" class="minwidth400
" maxlength="128
" name="comment
" value="';
1092 print GETPOSTISSET("comment") ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
1093 // print ' /
'.$object->ref_supplier; // Not yet available
1094 print '" class="flat
"><br>';
1096 print '<input type="checkbox
" checked="checked
" name="closeopenorder
"> '.$checkboxlabel;
1099 $dispatchBt = empty($conf->reception->enabled) ? $langs->trans("Receive
") : $langs->trans("CreateReception
");
1102 print '<input type="hidden
" name="backtopageforcancel
" value="'.$_SERVER["PHP_SELF"].'?
id=
'.$object->id.'">';
1103 print '<input type="submit
" class="button" name="dispatch
" value="'.dol_escape_htmltag($dispatchBt).'"';
1105 if (!$permissiontoreceive) {
1108 if (count($listwarehouses) <= 0) {
1120 // Message if nothing to dispatch
1123 if (!getDolGlobalString('SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
1124 print '<div class="opacitymedium
">'.$langs->trans("NoPredefinedProductToDispatch
").'</div>'; // No predefined line at all
1126 print '<div class="opacitymedium
">'.$langs->trans("NoMorePredefinedProductToDispatch
").'</div>'; // No predefined line that remain to be dispatched.
1133 print dol_get_fiche_end();
1135 // traitement entrepot par défaut
1136 print '<script type="text/javascript
">
1137 $(document).ready(function () {
1138 $("select[
name=fk_default_warehouse]
").change(function() {
1139 var fk_default_warehouse = $("option:selected
", this).val();
1140 $("select[
name^=entrepot_]
").val(fk_default_warehouse).change();
1143 $(".auto-fill-qty
").on("click touchstart
", function(e){
1145 $("input[
name=
"+$(this).data("rowname
")+"]
").val($(this).data("value
")).trigger("change
");
1148 $("#autoreset
").click(function() {
1149 $(".qtydispatchinput
").each(function(){
1150 id = $(this).attr("id");
1151 idtab = id.split("_
");
1155 $("#qty_dispatched_0_
"+idtab[2]).val("0
");
1157 obj = $(this).parent().parent();
1158 nameobj = obj.attr("name");
1159 nametab = nameobj.split("_
");
1161 $("tr[
name^=\
'"+nametab[0]+"_\'][name$=\'_"+nametab[2]+"\']:last .splitbutton").show();
1166 $(".resetline").click(function(e){
1168 id = $(this).attr("id");
1169 id = id.split("reset_");
1170 console.log("Reset trigger for id = qty_"+id[1]);
1171 $("#qty_"+id[1]).val("");
1177 $sql =
"SELECT p.rowid as pid, p.ref, p.label,";
1178 $sql .=
" e.rowid as warehouse_id, e.ref as entrepot,";
1179 $sql .=
" cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec";
1180 $sql .=
" ,cd.rowid, cd.subprice";
1181 if (isModEnabled(
'reception')) {
1182 $sql .=
" ,cfd.fk_reception, r.date_delivery";
1184 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product as p,";
1185 $sql .=
" ".MAIN_DB_PREFIX.
"receptiondet_batch as cfd";
1186 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as cd ON cd.rowid = cfd.fk_elementdet";
1187 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"entrepot as e ON cfd.fk_entrepot = e.rowid";
1188 if (isModEnabled(
'reception')) {
1189 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"reception as r ON cfd.fk_reception = r.rowid";
1191 $sql .=
" WHERE cfd.fk_element = ".((int)
$object->id);
1192 $sql .=
" AND cfd.fk_product = p.rowid";
1193 $sql .=
" ORDER BY cfd.rowid ASC";
1195 $resql = $db->query($sql);
1197 $num = $db->num_rows($resql);
1205 print
'<div class="div-table-responsive">';
1206 print
'<table id="dispatch_received_products" class="noborder centpercent">';
1208 print
'<tr class="liste_titre">';
1210 if ($conf->reception->enabled) {
1211 print
'<td>'.$langs->trans(
"Reception").
'</td>';
1214 print
'<td>'.$langs->trans(
"Product").
'</td>';
1215 print
'<td class="center">'.$langs->trans(
"DateCreation").
'</td>';
1216 print
'<td class="center">'.$langs->trans(
"DateDeliveryPlanned").
'</td>';
1217 if (isModEnabled(
'productbatch')) {
1218 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
1220 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
1223 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
1226 print
'<td class="right">'.$langs->trans(
"QtyDispatched").
'</td>';
1227 print
'<td>'.$langs->trans(
"Warehouse").
'</td>';
1228 print
'<td>'.$langs->trans(
"Comment").
'</td>';
1231 if (
getDolGlobalString(
'SUPPLIER_ORDER_USE_DISPATCH_STATUS') && empty($reception->rowid)) {
1232 print
'<td class="center" colspan="2">'.$langs->trans(
"Status").
'</td>';
1233 } elseif (isModEnabled(
"reception")) {
1234 print
'<td class="center"></td>';
1237 print
'<td class="center" colspan="2"></td>';
1243 $objp = $db->fetch_object($resql);
1245 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1246 print
'<form name="editdispatchedlines" id="editdispatchedlines" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'#line_'.
GETPOSTINT(
'lineid').
'" method="POST">
1247 <input type="hidden" name="token" value="'.
newToken().
'">
1248 <input type="hidden" name="action" value="updateline">
1249 <input type="hidden" name="mode" value="">
1250 <input type="hidden" name="lineid" value="'.$objp->dispatchlineid.
'">';
1253 print
'<tr class="oddeven" id="line_'.$objp->dispatchlineid.
'" >';
1256 if (isModEnabled(
"reception")) {
1257 print
'<td class="nowraponall">';
1258 if (!empty($objp->fk_reception)) {
1260 $reception->fetch($objp->fk_reception);
1261 print $reception->getNomUrl(1);
1268 print
'<td class="tdoverflowmax150">';
1269 if (empty($conf->cache[
'product'][$objp->fk_product])) {
1270 $tmpproduct =
new Product($db);
1271 $tmpproduct->fetch($objp->fk_product);
1272 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
1274 $tmpproduct = $conf->cache[
'product'][$objp->fk_product];
1276 print $tmpproduct->getNomUrl(1);
1277 print
' - '.$objp->label;
1281 print
'<td class="center">'.dol_print_date($db->jdate($objp->datec),
'day').
'</td>';
1284 print
'<td class="center">'.dol_print_date($db->jdate($objp->date_delivery),
'day').
'</td>';
1287 if (isModEnabled(
'productbatch')) {
1289 include_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
1291 $lot->fetch(0, $objp->pid, $objp->batch);
1292 print
'<td class="dispatch_batch_number">'.$lot->getNomUrl(1).
'</td>';
1294 print
'<td class="dispatch_dlc">'.dol_print_date($lot->sellby,
'day').
'</td>';
1297 print
'<td class="dispatch_dluo">'.dol_print_date($lot->eatby,
'day').
'</td>';
1300 print
'<td class="dispatch_batch_number"></td>';
1302 print
'<td class="dispatch_dlc"></td>';
1305 print
'<td class="dispatch_dluo"></td>';
1311 print
'<td class="right">';
1312 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1313 print
'<input style="width: 50px;" type="text" min="1" name="qty" value="'.$objp->qty.
'" />';
1317 print
'<input type="hidden" name="price" value="'.$objp->subprice.
'" />';
1321 print
'<td class="tdoverflowmax150">';
1322 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1323 if (count($listwarehouses) > 1) {
1324 print $formproduct->selectWarehouses(
GETPOST(
"fk_entrepot") ?
GETPOST(
"fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id :
''),
"fk_entrepot",
'', 1, 0, $objp->fk_product,
'', 1, 1, null,
'csswarehouse');
1325 } elseif (count($listwarehouses) == 1) {
1326 print $formproduct->selectWarehouses(
GETPOST(
"fk_entrepot") ?
GETPOST(
"fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id :
''),
"fk_entrepot",
'', 0, 0, $objp->fk_product,
'', 1, 1, null,
'csswarehouse');
1328 $langs->load(
"errors");
1329 print $langs->trans(
"ErrorNoWarehouseDefined");
1332 $warehouse_static->id = $objp->warehouse_id;
1333 $warehouse_static->label = $objp->entrepot;
1334 print $warehouse_static->getNomUrl(1);
1339 print
'<td class="tdoverflowmax300" style="white-space: pre;">'.$objp->comment.
'</td>';
1342 if (
getDolGlobalString(
'SUPPLIER_ORDER_USE_DISPATCH_STATUS') && empty($reception->rowid)) {
1343 print
'<td class="right">';
1344 $supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status);
1346 print $supplierorderdispatch->getLibStatut(5);
1350 print
'<td class="center">';
1351 if (!$permissiontocontrol) {
1352 if (empty($objp->status)) {
1353 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Approve").
'</a>';
1354 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1356 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Disapprove").
'</a>';
1357 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1364 if (empty($objp->status)) {
1365 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=checkdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1366 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=denydispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1368 if ($objp->status == 1) {
1369 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1370 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=denydispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1372 if ($objp->status == 2) {
1373 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1374 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=checkdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1378 } elseif (isModEnabled(
"reception")) {
1379 print
'<td class="right">';
1380 if (!empty($reception->id)) {
1381 print $reception->getLibStatut(5);
1387 if ($action !=
'editline' || $lineid != $objp->dispatchlineid) {
1388 if (empty($reception->id) || ($reception->statut == Reception::STATUS_DRAFT)) {
1389 print
'<td class="linecoledit center">';
1390 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editline&token='.
newToken().
'&lineid='.$objp->dispatchlineid.
'#line_'.$objp->dispatchlineid.
'">';
1395 print
'<td class="linecoldelete center">';
1396 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=ask_deleteline&token='.
newToken().
'&lineid='.$objp->dispatchlineid.
'#dispatch_received_products">';
1401 print
'<td></td><td></td>';
1404 print
'<td class="center valignmiddle">';
1405 print
'<input type="submit" class="button button-save" id="savelinebutton" name="save" value="'.$langs->trans(
"Save").
'" />';
1407 print
'<td class="center valignmiddle">';
1408 print
'<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans(
"Cancel").
'" />';
1414 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.