35require
'../../main.inc.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/modules/supplier_order/modules_commandefournisseur.php';
46require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/fourn.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.dispatch.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/mouvementstock.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
55 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
59$langs->loadLangs(array(
"bills",
"orders",
"sendings",
"companies",
"products",
"stocks",
"receptions"));
62 $langs->load(
'productbatch');
69$action =
GETPOST(
'action',
'aZ09');
70$fk_default_warehouse =
GETPOSTINT(
'fk_default_warehouse');
71$cancel =
GETPOST(
'cancel',
'alpha');
72$confirm =
GETPOST(
'confirm',
'alpha');
74if ($user->isExternalUser()) {
75 $socid = $user->isExternalUser();
78$hookmanager->initHooks(array(
'ordersupplierdispatch'));
82if (GETPOSTISSET(
"projectid")) {
88if ($id > 0 || !empty($ref)) {
89 $result =
$object->fetch($id, $ref);
93 $result =
$object->fetch_thirdparty();
99if (empty(
$conf->reception->enabled)) {
100 $permissiontoreceive = $user->hasRight(
"fournisseur",
"commande",
"receptionner");
101 $permissiontocontrol = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"fournisseur",
"commande",
"receptionner")) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"fournisseur",
"commande_advance",
"check")));
103 $permissiontoreceive = $user->hasRight(
"reception",
"creer");
104 $permissiontocontrol = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"reception",
"creer")) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"reception",
"reception_advance",
"validate")));
108$result =
restrictedArea($user,
'fournisseur', $object,
'commande_fournisseur',
'commande');
114$usercancreate = ($user->hasRight(
"fournisseur",
"commande",
"creer") || $user->hasRight(
"supplier_order",
"creer"));
115$permissiontoadd = $usercancreate;
124$parameters = array();
125$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
130if ($action ==
'checkdispatchline' && $permissiontocontrol) {
135 $result = $supplierorderdispatch->fetch($lineid);
138 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
143 $result = $supplierorderdispatch->setStatut(1);
145 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
152 $result =
$object->calcAndSetStatusDispatch($user);
166if ($action ==
'uncheckdispatchline' && $permissiontocontrol) {
171 $result = $supplierorderdispatch->fetch($lineid);
174 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
179 $result = $supplierorderdispatch->setStatut(0);
181 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
187 $result =
$object->calcAndSetStatusDispatch($user);
201if ($action ==
'denydispatchline' && $permissiontocontrol) {
206 $result = $supplierorderdispatch->fetch($lineid);
209 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
214 $result = $supplierorderdispatch->setStatut(2);
216 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
222 $result =
$object->calcAndSetStatusDispatch($user);
236$saveprice =
"savepriceIsNotSet";
237if ($action ==
'dispatch' && $permissiontoreceive) {
245 foreach ($_POST as $key => $value) {
248 if (preg_match(
'/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
253 $prod =
"product_".$reg[1].
'_'.$reg[2];
254 $qty =
"qty_".$reg[1].
'_'.$reg[2];
255 $ent =
"entrepot_".$reg[1].
'_'.$reg[2];
257 $ent = $fk_default_warehouse;
259 $pu =
"pu_".$reg[1].
'_'.$reg[2];
260 $fk_commandefourndet =
"fk_commandefourndet_".$reg[1].
'_'.$reg[2];
264 $dto =
GETPOSTINT(
"dto_".$reg[1].
'_'.$reg[2]);
266 $unit_price =
price2num((
float)
GETPOST(
"pu_".$reg[1]) * (100 - $dto) / 100,
'MU');
268 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
275 if ($qtytomove != 0) {
277 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
278 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline);
279 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
284 $result =
$object->dispatchProduct($user,
GETPOSTINT(
$prod), $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'),
'',
'',
'',
GETPOSTINT($fk_commandefourndet), $notrigger);
290 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
298 if (GETPOSTISSET($saveprice)) {
300 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
301 $sql .=
" SET unitprice='".price2num(
GETPOST($pu),
'MU').
"'";
302 $sql .=
", price=".price2num(
GETPOST($pu),
'MU').
"*quantity";
303 $sql .=
", remise_percent = ".((float) $dto);
304 $sql .=
" WHERE fk_soc=".((int)
$object->socid);
305 $sql .=
" AND fk_product=".(GETPOSTINT(
$prod));
307 $resql =
$db->query($sql);
315 if (preg_match(
'/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
321 $prod =
'product_batch_'.$reg[1].
'_'.$reg[2];
322 $qty =
'qty_'.$reg[1].
'_'.$reg[2];
323 $ent =
'entrepot_'.$reg[1].
'_'.$reg[2];
324 $pu =
'pu_'.$reg[1].
'_'.$reg[2];
325 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
326 $lot =
'lot_number_'.$reg[1].
'_'.$reg[2];
330 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
336 $unit_price =
price2num((
float)
GETPOST(
"pu_".$reg[1]) * (100 - $dto) / 100,
'MU');
338 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
345 if ($qtytomove > 0) {
349 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
350 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.((
int) $reg[1] + 1);
351 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
364 if (!
GETPOST($lot,
'alpha') && !$dDLUO && !$dDLC) {
365 dol_syslog(
'No dispatch for line '.$key.
' as serial/eat-by/sellby date are not set');
366 $text = $langs->transnoentities(
'atleast1batchfield').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.((
int) $reg[1] + 1);
367 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
372 $result =
$object->dispatchProduct($user, $productId, $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'), $dDLUO, $dDLC,
GETPOST($lot,
'alpha'),
GETPOSTINT($fk_commandefourndet), $notrigger);
378 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
382 if (GETPOSTISSET($saveprice)) {
384 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
385 $sql .=
" SET unitprice = ".price2num(
GETPOST($pu),
'MU', 2);
386 $sql .=
", price = ".price2num(
GETPOST($pu),
'MU', 2).
" * quantity";
387 $sql .=
", remise_percent = ".price2num((empty($dto) ? 0 : $dto), 3, 2);
388 $sql .=
" WHERE fk_soc = ".((int)
$object->socid);
389 $sql .=
" AND fk_product=".((int) $productId);
391 $resql =
$db->query($sql);
401 $result =
$object->calcAndSetStatusDispatch($user,
GETPOST(
'closeopenorder') ? 1 : 0,
GETPOST(
'comment'));
408 if ($result >= 0 && !$error) {
413 header(
"Location: dispatch.php?id=".$id);
429if ($action ==
'confirm_deleteline' && $confirm ==
'yes' && $permissiontoreceive) {
435 $result = $supplierorderdispatch->fetch($lineid);
437 $qty = $supplierorderdispatch->qty;
438 $entrepot = $supplierorderdispatch->fk_entrepot;
439 $product = $supplierorderdispatch->fk_product;
441 $comment = $supplierorderdispatch->comment;
442 $eatby = $supplierorderdispatch->eatby;
443 $sellby = $supplierorderdispatch->sellby;
444 $batch = $supplierorderdispatch->batch;
446 $result = $supplierorderdispatch->delete($user);
453 if ($entrepot > 0 &&
isModEnabled(
'stock') &&
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') && empty($supplierorderdispatch->fk_reception)) {
458 $result = $mouv->livraison($user, $product, $entrepot, $qty, (
float) $price, (
string) $comment,
'', (
int) $eatby, (
int) $sellby, $batch);
460 $errors = $mouv->errors;
475if ($action ==
'updateline' && $permissiontoreceive && empty($cancel)) {
481 $result = $supplierorderdispatch->fetch($lineid);
483 $qty = $supplierorderdispatch->qty;
484 $entrepot = $supplierorderdispatch->fk_entrepot;
485 $product = $supplierorderdispatch->fk_product;
487 $comment = $supplierorderdispatch->comment;
488 $eatby = $supplierorderdispatch->eatby;
489 $sellby = $supplierorderdispatch->sellby;
490 $batch = $supplierorderdispatch->batch;
492 $supplierorderdispatch->qty =
GETPOSTFLOAT(
'qty',
'MS');
493 $supplierorderdispatch->fk_entrepot =
GETPOSTINT(
'fk_entrepot');
494 $result = $supplierorderdispatch->update($user);
498 $errors = $supplierorderdispatch->errors;
506 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, (
string) $comment,
'', (
int) $eatby, (
int) $sellby, $batch);
508 $errors = $mouv->errors;
512 $result = $mouv->reception($user, $product, $supplierorderdispatch->fk_entrepot, $supplierorderdispatch->qty, $price, (
string) $comment, (
int) $eatby, (
int) $sellby, $batch);
514 $errors = $mouv->errors;
541$title =
$object->ref.
" - ".$langs->trans(
'OrderDispatch');
542$help_url =
'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
543$morejs = array(
'/fourn/js/lib_dispatch.js.php');
545llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs,
'',
'',
'mod-supplier-order page-card_dispatch');
547if ($id > 0 || !empty($ref)) {
552 $author->fetch(
$object->user_author_id);
556 $title = $langs->trans(
"SupplierOrder");
562 if ($action ==
'ask_deleteline') {
563 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
567 $parameters = array(
'lineid' => $lineid);
569 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
570 if (empty($reshook)) {
571 $formconfirm .= $hookmanager->resPrint;
572 } elseif ($reshook > 0) {
573 $formconfirm = $hookmanager->resPrint;
581 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fourn/commande/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
583 $morehtmlref =
'<div class="refidno">';
585 $morehtmlref .= $form->editfieldkey(
"RefSupplier",
'ref_supplier',
$object->ref_supplier, $object, 0,
'string',
'', 0, 1);
586 $morehtmlref .= $form->editfieldval(
"RefSupplier",
'ref_supplier',
$object->ref_supplier, $object, 0,
'string',
'',
null,
null,
'', 1);
588 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1);
591 $langs->load(
"projects");
592 $morehtmlref .=
'<br>';
594 $caneditproject =
false;
595 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
596 if ($action !=
'classify' && $caneditproject) {
597 $morehtmlref .=
'<a class="editfielda" href="'.dolBuildUrl($_SERVER[
'PHP_SELF'], [
'action' =>
'classify',
'id' =>
$object->id],
true).
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
599 $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');
601 if (!empty(
$object->fk_project)) {
603 $proj->fetch(
$object->fk_project);
604 $morehtmlref .= $proj->getNomUrl(1);
606 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
611 $morehtmlref .=
'</div>';
614 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
617 print
'<div class="fichecenter">';
618 print
'<div class="underbanner clearboth"></div>';
620 print
'<table class="border tableforfield" width="100%">';
623 if (
$object->methode_commande_id > 0) {
624 print
'<tr><td class="titlefield">'.$langs->trans(
"Date").
'</td><td>';
630 if (
$object->methode_commande) {
631 print
'<tr><td>'.$langs->trans(
"Method").
'</td><td>'.
$object->getInputMethod().
'</td></tr>';
636 print
'<tr><td class="titlefield">'.$langs->trans(
"AuthorRequest").
'</td>';
637 print
'<td>'.$author->getNomUrl(-1,
'', 0, 0, 0).
'</td>';
640 $parameters = array();
641 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
654 print
'<br><span class="opacitymedium">'.$langs->trans(
"OrderStatusNotReadyToDispatch").
'</span>';
660 $listwarehouses = array();
665 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
667 $formproduct->loadWarehouses();
669 $listwarehouses = $entrepot->list_array(1);
672 if (empty(
$conf->reception->enabled)) {
673 print
'<form method="POST" action="dispatch.php?id='.$object->id.
'">';
675 print
'<form method="post" action="'.dol_buildpath(
'/reception/card.php', 1).
'?originid='.
$object->id.
'&origin=supplierorder">';
678 print
'<input type="hidden" name="token" value="'.newToken().
'">';
679 if (empty(
$conf->reception->enabled)) {
680 print
'<input type="hidden" name="action" value="dispatch">';
682 print
'<input type="hidden" name="action" value="create">';
685 print
'<div class="div-table-responsive-no-min">';
686 print
'<table class="noborder centpercent">';
689 $products_dispatched = array();
690 $sql =
"SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty";
691 $sql .=
" FROM ".MAIN_DB_PREFIX.
"receptiondet_batch as cfd";
692 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l on l.rowid = cfd.fk_elementdet";
693 $sql .=
" WHERE cfd.fk_element = ".((int)
$object->id);
694 $sql .=
" GROUP BY l.rowid, cfd.fk_product";
696 $resql =
$db->query($sql);
698 $num =
$db->num_rows($resql);
703 $objd =
$db->fetch_object($resql);
704 $products_dispatched[$objd->rowid] =
price2num($objd->qty,
'MS');
712 $sql =
"SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty,";
713 $sql .=
" p.ref, p.label, p.tobatch, p.fk_default_warehouse";
716 $parameters = array();
717 $reshook = $hookmanager->executeHooks(
718 'printFieldListSelect',
726 $sql .= $hookmanager->resPrint;
728 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l";
729 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON l.fk_product=p.rowid";
730 $sql .=
" WHERE l.fk_commande = ".((int)
$object->id);
732 $sql .=
" AND l.product_type = 0";
736 $parameters = array();
737 $reshook = $hookmanager->executeHooks(
738 'printFieldListWhere',
746 $sql .= $hookmanager->resPrint;
749 $sql .=
" ORDER BY l.rang, p.ref, p.label";
755 $resql =
$db->query($sql);
757 $num =
$db->num_rows($resql);
761 print
'<tr class="liste_titre">';
763 print
'<td>'.$langs->trans(
"Description").
'</td>';
765 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
767 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
770 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
777 print
'<td class="right">'.$langs->trans(
"SupplierRef").
'</td>';
778 print
'<td class="right">'.$langs->trans(
"QtyOrdered").
'</td>';
779 print
'<td class="right">'.$langs->trans(
"QtyDispatchedShort").
'</td>';
780 print
' <td class="right">'.$langs->trans(
"QtyToDispatchShort");
781 print
'<br><a href="#" id="autoreset">'.img_picto($langs->trans(
"Reset"),
'eraser',
'class="pictofixedwidth opacitymedium"').$langs->trans(
"Reset").
'</a></td>';
782 print
'<td width="32"></td>';
786 print
'<td class="right">'.$langs->trans(
"Price").
'</td>';
787 print
'<td class="right">'.$langs->trans(
"ReductionShort").
' (%)</td>';
788 print
'<td class="right">'.$langs->trans(
"UpdatePrice").
'</td>';
792 print
'<td align="right">'.$langs->trans(
"Warehouse");
795 if (count($listwarehouses) > 1) {
796 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, $langs->trans(
"ForceTo"), 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
797 } elseif (count($listwarehouses) == 1) {
798 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
804 $parameters = array();
805 $reshook = $hookmanager->executeHooks(
806 'printFieldListTitle',
814 print $hookmanager->resPrint;
821 $conf->cache[
'product'] = array();
825 $objp =
$db->fetch_object($resql);
828 if (!$objp->fk_product > 0) {
831 $alreadydispatched = isset($products_dispatched[$objp->rowid]) ? $products_dispatched[$objp->rowid] : 0;
832 $remaintodispatch =
price2num($objp->qty - ((
float) $alreadydispatched), 5);
833 if ($remaintodispatch < 0 && !
getDolGlobalString(
'SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN')) {
834 $remaintodispatch = 0;
837 if ($remaintodispatch || !
getDolGlobalString(
'SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
846 print
'<!-- Line to dispatch '.$suffix.
' -->'.
"\n";
848 print
'<input id="qty_ordered'.$suffix.
'" type="hidden" value="'.$objp->qty.
'">';
849 print
'<input id="qty_dispatched'.$suffix.
'" type="hidden" value="'.(float) $alreadydispatched.
'">';
850 print
'<tr class="oddeven">';
852 if (empty(
$conf->cache[
'product'][$objp->fk_product])) {
854 $tmpproduct->fetch($objp->fk_product);
855 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
857 $tmpproduct =
$conf->cache[
'product'][$objp->fk_product];
860 $linktoprod = $tmpproduct->getNomUrl(1);
861 $linktoprod .=
' - '.$objp->label.
"\n";
864 if ($objp->tobatch) {
869 print
'<td class="dispatch_batch_number"></td>';
871 print
'<td class="dispatch_dlc"></td>';
874 print
'<td class="dispatch_dluo"></td>';
881 print
'<td class="dispatch_batch_number">';
882 print
'<span class="opacitymedium small">'.$langs->trans(
"ProductDoesNotUseBatchSerial").
'</small>';
885 print
'<td class="dispatch_dlc"></td>';
888 print
'<td class="dispatch_dluo"></td>';
892 print
'<td colspan="4">';
898 $up_ht_disc = $objp->subprice;
899 if (!empty($objp->remise_percent) && !
getDolGlobalString(
'STOCK_EXCLUDE_DISCOUNT_FOR_PMP')) {
900 $up_ht_disc =
price2num($up_ht_disc * (100 - $objp->remise_percent) / 100,
'MU');
904 print
'<td class="right">'.$objp->sref.
'</td>';
907 print
'<td class="right">'.$objp->qty.
'</td>';
910 print
'<td class="right">'.$alreadydispatched.
'</td>';
912 if (
isModEnabled(
'productbatch') && $objp->tobatch > 0) {
914 print
'<td class="right">';
924 'is_information_row' =>
true,
929 $reshook = $hookmanager->executeHooks(
930 'printFieldListValue',
938 print $hookmanager->resPrint;
942 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
944 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
945 print
'<input name="product_batch'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
947 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
949 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price($up_ht_disc).
'">';
951 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price($up_ht_disc).
'">';
957 print
'<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.
'" name="lot_number'.$suffix.
'" value="'.
GETPOST(
'lot_number'.$suffix).
'">';
960 print
'<td class="nowraponall">';
962 print $form->selectDate($dlcdatesuffix,
'dlc'.$suffix, 0, 0, 1,
'');
966 print
'<td class="nowraponall">';
968 print $form->selectDate($dluodatesuffix,
'dluo'.$suffix, 0, 0, 1,
'');
971 print
'<td colspan="3"> </td>';
977 print
'<td class="right">';
987 'is_information_row' =>
true,
992 $reshook = $hookmanager->executeHooks(
993 'printFieldListValue',
1001 print $hookmanager->resPrint;
1005 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
1006 print
'<td colspan="'.$colspan.
'">';
1007 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
1008 print
'<input name="product'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
1010 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
1012 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
1014 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
1021 print
'<td class="right nowrap">';
1022 if ($remaintodispatch > 0) {
1023 $btnLabel = $langs->trans(
"Fill").
' : '.$remaintodispatch;
1024 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>';
1026 print
'<input id="qty'.$suffix.
'" name="qty'.$suffix.
'" type="number" step="any" class="width75 right qtydispatchinput" value="'.(GETPOSTISSET(
'qty'.$suffix) ?
GETPOSTINT(
'qty'.$suffix) : (!
getDolGlobalString(
'SUPPLIER_ORDER_DISPATCH_FORCE_QTY_INPUT_TO_ZERO') ? $remaintodispatch : 0)).
'">';
1027 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>';
1031 if (
isModEnabled(
'productbatch') && $objp->tobatch > 0) {
1033 print
img_picto($langs->trans(
'AddStockLocationLine'),
'split',
'class="splitbutton" onClick="addDispatchLine('.$i.
', \''.$type.
'\')
"');
1034 if ($objp->tobatch == 2) {
1035 // Product managed with unique serial numbers: allow to enter several serial numbers at once (one line per serial)
1036 print img_picto($langs->trans('EnterMultipleSerialNumbers'), 'barcode', 'class="splitbutton marginleftonly
" onClick="addDispatchLinesFromSerialList(
'.$i.', \
''.$type.
'\')
"');
1040 print img_picto($langs->trans('AddStockLocationLine'), 'split', 'class="splitbutton
" onClick="addDispatchLine(
'.$i.', \
''.$type.
'\')
"');
1044 if (getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
1045 if (!isModEnabled("multicurrency
") && empty($conf->dynamicprices->enabled)) {
1047 print '<td class="right
">';
1048 print '<input id="pu
'.$suffix.'" name="pu
'.$suffix.'" type="text
" size="8
" value="'.price((GETPOST('pu
'.$suffix) != '' ? price2num(GETPOST('pu
'.$suffix)) : $up_ht_disc)).'">';
1052 print '<td class="right
">';
1053 print '<input id="dto
'.$suffix.'" name="dto
'.$suffix.'" type="text
" size="8
" value="'.(GETPOST('dto
'.$suffix) != '' ? GETPOST('dto
'.$suffix) : '').'">';
1057 print '<td class="center
">';
1058 print '<input class="flat checkformerge
" type="checkbox
" name="saveprice
'.$suffix.'" value="'.(GETPOST('saveprice
'.$suffix) != '' ? GETPOST('saveprice
'.$suffix) : '').'">';
1064 print '<td class="right
">';
1065 if (count($listwarehouses) > 1) {
1066 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);
1067 } elseif (count($listwarehouses) == 1) {
1068 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);
1070 $langs->load("errors
");
1071 print $langs->trans("ErrorNoWarehouseDefined
");
1075 // Enable hooks to append additional columns
1076 $parameters = array(
1077 'is_information_row' => false, // this is a dispatch form row
1079 'suffix' => $suffix,
1082 $reshook = $hookmanager->executeHooks(
1083 'printFieldListValue',
1089 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1091 print $hookmanager->resPrint;
1100 dol_print_error($db);
1107 $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically
", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
1109 print '<div class="center
">';
1110 $parameters = array();
1111 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
1113 if (empty($reshook)) {
1114 if (empty($conf->reception->enabled)) {
1115 print $langs->trans("Comment").' : ';
1116 print '<input type="text
" class="minwidth400
" maxlength="128
" name="comment
" value="';
1117 print GETPOSTISSET("comment") ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
1118 // print ' /
'.$object->ref_supplier; // Not yet available
1119 print '" class="flat
"><br>';
1121 print '<input type="checkbox
" checked="checked
" name="closeopenorder
"> '.$checkboxlabel;
1124 $dispatchBt = empty($conf->reception->enabled) ? $langs->trans("Receive
") : $langs->trans("CreateReception
");
1127 print '<input type="hidden
" name="backtopageforcancel
" value="'.$_SERVER["PHP_SELF"].'?
id=
'.$object->id.'">';
1128 print '<input type="submit
" class="button" name="dispatch
" value="'.dol_escape_htmltag($dispatchBt).'"';
1130 if (!$permissiontoreceive) {
1133 if (count($listwarehouses) <= 0) {
1145 // Message if nothing to dispatch
1148 if (!getDolGlobalString('SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
1149 print '<div class="opacitymedium
">'.$langs->trans("NoPredefinedProductToDispatch
").'</div>'; // No predefined line at all
1151 print '<div class="opacitymedium
">'.$langs->trans("NoMorePredefinedProductToDispatch
").'</div>'; // No predefined line that remain to be dispatched.
1158 print dol_get_fiche_end();
1160 // default warehouse processing
1161 print '<script type="text/javascript
">
1162 $(document).ready(function () {
1163 $("select[
name=fk_default_warehouse]
").change(function() {
1164 var fk_default_warehouse = $("option:selected
", this).val();
1165 $("select[
name^=entrepot_]
").val(fk_default_warehouse).change();
1168 $(".auto-fill-qty
").on("click touchstart
", function(e){
1170 $("input[
name=
"+$(this).data("rowname
")+"]
").val($(this).data("value
")).trigger("change
");
1173 $("#autoreset
").click(function() {
1174 $(".qtydispatchinput
").each(function(){
1175 id = $(this).attr("id");
1176 idtab = id.split("_
");
1180 $("#qty_dispatched_0_
"+idtab[2]).val("0
");
1182 obj = $(this).parent().parent();
1183 nameobj = obj.attr("name");
1184 nametab = nameobj.split("_
");
1186 $("tr[
name^=\
'"+nametab[0]+"_\'][name$=\'_"+nametab[2]+"\']:last .splitbutton").show();
1191 $(".resetline").click(function(e){
1193 id = $(this).attr("id");
1194 id = id.split("reset_");
1195 console.log("Reset trigger for id = qty_"+id[1]);
1196 $("#qty_"+id[1]).val("");
1202 $sql =
"SELECT p.rowid as pid, p.ref, p.label,";
1203 $sql .=
" e.rowid as warehouse_id, e.ref as entrepot,";
1204 $sql .=
" cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec";
1205 $sql .=
" ,cd.rowid, cd.subprice";
1207 $sql .=
", cfd.fk_reception, r.date_delivery";
1209 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product as p,";
1210 $sql .=
" ".MAIN_DB_PREFIX.
"receptiondet_batch as cfd";
1211 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as cd ON cd.rowid = cfd.fk_elementdet";
1212 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"entrepot as e ON cfd.fk_entrepot = e.rowid";
1214 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"reception as r ON cfd.fk_reception = r.rowid";
1216 $sql .=
" WHERE cfd.fk_element = ".((int)
$object->id);
1217 $sql .=
" AND cfd.fk_product = p.rowid";
1218 $sql .=
" ORDER BY cfd.rowid ASC";
1220 $resql =
$db->query($sql);
1222 $num =
$db->num_rows($resql);
1230 print
'<div class="div-table-responsive">';
1231 print
'<table id="dispatch_received_products" class="noborder centpercent">';
1233 print
'<tr class="liste_titre">';
1236 print
'<td>'.$langs->trans(
"Reception").
'</td>';
1239 print
'<td>'.$langs->trans(
"Product").
'</td>';
1240 print
'<td class="center">'.$langs->trans(
"DateCreation").
'</td>';
1241 print
'<td class="center">'.$langs->trans(
"DateDeliveryPlanned").
'</td>';
1243 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
1245 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
1248 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
1251 print
'<td class="right">'.$langs->trans(
"QtyDispatched").
'</td>';
1252 print
'<td>'.$langs->trans(
"Warehouse").
'</td>';
1253 print
'<td>'.$langs->trans(
"Comment").
'</td>';
1257 print
'<td class="center" colspan="2">'.$langs->trans(
"Status").
'</td>';
1259 print
'<td class="center"></td>';
1262 print
'<td class="center" colspan="2"></td>';
1268 $objp =
$db->fetch_object($resql);
1270 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1271 print
'<form name="editdispatchedlines" id="editdispatchedlines" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'#line_'.
GETPOSTINT(
'lineid').
'" method="POST">
1272 <input type="hidden" name="token" value="'.
newToken().
'">
1273 <input type="hidden" name="action" value="updateline">
1274 <input type="hidden" name="mode" value="">
1275 <input type="hidden" name="lineid" value="'.$objp->dispatchlineid.
'">';
1278 print
'<tr class="oddeven" id="line_'.$objp->dispatchlineid.
'" >';
1283 print
'<td class="nowraponall">';
1284 if (!empty($objp->fk_reception)) {
1286 $reception->fetch($objp->fk_reception);
1287 print $reception->getNomUrl(1);
1294 print
'<td class="tdoverflowmax150">';
1295 if (empty(
$conf->cache[
'product'][$objp->fk_product])) {
1297 $tmpproduct->fetch($objp->fk_product);
1298 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
1300 $tmpproduct =
$conf->cache[
'product'][$objp->fk_product];
1302 print $tmpproduct->getNomUrl(1);
1303 print
' - '.$objp->label;
1307 print
'<td class="center">'.dol_print_date(
$db->jdate($objp->datec),
'day').
'</td>';
1311 print
'<td class="center">';
1312 if (!empty($objp->date_delivery)) {
1317 print
'<td class="center"></td>';
1323 include_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
1325 $lot->fetch(0, $objp->pid, $objp->batch);
1326 print
'<td class="dispatch_batch_number" data-col="batch" data-batch="' .
dolPrintHTMLForAttribute($objp->batch) .
'" data-productid="' . $objp->fk_product .
'" >'.$lot->getNomUrl(1).
'</td>';
1328 print
'<td class="dispatch_dlc">'.dol_print_date($lot->sellby,
'day').
'</td>';
1331 print
'<td class="dispatch_dluo">'.dol_print_date($lot->eatby,
'day').
'</td>';
1334 print
'<td class="dispatch_batch_number" data-col="batch" data-batch="" data-productid="' . $objp->fk_product .
'" ></td>';
1336 print
'<td class="dispatch_dlc"></td>';
1339 print
'<td class="dispatch_dluo"></td>';
1345 print
'<td class="right">';
1346 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1347 print
'<input style="width: 50px;" type="text" min="1" name="qty" value="'.$objp->qty.
'" />';
1351 print
'<input type="hidden" name="price" value="'.$objp->subprice.
'" />';
1354 print
'<td class="tdoverflowmax150">';
1355 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1356 $warehouse_id =
GETPOSTINT(
"fk_entrepot") ?
GETPOSTINT(
"fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id :
'');
1357 if (count($listwarehouses) > 1) {
1358 print $formproduct->selectWarehouses($warehouse_id,
"fk_entrepot",
'', 1, 0, $objp->fk_product,
'', 1, 1, array(),
'csswarehouse');
1359 } elseif (count($listwarehouses) == 1) {
1360 print $formproduct->selectWarehouses($warehouse_id,
"fk_entrepot",
'', 0, 0, $objp->fk_product,
'', 1, 1, array(),
'csswarehouse');
1362 $langs->load(
"errors");
1363 print $langs->trans(
"ErrorNoWarehouseDefined");
1366 $warehouse_static->id = $objp->warehouse_id;
1367 $warehouse_static->label = $objp->entrepot;
1368 print $warehouse_static->getNomUrl(1);
1373 print
'<td class="tdoverflowmax300" style="white-space: pre;">'.$objp->comment.
'</td>';
1377 print
'<td class="right">';
1378 $supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status);
1380 print $supplierorderdispatch->getLibStatut(5);
1384 print
'<td class="center">';
1385 if (!$permissiontocontrol) {
1386 if (empty($objp->status)) {
1387 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Approve").
'</a>';
1388 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1390 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Disapprove").
'</a>';
1391 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1395 if (
$object->status == $object::STATUS_RECEIVED_COMPLETELY) {
1398 if (empty($objp->status)) {
1399 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=checkdispatchline&token=".
newToken().
"&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1400 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=denydispatchline&token=".
newToken().
"&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1402 if ($objp->status == 1) {
1403 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=uncheckdispatchline&token=".
newToken().
"&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1404 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=denydispatchline&token=".
newToken().
"&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1406 if ($objp->status == 2) {
1407 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=uncheckdispatchline&token=".
newToken().
"&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1408 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=checkdispatchline&token=".
newToken().
"&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1413 print
'<td class="right">';
1414 if ($reception !==
null && !empty($reception->id)) {
1415 print $reception->getLibStatut(5);
1421 if ($action !=
'editline' || $lineid != $objp->dispatchlineid) {
1422 if (($reception ===
null) || empty($reception->id) || ($reception->statut == Reception::STATUS_DRAFT)) {
1423 print
'<td class="linecoledit center">';
1424 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editline&token='.
newToken().
'&lineid='.$objp->dispatchlineid.
'#line_'.$objp->dispatchlineid.
'">';
1429 print
'<td class="linecoldelete center">';
1430 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=ask_deleteline&token='.
newToken().
'&lineid='.$objp->dispatchlineid.
'#dispatch_received_products">';
1435 print
'<td></td><td></td>';
1438 print
'<td class="center valignmiddle">';
1439 print
'<input type="submit" class="button button-save" id="savelinebutton" name="save" value="'.$langs->trans(
"Save").
'" />';
1441 print
'<td class="center valignmiddle">';
1442 print
'<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans(
"Cancel").
'" />';
1448 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...
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'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
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.
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.
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.
dolPrintHTMLForAttribute($s, $escapeonlyhtmltags=0, $allowothertags=array())
Return a string ready to be output into an HTML attribute (alt, title, data-html, ....
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.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
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...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
$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.