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';
46 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
58$langs->loadLangs(array(
"bills",
"orders",
"sendings",
"companies",
"products",
"stocks",
"receptions"));
61 $langs->load(
'productbatch');
68$action =
GETPOST(
'action',
'aZ09');
69$fk_default_warehouse =
GETPOSTINT(
'fk_default_warehouse');
70$cancel =
GETPOST(
'cancel',
'alpha');
71$confirm =
GETPOST(
'confirm',
'alpha');
74 $socid = $user->socid;
77$hookmanager->initHooks(array(
'ordersupplierdispatch'));
81if (GETPOSTISSET(
"projectid")) {
87if ($id > 0 || !empty($ref)) {
88 $result =
$object->fetch($id, $ref);
92 $result =
$object->fetch_thirdparty();
98if (empty($conf->reception->enabled)) {
99 $permissiontoreceive = $user->hasRight(
"fournisseur",
"commande",
"receptionner");
100 $permissiontocontrol = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"fournisseur",
"commande",
"receptionner")) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"fournisseur",
"commande_advance",
"check")));
102 $permissiontoreceive = $user->hasRight(
"reception",
"creer");
103 $permissiontocontrol = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"reception",
"creer")) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"reception",
"reception_advance",
"validate")));
107$result =
restrictedArea($user,
'fournisseur', $object,
'commande_fournisseur',
'commande');
113$usercancreate = ($user->hasRight(
"fournisseur",
"commande",
"creer") || $user->hasRight(
"supplier_order",
"creer"));
114$permissiontoadd = $usercancreate;
123$parameters = array();
124$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
130if (in_array($action, [
'checkdispatchline',
'uncheckdispatchline',
'denydispatchline',
'confirm_deleteline',
'updateline'])) {
132 if ($tmpdispatchline->fetch($lineid) <= 0 || (
int) $tmpdispatchline->fk_element !== (
int)
$object->id) {
138if ($action ==
'checkdispatchline' && $permissiontocontrol) {
143 $result = $supplierorderdispatch->fetch($lineid);
146 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
151 $result = $supplierorderdispatch->setStatut(1);
153 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
160 $result =
$object->calcAndSetStatusDispatch($user);
174if ($action ==
'uncheckdispatchline' && $permissiontocontrol) {
179 $result = $supplierorderdispatch->fetch($lineid);
182 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
187 $result = $supplierorderdispatch->setStatut(0);
189 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
195 $result =
$object->calcAndSetStatusDispatch($user);
209if ($action ==
'denydispatchline' && $permissiontocontrol) {
214 $result = $supplierorderdispatch->fetch($lineid);
217 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
222 $result = $supplierorderdispatch->setStatut(2);
224 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
230 $result =
$object->calcAndSetStatusDispatch($user);
244$saveprice =
"savepriceIsNotSet";
245if ($action ==
'dispatch' && $permissiontoreceive) {
251 foreach ($_POST as $key => $value) {
254 if (preg_match(
'/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
259 $prod =
"product_".$reg[1].
'_'.$reg[2];
260 $qty =
"qty_".$reg[1].
'_'.$reg[2];
261 $ent =
"entrepot_".$reg[1].
'_'.$reg[2];
263 $ent = $fk_default_warehouse;
265 $pu =
"pu_".$reg[1].
'_'.$reg[2];
266 $fk_commandefourndet =
"fk_commandefourndet_".$reg[1].
'_'.$reg[2];
269 if (!
isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
270 $dto =
GETPOSTINT(
"dto_".$reg[1].
'_'.$reg[2]);
272 $unit_price =
price2num((
float)
GETPOST(
"pu_".$reg[1]) * (100 - $dto) / 100,
'MU');
274 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
281 if ($qtytomove != 0) {
283 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
284 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline);
285 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
290 $result =
$object->dispatchProduct($user,
GETPOSTINT($prod), $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'),
'',
'',
'',
GETPOSTINT($fk_commandefourndet), $notrigger);
296 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
297 if (!
isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
304 if (GETPOSTISSET($saveprice)) {
306 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
307 $sql .=
" SET unitprice='".price2num(
GETPOST($pu),
'MU').
"'";
308 $sql .=
", price=".price2num(
GETPOST($pu),
'MU').
"*quantity";
309 $sql .=
", remise_percent = ".((float) $dto);
310 $sql .=
" WHERE fk_soc=".((int)
$object->socid);
311 $sql .=
" AND fk_product=".(GETPOSTINT($prod));
313 $resql = $db->query($sql);
321 if (preg_match(
'/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
327 $prod =
'product_batch_'.$reg[1].
'_'.$reg[2];
328 $qty =
'qty_'.$reg[1].
'_'.$reg[2];
329 $ent =
'entrepot_'.$reg[1].
'_'.$reg[2];
330 $pu =
'pu_'.$reg[1].
'_'.$reg[2];
331 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
332 $lot =
'lot_number_'.$reg[1].
'_'.$reg[2];
336 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
339 if (!
isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
342 $unit_price =
price2num((
float)
GETPOST(
"pu_".$reg[1]) * (100 - $dto) / 100,
'MU');
344 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
351 if ($qtytomove > 0) {
355 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
356 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.((
int) $reg[1] + 1);
357 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
370 if (!
GETPOST($lot,
'alpha') && !$dDLUO && !$dDLC) {
371 dol_syslog(
'No dispatch for line '.$key.
' as serial/eat-by/sellby date are not set');
372 $text = $langs->transnoentities(
'atleast1batchfield').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.((
int) $reg[1] + 1);
373 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
378 $result =
$object->dispatchProduct($user, $productId, $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'), $dDLUO, $dDLC,
GETPOST($lot,
'alpha'),
GETPOSTINT($fk_commandefourndet), $notrigger);
384 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
385 if (!
isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
388 if (GETPOSTISSET($saveprice)) {
390 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
391 $sql .=
" SET unitprice = ".price2num(
GETPOST($pu),
'MU', 2);
392 $sql .=
", price = ".price2num(
GETPOST($pu),
'MU', 2).
" * quantity";
393 $sql .=
", remise_percent = ".price2num((empty($dto) ? 0 : $dto), 3, 2);
394 $sql .=
" WHERE fk_soc = ".((int)
$object->socid);
395 $sql .=
" AND fk_product=".((int) $productId);
397 $resql = $db->query($sql);
407 $result =
$object->calcAndSetStatusDispatch($user,
GETPOST(
'closeopenorder') ? 1 : 0,
GETPOST(
'comment'));
414 if ($result >= 0 && !$error) {
419 header(
"Location: dispatch.php?id=".$id);
434if ($action ==
'confirm_deleteline' && $confirm ==
'yes' && $permissiontoreceive) {
438 $result = $supplierorderdispatch->fetch($lineid);
440 $qty = $supplierorderdispatch->qty;
441 $entrepot = $supplierorderdispatch->fk_entrepot;
442 $product = $supplierorderdispatch->fk_product;
444 $comment = $supplierorderdispatch->comment;
445 $eatby = $supplierorderdispatch->eatby;
446 $sellby = $supplierorderdispatch->sellby;
447 $batch = $supplierorderdispatch->batch;
449 $result = $supplierorderdispatch->delete($user);
456 if ($entrepot > 0 &&
isModEnabled(
'stock') &&
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') && empty($supplierorderdispatch->fk_reception)) {
461 $result = $mouv->livraison($user, $product, $entrepot, $qty, (
float) $price, $comment,
'', (
int) $eatby, (
int) $sellby, $batch);
463 $errors = $mouv->errors;
478if ($action ==
'updateline' && $permissiontoreceive && empty($cancel)) {
482 $result = $supplierorderdispatch->fetch($lineid);
484 $qty = $supplierorderdispatch->qty;
485 $entrepot = $supplierorderdispatch->fk_entrepot;
486 $product = $supplierorderdispatch->fk_product;
488 $comment = $supplierorderdispatch->comment;
489 $eatby = $supplierorderdispatch->eatby;
490 $sellby = $supplierorderdispatch->sellby;
491 $batch = $supplierorderdispatch->batch;
493 $supplierorderdispatch->qty =
GETPOSTFLOAT(
'qty',
'MS');
494 $supplierorderdispatch->fk_entrepot =
GETPOSTINT(
'fk_entrepot');
495 $result = $supplierorderdispatch->update($user);
499 $errors = $supplierorderdispatch->errors;
507 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment,
'', (
int) $eatby, (
int) $sellby, $batch);
509 $errors = $mouv->errors;
513 $result = $mouv->reception($user, $product, $supplierorderdispatch->fk_entrepot, $supplierorderdispatch->qty, $price, $comment, (
int) $eatby, (
int) $sellby, $batch);
515 $errors = $mouv->errors;
537$form =
new Form($db);
539$warehouse_static =
new Entrepot($db);
542$title =
$object->ref.
" - ".$langs->trans(
'OrderDispatch');
543$help_url =
'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
544$morejs = array(
'/fourn/js/lib_dispatch.js.php');
546llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs,
'',
'',
'mod-supplier-order page-card_dispatch');
548if ($id > 0 || !empty($ref)) {
552 $author =
new User($db);
553 $author->fetch(
$object->user_author_id);
557 $title = $langs->trans(
"SupplierOrder");
563 if ($action ==
'ask_deleteline') {
564 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
568 $parameters = array(
'lineid' => $lineid);
570 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
571 if (empty($reshook)) {
572 $formconfirm .= $hookmanager->resPrint;
573 } elseif ($reshook > 0) {
574 $formconfirm = $hookmanager->resPrint;
582 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fourn/commande/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
584 $morehtmlref =
'<div class="refidno">';
586 $morehtmlref .= $form->editfieldkey(
"RefSupplier",
'ref_supplier',
$object->ref_supplier, $object, 0,
'string',
'', 0, 1);
587 $morehtmlref .= $form->editfieldval(
"RefSupplier",
'ref_supplier',
$object->ref_supplier, $object, 0,
'string',
'',
null,
null,
'', 1);
589 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1);
592 $langs->load(
"projects");
593 $morehtmlref .=
'<br>';
595 $caneditproject =
false;
596 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
597 if ($action !=
'classify' && $caneditproject) {
598 $morehtmlref .=
'<a class="editfielda" href="'.dolBuildUrl($_SERVER[
'PHP_SELF'], [
'action' =>
'classify',
'id' =>
$object->id],
true).
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
600 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, (!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ?
$object->socid : -1), (string)
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
602 if (!empty(
$object->fk_project)) {
604 $proj->fetch(
$object->fk_project);
605 $morehtmlref .= $proj->getNomUrl(1);
607 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
612 $morehtmlref .=
'</div>';
615 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
618 print
'<div class="fichecenter">';
619 print
'<div class="underbanner clearboth"></div>';
621 print
'<table class="border tableforfield" width="100%">';
624 if (
$object->methode_commande_id > 0) {
625 print
'<tr><td class="titlefield">'.$langs->trans(
"Date").
'</td><td>';
631 if (
$object->methode_commande) {
632 print
'<tr><td>'.$langs->trans(
"Method").
'</td><td>'.
$object->getInputMethod().
'</td></tr>';
637 print
'<tr><td class="titlefield">'.$langs->trans(
"AuthorRequest").
'</td>';
638 print
'<td>'.$author->getNomUrl(-1,
'', 0, 0, 0).
'</td>';
641 $parameters = array();
642 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
655 print
'<br><span class="opacitymedium">'.$langs->trans(
"OrderStatusNotReadyToDispatch").
'</span>';
661 $listwarehouses = array();
666 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
668 $formproduct->loadWarehouses();
670 $listwarehouses = $entrepot->list_array(1);
673 if (empty($conf->reception->enabled)) {
674 print
'<form method="POST" action="dispatch.php?id='.$object->id.
'">';
676 print
'<form method="post" action="'.dol_buildpath(
'/reception/card.php', 1).
'?originid='.
$object->id.
'&origin=supplierorder">';
679 print
'<input type="hidden" name="token" value="'.newToken().
'">';
680 if (empty($conf->reception->enabled)) {
681 print
'<input type="hidden" name="action" value="dispatch">';
683 print
'<input type="hidden" name="action" value="create">';
686 print
'<div class="div-table-responsive-no-min">';
687 print
'<table class="noborder centpercent">';
690 $products_dispatched = array();
691 $sql =
"SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty";
692 $sql .=
" FROM ".MAIN_DB_PREFIX.
"receptiondet_batch as cfd";
693 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l on l.rowid = cfd.fk_elementdet";
694 $sql .=
" WHERE cfd.fk_element = ".((int)
$object->id);
695 $sql .=
" GROUP BY l.rowid, cfd.fk_product";
697 $resql = $db->query($sql);
699 $num = $db->num_rows($resql);
704 $objd = $db->fetch_object($resql);
705 $products_dispatched[$objd->rowid] =
price2num($objd->qty,
'MS');
713 $sql =
"SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty,";
714 $sql .=
" p.ref, p.label, p.tobatch, p.fk_default_warehouse";
717 $parameters = array();
718 $reshook = $hookmanager->executeHooks(
719 'printFieldListSelect',
727 $sql .= $hookmanager->resPrint;
729 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l";
730 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON l.fk_product=p.rowid";
731 $sql .=
" WHERE l.fk_commande = ".((int)
$object->id);
733 $sql .=
" AND l.product_type = 0";
737 $parameters = array();
738 $reshook = $hookmanager->executeHooks(
739 'printFieldListWhere',
747 $sql .= $hookmanager->resPrint;
750 $sql .=
" ORDER BY l.rang, p.ref, p.label";
756 $resql = $db->query($sql);
758 $num = $db->num_rows($resql);
762 print
'<tr class="liste_titre">';
764 print
'<td>'.$langs->trans(
"Description").
'</td>';
766 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
768 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
771 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
778 print
'<td class="right">'.$langs->trans(
"SupplierRef").
'</td>';
779 print
'<td class="right">'.$langs->trans(
"QtyOrdered").
'</td>';
780 print
'<td class="right">'.$langs->trans(
"QtyDispatchedShort").
'</td>';
781 print
' <td class="right">'.$langs->trans(
"QtyToDispatchShort");
782 print
'<br><a href="#" id="autoreset">'.img_picto($langs->trans(
"Reset"),
'eraser',
'class="pictofixedwidth opacitymedium"').$langs->trans(
"Reset").
'</a></td>';
783 print
'<td width="32"></td>';
786 if (!
isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
787 print
'<td class="right">'.$langs->trans(
"Price").
'</td>';
788 print
'<td class="right">'.$langs->trans(
"ReductionShort").
' (%)</td>';
789 print
'<td class="right">'.$langs->trans(
"UpdatePrice").
'</td>';
793 print
'<td align="right">'.$langs->trans(
"Warehouse");
796 if (count($listwarehouses) > 1) {
797 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, $langs->trans(
"ForceTo"), 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
798 } elseif (count($listwarehouses) == 1) {
799 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
805 $parameters = array();
806 $reshook = $hookmanager->executeHooks(
807 'printFieldListTitle',
815 print $hookmanager->resPrint;
822 $conf->cache[
'product'] = array();
826 $objp = $db->fetch_object($resql);
829 if (!$objp->fk_product > 0) {
832 $alreadydispatched = isset($products_dispatched[$objp->rowid]) ? $products_dispatched[$objp->rowid] : 0;
833 $remaintodispatch =
price2num($objp->qty - ((
float) $alreadydispatched), 5);
834 if ($remaintodispatch < 0 && !
getDolGlobalString(
'SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN')) {
835 $remaintodispatch = 0;
838 if ($remaintodispatch || !
getDolGlobalString(
'SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
847 print
'<!-- Line to dispatch '.$suffix.
' -->'.
"\n";
849 print
'<input id="qty_ordered'.$suffix.
'" type="hidden" value="'.$objp->qty.
'">';
850 print
'<input id="qty_dispatched'.$suffix.
'" type="hidden" value="'.(float) $alreadydispatched.
'">';
851 print
'<tr class="oddeven">';
853 if (empty($conf->cache[
'product'][$objp->fk_product])) {
854 $tmpproduct =
new Product($db);
855 $tmpproduct->fetch($objp->fk_product);
856 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
858 $tmpproduct = $conf->cache[
'product'][$objp->fk_product];
861 $linktoprod = $tmpproduct->getNomUrl(1);
862 $linktoprod .=
' - '.$objp->label.
"\n";
865 if ($objp->tobatch) {
870 print
'<td class="dispatch_batch_number"></td>';
872 print
'<td class="dispatch_dlc"></td>';
875 print
'<td class="dispatch_dluo"></td>';
882 print
'<td class="dispatch_batch_number">';
883 print
'<span class="opacitymedium small">'.$langs->trans(
"ProductDoesNotUseBatchSerial").
'</small>';
886 print
'<td class="dispatch_dlc"></td>';
889 print
'<td class="dispatch_dluo"></td>';
893 print
'<td colspan="4">';
899 $up_ht_disc = $objp->subprice;
900 if (!empty($objp->remise_percent) && !
getDolGlobalString(
'STOCK_EXCLUDE_DISCOUNT_FOR_PMP')) {
901 $up_ht_disc =
price2num($up_ht_disc * (100 - $objp->remise_percent) / 100,
'MU');
905 print
'<td class="right">'.$objp->sref.
'</td>';
908 print
'<td class="right">'.$objp->qty.
'</td>';
911 print
'<td class="right">'.$alreadydispatched.
'</td>';
913 if (
isModEnabled(
'productbatch') && $objp->tobatch > 0) {
915 print
'<td class="right">';
925 'is_information_row' =>
true,
930 $reshook = $hookmanager->executeHooks(
931 'printFieldListValue',
939 print $hookmanager->resPrint;
943 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
945 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
946 print
'<input name="product_batch'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
948 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
950 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price($up_ht_disc).
'">';
952 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price($up_ht_disc).
'">';
958 print
'<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.
'" name="lot_number'.$suffix.
'" value="'.
GETPOST(
'lot_number'.$suffix).
'">';
961 print
'<td class="nowraponall">';
963 print $form->selectDate($dlcdatesuffix,
'dlc'.$suffix, 0, 0, 1,
'');
967 print
'<td class="nowraponall">';
969 print $form->selectDate($dluodatesuffix,
'dluo'.$suffix, 0, 0, 1,
'');
972 print
'<td colspan="3"> </td>';
978 print
'<td class="right">';
988 'is_information_row' =>
true,
993 $reshook = $hookmanager->executeHooks(
994 'printFieldListValue',
1002 print $hookmanager->resPrint;
1006 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
1007 print
'<td colspan="'.$colspan.
'">';
1008 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
1009 print
'<input name="product'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
1011 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
1013 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
1015 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
1022 print
'<td class="right nowrap">';
1023 if ($remaintodispatch > 0) {
1024 $btnLabel = $langs->trans(
"Fill").
' : '.$remaintodispatch;
1025 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>';
1027 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)).
'">';
1028 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>';
1032 if (
isModEnabled(
'productbatch') && $objp->tobatch > 0) {
1034 print
img_picto($langs->trans(
'AddStockLocationLine'),
'split',
'class="splitbutton" onClick="addDispatchLine('.$i.
', \''.$type.
'\')
"');
1037 print img_picto($langs->trans('AddStockLocationLine'), 'split', 'class="splitbutton
" onClick="addDispatchLine(
'.$i.', \
''.$type.
'\')
"');
1041 if (getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
1042 if (!isModEnabled("multicurrency
") && empty($conf->dynamicprices->enabled)) {
1044 print '<td class="right
">';
1045 print '<input id="pu
'.$suffix.'" name="pu
'.$suffix.'" type="text
" size="8
" value="'.price((GETPOST('pu
'.$suffix) != '' ? price2num(GETPOST('pu
'.$suffix)) : $up_ht_disc)).'">';
1049 print '<td class="right
">';
1050 print '<input id="dto
'.$suffix.'" name="dto
'.$suffix.'" type="text
" size="8
" value="'.(GETPOST('dto
'.$suffix) != '' ? GETPOST('dto
'.$suffix) : '').'">';
1054 print '<td class="center
">';
1055 print '<input class="flat checkformerge
" type="checkbox
" name="saveprice
'.$suffix.'" value="'.(GETPOST('saveprice
'.$suffix) != '' ? GETPOST('saveprice
'.$suffix) : '').'">';
1061 print '<td class="right
">';
1062 if (count($listwarehouses) > 1) {
1063 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);
1064 } elseif (count($listwarehouses) == 1) {
1065 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);
1067 $langs->load("errors
");
1068 print $langs->trans("ErrorNoWarehouseDefined
");
1072 // Enable hooks to append additional columns
1073 $parameters = array(
1074 'is_information_row' => false, // this is a dispatch form row
1076 'suffix' => $suffix,
1079 $reshook = $hookmanager->executeHooks(
1080 'printFieldListValue',
1086 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1088 print $hookmanager->resPrint;
1097 dol_print_error($db);
1104 $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically
", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
1106 print '<div class="center
">';
1107 $parameters = array();
1108 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
1110 if (empty($reshook)) {
1111 if (empty($conf->reception->enabled)) {
1112 print $langs->trans("Comment").' : ';
1113 print '<input type="text
" class="minwidth400
" maxlength="128
" name="comment
" value="';
1114 print GETPOSTISSET("comment") ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
1115 // print ' /
'.$object->ref_supplier; // Not yet available
1116 print '" class="flat
"><br>';
1118 print '<input type="checkbox
" checked="checked
" name="closeopenorder
"> '.$checkboxlabel;
1121 $dispatchBt = empty($conf->reception->enabled) ? $langs->trans("Receive
") : $langs->trans("CreateReception
");
1124 print '<input type="hidden
" name="backtopageforcancel
" value="'.$_SERVER["PHP_SELF"].'?
id=
'.$object->id.'">';
1125 print '<input type="submit
" class="button" name="dispatch
" value="'.dol_escape_htmltag($dispatchBt).'"';
1127 if (!$permissiontoreceive) {
1130 if (count($listwarehouses) <= 0) {
1142 // Message if nothing to dispatch
1145 if (!getDolGlobalString('SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
1146 print '<div class="opacitymedium
">'.$langs->trans("NoPredefinedProductToDispatch
").'</div>'; // No predefined line at all
1148 print '<div class="opacitymedium
">'.$langs->trans("NoMorePredefinedProductToDispatch
").'</div>'; // No predefined line that remain to be dispatched.
1155 print dol_get_fiche_end();
1157 // traitement entrepot par défaut
1158 print '<script type="text/javascript
">
1159 $(document).ready(function () {
1160 $("select[
name=fk_default_warehouse]
").change(function() {
1161 var fk_default_warehouse = $("option:selected
", this).val();
1162 $("select[
name^=entrepot_]
").val(fk_default_warehouse).change();
1165 $(".auto-fill-qty
").on("click touchstart
", function(e){
1167 $("input[
name=
"+$(this).data("rowname
")+"]
").val($(this).data("value
")).trigger("change
");
1170 $("#autoreset
").click(function() {
1171 $(".qtydispatchinput
").each(function(){
1172 id = $(this).attr("id");
1173 idtab = id.split("_
");
1177 $("#qty_dispatched_0_
"+idtab[2]).val("0
");
1179 obj = $(this).parent().parent();
1180 nameobj = obj.attr("name");
1181 nametab = nameobj.split("_
");
1183 $("tr[
name^=\
'"+nametab[0]+"_\'][name$=\'_"+nametab[2]+"\']:last .splitbutton").show();
1188 $(".resetline").click(function(e){
1190 id = $(this).attr("id");
1191 id = id.split("reset_");
1192 console.log("Reset trigger for id = qty_"+id[1]);
1193 $("#qty_"+id[1]).val("");
1199 $sql =
"SELECT p.rowid as pid, p.ref, p.label,";
1200 $sql .=
" e.rowid as warehouse_id, e.ref as entrepot,";
1201 $sql .=
" cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec";
1202 $sql .=
" ,cd.rowid, cd.subprice";
1204 $sql .=
", cfd.fk_reception, r.date_delivery";
1206 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product as p,";
1207 $sql .=
" ".MAIN_DB_PREFIX.
"receptiondet_batch as cfd";
1208 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as cd ON cd.rowid = cfd.fk_elementdet";
1209 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"entrepot as e ON cfd.fk_entrepot = e.rowid";
1211 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"reception as r ON cfd.fk_reception = r.rowid";
1213 $sql .=
" WHERE cfd.fk_element = ".((int)
$object->id);
1214 $sql .=
" AND cfd.fk_product = p.rowid";
1215 $sql .=
" ORDER BY cfd.rowid ASC";
1217 $resql = $db->query($sql);
1219 $num = $db->num_rows($resql);
1227 print
'<div class="div-table-responsive">';
1228 print
'<table id="dispatch_received_products" class="noborder centpercent">';
1230 print
'<tr class="liste_titre">';
1233 print
'<td>'.$langs->trans(
"Reception").
'</td>';
1236 print
'<td>'.$langs->trans(
"Product").
'</td>';
1237 print
'<td class="center">'.$langs->trans(
"DateCreation").
'</td>';
1238 print
'<td class="center">'.$langs->trans(
"DateDeliveryPlanned").
'</td>';
1240 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
1242 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
1245 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
1248 print
'<td class="right">'.$langs->trans(
"QtyDispatched").
'</td>';
1249 print
'<td>'.$langs->trans(
"Warehouse").
'</td>';
1250 print
'<td>'.$langs->trans(
"Comment").
'</td>';
1254 print
'<td class="center" colspan="2">'.$langs->trans(
"Status").
'</td>';
1256 print
'<td class="center"></td>';
1259 print
'<td class="center" colspan="2"></td>';
1265 $objp = $db->fetch_object($resql);
1267 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1268 print
'<form name="editdispatchedlines" id="editdispatchedlines" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'#line_'.
GETPOSTINT(
'lineid').
'" method="POST">
1269 <input type="hidden" name="token" value="'.
newToken().
'">
1270 <input type="hidden" name="action" value="updateline">
1271 <input type="hidden" name="mode" value="">
1272 <input type="hidden" name="lineid" value="'.$objp->dispatchlineid.
'">';
1275 print
'<tr class="oddeven" id="line_'.$objp->dispatchlineid.
'" >';
1280 print
'<td class="nowraponall">';
1281 if (!empty($objp->fk_reception)) {
1283 $reception->fetch($objp->fk_reception);
1284 print $reception->getNomUrl(1);
1291 print
'<td class="tdoverflowmax150">';
1292 if (empty($conf->cache[
'product'][$objp->fk_product])) {
1293 $tmpproduct =
new Product($db);
1294 $tmpproduct->fetch($objp->fk_product);
1295 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
1297 $tmpproduct = $conf->cache[
'product'][$objp->fk_product];
1299 print $tmpproduct->getNomUrl(1);
1300 print
' - '.$objp->label;
1304 print
'<td class="center">'.dol_print_date($db->jdate($objp->datec),
'day').
'</td>';
1308 print
'<td class="center">';
1309 if (!empty($objp->date_delivery)) {
1314 print
'<td class="center"></td>';
1320 include_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
1322 $lot->fetch(0, $objp->pid, $objp->batch);
1323 print
'<td class="dispatch_batch_number">'.$lot->getNomUrl(1).
'</td>';
1325 print
'<td class="dispatch_dlc">'.dol_print_date($lot->sellby,
'day').
'</td>';
1328 print
'<td class="dispatch_dluo">'.dol_print_date($lot->eatby,
'day').
'</td>';
1331 print
'<td class="dispatch_batch_number"></td>';
1333 print
'<td class="dispatch_dlc"></td>';
1336 print
'<td class="dispatch_dluo"></td>';
1342 print
'<td class="right">';
1343 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1344 print
'<input style="width: 50px;" type="text" min="1" name="qty" value="'.$objp->qty.
'" />';
1348 print
'<input type="hidden" name="price" value="'.$objp->subprice.
'" />';
1351 print
'<td class="tdoverflowmax150">';
1352 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1353 $warehouse_id =
GETPOSTINT(
"fk_entrepot") ?
GETPOSTINT(
"fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id :
'');
1354 if (count($listwarehouses) > 1) {
1355 print $formproduct->selectWarehouses($warehouse_id,
"fk_entrepot",
'', 1, 0, $objp->fk_product,
'', 1, 1, array(),
'csswarehouse');
1356 } elseif (count($listwarehouses) == 1) {
1357 print $formproduct->selectWarehouses($warehouse_id,
"fk_entrepot",
'', 0, 0, $objp->fk_product,
'', 1, 1, array(),
'csswarehouse');
1359 $langs->load(
"errors");
1360 print $langs->trans(
"ErrorNoWarehouseDefined");
1363 $warehouse_static->id = $objp->warehouse_id;
1364 $warehouse_static->label = $objp->entrepot;
1365 print $warehouse_static->getNomUrl(1);
1370 print
'<td class="tdoverflowmax300" style="white-space: pre;">'.$objp->comment.
'</td>';
1374 print
'<td class="right">';
1375 $supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status);
1377 print $supplierorderdispatch->getLibStatut(5);
1381 print
'<td class="center">';
1382 if (!$permissiontocontrol) {
1383 if (empty($objp->status)) {
1384 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Approve").
'</a>';
1385 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1387 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Disapprove").
'</a>';
1388 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1392 if (
$object->status == $object::STATUS_RECEIVED_COMPLETELY) {
1395 if (empty($objp->status)) {
1396 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=checkdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1397 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=denydispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1399 if ($objp->status == 1) {
1400 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1401 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=denydispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1403 if ($objp->status == 2) {
1404 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1405 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=checkdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1410 print
'<td class="right">';
1411 if ($reception !==
null && !empty($reception->id)) {
1412 print $reception->getLibStatut(5);
1418 if ($action !=
'editline' || $lineid != $objp->dispatchlineid) {
1419 if (($reception ===
null) || empty($reception->id) || ($reception->statut == Reception::STATUS_DRAFT)) {
1420 print
'<td class="linecoledit center">';
1421 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editline&token='.
newToken().
'&lineid='.$objp->dispatchlineid.
'#line_'.$objp->dispatchlineid.
'">';
1426 print
'<td class="linecoldelete center">';
1427 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=ask_deleteline&token='.
newToken().
'&lineid='.$objp->dispatchlineid.
'#dispatch_received_products">';
1432 print
'<td></td><td></td>';
1435 print
'<td class="center valignmiddle">';
1436 print
'<input type="submit" class="button button-save" id="savelinebutton" name="save" value="'.$langs->trans(
"Save").
'" />';
1438 print
'<td class="center valignmiddle">';
1439 print
'<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans(
"Cancel").
'" />';
1445 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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_now($mode='gmt')
Return date for now.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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, $morecssdiv='')
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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...
multi select button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
treeview li table
No Email.
$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.