34 require
'../../main.inc.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/modules/supplier_order/modules_commandefournisseur.php';
36 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/fourn.lib.php';
38 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.dispatch.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/mouvementstock.class.php';
43 if (!empty($conf->projet->enabled))
44 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
47 $langs->loadLangs(array(
"bills",
"orders",
"sendings",
"companies",
"deliveries",
"products",
"stocks",
"receptions"));
49 if (!empty($conf->productbatch->enabled))
50 $langs->load(
'productbatch');
55 $lineid =
GETPOST(
'lineid',
'int');
56 $action =
GETPOST(
'action',
'aZ09');
57 $fk_default_warehouse =
GETPOST(
'fk_default_warehouse',
'int');
58 $cancel =
GETPOST(
'cancel',
'alpha');
59 $confirm =
GETPOST(
'confirm',
'alpha');
62 $socid = $user->socid;
63 $result =
restrictedArea($user,
'fournisseur', $id,
'commande_fournisseur',
'commande');
65 if (empty($conf->stock->enabled)) {
69 $hookmanager->initHooks(array(
'ordersupplierdispatch'));
73 if ($_GET[
"projectid"])
74 $projectid =
GETPOST(
"projectid",
'int');
78 if ($id > 0 || !empty($ref)) {
79 $result = $object->fetch($id, $ref);
83 $result = $object->fetch_thirdparty();
94 $parameters = array();
95 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
96 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
98 if ($action ==
'checkdispatchline' && !((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))))
105 $result = $supplierorderdispatch->fetch($lineid);
109 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
115 $result = $supplierorderdispatch->setStatut(1);
117 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
125 $result = $object->calcAndSetStatusDispatch($user);
140 if ($action ==
'uncheckdispatchline' && !((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))))
147 $result = $supplierorderdispatch->fetch($lineid);
151 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
157 $result = $supplierorderdispatch->setStatut(0);
159 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
166 $result = $object->calcAndSetStatusDispatch($user);
181 if ($action ==
'denydispatchline' && !((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))))
188 $result = $supplierorderdispatch->fetch($lineid);
192 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
198 $result = $supplierorderdispatch->setStatut(2);
200 setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors,
'errors');
207 $result = $object->calcAndSetStatusDispatch($user);
222 if ($action ==
'dispatch' && $user->rights->fournisseur->commande->receptionner) {
228 foreach ($_POST as $key => $value)
232 if (preg_match(
'/^product_([0-9]+)_([0-9]+)$/i', $key, $reg))
238 $prod =
"product_".$reg[1].
'_'.$reg[2];
239 $qty =
"qty_".$reg[1].
'_'.$reg[2];
240 $ent =
"entrepot_".$reg[1].
'_'.$reg[2];
241 if (empty(
GETPOST($ent))) $ent = $fk_default_warehouse;
242 $pu =
"pu_".$reg[1].
'_'.$reg[2];
243 $fk_commandefourndet =
"fk_commandefourndet_".$reg[1].
'_'.$reg[2];
245 if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
246 if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
247 $dto =
GETPOST(
"dto_".$reg[1].
'_'.$reg[2],
'int');
251 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
257 if (!(
GETPOST($ent,
'int') > 0)) {
258 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
259 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline);
260 setEventMessages($langs->trans(
'ErrorFieldRequired', $text), null,
'errors');
265 $result = $object->dispatchProduct($user,
GETPOST($prod,
'int'),
GETPOST($qty),
GETPOST($ent,
'int'),
GETPOST($pu),
GETPOST(
'comment'),
'',
'',
'',
GETPOST($fk_commandefourndet,
'int'), $notrigger);
271 if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
272 if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
281 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
282 $sql .=
" SET unitprice='".price2num(
GETPOST($pu),
'MU').
"'";
283 $sql .=
", price=".price2num(
GETPOST($pu),
'MU').
"*quantity";
284 $sql .=
", remise_percent = ".((float) $dto);
285 $sql .=
" WHERE fk_soc=".((int) $object->socid);
286 $sql .=
" AND fk_product=".((int)
GETPOST($prod,
'int'));
288 $resql = $db->query($sql);
296 if (preg_match(
'/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg))
303 $prod =
'product_batch_'.$reg[1].
'_'.$reg[2];
304 $qty =
'qty_'.$reg[1].
'_'.$reg[2];
305 $ent =
'entrepot_'.$reg[1].
'_'.$reg[2];
306 $pu =
'pu_'.$reg[1].
'_'.$reg[2];
307 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
308 $lot =
'lot_number_'.$reg[1].
'_'.$reg[2];
309 $dDLUO =
dol_mktime(12, 0, 0, $_POST[
'dluo_'.$reg[1].
'_'.$reg[2].
'month'], $_POST[
'dluo_'.$reg[1].
'_'.$reg[2].
'day'], $_POST[
'dluo_'.$reg[1].
'_'.$reg[2].
'year']);
310 $dDLC =
dol_mktime(12, 0, 0, $_POST[
'dlc_'.$reg[1].
'_'.$reg[2].
'month'], $_POST[
'dlc_'.$reg[1].
'_'.$reg[2].
'day'], $_POST[
'dlc_'.$reg[1].
'_'.$reg[2].
'year']);
312 $fk_commandefourndet =
'fk_commandefourndet_'.$reg[1].
'_'.$reg[2];
314 if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
315 if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
316 $dto =
GETPOST(
"dto_".$reg[1].
'_'.$reg[2],
'int');
320 $saveprice =
"saveprice_".$reg[1].
'_'.$reg[2];
326 if (!(
GETPOST($ent,
'int') > 0)) {
327 dol_syslog(
'No dispatch for line '.$key.
' as no warehouse was chosen.');
328 $text = $langs->transnoentities(
'Warehouse').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.($reg[1] + 1);
329 setEventMessages($langs->trans(
'ErrorFieldRequired', $text), null,
'errors');
333 if (!(
GETPOST($lot,
'alpha') || $dDLUO || $dDLC)) {
334 dol_syslog(
'No dispatch for line '.$key.
' as serial/eat-by/sellby date are not set');
335 $text = $langs->transnoentities(
'atleast1batchfield').
', '.$langs->transnoentities(
'Line').
' '.($numline).
'-'.($reg[1] + 1);
336 setEventMessages($langs->trans(
'ErrorFieldRequired', $text), null,
'errors');
341 $result = $object->dispatchProduct($user,
GETPOST($prod,
'int'),
GETPOST($qty),
GETPOST($ent,
'int'),
GETPOST($pu),
GETPOST(
'comment'), $dDLC, $dDLUO,
GETPOST($lot,
'alpha'),
GETPOST($fk_commandefourndet,
'int'), $notrigger);
347 if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
348 if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
349 $dto =
GETPOST(
"dto_".$reg[1].
'_'.$reg[2],
'int');
353 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product_fournisseur_price";
354 $sql .=
" SET unitprice='".GETPOST($pu).
"'";
355 $sql .=
", price=".GETPOST($pu).
"*quantity";
356 $sql .=
", remise_percent='".(!empty($dto) ? $dto : 0).
"'";
357 $sql .=
" WHERE fk_soc=".$object->socid;
358 $sql .=
" AND fk_product=".GETPOST($prod,
'int');
360 $resql = $db->query($sql);
370 $result = $object->calcAndSetStatusDispatch($user,
GETPOST(
'closeopenorder') ? 1 : 0,
GETPOST(
'comment'));
377 if (!$notrigger && !$error) {
378 global $conf, $langs, $user;
381 $result = $object->call_trigger(
'ORDER_SUPPLIER_DISPATCH', $user);
390 if ($result >= 0 && !$error) {
393 header(
"Location: dispatch.php?id=".$id);
401 if ($action ==
'confirm_deleteline' && $confirm ==
'yes' && $user->rights->fournisseur->commande->receptionner)
406 $result = $supplierorderdispatch->fetch($lineid);
409 $qty = $supplierorderdispatch->qty;
410 $entrepot = $supplierorderdispatch->fk_entrepot;
411 $product = $supplierorderdispatch->fk_product;
413 $comment = $supplierorderdispatch->comment;
414 $eatby = $supplierorderdispatch->fk_product;
415 $sellby = $supplierorderdispatch->sellby;
416 $batch = $supplierorderdispatch->batch;
418 $result = $supplierorderdispatch->delete($user);
422 $errors = $object->errors;
427 if ($entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
432 $mouv->origin = &$object;
433 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment,
'', $eatby, $sellby, $batch);
436 $errors = $mouv->errors;
453 if ($action ==
'updateline' && $user->rights->fournisseur->commande->receptionner)
459 $result = $supplierorderdispatch->fetch($lineid);
462 $qty = $supplierorderdispatch->qty;
463 $entrepot = $supplierorderdispatch->fk_entrepot;
464 $product = $supplierorderdispatch->fk_product;
466 $comment = $supplierorderdispatch->comment;
467 $eatby = $supplierorderdispatch->fk_product;
468 $sellby = $supplierorderdispatch->sellby;
469 $batch = $supplierorderdispatch->batch;
472 $supplierorderdispatch->fk_entrepot =
GETPOST(
'fk_entrepot');
473 $result = $supplierorderdispatch->update($user);
478 $errors = $supplierorderdispatch->errors;
482 if ($entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
487 $mouv->origin = &$object;
488 $result = $mouv->livraison($user, $product, $entrepot, $qty, $price, $comment,
'', $eatby, $sellby, $batch);
491 $errors = $mouv->errors;
495 $mouv->origin = &$object;
496 $result = $mouv->reception($user, $product, $supplierorderdispatch->fk_entrepot, $supplierorderdispatch->qty, $price, $comment, $eatby, $sellby, $batch);
499 $errors = $mouv->errors;
522 $form =
new Form($db);
524 $warehouse_static =
new Entrepot($db);
527 $help_url =
'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores';
528 llxHeader(
'', $langs->trans(
"OrderDispatch"), $help_url,
'', 0, 0, array(
'/fourn/js/lib_dispatch.js.php'));
530 if ($id > 0 || !empty($ref)) {
532 $soc->fetch($object->socid);
534 $author =
new User($db);
535 $author->fetch($object->user_author_id);
539 $title = $langs->trans(
"SupplierOrder");
545 if ($action ==
'ask_deleteline')
547 $formconfirm = $form->formconfirm(
$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
551 $parameters = array(
'lineid' => $lineid);
553 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
554 if (empty($reshook)) $formconfirm .= $hookmanager->resPrint;
555 elseif ($reshook > 0) $formconfirm = $hookmanager->resPrint;
562 $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
564 $morehtmlref = '<div class="refidno">';
566 $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, '
string', '', 0, 1);
567 $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, '
string', '', null, null, '', 1);
569 $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
571 if (!empty($conf->projet->enabled))
573 $langs->load(
"projects");
574 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
575 if ($user->rights->fournisseur->commande->creer)
577 if ($action !=
'classify') {
579 $morehtmlref .=
' : ';
581 if ($action ==
'classify') {
583 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
584 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
585 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
586 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
587 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
588 $morehtmlref .=
'</form>';
590 $morehtmlref .= $form->form_project(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
593 if (!empty($object->fk_project)) {
595 $proj->fetch($object->fk_project);
596 $morehtmlref .=
'<a href="'.DOL_URL_ROOT.
'/projet/card.php?id='.$object->fk_project.
'" title="'.$langs->trans(
'ShowProject').
'">';
597 $morehtmlref .= $proj->ref;
598 $morehtmlref .=
'</a>';
604 $morehtmlref .=
'</div>';
607 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
610 print '<div class="fichecenter">';
611 print '<div class="underbanner clearboth"></div>';
613 print '<table class="border tableforfield" width="100%">';
616 if ($object->methode_commande_id > 0) {
617 print '<tr><td class="titlefield">'.$langs->trans(
"Date").
'</td><td>';
618 if ($object->date_commande) {
623 if ($object->methode_commande) {
624 print '<tr><td>'.$langs->trans(
"Method").
'</td><td>'.$object->getInputMethod().
'</td></tr>';
629 print '<tr><td class="titlefield">'.$langs->trans(
"AuthorRequest").
'</td>';
630 print '<td>'.$author->getNomUrl(1,
'', 0, 0, 0).
'</td>';
633 $parameters = array();
634 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
644 if (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
649 print '<br><span class="opacitymedium">'.$langs->trans(
"OrderStatusNotReadyToDispatch").
'</span>';
656 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
658 $formproduct->loadWarehouses();
660 $listwarehouses = $entrepot->list_array(1);
663 if (empty($conf->reception->enabled))
print '<form method="POST" action="dispatch.php?id='.$object->id.
'">';
664 else print '<form method="post" action="'.dol_buildpath(
'/reception/card.php', 1).
'?originid='.$object->id.
'&origin=supplierorder">';
666 print '<input type="hidden" name="token" value="'.newToken().
'">';
667 if (empty($conf->reception->enabled))
print '<input type="hidden" name="action" value="dispatch">';
668 else print '<input type="hidden" name="action" value="create">';
670 print '<div class="div-table-responsive-no-min">';
671 print '<table class="noborder centpercent">';
674 $products_dispatched = array();
675 $sql =
"SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty";
676 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur_dispatch as cfd";
677 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l on l.rowid = cfd.fk_commandefourndet";
678 $sql .=
" WHERE cfd.fk_commande = ".$object->id;
679 $sql .=
" GROUP BY l.rowid, cfd.fk_product";
681 $resql = $db->query($sql);
683 $num = $db->num_rows(
$resql);
688 $objd = $db->fetch_object(
$resql);
689 $products_dispatched[$objd->rowid] =
price2num($objd->qty, 5);
696 $sql =
"SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, SUM(l.qty) as qty,";
697 $sql .=
" p.ref, p.label, p.tobatch, p.fk_default_warehouse";
700 $parameters = array();
701 $reshook = $hookmanager->executeHooks(
702 'printFieldListSelect',
707 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
708 $sql .= $hookmanager->resPrint;
710 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseurdet as l";
711 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON l.fk_product=p.rowid";
712 $sql .=
" WHERE l.fk_commande = ".$object->id;
713 if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
714 $sql .=
" AND l.product_type = 0";
717 $parameters = array();
718 $reshook = $hookmanager->executeHooks(
719 'printFieldListWhere',
724 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
725 $sql .= $hookmanager->resPrint;
727 $sql .=
" GROUP BY p.ref, p.label, p.tobatch, p.fk_default_warehouse, l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref";
728 $sql .=
" ORDER BY p.ref, p.label";
730 $resql = $db->query($sql);
732 $num = $db->num_rows(
$resql);
736 print '<tr class="liste_titre">';
738 print '<td>'.$langs->trans(
"Description").
'</td>';
739 if (!empty($conf->productbatch->enabled)) {
740 print '<td class="dispatch_batch_number_title">'.$langs->trans(
"batch_number").
'</td>';
741 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
742 print '<td class="dispatch_dluo_title">'.$langs->trans(
"EatByDate").
'</td>';
744 if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
745 print '<td class="dispatch_dlc_title">'.$langs->trans(
"SellByDate").
'</td>';
752 print '<td class="right">'.$langs->trans(
"SupplierRef").
'</td>';
753 print '<td class="right">'.$langs->trans(
"QtyOrdered").
'</td>';
754 print '<td class="right">'.$langs->trans(
"QtyDispatchedShort").
'</td>';
755 print ' <td class="right">'.$langs->trans(
"QtyToDispatchShort");
756 print '<br><a href="#" id="autoreset">'.$langs->trans(
"Reset").
'</a></td>';
757 print '<td width="32"></td>';
759 if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
760 if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
761 print '<td class="right">'.$langs->trans(
"Price").
'</td>';
762 print '<td class="right">'.$langs->trans(
"ReductionShort").
' (%)</td>';
763 print '<td class="right">'.$langs->trans(
"UpdatePrice").
'</td>';
767 print '<td align="right">'.$langs->trans(
"Warehouse");
770 if (count($listwarehouses) > 1) {
771 print '<br>'.$langs->trans(
"ForceTo").
' '.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 1, 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
772 } elseif (count($listwarehouses) == 1) {
773 print '<br>'.$langs->trans(
"ForceTo").
' '.$form->selectarray(
'fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0,
'', 0, 0, $disabled,
'',
'minwidth100 maxwidth300', 1);
779 $parameters = array();
780 $reshook = $hookmanager->executeHooks(
781 'printFieldListTitle',
786 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
787 print $hookmanager->resPrint;
797 $objp = $db->fetch_object(
$resql);
800 if (!$objp->fk_product > 0) {
803 $remaintodispatch =
price2num($objp->qty - ((
float) $products_dispatched[$objp->rowid]), 5);
804 if ($remaintodispatch < 0)
805 $remaintodispatch = 0;
807 if ($remaintodispatch || empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED)) {
816 print '<!-- Line to dispatch '.$suffix.
' -->'.
"\n";
818 print '<input id="qty_ordered'.$suffix.
'" type="hidden" value="'.$objp->qty.
'">';
819 print '<input id="qty_dispatched'.$suffix.
'" type="hidden" value="'.(
float) $products_dispatched[$objp->rowid].
'">';
820 print '<tr class="oddeven">';
822 $linktoprod =
'<a href="'.DOL_URL_ROOT.
'/product/fournisseurs.php?id='.$objp->fk_product.
'">'.
img_object($langs->trans(
"ShowProduct"),
'product').
' '.$objp->ref.
'</a>';
823 $linktoprod .=
' - '.$objp->label.
"\n";
825 if (!empty($conf->productbatch->enabled)) {
826 if ($objp->tobatch) {
830 print '<td class="dispatch_batch_number"></td>';
831 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
832 print '<td class="dispatch_dluo"></td>';
834 if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
835 print '<td class="dispatch_dlc"></td>';
841 print '<td class="dispatch_batch_number">';
842 print $langs->trans(
"ProductDoesNotUseBatchSerial");
844 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
845 print '<td class="dispatch_dluo"></td>';
847 if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
848 print '<td class="dispatch_dlc"></td>';
852 print '<td colspan="4">';
858 $up_ht_disc = $objp->subprice;
859 if (!empty($objp->remise_percent) && empty($conf->global->STOCK_EXCLUDE_DISCOUNT_FOR_PMP))
860 $up_ht_disc =
price2num($up_ht_disc * (100 - $objp->remise_percent) / 100,
'MU');
863 print '<td class="right">'.$objp->sref.
'</td>';
866 print '<td class="right">'.$objp->qty.
'</td>';
869 print '<td class="right">'.$products_dispatched[$objp->rowid].
'</td>';
871 if (!empty($conf->productbatch->enabled) && $objp->tobatch == 1) {
873 print '<td class="right">';
882 'is_information_row' =>
true,
887 $reshook = $hookmanager->executeHooks(
888 'printFieldListValue',
893 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
894 print $hookmanager->resPrint;
898 print '<tr class="oddeven" name="'.$type.$suffix.
'">';
900 print '<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
901 print '<input name="product_batch'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
903 print '<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
904 if (!empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT))
906 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
908 print '<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
914 print '<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.
'" name="lot_number'.$suffix.
'" value="'.
GETPOST(
'lot_number'.$suffix).
'">';
916 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
917 print '<td class="nowraponall">';
919 print $form->selectDate($dlcdatesuffix,
'dlc'.$suffix,
'',
'', 1,
'');
922 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
923 print '<td class="nowraponall">';
925 print $form->selectDate($dluodatesuffix,
'dluo'.$suffix,
'',
'', 1,
'');
928 print '<td colspan="3"> </td>';
932 $colspan = (!empty($conf->global->PRODUCT_DISABLE_EATBY)) ? --$colspan : $colspan;
933 $colspan = (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) ? --$colspan : $colspan;
934 print '<td class="right">';
943 'is_information_row' =>
true,
948 $reshook = $hookmanager->executeHooks(
949 'printFieldListValue',
954 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
955 print $hookmanager->resPrint;
959 print '<tr class="oddeven" name="'.$type.$suffix.
'">';
960 print '<td colspan="'.$colspan.
'">';
961 print '<input name="fk_commandefourndet'.$suffix.
'" type="hidden" value="'.$objp->rowid.
'">';
962 print '<input name="product'.$suffix.
'" type="hidden" value="'.$objp->fk_product.
'">';
964 print '<!-- This is a up (may include discount or not depending on STOCK_EXCLUDE_DISCOUNT_FOR_PMP. will be used for PMP calculation) -->';
965 if (!empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT))
967 print $langs->trans(
"BuyingPrice").
': <input class="maxwidth75" name="pu'.$suffix.
'" type="text" value="'.
price2num($up_ht_disc,
'MU').
'">';
969 print '<input class="maxwidth75" name="pu'.$suffix.
'" type="hidden" value="'.
price2num($up_ht_disc,
'MU').
'">';
976 print '<td class="right">';
977 print '<input id="qty'.$suffix.
'" name="qty'.$suffix.
'" type="text" class="width50 right" value="'.(
GETPOSTISSET(
'qty'.$suffix) ?
GETPOST(
'qty'.$suffix,
'int') : (empty($conf->global->SUPPLIER_ORDER_DISPATCH_FORCE_QTY_INPUT_TO_ZERO) ? $remaintodispatch : 0)).
'">';
981 if (!empty($conf->productbatch->enabled) && $objp->tobatch == 1) {
983 print img_picto($langs->trans(
'AddStockLocationLine'),
'split.png',
'class="splitbutton" onClick="addDispatchLine('.$i.
', \''.$type.
'\')
"');
986 print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton
" onClick="addDispatchLine(
'.$i.', \
''.$type.
'\')
"');
990 if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
991 if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
993 print '<td class="right
">';
994 print '<input id="pu
'.$suffix.'" name="pu
'.$suffix.'" type="text
" size="8
" value="'.price((GETPOST('pu
'.$suffix) != '' ? GETPOST('pu
'.$suffix) : $up_ht_disc)).'">';
998 print '<td class="right
">';
999 print '<input id="dto
'.$suffix.'" name="dto
'.$suffix.'" type="text
" size="8
" value="'.(GETPOST('dto
'.$suffix) != '' ? GETPOST('dto
'.$suffix) : '').'">';
1003 print '<td class="center
">';
1004 print '<input class="flat checkformerge
" type="checkbox
" name="saveprice
'.$suffix.'" value="'.(GETPOST('saveprice
'.$suffix) != '' ? GETPOST('saveprice
'.$suffix) : '').'">';
1010 print '<td class="right
">';
1011 if (count($listwarehouses) > 1) {
1012 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);
1013 } elseif (count($listwarehouses) == 1) {
1014 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);
1016 $langs->load("errors
");
1017 print $langs->trans("ErrorNoWarehouseDefined
");
1021 // Enable hooks to append additional columns
1022 $parameters = array(
1023 'is_information_row' => false // this is a dispatch form row
1025 $reshook = $hookmanager->executeHooks(
1026 'printFieldListValue',
1031 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1032 print $hookmanager->resPrint;
1041 dol_print_error($db);
1049 $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically
", $langs->transnoentitiesnoconv('StatusOrderReceivedAll'));
1051 print '<div class="center
">';
1052 $parameters = array();
1053 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
1055 if (empty($reshook))
1057 if (empty($conf->reception->enabled)) {
1058 print $langs->trans("Comment").' : ';
1059 print '<input type="text
" class="minwidth400
" maxlength="128
" name="comment
" value="';
1060 print $_POST["comment"] ? GETPOST("comment") : $langs->trans("DispatchSupplierOrder", $object->ref);
1061 // print ' /
'.$object->ref_supplier; // Not yet available
1062 print '" class="flat
"><br>';
1064 print '<input type="checkbox
" checked="checked
" name="closeopenorder
"> '.$checkboxlabel;
1067 $dispatchBt = empty($conf->reception->enabled) ? $langs->trans("Receive
") : $langs->trans("CreateReception
");
1069 print '<br><input type="submit
" class="button
" name="dispatch
" value="'.dol_escape_htmltag($dispatchBt).'"';
1070 if (count($listwarehouses) <= 0)
1077 // Message if nothing to dispatch
1080 if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED))
1081 print '<div class="opacitymedium
">'.$langs->trans("NoPredefinedProductToDispatch
").'</div>'; // No predefined line at all
1082 else print '<div class="opacitymedium
">'.$langs->trans("NoMorePredefinedProductToDispatch
").'</div>'; // No predefined line that remain to be dispatched.
1088 print dol_get_fiche_end();
1090 // traitement entrepot par défaut
1091 print '<script type="text/javascript
">
1092 $(document).ready(function () {
1093 $("select[
name=fk_default_warehouse]
").change(function() {
1094 var fk_default_warehouse = $("option:selected
", this).val();
1095 $("select[name^=entrepot_]
").val(fk_default_warehouse).change();
1098 jQuery("#autoreset
").click(function() {';
1100 while ($i < $nbproduct) {
1101 print ' jQuery("#qty_0_
'.$i.'").val("");';
1109 // List of lines already dispatched
1110 $sql = "SELECT p.rowid as pid, p.ref, p.label,
";
1111 $sql .= " e.rowid as warehouse_id, e.ref as entrepot,
";
1112 $sql .= " cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec
";
1113 $sql .= " ,cd.rowid, cd.subprice
";
1114 if ($conf->reception->enabled)$sql .= " ,cfd.fk_reception, r.date_delivery
";
1115 $sql .= " FROM
".MAIN_DB_PREFIX."product as p,
";
1116 $sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd
";
1117 $sql .= " LEFT JOIN
".MAIN_DB_PREFIX."commande_fournisseurdet as cd ON cd.rowid = cfd.fk_commandefourndet
";
1118 $sql .= " LEFT JOIN
".MAIN_DB_PREFIX."entrepot as e ON cfd.fk_entrepot = e.rowid
";
1119 if ($conf->reception->enabled)$sql .= " LEFT JOIN
".MAIN_DB_PREFIX."reception as r ON cfd.fk_reception = r.rowid
";
1120 $sql .= " WHERE cfd.fk_commande =
".$object->id;
1121 $sql .= " AND cfd.fk_product = p.rowid
";
1122 $sql .= " ORDER BY cfd.rowid ASC
";
1124 $resql = $db->query($sql);
1126 $num = $db->num_rows($resql);
1132 print load_fiche_titre($langs->trans("ReceivingForSameOrder
"));
1134 print '<div class="div-table-responsive
">';
1135 print '<table id="dispatch_received_products
" class="noborder centpercent
">';
1137 print '<tr class="liste_titre
">';
1138 if ($conf->reception->enabled)print '<td>'.$langs->trans("Reception").'</td>';
1140 print '<td>'.$langs->trans("Product").'</td>';
1141 print '<td>'.$langs->trans("DateCreation
").'</td>';
1142 print '<td>'.$langs->trans("DateDeliveryPlanned
").'</td>';
1143 if (!empty($conf->productbatch->enabled)) {
1144 print '<td class="dispatch_batch_number_title
">'.$langs->trans("batch_number
").'</td>';
1145 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
1146 print '<td class="dispatch_dluo_title
">'.$langs->trans("EatByDate
").'</td>';
1148 if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
1149 print '<td class="dispatch_dlc_title
">'.$langs->trans("SellByDate
").'</td>';
1152 print '<td class="right
">'.$langs->trans("QtyDispatched
").'</td>';
1153 print '<td>'.$langs->trans("Warehouse
").'</td>';
1154 print '<td>'.$langs->trans("Comment").'</td>';
1157 if (!empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) {
1158 print '<td class="center
" colspan="2
">'.$langs->trans("Status").'</td>';
1159 } elseif (!empty($conf->reception->enabled)) {
1160 print '<td class="center
"></td>';
1163 print '<td class="center
" colspan="2
"></td>';
1168 $objp = $db->fetch_object($resql);
1170 if ($action == 'editline' && $lineid == $objp->dispatchlineid)
1172 print '<form name="editdispatchedlines
" id="editdispatchedlines
" action="'.$_SERVER["PHP_SELF"].'?
id=
'.$object->id.'#line_
'.GETPOST('lineid
').'" method="POST
">
1173 <input type="hidden
" name="token
" value="'.newToken().'">
1174 <input type="hidden
" name="action
" value="updateline
">
1175 <input type="hidden
" name="mode
" value="">
1176 <input type="hidden
" name="lineid
" value="'.$objp->dispatchlineid.'">';
1179 print '<tr class="oddeven
" id="line_
'.$objp->dispatchlineid.'" >';
1181 if (!empty($conf->reception->enabled)) {
1183 if (!empty($objp->fk_reception)) {
1184 $reception = new Reception($db);
1185 $reception->fetch($objp->fk_reception);
1186 print $reception->getNomUrl(1);
1193 print '<a href="'.DOL_URL_ROOT.'/product/fournisseurs.php?
id=
'.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct
"), 'product').' '.$objp->ref.'</a>';
1194 print ' - '.$objp->label;
1196 print '<td>'.dol_print_date($db->jdate($objp->datec), 'day').'</td>';
1197 print '<td>'.dol_print_date($db->jdate($objp->date_delivery), 'day').'</td>';
1199 if (!empty($conf->productbatch->enabled)) {
1201 include_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
1202 $lot = new Productlot($db);
1203 $lot->fetch(0, $objp->pid, $objp->batch);
1204 print '<td class="dispatch_batch_number
">'.$lot->getNomUrl(1).'</td>';
1205 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
1206 print '<td class="dispatch_dluo
">'.dol_print_date($lot->eatby, 'day').'</td>';
1208 if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
1209 print '<td class="dispatch_dlc
">'.dol_print_date($lot->sellby, 'day').'</td>';
1212 print '<td class="dispatch_batch_number
"></td>';
1213 print '<td class="dispatch_dluo
"></td>';
1214 print '<td class="dispatch_dlc
"></td>';
1219 print '<td class="right
">';
1220 if ($action == 'editline' && $lineid == $objp->dispatchlineid)
1222 print '<input style="width: 50px;
" type="number
" min="1
" name="qty
" value="'.$objp->qty.'" />';
1227 print '<input type="hidden
" name="price" value="'.$objp->subprice.'" />';
1232 if ($action == 'editline' && $lineid == $objp->dispatchlineid)
1234 if (count($listwarehouses) > 1) {
1235 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');
1236 } elseif (count($listwarehouses) == 1) {
1237 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');
1239 $langs->load("errors
");
1240 print $langs->trans("ErrorNoWarehouseDefined
");
1244 $warehouse_static->id = $objp->warehouse_id;
1245 $warehouse_static->libelle = $objp->entrepot;
1246 print $warehouse_static->getNomUrl(1);
1251 print '<td class="tdoverflowmax300
" style="white-space: pre;
">'.$objp->comment.'</td>';
1254 if (!empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) {
1255 print '<td class="right
">';
1256 $supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status);
1257 // print $supplierorderdispatch->status;
1258 print $supplierorderdispatch->getLibStatut(5);
1261 // Add button to check/uncheck disaptching
1262 print '<td class="center
">';
1263 if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))
1265 if (empty($objp->status)) {
1266 print '<a class="button buttonRefused
" href="#
">'.$langs->trans("Approve
").'</a>';
1267 print '<a class="button buttonRefused
" href="#
">'.$langs->trans("Deny
").'</a>';
1269 print '<a class="button buttonRefused
" href="#
">'.$langs->trans("Disapprove
").'</a>';
1270 print '<a class="button buttonRefused
" href="#
">'.$langs->trans("Deny
").'</a>';
1274 if ($object->statut == 5)
1276 if (empty($objp->status)) {
1277 print '<a class="button
'.($disabled ? ' buttonRefused
' : '').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=checkdispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Approve
").'</a>';
1278 print '<a class="button
'.($disabled ? ' buttonRefused
' : '').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=denydispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Deny
").'</a>';
1280 if ($objp->status == 1) {
1281 print '<a class="button
'.($disabled ? ' buttonRefused
' : '').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Reinit
").'</a>';
1282 print '<a class="button
'.($disabled ? ' buttonRefused
' : '').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=denydispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Deny
").'</a>';
1284 if ($objp->status == 2) {
1285 print '<a class="button
'.($disabled ? ' buttonRefused
' : '').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=uncheckdispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Reinit
").'</a>';
1286 print '<a class="button
'.($disabled ? ' buttonRefused
' : '').'" href="'.$_SERVER["PHP_SELF"]."?id=".$id."&action=checkdispatchline&lineid=".$objp->dispatchlineid.'">'.$langs->trans("Approve
").'</a>';
1290 } elseif (!empty($conf->reception->enabled)) {
1291 print '<td class="right
">';
1292 if (!empty($reception->id)) {
1293 print $reception->getLibStatut(5);
1298 if ($action != 'editline' || $lineid != $objp->dispatchlineid)
1300 print '<td class="linecoledit center
">';
1301 print '<a href="'.$_SERVER["PHP_SELF"].'?
id=
'.$object->id.'&action=editline&lineid=
'.$objp->dispatchlineid.'#line_
'.$objp->dispatchlineid.'">';
1306 print '<td class="linecoldelete center
">';
1307 print '<a href="'.$_SERVER["PHP_SELF"].'?
id=
'.$object->id.'&action=ask_deleteline&lineid=
'.$objp->dispatchlineid.'#dispatch_received_products
">';
1313 print '<td class="center valignmiddle
">';
1314 print '<input type="submit
" class="button button-save
" id="savelinebutton
" name="save
" value="'.$langs->trans("Save").'" />';
1316 print '<td class="center valignmiddle
">';
1317 print '<input type="submit
" class="button button-cancel
" id="cancellinebutton
" name="cancel
" value="'.$langs->trans("Cancel").'" />';
1323 if ($action == 'editline' && $lineid == $objp->dispatchlineid) print '</form>';
1333 dol_print_error($db);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage stock movements.
const STATUS_ACCEPTED
Accepted.
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...
ordersupplier_prepare_head($object)
Prepare array with list of tabs.
const STATUS_RECEIVED_COMPLETELY
Received completely.
Class to manage table commandefournisseurdispatch.
Class to manage products or services.
dol_now($mode= 'auto')
Return date for now.
Class to manage Dolibarr users.
$conf db name
Only used if Module[ID]Name translation string is not found.
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...
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage projects.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
const STATUS_RECEIVED_PARTIALLY
Received partially.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Class to manage receptions.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=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 Calling this function terminate execution ...
Class to manage predefined suppliers products.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
div float
Buy price without taxes.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
const STATUS_ORDERSENT
Order sent, shipment on process.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
print $_SERVER["PHP_SELF"] n
Edit parameters.
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.
const STATUS_CANCELED
Order canceled.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
Class to manage warehouses.