35require
'../../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/modules/supplier_order/modules_commandefournisseur.php';
37require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/fourn.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.dispatch.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/mouvementstock.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
45if (isModEnabled(
'project')) {
46 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
58$langs->loadLangs(array(
"bills",
"orders",
"sendings",
"companies",
"deliveries",
"products",
"stocks",
"receptions"));
60if (isModEnabled(
'productbatch')) {
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');
109if (!isModEnabled(
'stock')) {
114if (($action ==
'confirm_deleteline' || ($action ==
'updateline' && empty($cancel))) && $lineid > 0) {
116 if ($tmpdispatchline->fetch($lineid) > 0 && $tmpdispatchline->fk_reception > 0) {
117 require_once DOL_DOCUMENT_ROOT.
'/reception/class/reception.class.php';
119 if ($tmpreception->fetch($tmpdispatchline->fk_reception) > 0 && $tmpreception->status != Reception::STATUS_DRAFT) {
120 setEventMessages($langs->trans(
'StatusOfRefMustBe', $langs->transnoentitiesnoconv(
'Reception'), $langs->transnoentitiesnoconv(
'StatusReceptionDraftShort')),
null,
'errors');
126$usercancreate = ($user->hasRight(
"fournisseur",
"commande",
"creer") || $user->hasRight(
"supplier_order",
"creer"));
127$permissiontoadd = $usercancreate;
136$parameters = array();
137$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
142if ($action ==
'checkdispatchline' && $permissiontocontrol) {
147 $result = $supplierorderdispatch->fetch($lineid);
150 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
155 $result = $supplierorderdispatch->setStatut(1);
157 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
164 $result =
$object->calcAndSetStatusDispatch($user);
178if ($action ==
'uncheckdispatchline' && $permissiontocontrol) {
183 $result = $supplierorderdispatch->fetch($lineid);
186 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
191 $result = $supplierorderdispatch->setStatut(0);
193 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
199 $result =
$object->calcAndSetStatusDispatch($user);
213if ($action ==
'denydispatchline' && $permissiontocontrol) {
218 $result = $supplierorderdispatch->fetch($lineid);
221 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
226 $result = $supplierorderdispatch->setStatut(2);
228 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
234 $result =
$object->calcAndSetStatusDispatch($user);
248$saveprice =
"savepriceIsNotSet";
249if ($action ==
'dispatch' && $permissiontoreceive) {
255 foreach ($_POST as $key => $value) {
258 if (preg_match(
'/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
263 $prod =
"product_".$reg[1].
'_'.$reg[2];
264 $qty =
"qty_".$reg[1].
'_'.$reg[2];
265 $ent =
"entrepot_".$reg[1].
'_'.$reg[2];
267 $ent = $fk_default_warehouse;
269 $pu =
"pu_".$reg[1].
'_'.$reg[2];
270 $fk_commandefourndet =
"fk_commandefourndet_".$reg[1].
'_'.$reg[2];
273 if (!isModEnabled(
"multicurrency") && empty(
$conf->dynamicprices->enabled)) {
274 $dto =
GETPOSTINT(
"dto_".$reg[1].
'_'.$reg[2]);
276 $unit_price =
price2num((
float)
GETPOST(
"pu_".$reg[1]) * (100 - $dto) / 100,
'MU');
278 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
285 if ($qtytomove != 0) {
287 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
288 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline);
289 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
294 $result =
$object->dispatchProduct($user,
GETPOSTINT($prod), $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'),
'',
'',
'',
GETPOSTINT($fk_commandefourndet), $notrigger);
300 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
301 if (!isModEnabled(
"multicurrency") && empty(
$conf->dynamicprices->enabled)) {
308 if (GETPOSTISSET($saveprice)) {
310 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
311 $sql .=
" SET unitprice='".price2num(
GETPOST($pu),
'MU').
"'";
312 $sql .=
", price=".price2num(
GETPOST($pu),
'MU').
"*quantity";
313 $sql .=
", remise_percent = ".((float) $dto);
314 $sql .=
" WHERE fk_soc=".((int)
$object->socid);
315 $sql .=
" AND fk_product=".(GETPOSTINT($prod));
317 $resql = $db->query($sql);
325 if (preg_match(
'/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
331 $prod =
'product_batch_'.$reg[1].
'_'.$reg[2];
332 $qty =
'qty_'.$reg[1].
'_'.$reg[2];
333 $ent =
'entrepot_'.$reg[1].
'_'.$reg[2];
334 $pu =
'pu_'.$reg[1].
'_'.$reg[2];
335 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
336 $lot =
'lot_number_'.$reg[1].
'_'.$reg[2];
340 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
343 if (!isModEnabled(
"multicurrency") && empty(
$conf->dynamicprices->enabled)) {
346 $unit_price =
price2num((
float)
GETPOST(
"pu_".$reg[1]) * (100 - $dto) / 100,
'MU');
348 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
355 if ($qtytomove > 0) {
359 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
360 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.((
int) $reg[1] + 1);
361 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
374 if (!
GETPOST($lot,
'alpha') && !$dDLUO && !$dDLC) {
375 dol_syslog(
'No dispatch for line '.$key.
' as serial/eat-by/sellby date are not set');
376 $text = $langs->transnoentities(
'atleast1batchfield').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.((
int) $reg[1] + 1);
377 setEventMessages($langs->trans(
'ErrorFieldRequired', $text),
null,
'errors');
382 $result =
$object->dispatchProduct($user, $productId, $qtytomove,
GETPOSTINT($ent), $puformove,
GETPOST(
'comment'), $dDLUO, $dDLC,
GETPOST($lot,
'alpha'),
GETPOSTINT($fk_commandefourndet), $notrigger);
388 if (!$error &&
getDolGlobalString(
'SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
389 if (!isModEnabled(
"multicurrency") && empty(
$conf->dynamicprices->enabled)) {
392 if (GETPOSTISSET($saveprice)) {
394 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
395 $sql .=
" SET unitprice = ".price2num(
GETPOST($pu),
'MU', 2);
396 $sql .=
", price = ".price2num(
GETPOST($pu),
'MU', 2).
" * quantity";
397 $sql .=
", remise_percent = ".price2num((empty($dto) ? 0 : $dto), 3, 2).
"'";
398 $sql .=
" WHERE fk_soc = ".((int)
$object->socid);
399 $sql .=
" AND fk_product=".((int) $productId);
401 $resql = $db->query($sql);
411 $result =
$object->calcAndSetStatusDispatch($user,
GETPOST(
'closeopenorder') ? 1 : 0,
GETPOST(
'comment'));
418 if ($result >= 0 && !$error) {
423 header(
"Location: dispatch.php?id=".$id);
438if ($action ==
'confirm_deleteline' && $confirm ==
'yes' && $permissiontoreceive) {
442 $result = $supplierorderdispatch->fetch($lineid);
444 $qty = $supplierorderdispatch->qty;
445 $entrepot = $supplierorderdispatch->fk_entrepot;
446 $product = $supplierorderdispatch->fk_product;
448 $comment = $supplierorderdispatch->comment;
449 $eatby = $supplierorderdispatch->eatby;
450 $sellby = $supplierorderdispatch->sellby;
451 $batch = $supplierorderdispatch->batch;
453 $result = $supplierorderdispatch->delete($user);
460 if ($entrepot > 0 && isModEnabled(
'stock') &&
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') && empty($supplierorderdispatch->fk_reception)) {
465 $result = $mouv->livraison($user, $product, $entrepot, $qty, (
float) $price, $comment,
'', (
int) $eatby, (
int) $sellby, $batch);
467 $errors = $mouv->errors;
482if ($action ==
'updateline' && $permissiontoreceive && empty($cancel)) {
486 $result = $supplierorderdispatch->fetch($lineid);
488 $qty = $supplierorderdispatch->qty;
489 $entrepot = $supplierorderdispatch->fk_entrepot;
490 $product = $supplierorderdispatch->fk_product;
492 $comment = $supplierorderdispatch->comment;
496 $batch = $supplierorderdispatch->batch;
498 $supplierorderdispatch->qty =
GETPOSTFLOAT(
'qty',
'MS');
499 $supplierorderdispatch->fk_entrepot =
GETPOSTINT(
'fk_entrepot');
500 $result = $supplierorderdispatch->update($user);
504 $errors = $supplierorderdispatch->errors;
507 if ($entrepot > 0 && isModEnabled(
'stock') &&
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER')) {
512 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment,
'', (
int) $eatby, (
int) $sellby, $batch);
514 $errors = $mouv->errors;
518 $result = $mouv->reception($user, $product, $supplierorderdispatch->fk_entrepot, $supplierorderdispatch->qty, $price, $comment, (
int) $eatby, (
int) $sellby, $batch);
520 $errors = $mouv->errors;
542$form =
new Form($db);
544$warehouse_static =
new Entrepot($db);
547$title =
$object->ref.
" - ".$langs->trans(
'OrderDispatch');
548$help_url =
'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
549$morejs = array(
'/fourn/js/lib_dispatch.js.php');
551llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs,
'',
'',
'mod-supplier-order page-card_dispatch');
553if ($id > 0 || !empty($ref)) {
557 $author =
new User($db);
558 $author->fetch(
$object->user_author_id);
562 $title = $langs->trans(
"SupplierOrder");
568 if ($action ==
'ask_deleteline') {
569 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
573 $parameters = array(
'lineid' => $lineid);
575 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
576 if (empty($reshook)) {
577 $formconfirm .= $hookmanager->resPrint;
578 } elseif ($reshook > 0) {
579 $formconfirm = $hookmanager->resPrint;
587 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fourn/commande/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
589 $morehtmlref =
'<div class="refidno">';
591 $morehtmlref .= $form->editfieldkey(
"RefSupplier",
'ref_supplier',
$object->ref_supplier, $object, 0,
'string',
'', 0, 1);
592 $morehtmlref .= $form->editfieldval(
"RefSupplier",
'ref_supplier',
$object->ref_supplier, $object, 0,
'string',
'',
null,
null,
'', 1);
594 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1);
596 if (isModEnabled(
'project')) {
597 $langs->load(
"projects");
598 $morehtmlref .=
'<br>';
600 $caneditproject =
false;
601 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
602 if ($action !=
'classify' && $caneditproject) {
603 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
605 $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');
607 if (!empty(
$object->fk_project)) {
609 $proj->fetch(
$object->fk_project);
610 $morehtmlref .= $proj->getNomUrl(1);
612 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
617 $morehtmlref .=
'</div>';
620 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
623 print
'<div class="fichecenter">';
624 print
'<div class="underbanner clearboth"></div>';
626 print
'<table class="border tableforfield" width="100%">';
629 if (
$object->methode_commande_id > 0) {
630 print
'<tr><td class="titlefield">'.$langs->trans(
"Date").
'</td><td>';
636 if (
$object->methode_commande) {
637 print
'<tr><td>'.$langs->trans(
"Method").
'</td><td>'.
$object->getInputMethod().
'</td></tr>';
642 print
'<tr><td class="titlefield">'.$langs->trans(
"AuthorRequest").
'</td>';
643 print
'<td>'.$author->getNomUrl(-1,
'', 0, 0, 0).
'</td>';
646 $parameters = array();
647 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
660 print
'<br><span class="opacitymedium">'.$langs->trans(
"OrderStatusNotReadyToDispatch").
'</span>';
666 $listwarehouses = array();
671 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
673 $formproduct->loadWarehouses();
675 $listwarehouses = $entrepot->list_array(1);
678 if (empty(
$conf->reception->enabled)) {
679 print
'<form method="POST" action="dispatch.php?id='.$object->id.
'">';
681 print
'<form method="post" action="'.dol_buildpath(
'/reception/card.php', 1).
'?originid='.
$object->id.
'&origin=supplierorder">';
684 print
'<input type="hidden" name="token" value="'.newToken().
'">';
685 if (empty(
$conf->reception->enabled)) {
686 print
'<input type="hidden" name="action" value="dispatch">';
688 print
'<input type="hidden" name="action" value="create">';
691 print
'<div class="div-table-responsive-no-min">';
692 print
'<table class="noborder centpercent">';
695 $products_dispatched = array();
696 $sql =
"SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty";
697 $sql .=
" FROM ".MAIN_DB_PREFIX.
"receptiondet_batch as cfd";
698 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l on l.rowid = cfd.fk_elementdet";
699 $sql .=
" WHERE cfd.fk_element = ".((int)
$object->id);
700 $sql .=
" GROUP BY l.rowid, cfd.fk_product";
702 $resql = $db->query($sql);
704 $num = $db->num_rows($resql);
709 $objd = $db->fetch_object($resql);
710 $products_dispatched[$objd->rowid] =
price2num($objd->qty,
'MS');
718 $sql =
"SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty,";
719 $sql .=
" p.ref, p.label, p.tobatch, p.fk_default_warehouse";
722 $parameters = array();
723 $reshook = $hookmanager->executeHooks(
724 'printFieldListSelect',
732 $sql .= $hookmanager->resPrint;
734 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l";
735 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON l.fk_product=p.rowid";
736 $sql .=
" WHERE l.fk_commande = ".((int)
$object->id);
738 $sql .=
" AND l.product_type = 0";
742 $parameters = array();
743 $reshook = $hookmanager->executeHooks(
744 'printFieldListWhere',
752 $sql .= $hookmanager->resPrint;
755 $sql .=
" ORDER BY l.rang, p.ref, p.label";
761 $resql = $db->query($sql);
763 $num = $db->num_rows($resql);
767 print
'<tr class="liste_titre">';
769 print
'<td>'.$langs->trans(
"Description").
'</td>';
770 if (isModEnabled(
'productbatch')) {
771 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
773 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
776 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
783 print
'<td class="right">'.$langs->trans(
"SupplierRef").
'</td>';
784 print
'<td class="right">'.$langs->trans(
"QtyOrdered").
'</td>';
785 print
'<td class="right">'.$langs->trans(
"QtyDispatchedShort").
'</td>';
786 print
' <td class="right">'.$langs->trans(
"QtyToDispatchShort");
787 print
'<br><a href="#" id="autoreset">'.img_picto($langs->trans(
"Reset"),
'eraser',
'class="pictofixedwidth opacitymedium"').$langs->trans(
"Reset").
'</a></td>';
788 print
'<td width="32"></td>';
791 if (!isModEnabled(
"multicurrency") && empty(
$conf->dynamicprices->enabled)) {
792 print
'<td class="right">'.$langs->trans(
"Price").
'</td>';
793 print
'<td class="right">'.$langs->trans(
"ReductionShort").
' (%)</td>';
794 print
'<td class="right">'.$langs->trans(
"UpdatePrice").
'</td>';
798 print
'<td align="right">'.$langs->trans(
"Warehouse");
801 if (count($listwarehouses) > 1) {
802 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, $langs->trans(
"ForceTo"), 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
803 } elseif (count($listwarehouses) == 1) {
804 print
'<br>'.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
810 $parameters = array();
811 $reshook = $hookmanager->executeHooks(
812 'printFieldListTitle',
820 print $hookmanager->resPrint;
827 $conf->cache[
'product'] = array();
831 $objp = $db->fetch_object($resql);
834 if (!$objp->fk_product > 0) {
837 $alreadydispatched = isset($products_dispatched[$objp->rowid]) ? $products_dispatched[$objp->rowid] : 0;
838 $remaintodispatch =
price2num($objp->qty - ((
float) $alreadydispatched), 5);
839 if ($remaintodispatch < 0 && !
getDolGlobalString(
'SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN')) {
840 $remaintodispatch = 0;
843 if ($remaintodispatch || !
getDolGlobalString(
'SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
852 print
'<!-- Line to dispatch '.$suffix.
' -->'.
"\n";
854 print
'<input id="qty_ordered'.$suffix.
'" type="hidden" value="'.$objp->qty.
'">';
855 print
'<input id="qty_dispatched'.$suffix.
'" type="hidden" value="'.(float) $alreadydispatched.
'">';
856 print
'<tr class="oddeven">';
858 if (empty(
$conf->cache[
'product'][$objp->fk_product])) {
859 $tmpproduct =
new Product($db);
860 $tmpproduct->fetch($objp->fk_product);
861 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
863 $tmpproduct =
$conf->cache[
'product'][$objp->fk_product];
866 $linktoprod = $tmpproduct->getNomUrl(1);
867 $linktoprod .=
' - '.$objp->label.
"\n";
869 if (isModEnabled(
'productbatch')) {
870 if ($objp->tobatch) {
875 print
'<td class="dispatch_batch_number"></td>';
877 print
'<td class="dispatch_dlc"></td>';
880 print
'<td class="dispatch_dluo"></td>';
887 print
'<td class="dispatch_batch_number">';
888 print
'<span class="opacitymedium small">'.$langs->trans(
"ProductDoesNotUseBatchSerial").
'</small>';
891 print
'<td class="dispatch_dlc"></td>';
894 print
'<td class="dispatch_dluo"></td>';
898 print
'<td colspan="4">';
904 $up_ht_disc = $objp->subprice;
905 if (!empty($objp->remise_percent) && !
getDolGlobalString(
'STOCK_EXCLUDE_DISCOUNT_FOR_PMP')) {
906 $up_ht_disc =
price2num($up_ht_disc * (100 - $objp->remise_percent) / 100,
'MU');
910 print
'<td class="right">'.$objp->sref.
'</td>';
913 print
'<td class="right">'.$objp->qty.
'</td>';
916 print
'<td class="right">'.$alreadydispatched.
'</td>';
918 if (isModEnabled(
'productbatch') && $objp->tobatch > 0) {
920 print
'<td class="right">';
930 'is_information_row' =>
true,
935 $reshook = $hookmanager->executeHooks(
936 'printFieldListValue',
944 print $hookmanager->resPrint;
948 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
950 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
951 print
'<input name="product_batch'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
953 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
955 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price($up_ht_disc).
'">';
957 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price($up_ht_disc).
'">';
963 print
'<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.
'" name="lot_number'.$suffix.
'" value="'.
GETPOST(
'lot_number'.$suffix).
'">';
966 print
'<td class="nowraponall">';
968 print $form->selectDate($dlcdatesuffix,
'dlc'.$suffix, 0, 0, 1,
'');
972 print
'<td class="nowraponall">';
974 print $form->selectDate($dluodatesuffix,
'dluo'.$suffix, 0, 0, 1,
'');
977 print
'<td colspan="3"> </td>';
983 print
'<td class="right">';
993 'is_information_row' =>
true,
998 $reshook = $hookmanager->executeHooks(
999 'printFieldListValue',
1007 print $hookmanager->resPrint;
1011 print
'<tr class="oddeven" name="'.$type.$suffix.
'">';
1012 print
'<td colspan="'.$colspan.
'">';
1013 print
'<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
1014 print
'<input name="product'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
1016 print
'<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
1018 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
1020 print
'<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
1027 print
'<td class="right nowrap">';
1028 if ($remaintodispatch > 0) {
1029 $btnLabel = $langs->trans(
"Fill").
' : '.$remaintodispatch;
1030 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>';
1032 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)).
'">';
1033 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>';
1037 if (isModEnabled(
'productbatch') && $objp->tobatch > 0) {
1039 print
img_picto($langs->trans(
'AddStockLocationLine'),
'split.png',
'class="splitbutton" onClick="addDispatchLine('.$i.
', \''.$type.
'\')
"');
1042 print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton
" onClick="addDispatchLine(
'.$i.', \
''.$type.
'\')
"');
1046 if (getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
1047 if (!isModEnabled("multicurrency
") && empty($conf->dynamicprices->enabled)) {
1049 print '<td class="right
">';
1050 print '<input id="pu
'.$suffix.'" name="pu
'.$suffix.'" type="text
" size="8
" value="'.price((GETPOST('pu
'.$suffix) != '' ? price2num(GETPOST('pu
'.$suffix)) : $up_ht_disc)).'">';
1054 print '<td class="right
">';
1055 print '<input id="dto
'.$suffix.'" name="dto
'.$suffix.'" type="text
" size="8
" value="'.(GETPOST('dto
'.$suffix) != '' ? GETPOST('dto
'.$suffix) : '').'">';
1059 print '<td class="center
">';
1060 print '<input class="flat checkformerge
" type="checkbox
" name="saveprice
'.$suffix.'" value="'.(GETPOST('saveprice
'.$suffix) != '' ? GETPOST('saveprice
'.$suffix) : '').'">';
1066 print '<td class="right
">';
1067 if (count($listwarehouses) > 1) {
1068 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);
1069 } elseif (count($listwarehouses) == 1) {
1070 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);
1072 $langs->load("errors
");
1073 print $langs->trans("ErrorNoWarehouseDefined
");
1077 // Enable hooks to append additional columns
1078 $parameters = array(
1079 'is_information_row' => false, // this is a dispatch form row
1081 'suffix' => $suffix,
1084 $reshook = $hookmanager->executeHooks(
1085 'printFieldListValue',
1091 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1093 print $hookmanager->resPrint;
1102 dol_print_error($db);
1109 $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically
", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
1111 print '<div class="center
">';
1112 $parameters = array();
1113 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
1115 if (empty($reshook)) {
1116 if (empty($conf->reception->enabled)) {
1117 print $langs->trans("Comment").' : ';
1118 print '<input type="text
" class="minwidth400
" maxlength="128
" name="comment
" value="';
1119 print GETPOSTISSET("comment") ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
1120 // print ' /
'.$object->ref_supplier; // Not yet available
1121 print '" class="flat
"><br>';
1123 print '<input type="checkbox
" checked="checked
" name="closeopenorder
"> '.$checkboxlabel;
1126 $dispatchBt = empty($conf->reception->enabled) ? $langs->trans("Receive
") : $langs->trans("CreateReception
");
1129 print '<input type="hidden
" name="backtopageforcancel
" value="'.$_SERVER["PHP_SELF"].'?
id=
'.$object->id.'">';
1130 print '<input type="submit
" class="button" name="dispatch
" value="'.dol_escape_htmltag($dispatchBt).'"';
1132 if (!$permissiontoreceive) {
1135 if (count($listwarehouses) <= 0) {
1147 // Message if nothing to dispatch
1150 if (!getDolGlobalString('SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) {
1151 print '<div class="opacitymedium
">'.$langs->trans("NoPredefinedProductToDispatch
").'</div>'; // No predefined line at all
1153 print '<div class="opacitymedium
">'.$langs->trans("NoMorePredefinedProductToDispatch
").'</div>'; // No predefined line that remain to be dispatched.
1160 print dol_get_fiche_end();
1162 // traitement entrepot par défaut
1163 print '<script type="text/javascript
">
1164 $(document).ready(function () {
1165 $("select[
name=fk_default_warehouse]
").change(function() {
1166 var fk_default_warehouse = $("option:selected
", this).val();
1167 $("select[
name^=entrepot_]
").val(fk_default_warehouse).change();
1170 $(".auto-fill-qty
").on("click touchstart
", function(e){
1172 $("input[
name=
"+$(this).data("rowname
")+"]
").val($(this).data("value
")).trigger("change
");
1175 $("#autoreset
").click(function() {
1176 $(".qtydispatchinput
").each(function(){
1177 id = $(this).attr("id");
1178 idtab = id.split("_
");
1182 $("#qty_dispatched_0_
"+idtab[2]).val("0
");
1184 obj = $(this).parent().parent();
1185 nameobj = obj.attr("name");
1186 nametab = nameobj.split("_
");
1188 $("tr[
name^=\
'"+nametab[0]+"_\'][name$=\'_"+nametab[2]+"\']:last .splitbutton").show();
1193 $(".resetline").click(function(e){
1195 id = $(this).attr("id");
1196 id = id.split("reset_");
1197 console.log("Reset trigger for id = qty_"+id[1]);
1198 $("#qty_"+id[1]).val("");
1204 $sql =
"SELECT p.rowid as pid, p.ref, p.label,";
1205 $sql .=
" e.rowid as warehouse_id, e.ref as entrepot,";
1206 $sql .=
" cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec";
1207 $sql .=
" ,cd.rowid, cd.subprice";
1208 if (isModEnabled(
'reception')) {
1209 $sql .=
", cfd.fk_reception, r.date_delivery";
1211 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product as p,";
1212 $sql .=
" ".MAIN_DB_PREFIX.
"receptiondet_batch as cfd";
1213 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as cd ON cd.rowid = cfd.fk_elementdet";
1214 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"entrepot as e ON cfd.fk_entrepot = e.rowid";
1215 if (isModEnabled(
'reception')) {
1216 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"reception as r ON cfd.fk_reception = r.rowid";
1218 $sql .=
" WHERE cfd.fk_element = ".((int)
$object->id);
1219 $sql .=
" AND cfd.fk_product = p.rowid";
1220 $sql .=
" ORDER BY cfd.rowid ASC";
1222 $resql = $db->query($sql);
1224 $num = $db->num_rows($resql);
1232 print
'<div class="div-table-responsive">';
1233 print
'<table id="dispatch_received_products" class="noborder centpercent">';
1235 print
'<tr class="liste_titre">';
1237 if (isModEnabled(
"reception")) {
1238 print
'<td>'.$langs->trans(
"Reception").
'</td>';
1241 print
'<td>'.$langs->trans(
"Product").
'</td>';
1242 print
'<td class="center">'.$langs->trans(
"DateCreation").
'</td>';
1243 print
'<td class="center">'.$langs->trans(
"DateDeliveryPlanned").
'</td>';
1244 if (isModEnabled(
'productbatch')) {
1245 print
'<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
1247 print
'<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
1250 print
'<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
1253 print
'<td class="right">'.$langs->trans(
"QtyDispatched").
'</td>';
1254 print
'<td>'.$langs->trans(
"Warehouse").
'</td>';
1255 print
'<td>'.$langs->trans(
"Comment").
'</td>';
1258 if (
getDolGlobalString(
'SUPPLIER_ORDER_USE_DISPATCH_STATUS') && !isModEnabled(
"reception")) {
1259 print
'<td class="center" colspan="2">'.$langs->trans(
"Status").
'</td>';
1260 } elseif (isModEnabled(
"reception")) {
1261 print
'<td class="center"></td>';
1264 print
'<td class="center" colspan="2"></td>';
1270 $objp = $db->fetch_object($resql);
1272 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1273 print
'<form name="editdispatchedlines" id="editdispatchedlines" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'#line_'.
GETPOSTINT(
'lineid').
'" method="POST">
1274 <input type="hidden" name="token" value="'.
newToken().
'">
1275 <input type="hidden" name="action" value="updateline">
1276 <input type="hidden" name="mode" value="">
1277 <input type="hidden" name="lineid" value="'.$objp->dispatchlineid.
'">';
1280 print
'<tr class="oddeven" id="line_'.$objp->dispatchlineid.
'" >';
1284 if (isModEnabled(
"reception")) {
1285 print
'<td class="nowraponall">';
1286 if (!empty($objp->fk_reception)) {
1288 $reception->fetch($objp->fk_reception);
1289 print $reception->getNomUrl(1);
1296 print
'<td class="tdoverflowmax150">';
1297 if (empty(
$conf->cache[
'product'][$objp->fk_product])) {
1298 $tmpproduct =
new Product($db);
1299 $tmpproduct->fetch($objp->fk_product);
1300 $conf->cache[
'product'][$objp->fk_product] = $tmpproduct;
1302 $tmpproduct =
$conf->cache[
'product'][$objp->fk_product];
1304 print $tmpproduct->getNomUrl(1);
1305 print
' - '.$objp->label;
1309 print
'<td class="center">'.dol_print_date($db->jdate($objp->datec),
'day').
'</td>';
1312 if (isModEnabled(
'reception')) {
1313 print
'<td class="center">';
1314 if (!empty($objp->date_delivery)) {
1319 print
'<td class="center"></td>';
1323 if (isModEnabled(
'productbatch')) {
1325 include_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
1327 $lot->fetch(0, $objp->pid, $objp->batch);
1328 print
'<td class="dispatch_batch_number">'.$lot->getNomUrl(1).
'</td>';
1330 print
'<td class="dispatch_dlc">'.dol_print_date($lot->sellby,
'day').
'</td>';
1333 print
'<td class="dispatch_dluo">'.dol_print_date($lot->eatby,
'day').
'</td>';
1336 print
'<td class="dispatch_batch_number"></td>';
1338 print
'<td class="dispatch_dlc"></td>';
1341 print
'<td class="dispatch_dluo"></td>';
1347 print
'<td class="right">';
1348 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1349 print
'<input style="width: 50px;" type="text" min="1" name="qty" value="'.$objp->qty.
'" />';
1353 print
'<input type="hidden" name="price" value="'.$objp->subprice.
'" />';
1356 print
'<td class="tdoverflowmax150">';
1357 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
1358 $warehouse_id =
GETPOSTINT(
"fk_entrepot") ?
GETPOSTINT(
"fk_entrepot") : ($objp->warehouse_id ? $objp->warehouse_id :
'');
1359 if (count($listwarehouses) > 1) {
1360 print $formproduct->selectWarehouses($warehouse_id,
"fk_entrepot",
'', 1, 0, $objp->fk_product,
'', 1, 1, array(),
'csswarehouse');
1361 } elseif (count($listwarehouses) == 1) {
1362 print $formproduct->selectWarehouses($warehouse_id,
"fk_entrepot",
'', 0, 0, $objp->fk_product,
'', 1, 1, array(),
'csswarehouse');
1364 $langs->load(
"errors");
1365 print $langs->trans(
"ErrorNoWarehouseDefined");
1368 $warehouse_static->id = $objp->warehouse_id;
1369 $warehouse_static->label = $objp->entrepot;
1370 print $warehouse_static->getNomUrl(1);
1375 print
'<td class="tdoverflowmax300" style="white-space: pre;">'.$objp->comment.
'</td>';
1378 if (
getDolGlobalString(
'SUPPLIER_ORDER_USE_DISPATCH_STATUS') && !isModEnabled(
"reception")) {
1379 print
'<td class="right">';
1380 $supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status);
1382 print $supplierorderdispatch->getLibStatut(5);
1386 print
'<td class="center">';
1387 if (!$permissiontocontrol) {
1388 if (empty($objp->status)) {
1389 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Approve").
'</a>';
1390 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1392 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Disapprove").
'</a>';
1393 print
'<a class="button buttonRefused" href="#">'.$langs->trans(
"Deny").
'</a>';
1397 if (
$object->status == $object::STATUS_RECEIVED_COMPLETELY) {
1400 if (empty($objp->status)) {
1401 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=checkdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1402 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=denydispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1404 if ($objp->status == 1) {
1405 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1406 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=denydispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Deny").
'</a>';
1408 if ($objp->status == 2) {
1409 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Reinit").
'</a>';
1410 print
'<a class="button'.($disabled ?
' buttonRefused' :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
"?id=".
$id.
"&action=checkdispatchline&lineid=".$objp->dispatchlineid.
'">'.$langs->trans(
"Approve").
'</a>';
1414 } elseif (isModEnabled(
"reception")) {
1415 print
'<td class="right">';
1416 if ($reception !==
null && !empty($reception->id)) {
1417 print $reception->getLibStatut(5);
1423 if ($action !=
'editline' || $lineid != $objp->dispatchlineid) {
1424 if (($reception ===
null) || empty($reception->id) || ($reception->statut == Reception::STATUS_DRAFT)) {
1425 print
'<td class="linecoledit center">';
1426 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editline&token='.
newToken().
'&lineid='.$objp->dispatchlineid.
'#line_'.$objp->dispatchlineid.
'">';
1431 print
'<td class="linecoldelete center">';
1432 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=ask_deleteline&token='.
newToken().
'&lineid='.$objp->dispatchlineid.
'#dispatch_received_products">';
1437 print
'<td></td><td></td>';
1440 print
'<td class="center valignmiddle">';
1441 print
'<input type="submit" class="button button-save" id="savelinebutton" name="save" value="'.$langs->trans(
"Save").
'" />';
1443 print
'<td class="center valignmiddle">';
1444 print
'<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans(
"Cancel").
'" />';
1450 if ($action ==
'editline' && $lineid == $objp->dispatchlineid) {
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_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.
dol_now($mode='auto')
Return date for now.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='')
Return the value of a $_GET or $_POST supervariable, converted into float.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
treeview li table
No Email.
ui state ui widget content ui state ui widget header ui state a ui button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
$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.