34require
'../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/modules/supplier_order/modules_commandefournisseur.php';
36require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/fourn.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.dispatch.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/mouvementstock.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
44if (isModEnabled(
'project')) {
45 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
49$langs->loadLangs(array(
"bills",
"orders",
"sendings",
"companies",
"deliveries",
"products",
"stocks",
"receptions"));
51if (isModEnabled(
'productbatch')) {
52 $langs->load(
'productbatch');
58$lineid =
GETPOST(
'lineid',
'int');
59$action =
GETPOST(
'action',
'aZ09');
60$fk_default_warehouse =
GETPOST(
'fk_default_warehouse',
'int');
61$cancel =
GETPOST(
'cancel',
'alpha');
62$confirm =
GETPOST(
'confirm',
'alpha');
65 $socid = $user->socid;
68$hookmanager->initHooks(array(
'ordersupplierdispatch'));
72if (GETPOSTISSET(
"projectid")) {
73 $projectid =
GETPOST(
"projectid",
'int');
78if ($id > 0 || !empty($ref)) {
79 $result = $object->fetch($id, $ref);
83 $result = $object->fetch_thirdparty();
89if (empty($conf->reception->enabled)) {
90 $permissiontoreceive = $user->hasRight(
"fournisseur",
"commande",
"receptionner");
91 $permissiontocontrol = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"fournisseur",
"commande",
"receptionner")) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"fournisseur",
"commande_advance",
"check")));
93 $permissiontoreceive = $user->hasRight(
"reception",
"creer");
94 $permissiontocontrol = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"reception",
"creer")) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
"reception",
"reception_advance",
"validate")));
98$result =
restrictedArea($user,
'fournisseur', $object,
'commande_fournisseur',
'commande');
100if (!isModEnabled(
'stock')) {
104$usercancreate = ($user->hasRight(
"fournisseur",
"commande",
"creer") || $user->hasRight(
"supplier_order",
"creer"));
105$permissiontoadd = $usercancreate;
112$parameters = array();
113$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
118if ($action ==
'checkdispatchline' && $permissiontocontrol) {
124 $result = $supplierorderdispatch->fetch($lineid);
127 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
132 $result = $supplierorderdispatch->setStatut(1);
134 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
141 $result = $object->calcAndSetStatusDispatch($user);
155if ($action ==
'uncheckdispatchline' && $permissiontocontrol) {
161 $result = $supplierorderdispatch->fetch($lineid);
164 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
169 $result = $supplierorderdispatch->setStatut(0);
171 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
177 $result = $object->calcAndSetStatusDispatch($user);
191if ($action ==
'denydispatchline' && $permissiontocontrol) {
197 $result = $supplierorderdispatch->fetch($lineid);
200 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
205 $result = $supplierorderdispatch->setStatut(2);
207 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
213 $result = $object->calcAndSetStatusDispatch($user);
227if ($action ==
'dispatch' && $permissiontoreceive) {
234 foreach ($_POST as $key => $value) {
237 if (preg_match(
'/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
242 $prod =
"product_".$reg[1].
'_'.$reg[2];
243 $qty =
"qty_".$reg[1].
'_'.$reg[2];
244 $ent =
"entrepot_".$reg[1].
'_'.$reg[2];
246 $ent = $fk_default_warehouse;
248 $pu =
"pu_".$reg[1].
'_'.$reg[2];
249 $fk_commandefourndet =
"fk_commandefourndet_".$reg[1].
'_'.$reg[2];
252 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
253 $dto =
GETPOST(
"dto_".$reg[1].
'_'.$reg[2],
'int');
257 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
264 if ($qtytomove != 0) {
265 if (!(
GETPOST($ent,
'int') > 0)) {
266 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
267 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline);
268 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
273 $result = $object->dispatchProduct($user,
GETPOSTINT($prod), $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'),
'',
'',
'',
GETPOST($fk_commandefourndet,
'int'), $notrigger);
279 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
280 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
287 if (GETPOSTISSET($saveprice)) {
289 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
290 $sql .=
" SET unitprice='".price2num(
GETPOST($pu),
'MU').
"'";
291 $sql .=
", price=".price2num(
GETPOST($pu),
'MU').
"*quantity";
292 $sql .=
", remise_percent = ".((float) $dto);
293 $sql .=
" WHERE fk_soc=".((int) $object->socid);
294 $sql .=
" AND fk_product=".((int)
GETPOST($prod,
'int'));
296 $resql = $db->query($sql);
304 if (preg_match(
'/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
310 $prod =
'product_batch_'.$reg[1].
'_'.$reg[2];
311 $qty =
'qty_'.$reg[1].
'_'.$reg[2];
312 $ent =
'entrepot_'.$reg[1].
'_'.$reg[2];
313 $pu =
'pu_'.$reg[1].
'_'.$reg[2];
314 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
315 $lot =
'lot_number_'.$reg[1].
'_'.$reg[2];
316 $dDLUO =
dol_mktime(12, 0, 0,
GETPOST(
'dluo_'.$reg[1].
'_'.$reg[2].
'month',
'int'),
GETPOST(
'dluo_'.$reg[1].
'_'.$reg[2].
'day',
'int'),
GETPOST(
'dluo_'.$reg[1].
'_'.$reg[2].
'year',
'int'));
317 $dDLC =
dol_mktime(12, 0, 0,
GETPOST(
'dlc_'.$reg[1].
'_'.$reg[2].
'month',
'int'),
GETPOST(
'dlc_'.$reg[1].
'_'.$reg[2].
'day',
'int'),
GETPOST(
'dlc_'.$reg[1].
'_'.$reg[2].
'year',
'int'));
319 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
322 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
323 $dto =
GETPOST(
"dto_".$reg[1].
'_'.$reg[2],
'int');
327 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
334 if ($qtytomove > 0) {
337 if (!(
GETPOST($ent,
'int') > 0)) {
338 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
339 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.($reg[1] + 1);
340 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
344 if (!(
GETPOST($lot,
'alpha') || $dDLUO || $dDLC)) {
345 dol_syslog(
'No dispatch for line '.$key.
' as serial/eat-by/sellby date are not set');
346 $text = $langs->transnoentities(
'atleast1batchfield').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.($reg[1] + 1);
347 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
352 $result = $object->dispatchProduct($user, $productId, $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'), $dDLUO, $dDLC,
GETPOST($lot,
'alpha'),
GETPOST($fk_commandefourndet,
'int'), $notrigger);
358 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
359 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
360 $dto =
GETPOST(
"dto_".$reg[1].
'_'.$reg[2],
'int');
362 if (GETPOSTISSET($saveprice)) {
364 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
365 $sql .=
" SET unitprice = ".price2num(
GETPOST($pu),
'MU', 2);
366 $sql .=
", price = ".price2num(
GETPOST($pu),
'MU', 2).
" * quantity";
367 $sql .=
", remise_percent = ".price2num((empty($dto) ? 0 : $dto), 3, 2).
"'";
368 $sql .=
" WHERE fk_soc = ".((int) $object->socid);
369 $sql .=
" AND fk_product=".((int) $productId);
371 $resql = $db->query($sql);
381 $result = $object->calcAndSetStatusDispatch($user,
GETPOST(
'closeopenorder') ? 1 : 0,
GETPOST(
'comment'));
388 if ($result >= 0 && !$error) {
393 header(
"Location: dispatch.php?id=".$id);
401if ($action ==
'confirm_deleteline' && $confirm ==
'yes' && $permissiontoreceive) {
405 $result = $supplierorderdispatch->fetch($lineid);
407 $qty = $supplierorderdispatch->qty;
408 $entrepot = $supplierorderdispatch->fk_entrepot;
409 $product = $supplierorderdispatch->fk_product;
411 $comment = $supplierorderdispatch->comment;
412 $eatby = $supplierorderdispatch->eatby;
413 $sellby = $supplierorderdispatch->sellby;
414 $batch = $supplierorderdispatch->batch;
416 $result = $supplierorderdispatch->delete($user);
419 $errors = $object->errors;
423 if ($entrepot > 0 && isModEnabled(
'stock') &&
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') && empty($supplierorderdispatch->fk_reception)) {
426 $mouv->origin = &$object;
427 $mouv->setOrigin($object->element, $object->id);
428 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment,
'', $eatby, $sellby, $batch);
430 $errors = $mouv->errors;
445if ($action ==
'updateline' && $permissiontoreceive) {
450 $result = $supplierorderdispatch->fetch($lineid);
452 $qty = $supplierorderdispatch->qty;
453 $entrepot = $supplierorderdispatch->fk_entrepot;
454 $product = $supplierorderdispatch->fk_product;
456 $comment = $supplierorderdispatch->comment;
457 $eatby = $supplierorderdispatch->eatby;
458 $sellby = $supplierorderdispatch->sellby;
459 $batch = $supplierorderdispatch->batch;
462 $supplierorderdispatch->fk_entrepot =
GETPOST(
'fk_entrepot');
463 $result = $supplierorderdispatch->update($user);
467 $errors = $supplierorderdispatch->errors;
470 if ($entrepot > 0 && isModEnabled(
'stock') &&
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER')) {
473 $mouv->origin = &$object;
474 $mouv->setOrigin($object->element, $object->id);
475 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment,
'', $eatby, $sellby, $batch);
477 $errors = $mouv->errors;
480 $mouv->origin = &$object;
481 $result = $mouv->reception($user, $product, $supplierorderdispatch->fk_entrepot, $supplierorderdispatch->qty, $price, $comment, $eatby, $sellby, $batch);
483 $errors = $mouv->errors;
505$form =
new Form($db);
507$warehouse_static =
new Entrepot($db);
510$title = $object->ref.
" - ".$langs->trans(
'OrderDispatch');
511$help_url =
'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
512$morejs = array(
'/fourn/js/lib_dispatch.js.php');
514llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs);
516if ($id > 0 || !empty($ref)) {
518 $soc->fetch($object->socid);
520 $author =
new User($db);
521 $author->fetch($object->user_author_id);
525 $title = $langs->trans(
"SupplierOrder");
531 if ($action ==
'ask_deleteline') {
532 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
536 $parameters = array(
'lineid' => $lineid);
538 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
539 if (empty($reshook)) {
540 $formconfirm .= $hookmanager->resPrint;
541 } elseif ($reshook > 0) {
542 $formconfirm = $hookmanager->resPrint;
550 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fourn/commande/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
552 $morehtmlref =
'<div class="refidno">';
554 $morehtmlref .= $form->editfieldkey(
"RefSupplier",
'ref_supplier', $object->ref_supplier, $object, 0,
'string',
'', 0, 1);
555 $morehtmlref .= $form->editfieldval(
"RefSupplier",
'ref_supplier', $object->ref_supplier, $object, 0,
'string',
'',
null,
null,
'', 1);
557 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1);
559 if (isModEnabled(
'project')) {
560 $langs->load(
"projects");
561 $morehtmlref .=
'<br>';
563 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
564 if ($action !=
'classify' && $caneditproject) {
565 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
567 $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');
569 if (!empty($object->fk_project)) {
571 $proj->fetch($object->fk_project);
572 $morehtmlref .= $proj->getNomUrl(1);
574 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
579 $morehtmlref .=
'</div>';
582 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
585 print
'<div class="fichecenter">';
586 print
'<div class="underbanner clearboth"></div>';
588 print
'<table class="border tableforfield" width="100%">';
591 if ($object->methode_commande_id > 0) {
592 print
'<tr><td class="titlefield">'.$langs->trans(
"Date").
'</td><td>';
593 if ($object->date_commande) {
598 if ($object->methode_commande) {
599 print
'<tr><td>'.$langs->trans(
"Method").
'</td><td>'.$object->getInputMethod().
'</td></tr>';
604 print
'<tr><td class="titlefield">'.$langs->trans(
"AuthorRequest").
'</td>';
605 print
'<td>'.$author->getNomUrl(1,
'', 0, 0, 0).
'</td>';
608 $parameters = array();
609 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
626 print
'<br><span class="opacitymedium">'.$langs->trans(
"OrderStatusNotReadyToDispatch").
'</span>';
636 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
638 $formproduct->loadWarehouses();
640 $listwarehouses = $entrepot->list_array(1);
643 if (empty($conf->reception->enabled)) {
644 print
'<form method="POST" action="dispatch.php?id='.$object->id.
'">';
646 print
'<form method="post" action="'.dol_buildpath(
'/reception/card.php', 1).
'?originid='.$object->id.
'&origin=supplierorder">';
649 print
'<input type="hidden" name="token" value="'.newToken().
'">';
650 if (empty($conf->reception->enabled)) {
651 print
'<input type="hidden" name="action" value="dispatch">';
653 print
'<input type="hidden" name="action" value="create">';
656 print
'<div class="div-table-responsive-no-min">';
657 print
'<table class="noborder centpercent">';
660 $products_dispatched = array();
661 $sql =
"SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty";
662 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur_dispatch as cfd";
663 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l on l.rowid = cfd.fk_commandefourndet";
664 $sql .=
" WHERE cfd.fk_commande = ".((int) $object->id);
665 $sql .=
" GROUP BY l.rowid, cfd.fk_product";
667 $resql = $db->query($sql);
669 $num = $db->num_rows($resql);
674 $objd = $db->fetch_object($resql);
675 $products_dispatched[$objd->rowid] =
price2num($objd->qty,
'MS');
683 $sql =
"SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty,";
684 $sql .=
" p.ref, p.label, p.tobatch, p.fk_default_warehouse";
687 $parameters = array();
688 $reshook = $hookmanager->executeHooks(
689 'printFieldListSelect',
697 $sql .= $hookmanager->resPrint;
699 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l";
700 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON l.fk_product=p.rowid";
701 $sql .=
" WHERE l.fk_commande = ".((int) $object->id);
703 $sql .=
" AND l.product_type = 0";
707 $parameters = array();
708 $reshook = $hookmanager->executeHooks(
709 'printFieldListWhere',
717 $sql .= $hookmanager->resPrint;
720 $sql .=
" ORDER BY l.rang, p.ref, p.label";
722 $resql = $db->query($sql);
724 $num = $db->num_rows($resql);
728 print
'<tr class="liste_titre">';
730 print
'<td>'.$langs->trans(
"Description").
'</td>';
731 if (isModEnabled(
'productbatch')) {
732 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
734 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
737 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
744 print
'<td class="right">'.$langs->trans(
"SupplierRef").
'</td>';
745 print
'<td class="right">'.$langs->trans(
"QtyOrdered").
'</td>';
746 print
'<td class="right">'.$langs->trans(
"QtyDispatchedShort").
'</td>';
747 print
' <td class="right">'.$langs->trans(
"QtyToDispatchShort");
748 print
'<br><a href="#" id="autoreset">'.img_picto($langs->trans(
"Reset"),
'eraser',
'class="pictofixedwidth opacitymedium"').$langs->trans(
"Reset").
'</a></td>';
749 print
'<td width="32"></td>';
752 if (!isModEnabled(
"multicurrency") && empty($conf->dynamicprices->enabled)) {
753 print
'<td class="right">'.$langs->trans(
"Price").
'</td>';
754 print
'<td class="right">'.$langs->trans(
"ReductionShort").
' (%)</td>';
755 print
'<td class="right">'.$langs->trans(
"UpdatePrice").
'</td>';
759 print
'<td align="right">'.$langs->trans(
"Warehouse");
762 if (count($listwarehouses) > 1) {
763 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, $langs->trans(
"ForceTo"), 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
764 } elseif (count($listwarehouses) == 1) {
765 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
771 $parameters = array();
772 $reshook = $hookmanager->executeHooks(
773 'printFieldListTitle',
781 print $hookmanager->resPrint;
790 $conf->cache[
'product'] = array();
794 $objp = $db->fetch_object($resql);
797 if (!$objp->fk_product > 0) {
800 $alreadydispatched = isset($products_dispatched[$objp->rowid]) ? $products_dispatched[$objp->rowid] : 0;
801 $remaintodispatch =
price2num($objp->qty - ((
float) $alreadydispatched), 5);
802 if ($remaintodispatch < 0 && !
getDolGlobalString(
'SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN')) {
803 $remaintodispatch = 0;
806 if ($remaintodispatch || !
getDolGlobalString(
'SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
815 print
'<!-- Line to dispatch '.$suffix.
' -->'.
"\n";
817 print
'<input id="qty_ordered'.$suffix.
'" type="hidden" value="'.$objp->qty.
'">';
818 print
'<input id="qty_dispatched'.$suffix.
'" type="hidden" value="'.(float) $alreadydispatched.
'">';
819 print
'<tr class="oddeven">';
821 if (empty($conf->cache[
'product'][$objp->fk_product])) {
822 $tmpproduct =
new Product($db);
823 $tmpproduct->fetch($objp->fk_product);
824 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
826 $tmpproduct = $conf->cache[
'product'][$objp->fk_product];
829 $linktoprod = $tmpproduct->getNomUrl(1);
830 $linktoprod .=
' - '.$objp->label.
"\n";
832 if (isModEnabled(
'productbatch')) {
833 if ($objp->tobatch) {
838 print
'<td class="dispatch_batch_number"></td>';
840 print
'<td class="dispatch_dlc"></td>';
843 print
'<td class="dispatch_dluo"></td>';
850 print
'<td class="dispatch_batch_number">';
851 print
'<span class="opacitymedium small">'.$langs->trans(
"ProductDoesNotUseBatchSerial").
'</small>';
854 print
'<td class="dispatch_dlc"></td>';
857 print
'<td class="dispatch_dluo"></td>';
861 print
'<td colspan="4">';
867 $up_ht_disc = $objp->subprice;
868 if (!empty($objp->remise_percent) && !
getDolGlobalString(
'STOCK_EXCLUDE_DISCOUNT_FOR_PMP')) {
869 $up_ht_disc =
price2num($up_ht_disc * (100 - $objp->remise_percent) / 100,
'MU');
873 print
'<td class="right">'.$objp->sref.
'</td>';
876 print
'<td class="right">'.$objp->qty.
'</td>';
879 print
'<td class="right">'.$alreadydispatched.
'</td>';
881 if (isModEnabled(
'productbatch') && $objp->tobatch > 0) {
883 print
'<td class="right">';
893 'is_information_row' =>
true,
898 $reshook = $hookmanager->executeHooks(
899 'printFieldListValue',
907 print $hookmanager->resPrint;
911 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
913 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
914 print
'<input name="product_batch'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
916 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
918 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
920 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
926 print
'<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.
'" name="lot_number'.$suffix.
'" value="'.
GETPOST(
'lot_number'.$suffix).
'">';
929 print
'<td class="nowraponall">';
931 print $form->selectDate($dlcdatesuffix,
'dlc'.$suffix,
'',
'', 1,
'');
935 print
'<td class="nowraponall">';
937 print $form->selectDate($dluodatesuffix,
'dluo'.$suffix,
'',
'', 1,
'');
940 print
'<td colspan="3"> </td>';
946 print
'<td class="right">';
956 'is_information_row' =>
true,
961 $reshook = $hookmanager->executeHooks(
962 'printFieldListValue',
970 print $hookmanager->resPrint;
974 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
975 print
'<td colspan="'.$colspan.
'">';
976 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
977 print
'<input name="product'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
979 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
981 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
983 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
990 print
'<td class="right">';
991 print
'<a href="#" id="reset'.$suffix.
'" class="resetline">'.
img_picto($langs->trans(
"Reset"),
'eraser',
'class="pictofixedwidth opacitymedium"').
'</a>';
992 print
'<input id="qty'.$suffix.
'" name="qty'.$suffix.
'" type="text" class="width50 right qtydispatchinput" value="'.(GETPOSTISSET(
'qty'.$suffix) ?
GETPOST(
'qty'.$suffix,
'int') : (!
getDolGlobalString(
'SUPPLIER_ORDER_DISPATCH_FORCE_QTY_INPUT_TO_ZERO') ? $remaintodispatch : 0)).
'">';
996 if (isModEnabled(
'productbatch') && $objp->tobatch > 0) {
998 print
img_picto($langs->trans(
'AddStockLocationLine'),
'split.png',
'class="splitbutton" onClick="addDispatchLine('.$i.
', \''.$type.
'\')
"');
1001 print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton
" onClick="addDispatchLine(
'.$i.', \
''.$type.
'\')
"');
1005 if (getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
1006 if (!isModEnabled("multicurrency
") && empty($conf->dynamicprices->enabled)) {
1008 print '<td class="right
">';
1009 print '<input id="pu
'.$suffix.'" name="pu
'.$suffix.'" type="text
" size="8
" value="'.price((GETPOST('pu
'.$suffix) != '' ? price2num(GETPOST('pu
'.$suffix)) : $up_ht_disc)).'">';
1013 print '<td class="right
">';
1014 print '<input id="dto
'.$suffix.'" name="dto
'.$suffix.'" type="text
" size="8
" value="'.(GETPOST('dto
'.$suffix) != '' ? GETPOST('dto
'.$suffix) : '').'">';
1018 print '<td class="center
">';
1019 print '<input class="flat checkformerge
" type="checkbox
" name="saveprice
'.$suffix.'" value="'.(GETPOST('saveprice
'.$suffix) != '' ? GETPOST('saveprice
'.$suffix) : '').'">';
1025 print '<td class="right
">';
1026 if (count($listwarehouses) > 1) {
1027 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);
1028 } elseif (count($listwarehouses) == 1) {
1029 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);
1031 $langs->load("errors
");
1032 print $langs->trans("ErrorNoWarehouseDefined
");
1036 // Enable hooks to append additional columns
1037 $parameters = array(
1038 'is_information_row' => false, // this is a dispatch form row
1040 'suffix' => $suffix,
1043 $reshook = $hookmanager->executeHooks(
1044 'printFieldListValue',
1050 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1052 print $hookmanager->resPrint;
1061 dol_print_error($db);
1068 $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically
", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
1070 print '<div class="center
">';
1071 $parameters = array();
1072 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
1074 if (empty($reshook)) {
1075 if (empty($conf->reception->enabled)) {
1076 print $langs->trans("Comment").' : ';
1077 print '<input type="text
" class="minwidth400
" maxlength="128
" name="comment
" value="';
1078 print GETPOSTISSET("comment") ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
1079 // print ' /
'.$object->ref_supplier; // Not yet available
1080 print '" class="flat
"><br>';
1082 print '<input type="checkbox
" checked="checked
" name="closeopenorder
"> '.$checkboxlabel;
1085 $dispatchBt = empty($conf->reception->enabled) ? $langs->trans("Receive
") : $langs->trans("CreateReception
");
1088 print '<input type="hidden
" name="backtopageforcancel
" value="'.$_SERVER["PHP_SELF"].'?
id=
'.$object->id.'">';
1089 print '<input type="submit
" class="button" name="dispatch
" value="'.dol_escape_htmltag($dispatchBt).'"';
1091 if (!$permissiontoreceive) {
1094 if (count($listwarehouses) <= 0) {
1106 // Message if nothing to dispatch
1109 if (!getDolGlobalString('SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
1110 print '<div class="opacitymedium
">'.$langs->trans("NoPredefinedProductToDispatch
").'</div>'; // No predefined line at all
1112 print '<div class="opacitymedium
">'.$langs->trans("NoMorePredefinedProductToDispatch
").'</div>'; // No predefined line that remain to be dispatched.
1119 print dol_get_fiche_end();
1121 // traitement entrepot par défaut
1122 print '<script type="text/javascript
">
1123 $(document).ready(function () {
1124 $("select[
name=fk_default_warehouse]
").change(function() {
1125 var fk_default_warehouse = $("option:selected
", this).val();
1126 $("select[
name^=entrepot_]
").val(fk_default_warehouse).change();
1129 $("#autoreset
").click(function() {
1130 $(".qtydispatchinput
").each(function(){
1131 id = $(this).attr("id");
1132 idtab = id.split("_
");
1136 $("#qty_dispatched_0_
"+idtab[2]).val("0
");
1138 obj = $(this).parent().parent();
1139 nameobj = obj.attr("name");
1140 nametab = nameobj.split("_
");
1142 $("tr[
name^=\
'"+nametab[0]+"_\'][name$=\'_"+nametab[2]+"\']:last .splitbutton").show();
1147 $(".resetline").click(function(){
1148 id = $(this).attr("id");
1149 id = id.split("reset_");
1150 console.log("Reset trigger for id = qty_"+id[1]);
1151 $("#qty_"+id[1]).val("");
1157 $sql =
"SELECT p.rowid as pid, p.ref, p.label,";
1158 $sql .=
" e.rowid as warehouse_id, e.ref as entrepot,";
1159 $sql .=
" cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec";
1160 $sql .=
" ,cd.rowid, cd.subprice";
1161 if ($conf->reception->enabled) {
1162 $sql .=
" ,cfd.fk_reception, r.date_delivery";
1164 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product as p,";
1165 $sql .=
" ".MAIN_DB_PREFIX.
"commande_fournisseur_dispatch as cfd";
1166 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as cd ON cd.rowid = cfd.fk_commandefourndet";
1167 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"entrepot as e ON cfd.fk_entrepot = e.rowid";
1168 if ($conf->reception->enabled) {
1169 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"reception as r ON cfd.fk_reception = r.rowid";
1171 $sql .=
" WHERE cfd.fk_commande = ".((int) $object->id);
1172 $sql .=
" AND cfd.fk_product = p.rowid";
1173 $sql .=
" ORDER BY cfd.rowid ASC";
1175 $resql = $db->query($sql);
1177 $num = $db->num_rows($resql);
1185 print
'<div class="div-table-responsive">';
1186 print
'<table id="dispatch_received_products" class="noborder centpercent">';
1188 print
'<tr class="liste_titre">';
1190 if ($conf->reception->enabled) {
1191 print
'<td>'.$langs->trans(
"Reception").
'</td>';
1194 print
'<td>'.$langs->trans(
"Product").
'</td>';
1195 print
'<td class="center">'.$langs->trans(
"DateCreation").
'</td>';
1196 print
'<td class="center">'.$langs->trans(
"DateDeliveryPlanned").
'</td>';
1197 if (isModEnabled(
'productbatch')) {
1198 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
1200 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
1203 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
1206 print
'<td class="right">'.$langs->trans(
"QtyDispatched").
'</td>';
1207 print
'<td>'.$langs->trans(
"Warehouse").
'</td>';
1208 print
'<td>'.$langs->trans(
"Comment").
'</td>';
1211 if (
getDolGlobalString(
'SUPPLIER_ORDER_USE_DISPATCH_STATUS') && empty($reception->rowid)) {
1212 print
'<td class="center" colspan="2">'.$langs->trans(
"Status").
'</td>';
1213 } elseif (isModEnabled(
"reception")) {
1214 print
'<td class="center"></td>';
1217 print
'<td class="center" colspan="2"></td>';
1223 $objp = $db->fetch_object($resql);
1225 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1226 print
'<form name="editdispatchedlines" id="editdispatchedlines" action="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'#line_'.
GETPOST(
'lineid',
'int').
'" method="POST">
1227 <input type="hidden" name="token" value="'.newToken().
'">
1228 <input type="hidden" name="action" value="updateline">
1229 <input type="hidden" name="mode" value="">
1230 <input type="hidden" name="lineid" value="'.$objp->dispatchlineid.
'">';
1233 print
'<tr class="oddeven" id="line_'.$objp->dispatchlineid.
'" >';
1236 if (isModEnabled(
"reception")) {
1237 print
'<td class="nowraponall">';
1238 if (!empty($objp->fk_reception)) {
1240 $reception->fetch($objp->fk_reception);
1241 print $reception->getNomUrl(1);
1248 print
'<td class="tdoverflowmax150">';
1249 if (empty($conf->cache[
'product'][$objp->fk_product])) {
1250 $tmpproduct =
new Product($db);
1251 $tmpproduct->fetch($objp->fk_product);
1252 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
1254 $tmpproduct = $conf->cache[
'product'][$objp->fk_product];
1256 print $tmpproduct->getNomUrl(1);
1257 print
' - '.$objp->label;
1261 print
'<td class="center">'.dol_print_date($db->jdate($objp->datec),
'day').
'</td>';
1264 print
'<td class="center">'.dol_print_date($db->jdate($objp->date_delivery),
'day').
'</td>';
1267 if (isModEnabled(
'productbatch')) {
1269 include_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
1271 $lot->fetch(0, $objp->pid, $objp->batch);
1272 print
'<td class="dispatch_batch_number">'.$lot->getNomUrl(1).
'</td>';
1274 print
'<td class="dispatch_dlc">'.dol_print_date($lot->sellby,
'day').
'</td>';
1277 print
'<td class="dispatch_dluo">'.dol_print_date($lot->eatby,
'day').
'</td>';
1280 print
'<td class="dispatch_batch_number"></td>';
1282 print
'<td class="dispatch_dlc"></td>';
1285 print
'<td class="dispatch_dluo"></td>';
1291 print
'<td class="right">';
1292 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1293 print
'<input style="width: 50px;" type="text" min="1" name="qty" value="'.$objp->qty.
'" />';
1297 print
'<input type="hidden" name="price" value="'.$objp->subprice.
'" />';
1301 print
'<td class="tdoverflowmax150">';
1302 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1303 if (count($listwarehouses) > 1) {
1304 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');
1305 } elseif (count($listwarehouses) == 1) {
1306 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');
1308 $langs->load(
"errors");
1309 print $langs->trans(
"ErrorNoWarehouseDefined");
1312 $warehouse_static->id = $objp->warehouse_id;
1313 $warehouse_static->label = $objp->entrepot;
1314 print $warehouse_static->getNomUrl(1);
1319 print
'<td class="tdoverflowmax300" style="white-space: pre;">'.$objp->comment.
'</td>';
1322 if (
getDolGlobalString(
'SUPPLIER_ORDER_USE_DISPATCH_STATUS') && empty($reception->rowid)) {
1323 print
'<td class="right">';
1324 $supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status);
1326 print $supplierorderdispatch->getLibStatut(5);
1330 print
'<td class="center">';
1331 if (!$permissiontocontrol) {
1332 if (empty($objp->status)) {
1333 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Approve").
'</a>';
1334 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1336 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Disapprove").
'</a>';
1337 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1341 if ($object->statut == 5) {
1344 if (empty($objp->status)) {
1345 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".$id.
"&action=checkdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1346 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".$id.
"&action=denydispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1348 if ($objp->status == 1) {
1349 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".$id.
"&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1350 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".$id.
"&action=denydispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1352 if ($objp->status == 2) {
1353 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".$id.
"&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1354 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".$id.
"&action=checkdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1358 } elseif (isModEnabled(
"reception")) {
1359 print
'<td class="right">';
1360 if (!empty($reception->id)) {
1361 print $reception->getLibStatut(5);
1367 if ($action !=
'editline' || $lineid != $objp->dispatchlineid) {
1368 if (empty($reception->id) || ($reception->statut == Reception::STATUS_DRAFT)) {
1369 print
'<td class="linecoledit center">';
1370 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=editline&token='.newToken().
'&lineid='.$objp->dispatchlineid.
'#line_'.$objp->dispatchlineid.
'">';
1375 print
'<td class="linecoldelete center">';
1376 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=ask_deleteline&token='.newToken().
'&lineid='.$objp->dispatchlineid.
'#dispatch_received_products">';
1381 print
'<td></td><td></td>';
1384 print
'<td class="center valignmiddle">';
1385 print
'<input type="submit" class="button button-save" id="savelinebutton" name="save" value="'.$langs->trans(
"Save").
'" />';
1387 print
'<td class="center valignmiddle">';
1388 print
'<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans(
"Cancel").
'" />';
1394 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage table commandefournisseurdispatch.
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_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
GETPOSTINT($paramname, $method=0)
Return value of a param into GET or POST supervariable.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
ui dialog ui datepicker calendar ui widget content ui state ui datepicker calendar ui widget header ui state ui datepicker calendar 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.