39require
'../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/reception/class/reception.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/reception.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/modules/reception/modules_reception.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
50if (isModEnabled(
"product") || isModEnabled(
"service")) {
51 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
53if (isModEnabled(
"propal")) {
54 require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
56require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
57require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.orderline.class.php';
58require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.dispatch.class.php';
59if (isModEnabled(
'productbatch')) {
60 require_once DOL_DOCUMENT_ROOT.
'/product/class/productbatch.class.php';
62if (isModEnabled(
'project')) {
63 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
64 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
74$langs->loadLangs(array(
"receptions",
"companies",
"bills",
'deliveries',
'orders',
'stocks',
'other',
'propal',
'sendings'));
76if (isModEnabled(
'incoterm')) {
77 $langs->load(
'incoterm');
79if (isModEnabled(
'productbatch')) {
80 $langs->load(
'productbatch');
83$origin =
GETPOST(
'origin',
'alpha') ?
GETPOST(
'origin',
'alpha') :
'reception';
86if (empty($origin_id)) {
89if (empty($origin_id)) {
92if (empty($origin_id)) {
99$action =
GETPOST(
'action',
'alpha');
104$confirm =
GETPOST(
'confirm',
'alpha');
105$cancel =
GETPOST(
'cancel',
'alpha');
106$backtopage =
GETPOST(
'backtopage',
'alpha');
107$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
119$extrafields->fetch_name_optionals_label(
$object->table_element);
120$extrafields->fetch_name_optionals_label(
$object->table_element_line);
121$extrafields->fetch_name_optionals_label($objectorder->table_element_line);
124include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
127$hookmanager->initHooks(array(
'receptioncard',
'globalcard'));
131if ($id > 0 || !empty($ref)) {
144 if (($origin ==
'order_supplier' || $origin ==
'supplier_order') && is_object(
$object->origin_object) && isModEnabled(
"supplier_order")) {
145 $origin_id =
$object->origin_object->id;
146 $objectsrc =
$object->origin_object;
153 $socid = $user->socid;
157if (isModEnabled(
"reception") || $origin ==
'reception' || empty($origin)) {
161 if ($origin ==
'supplierorder' || $origin ==
'order_supplier') {
162 $result =
restrictedArea($user,
'fournisseur', $origin_id,
'commande_fournisseur',
'commande');
163 } elseif (!$user->hasRight($origin,
'lire') && !$user->hasRight($origin,
'read')) {
168if (isModEnabled(
"reception")) {
169 $permissiontoread = $user->hasRight(
'reception',
'lire');
170 $permissiontoadd = $user->hasRight(
'reception',
'creer');
171 $permissiondellink = $user->hasRight(
'reception',
'creer');
172 $permissiontovalidate = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'reception',
'creer')) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'reception',
'reception_advance',
'validate')));
173 $permissiontodelete = $user->hasRight(
'reception',
'supprimer');
175 $permissiontoread = $user->hasRight(
'fournisseur',
'commande',
'receptionner');
176 $permissiontoadd = $user->hasRight(
'fournisseur',
'commande',
'receptionner');
177 $permissiondellink = $user->hasRight(
'fournisseur',
'commande',
'receptionner');
178 $permissiontovalidate = ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'fournisseur',
'commande',
'receptionner')) || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'fournisseur',
'commande_advance',
'check')));
179 $permissiontodelete = $user->hasRight(
'fournisseur',
'commande',
'receptionner');
181$permissiontoeditextra = $permissiontoadd;
182if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
184 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
194$parameters = array();
195$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
200if (empty($reshook)) {
216 if (!empty($backtopageforcancel)) {
217 header(
"Location: ".$backtopageforcancel);
219 } elseif (!empty($backtopage)) {
220 header(
"Location: ".$backtopage);
227 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
230 if ($action ==
'reopen' && $permissiontoadd) {
235 if ($action ==
'modif' && $permissiontoadd) {
236 $result =
$object->setDraft($user);
240 $outputlangs = $langs;
243 $newlang =
GETPOST(
'lang_id',
'aZ09');
246 $newlang =
$object->thirdparty->default_lang;
248 if (!empty($newlang)) {
250 $outputlangs->setDefaultLang($newlang);
254 $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
262 if ($action ==
'set_incoterms' && isModEnabled(
'incoterm') && $permissiontoadd) {
266 if ($action ==
'setref_supplier' && $permissiontoadd) {
271 $result =
$object->setValueFrom(
'ref_supplier',
GETPOST(
'ref_supplier',
'alpha'),
'',
null,
'text',
'', $user,
'RECEPTION_MODIFY');
274 $action =
'editref_supplier';
276 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?id=".
$object->id);
281 if ($action ==
'update_extras' && $permissiontoeditextra) {
284 $attribute_name =
GETPOST(
'attribute',
'aZ09');
287 $ret = $extrafields->setOptionalsFromPost(
null,
$object, $attribute_name);
293 $result =
$object->updateExtraField($attribute_name,
'RECEPTION_MODIFY');
301 $action =
'edit_extras';
306 if ($action ==
'add' && $permissiontoadd) {
314 $object->origin_id = $origin_id;
326 if (
$object->origin ==
"supplierorder") {
327 $object->origin =
'order_supplier';
328 $classname =
'CommandeFournisseur';
330 $classname = ucfirst(
$object->origin);
332 $objectsrc =
new $classname($db);
333 $objectsrc->fetch(
$object->origin_id);
335 $object->socid = $objectsrc->socid;
338 $object->date_delivery = $date_delivery;
339 $object->fk_delivery_address = $objectsrc->fk_delivery_address;
345 $object->location_incoterms =
GETPOST(
'location_incoterms',
'alpha');
347 $batch_line = array();
348 $stockLine = array();
349 $array_options = array();
354 foreach ($_POST as $key => $value) {
357 if (strpos($key,
'qtyasked') !==
false) {
363 for ($i = 1; $i <= $num; $i++) {
375 if (
GETPOST($qty,
'alpha') > 0) {
380 $array_options[$i] = $extrafields->getOptionalsFromPost(
$object->table_element_line, (
string) $i);
385 for ($i = 1; $i <= $num; $i++) {
389 foreach ($objectsrc->lines as $linesrc) {
390 if ($linesrc->id == $lineId) {
391 $lineToTest = $linesrc;
395 if (empty($lineToTest)) {
399 $comment =
"comment".$i;
404 $cost_price =
"cost_price".$i;
423 if ($entrepot_id < 0) {
430 $eatby =
GETPOST($eatby,
'alpha');
431 $sellby =
GETPOST($sellby,
'alpha');
432 $eatbydate = str_replace(
'/',
'-', $eatby);
433 $sellbydate = str_replace(
'/',
'-', $sellby);
436 $ret =
$object->addline($entrepot_id,
GETPOSTINT($idl), (
float)
price2num(
GETPOST($qty),
'MS'), $array_options[$i],
GETPOST($comment), strtotime($eatbydate), strtotime($sellbydate),
GETPOST($batch),
GETPOSTFLOAT($cost_price,
'MU'));
448 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
462 $outputlangs = $langs;
465 $newlang =
GETPOST(
'lang_id',
'aZ09');
468 $newlang =
$object->thirdparty->default_lang;
470 if (!empty($newlang)) {
472 $outputlangs->setDefaultLang($newlang);
477 $result =
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
485 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"QtyToReceive").
'/'.$langs->transnoentitiesnoconv(
"Warehouse")),
null,
'errors');
491 header(
"Location: card.php?id=".
$object->id);
498 } elseif ($action ==
'confirm_valid' && $confirm ==
'yes' && $permissiontovalidate) {
501 $result =
$object->valid($user);
504 $langs->load(
"errors");
509 $outputlangs = $langs;
512 $newlang =
GETPOST(
'lang_id',
'aZ09');
515 $newlang =
$object->thirdparty->default_lang;
517 if (!empty($newlang)) {
519 $outputlangs->setDefaultLang($newlang);
524 $result =
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
530 } elseif ($action ==
'confirm_delete' && $confirm ==
'yes' && $permissiontodelete) {
531 $result =
$object->delete($user);
533 header(
"Location: ".DOL_URL_ROOT.
'/reception/index.php');
545 } elseif ($action ==
'setdate_livraison' && $permissiontoadd) {
549 $result =
$object->setDeliveryDate($user, $datedelivery);
553 } elseif (in_array($action, array(
'settracking_number',
'settracking_url',
'settrueWeight',
'settrueWidth',
'settrueHeight',
'settrueDepth',
'setshipping_method_id')) && $permissiontoadd) {
557 if ($action ==
'settracking_number') {
558 $object->tracking_number = trim(
GETPOST(
'tracking_number',
'alpha'));
560 if ($action ==
'settracking_url') {
561 $object->tracking_url = trim(
GETPOST(
'tracking_url',
'restricthtml'));
563 if ($action ==
'settrueWeight') {
567 if ($action ==
'settrueWidth') {
570 if ($action ==
'settrueHeight') {
574 if ($action ==
'settrueDepth') {
577 if ($action ==
'setshipping_method_id') {
582 if (
$object->update($user) >= 0) {
583 header(
"Location: card.php?id=".
$object->id);
590 } elseif ($action ==
'builddoc' && $permissiontoread) {
599 $outputlangs = $langs;
602 $newlang =
GETPOST(
'lang_id',
'aZ09');
605 $newlang = $reception->thirdparty->default_lang;
607 if (!empty($newlang)) {
609 $outputlangs->setDefaultLang($newlang);
611 $result =
$object->generateDocument(
$object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
616 } elseif ($action ==
'remove_file' && $permissiontoadd) {
618 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
620 $upload_dir =
$conf->reception->dir_output;
621 $file = $upload_dir.
'/'.
GETPOST(
'file');
628 } elseif ($action ==
'classifybilled' && $permissiontoadd) {
629 $result =
$object->setBilled();
631 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
637 } elseif ($action ==
'classifyclosed' && $permissiontoread) {
638 $result =
$object->setClosed();
640 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
646 } elseif ($action ==
'deleteline' && !empty($line_id) && $permissiontoread) {
651 $num_prod = count($lines);
652 for ($i = 0; $i < $num_prod; $i++) {
653 if ($lines[$i]->
id == $line_id) {
655 $line->id = $line_id;
656 if (!$error && $line->delete($user) < 0) {
660 unset($_POST[
"lineid"]);
664 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
669 } elseif ($action ==
'updateline' &&
GETPOST(
'save') && $permissiontoadd) {
677 $num_prod = count($lines);
678 for ($i = 0; $i < $num_prod; $i++) {
679 if ($lines[$i]->
id == $line_id) {
681 $line->fetch($line_id);
683 $extrafields->fetch_name_optionals_label(
$object->table_element_line);
684 $line->array_options = $extrafields->getOptionalsFromPost(
$object->table_element_line);
687 $line->fk_product = $lines[$i]->fk_product;
690 if ($lines[$i]->fk_product > 0) {
692 $stockLocation =
"entl".$line_id;
693 $qty =
"qtyl".$line_id;
694 $comment =
"comment".$line_id;
697 $line->id = $line_id;
698 $line->fk_entrepot =
GETPOSTINT($stockLocation);
700 $line->comment =
GETPOST($comment,
'alpha');
702 if (isModEnabled(
'productbatch')) {
703 $batch =
"batch".$line_id;
704 $dlc =
"dlc".$line_id;
705 $dluo =
"dluo".$line_id;
707 $eatby =
GETPOST($dluo,
'alpha');
708 $eatbydate = str_replace(
'/',
'-', $eatby);
710 $sellby =
GETPOST($dlc,
'alpha');
711 $sellbydate = str_replace(
'/',
'-', $sellby);
712 $line->batch =
GETPOST($batch,
'alpha');
713 $line->eatby = strtotime($eatbydate);
714 $line->sellby = strtotime($sellbydate);
717 if ($line->update($user) < 0) {
722 $qty =
"qtyl".$line_id;
723 $line->id = $line_id;
725 $line->fk_entrepot = 0;
726 if ($line->update($user) < 0) {
735 unset($_POST[
"lineid"]);
740 $outputlangs = $langs;
743 $newlang =
GETPOST(
'lang_id',
'aZ09');
746 $newlang =
$object->thirdparty->default_lang;
748 if (!empty($newlang)) {
750 $outputlangs->setDefaultLang($newlang);
754 $object->generateDocument(
$object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
757 header(
'Location: '.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id);
760 } elseif ($action ==
'updateline' && $permissiontoadd &&
GETPOST(
'cancel',
'alpha') == $langs->trans(
"Cancel")) {
761 header(
'Location: '.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id);
765 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
771 $triggersendname =
'RECEPTION_SENTBYMAIL';
773 $mode =
'emailfromreception';
774 $autocopy =
'MAIN_MAIL_AUTOCOPY_RECEPTION_TO';
775 $trackid =
'rec'.$object->id;
776 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
784$title =
$object->ref.
' - '.$langs->trans(
'Reception');
786llxHeader(
'', $title,
'Reception',
'', 0, 0,
'',
'',
'',
'mod-reception page-card');
788$form =
new Form($db);
792if (isModEnabled(
'project')) {
796$product_static =
new Product($db);
798$warehousestatic =
new Entrepot($db);
800if ($action ==
'create2') {
801 print
load_fiche_titre($langs->trans(
"CreateReception"),
'',
'dollyrevert');
803 print
'<br>'.$langs->trans(
"ReceptionCreationIsDoneFromOrder");
810if ($action ==
'create') {
819 if ($origin ==
'supplierorder') {
820 $classname =
'CommandeFournisseur';
822 $classname = ucfirst($origin);
825 $objectsrc =
new $classname($db);
826 if ($objectsrc->fetch($origin_id)) {
828 $soc->fetch($objectsrc->socid);
830 $author =
new User($db);
831 $author->fetch($objectsrc->user_author_id);
833 if (isModEnabled(
'stock')) {
837 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
838 print
'<input type="hidden" name="token" value="'.newToken().
'">';
839 print
'<input type="hidden" name="action" value="add">';
840 print
'<input type="hidden" name="origin" value="'.$origin.
'">';
841 print
'<input type="hidden" name="origin_id" value="'.$objectsrc->id.
'">';
842 print
'<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.
'">';
843 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
845 print
'<input type="hidden" name="entrepot_id" value="'.GETPOSTINT(
'entrepot_id').
'">';
850 print
'<table class="border centpercent">';
853 print
'<tr><td class="titlefieldcreate fieldrequired">';
854 if ($origin ==
'supplierorder' && isModEnabled(
"supplier_order")) {
855 print $langs->trans(
"RefOrder").
'</td><td colspan="3"><a href="'.DOL_URL_ROOT.
'/fourn/commande/card.php?id='.$objectsrc->id.
'">'.
img_object($langs->trans(
"ShowOrder"),
'order').
' '.$objectsrc->ref;
857 if ($origin ==
'propal' && isModEnabled(
"propal")) {
858 print $langs->trans(
"RefProposal").
'</td><td colspan="3"><a href="'.DOL_URL_ROOT.
'/comm/card.php?id='.$objectsrc->id.
'">'.
img_object($langs->trans(
"ShowProposal"),
'propal').
' '.$objectsrc->ref;
865 if ($origin ==
'supplier_order') {
866 print $langs->trans(
'SupplierOrder');
868 print $langs->trans(
'RefSupplier');
870 print
'</td><td colspan="3">';
871 print
'<input type="text" name="ref_supplier" value="'.$objectsrc->ref_supplier.
'" />';
876 print
'<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans(
'Company').
'</td>';
877 print
'<td colspan="3">'.$soc->getNomUrl(1).
'</td>';
881 if (isModEnabled(
'project') && $formproject !==
null) {
883 if (empty($projectid) && !empty($objectsrc->fk_project)) {
884 $projectid = $objectsrc->fk_project;
886 if ($origin ==
'project') {
887 $projectid = ($originid ? $originid : 0);
890 $langs->load(
"projects");
892 print
'<td>'.$langs->trans(
"Project").
'</td><td colspan="2">';
893 print
img_picto(
'',
'project',
'class="paddingright"');
894 print $formproject->select_projects((!
getDolGlobalString(
'PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $soc->id : -1), (string) $projectid,
'projectid', 0, 0, 1, 0, 1, 0, 0,
'', 1, 0,
'maxwidth500');
895 print
' <a href="'.DOL_URL_ROOT.
'/projet/card.php?socid='.$soc->id.
'&action=create&status=1&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?action=create&socid='.$soc->id).
'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans(
"AddProject").
'"></span></a>';
901 print
'<tr><td>'.$langs->trans(
"DateDeliveryPlanned").
'</td>';
902 print
'<td colspan="3">';
903 $date_delivery = ($date_delivery ? $date_delivery : $objectsrc->delivery_date);
904 print $form->selectDate($date_delivery ? $date_delivery : -1,
'date_delivery', 1, 1, 1);
909 print
'<tr><td>'.$langs->trans(
"NotePublic").
'</td>';
910 print
'<td colspan="3">';
911 $doleditor =
new DolEditor(
'note_public', $objectsrc->note_public,
'', 60,
'dolibarr_notes',
'In',
false,
false, !
getDolGlobalString(
'FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3,
'90%');
912 print $doleditor->Create(1);
916 if ($objectsrc->note_private && !$user->socid) {
917 print
'<tr><td>'.$langs->trans(
"NotePrivate").
'</td>';
918 print
'<td colspan="3">';
919 $doleditor =
new DolEditor(
'note_private', $objectsrc->note_private,
'', 60,
'dolibarr_notes',
'In',
false,
false, !
getDolGlobalString(
'FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3,
'90%');
920 print $doleditor->Create(1);
926 print $langs->trans(
"Weight");
927 print
'</td><td colspan="3"><input name="weight" size="4" value="'.GETPOST(
'weight').
'"> ';
928 $text = $formproduct->selectMeasuringUnits(
"weight_units",
"weight", (
string)
GETPOSTINT(
'weight_units'), 0, 2);
929 $htmltext = $langs->trans(
"KeepEmptyForAutoCalculation");
930 print $form->textwithpicto($text, $htmltext);
934 print $langs->trans(
"Width").
' x '.$langs->trans(
"Height").
' x '.$langs->trans(
"Depth");
935 print
' </td><td colspan="3"><input name="trueWidth" size="4" value="'.GETPOST(
'trueWidth').
'">';
936 print
' x <input name="trueHeight" size="4" value="'.GETPOST(
'trueHeight').
'">';
937 print
' x <input name="trueDepth" size="4" value="'.GETPOST(
'trueDepth').
'">';
939 $text = $formproduct->selectMeasuringUnits(
"size_units",
"size", (
string)
GETPOSTINT(
'size_units'), 0, 2);
940 $htmltext = $langs->trans(
"KeepEmptyForAutoCalculation");
941 print $form->textwithpicto($text, $htmltext);
945 print
"<tr><td>".$langs->trans(
"ReceptionMethod").
"</td>";
946 print
'<td colspan="3">';
947 $recept->fetch_delivery_methods();
948 print $form->selectarray(
"shipping_method_id", $recept->meths,
GETPOSTINT(
'shipping_method_id'), 1, 0, 0,
"", 1);
950 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
952 print
"</td></tr>\n";
955 print
"<tr><td>".$langs->trans(
"TrackingNumber").
"</td>";
956 print
'<td colspan="3">';
957 print
'<input name="tracking_number" size="20" value="'.GETPOST(
'tracking_number',
'alpha').
'">';
958 print
"</td></tr>\n";
961 $parameters = array(
'objectsrc' => $objectsrc,
'colspan' =>
' colspan="3"',
'cols' =>
'3',
'socid' => $socid);
962 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $recept, $action);
963 print $hookmanager->resPrint;
966 $extrafields->fetch_name_optionals_label(
$object->table_element);
967 if (empty($reshook) && !empty($extrafields->attributes[
$object->table_element][
'label'])) {
969 if ($objectsrc->fetch_optionals() > 0) {
970 $recept->array_options = array_merge($recept->array_options, $objectsrc->array_options);
972 print $recept->showOptionals($extrafields,
'create', $parameters);
976 if (isModEnabled(
'incoterm')) {
978 print
'<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans(
"IncotermLabel"), $objectsrc->label_incoterms, 1).
'</label></td>';
979 print
'<td colspan="3" class="maxwidthonsmartphone">';
980 print $form->select_incoterms((!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms :
''), (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms :
''));
985 include_once DOL_DOCUMENT_ROOT.
'/core/modules/reception/modules_reception.php';
988 if (is_array($list) && count($list) > 1) {
989 print
"<tr><td>".$langs->trans(
"DefaultModel").
"</td>";
990 print
'<td colspan="3">';
992 print
"</td></tr>\n";
1006 $suffix2numAsked = array();
1007 $dispatchLines = array();
1009 foreach ($_POST as $key => $value) {
1014 if (preg_match(
'/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
1016 $paramSuffix = $reg[1] .
'_' . $reg[2];
1017 $suffix2numAsked[$paramSuffix] = $numAsked;
1020 $numline = $numAsked;
1022 $prod =
"product_" . $paramSuffix;
1023 $qty =
"qty_" . $paramSuffix;
1024 $ent =
"entrepot_" . $paramSuffix;
1025 $pu =
"pu_" . $paramSuffix;
1026 $fk_commandefourndet =
"fk_commandefourndet_" . $paramSuffix;
1031 if (preg_match(
'/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
1033 $paramSuffix = $reg[1] .
'_' . $reg[2];
1034 $suffix2numAsked[$paramSuffix] = $numAsked;
1038 $numline = $numAsked;
1040 $prod =
'product_batch_' . $paramSuffix;
1041 $qty =
'qty_' . $paramSuffix;
1042 $ent =
'entrepot_' . $paramSuffix;
1043 $pu =
'pu_' . $paramSuffix;
1044 $lot =
'lot_number_' . $paramSuffix;
1047 $fk_commandefourndet =
'fk_commandefourndet_'.$paramSuffix;
1048 $dispatchLines[$numAsked] = array(
'paramSuffix' => $paramSuffix,
'prod' =>
GETPOSTINT($prod),
'qty' =>
price2num(
GETPOST($qty),
'MS'),
'ent' =>
GETPOSTINT($ent),
'pu' =>
price2num(
GETPOST($pu),
'MU'),
'comment' =>
GETPOST(
'comment'),
'fk_commandefourndet' =>
GETPOSTINT($fk_commandefourndet),
'DLC' => $dDLC,
'DLUO' => $dDLUO,
'lot' =>
GETPOST($lot));
1052 if (preg_match(
'/^productl([0-9]+)$/i', $key, $reg)) {
1054 $paramSuffix = $reg[1];
1055 $suffix2numAsked[$paramSuffix] = $numAsked;
1059 $numline = $numAsked;
1061 $prod =
'productid'.$paramSuffix;
1062 $comment =
'comment'.$paramSuffix;
1063 $qty =
'qtyl'.$paramSuffix;
1064 $ent =
'entl'.$paramSuffix;
1065 $pu =
'pul'.$paramSuffix;
1066 $lot =
'batch'.$paramSuffix;
1069 $fk_commandefourndet =
'fk_commandefournisseurdet'.$paramSuffix;
1070 $dispatchLines[$numAsked] = array(
'prod' =>
GETPOSTINT($prod),
'qty' =>
price2num(
GETPOST($qty),
'MS'),
'ent' =>
GETPOSTINT($ent),
'pu' =>
price2num(
GETPOST($pu),
'MU'),
'comment' =>
GETPOST($comment),
'fk_commandefourndet' =>
GETPOSTINT($fk_commandefourndet),
'DLC' => $dDLC,
'DLUO' => $dDLUO,
'lot' =>
GETPOSTINT($lot));
1077 foreach ($suffix2numAsked as $suffix => $n) {
1078 $dispatchLines[$n][
'array_options'] = $extrafields->getOptionalsFromPost(
'receptiondet_batch',
'_' . $suffix,
'');
1081 print
'<script type="text/javascript">
1082 jQuery(document).ready(function() {
1083 jQuery("#autofill").click(function(event) {
1084 event.preventDefault();';
1086 while ($i <= $numAsked) {
1087 print
'jQuery("#qtyl'.$i.
'").val(jQuery("#qtyasked'.$i.
'").val() - jQuery("#qtydelivered'.$i.
'").val());'.
"\n";
1091 jQuery("#autoreset").click(function(event) {
1092 event.preventDefault();';
1094 while ($i <= $numAsked) {
1095 print
'jQuery("#qtyl'.$i.
'").val(0);'.
"\n";
1104 print
'<table class="noborder centpercent">';
1107 $objectsrc->loadReceptions();
1110 print
'<tr class="liste_titre">';
1111 print
'<td>'.$langs->trans(
"Description").
'</td>';
1112 print
'<td>'.$langs->trans(
"Comment").
'</td>';
1113 print
'<td class="center">'.$langs->trans(
"QtyOrdered").
'</td>';
1114 print
'<td class="center">'.$langs->trans(
"QtyReceived").
'</td>';
1115 print
'<td class="center">'.$langs->trans(
"QtyToReceive");
1117 print
'<td>'.$langs->trans(
"BuyingPrice").
'</td>';
1119 if (!isModEnabled(
'productbatch')) {
1120 print
' <br><center><a href="#" id="autofill"><span class="fas fa-fill pictofixedwidth" style=""></span> '.$langs->trans(
"Fill").
'</a>';
1121 print
' <a href="#" id="autoreset"><span class="fas fa-eraser pictofixedwidth" style=""></span>'.$langs->trans(
"Reset").
'</a></center><br>';
1124 if (isModEnabled(
'stock')) {
1125 print
'<td class="left">'.$langs->trans(
"Warehouse").
' ('.$langs->trans(
"Stock").
')</td>';
1127 if (isModEnabled(
'productbatch')) {
1128 print
'<td class="left">'.$langs->trans(
"batch_number").
'</td>';
1130 print
'<td class="left">'.$langs->trans(
"SellByDate").
'</td>';
1133 print
'<td class="left">'.$langs->trans(
"EatByDate").
'</td>';
1142 $arrayofpurchaselinealreadyoutput = array();
1146 while ($indiceAsked <= $numAsked) {
1151 foreach ($objectsrc->lines as $supplierLine) {
1152 if ($dispatchLines[$indiceAsked][
'fk_commandefourndet'] == $supplierLine->id) {
1153 $line = $supplierLine;
1161 $type = $line->product_type ? $line->product_type : $line->fk_product_type;
1163 if (!empty($line->date_start)) {
1166 if (!empty($line->date_end)) {
1170 print
'<!-- line fk_commandefourndet='.$line->id.
' for product='.$line->fk_product.
' -->'.
"\n";
1171 print
'<tr class="oddeven">'.
"\n";
1174 if ($line->fk_product > 0) {
1175 $product->fetch($line->fk_product);
1176 $product->load_stock(
'warehouseopen');
1181 print
'<a name="'.$line->id.
'"></a>';
1183 print
'<input type="hidden" name="productl'.$indiceAsked.
'" value="'.$line->fk_product.
'">';
1185 if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) {
1186 print
'<input type="hidden" name="productid'.$indiceAsked.
'" value="'.$line->fk_product.
'">';
1189 $product_static = $product;
1191 $text = $product_static->getNomUrl(1);
1192 $text .=
' - '.(!empty($line->label) ? $line->label : $line->product_label);
1194 print $form->textwithtooltip($text, $description, 3, 0,
'', (
string) $i);
1197 print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end));
1201 print ($line->desc && $line->desc != $line->product_label) ?
'<br>'.dol_htmlentitiesbr($line->desc) :
'';
1207 if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) {
1209 $text =
img_object($langs->trans(
'Service'),
'service');
1211 $text =
img_object($langs->trans(
'Product'),
'product');
1214 if (!empty($line->label)) {
1215 $text .=
' <strong>'.$line->label.
'</strong>';
1216 print $form->textwithtooltip($text, $line->desc, 3, 0,
'', (
string) $i);
1218 print $text.
' '.nl2br($line->desc);
1222 print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end));
1229 $defaultcomment = $dispatchLines[$indiceAsked][
'comment'];
1231 print
'<input type="text" class="maxwidth100" name="comment'.$indiceAsked.
'" value="'.$defaultcomment.
'">';
1235 print
'<td class="center">';
1236 if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) {
1239 print
'<input type="hidden" name="fk_commandefournisseurdet'.$indiceAsked.
'" value="'.$line->id.
'">';
1240 print
'<input type="hidden" name="pul'.$indiceAsked.
'" value="'.$line->pu_ht.
'">';
1241 print
'<input name="qtyasked'.$indiceAsked.
'" id="qtyasked'.$indiceAsked.
'" type="hidden" value="'.$line->qty.
'">';
1243 $qtyProdCom = $line->qty;
1246 print
'<td class="center">';
1247 $quantityDelivered = isset($objectsrc->receptions[$line->id]) ? $objectsrc->receptions[$line->id] : 0;
1248 if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) {
1249 print $quantityDelivered;
1251 print
'<input name="qtydelivered'.$indiceAsked.
'" id="qtydelivered'.$indiceAsked.
'" type="hidden" value="'.$quantityDelivered.
'">';
1256 $quantityToBeDelivered = 0;
1258 $quantityToBeDelivered = $dispatchLines[$indiceAsked][
'qty'];
1260 $warehouse_id = $dispatchLines[$indiceAsked][
'ent'];
1263 $warehouseObject =
null;
1264 if (isModEnabled(
'stock')) {
1266 print
'<!-- Case warehouse already known or product not a predefined product -->';
1267 if (array_key_exists($dispatchLines[$indiceAsked][
'ent'], $product->stock_warehouse)) {
1268 $stock = +$product->stock_warehouse[$dispatchLines[$indiceAsked][
'ent']]->real;
1270 $deliverableQty = $dispatchLines[$indiceAsked][
'qty'];
1271 $cost_price = $dispatchLines[$indiceAsked][
'pu'];
1274 print
'<td class="center">';
1277 $defaultqty =
GETPOSTINT(
'qtyl'.$indiceAsked);
1279 print
'<input name="idl'.$indiceAsked.
'" type="hidden" value="'.$line->id.
'">';
1280 print
'<input class="right" name="qtyl'.$indiceAsked.
'" id="qtyl'.$indiceAsked.
'" type="text" size="4" value="'.$deliverableQty.
'">';
1282 print $langs->trans(
"NA");
1288 print
'<input class="width75 right" name="cost_price'.$indiceAsked.
'" id="cost_price'.$indiceAsked.
'" value="'.
price($cost_price).
'">';
1293 if (isModEnabled(
'stock')) {
1294 print
'<td class="left">';
1297 $ent =
"entl".$indiceAsked;
1298 $idl =
"idl".$indiceAsked;
1300 if ($line->fk_product > 0) {
1301 print
'<!-- Show warehouse selection -->';
1302 print $formproduct->selectWarehouses($tmpentrepot_id,
'entl'.$indiceAsked,
'', 0, 0, $line->fk_product,
'', 1);
1305 print $langs->trans(
"Service");
1310 if (isModEnabled(
'productbatch')) {
1311 if (!empty($product->status_batch)) {
1312 print
'<td><input name="batch'.$indiceAsked.
'" value="'.$dispatchLines[$indiceAsked][
'lot'].
'"></td>';
1314 print
'<td class="nowraponall">';
1315 print $form->selectDate($dispatchLines[$indiceAsked][
'DLC'],
'dlc'.$indiceAsked, 0, 0, 1,
"");
1319 print
'<td class="nowraponall">';
1320 print $form->selectDate($dispatchLines[$indiceAsked][
'DLUO'],
'dluo'.$indiceAsked, 0, 0, 1,
"");
1324 print
'<td colspan="3"></td>';
1329 $arrayofpurchaselinealreadyoutput[$line->id] = $line->id;
1335 if (!empty($extrafields)) {
1337 if (isModEnabled(
'productbatch')) {
1349 $srcLine->id = $line->id;
1350 $srcLine->fetch_optionals();
1352 if (empty($recLine->array_options) && !empty($dispatchLines[$indiceAsked][
'array_options'])) {
1353 $recLine->array_options = $dispatchLines[$indiceAsked][
'array_options'];
1355 $recLine->array_options = array_merge($recLine->array_options, $srcLine->array_options);
1357 print $recLine->showOptionals($extrafields,
'edit', array(
'style' =>
'class="oddeven"',
'colspan' => $colspan), (
string) $indiceAsked,
'',
'1');
1367 print $form->buttonsSaveCancel(
"Create");
1376} elseif ($id || $ref) {
1384 $num_prod = count($lines);
1388 print $langs->trans(
"NoRecordFound");
1395 $object->origin =
'CommandeFournisseur';
1396 $typeobject =
$object->origin;
1398 $origin_id =
$object->origin_id;
1405 $res =
$object->fetch_optionals();
1408 print
dol_get_fiche_head($head,
'reception', $langs->trans(
"Reception"), -1,
'dollyrevert');
1413 if ($action ==
'delete') {
1414 $formconfirm = $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $langs->trans(
'DeleteReception'), $langs->trans(
"ConfirmDeleteReception",
$object->ref),
'confirm_delete',
'', 0, 1);
1418 if ($action ==
'valid') {
1419 $objectref = substr(
$object->ref, 1, 4);
1420 if ($objectref ==
'PROV') {
1421 $numref =
$object->getNextNumRef($soc);
1426 $text = $langs->trans(
"ConfirmValidateReception", $numref);
1428 $text .=
'<br>'.img_picto(
'',
'movement',
'class="pictofixedwidth"').$langs->trans(
"StockMovementWillBeRecorded").
'.';
1430 $text .=
'<br>'.img_picto(
'',
'movement',
'class="pictofixedwidth"').$langs->trans(
"StockMovementNotYetRecorded").
'.';
1433 if (isModEnabled(
'notification')) {
1434 require_once DOL_DOCUMENT_ROOT.
'/core/class/notify.class.php';
1435 $notify =
new Notify($db);
1437 $text .= $notify->confirmMessage(
'RECEPTION_VALIDATE',
$object->socid,
$object);
1440 $formconfirm = $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $langs->trans(
'ValidateReception'), $text,
'confirm_valid',
'', 0, 1, 250);
1444 if ($action ==
'annuler') {
1445 $formconfirm = $form->formconfirm($_SERVER[
'PHP_SELF'].
'?id='.
$object->id, $langs->trans(
'CancelReception'), $langs->trans(
"ConfirmCancelReception",
$object->ref),
'confirm_cancel',
'', 0, 1);
1448 if (!$formconfirm) {
1449 $parameters = array(
'formConfirm' => $formconfirm);
1450 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters,
$object, $action);
1451 if (empty($reshook)) {
1452 $formconfirm .= $hookmanager->resPrint;
1453 } elseif ($reshook > 0) {
1454 $formconfirm = $hookmanager->resPrint;
1464 $tmparray =
$object->getTotalWeightVolume();
1465 $totalWeight = $tmparray[
'weight'];
1466 $totalVolume = $tmparray[
'volume'];
1469 if ($typeobject ==
'commande' &&
$object->origin_object->id && isModEnabled(
'order')) {
1471 $objectsrc->fetch(
$object->origin_object->id);
1473 if ($typeobject ==
'propal' &&
$object->origin_object->id && isModEnabled(
"propal")) {
1474 $objectsrc =
new Propal($db);
1475 $objectsrc->fetch(
$object->origin_object->id);
1477 if ($typeobject ==
'CommandeFournisseur' &&
$object->origin_object->id && isModEnabled(
"supplier_order")) {
1479 $objectsrc->fetch(
$object->origin_object->id);
1482 $linkback =
'<a href="'.DOL_URL_ROOT.
'/reception/list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
1483 $morehtmlref =
'<div class="refidno">';
1486 $morehtmlref .= $form->editfieldkey(
"RefSupplier",
'ref_supplier',
$object->ref_supplier,
$object, $user->hasRight(
'reception',
'creer'),
'string',
'', 0, 1);
1487 $morehtmlref .= $form->editfieldval(
"RefSupplier",
'ref_supplier',
$object->ref_supplier,
$object, $user->hasRight(
'reception',
'creer'),
'string',
'',
null,
null,
'', 1);
1490 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1);
1492 if (isModEnabled(
'project')) {
1493 $langs->load(
"projects");
1494 $morehtmlref .=
'<br>';
1496 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
1497 if ($action !=
'classify' && $permissiontoadd) {
1498 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
1500 $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');
1502 if (!empty($objectsrc) && !empty($objectsrc->fk_project)) {
1504 $proj->fetch($objectsrc->fk_project);
1505 $morehtmlref .= $proj->getNomUrl(1);
1507 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
1512 $morehtmlref .=
'</div>';
1514 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
1517 print
'<div class="fichecenter">';
1518 print
'<div class="fichehalfleft">';
1519 print
'<div class="underbanner clearboth"></div>';
1521 print
'<table class="border centpercent tableforfield">';
1524 if ($typeobject ==
'commande' &&
$object->origin_object->id && isModEnabled(
'order')) {
1526 print $langs->trans(
"RefOrder").
'</td>';
1527 print
'<td colspan="3">';
1528 print $objectsrc->getNomUrl(1,
'commande');
1532 if ($typeobject ==
'propal' &&
$object->origin_object->id && isModEnabled(
"propal")) {
1534 print $langs->trans(
"RefProposal").
'</td>';
1535 print
'<td colspan="3">';
1536 print $objectsrc->getNomUrl(1,
'reception');
1540 if ($typeobject ==
'CommandeFournisseur' &&
$object->origin_object->id && isModEnabled(
"propal")) {
1542 print $langs->trans(
"SupplierOrder").
'</td>';
1543 print
'<td colspan="3">';
1544 print $objectsrc->getNomUrl(1,
'reception');
1550 print
'<tr><td class="titlefield">'.$langs->trans(
"DateCreation").
'</td>';
1551 print
'<td colspan="3">'.dol_print_date(
$object->date_creation,
"dayhour",
"tzuserrel").
"</td>\n";
1555 print
'<tr><td height="10">';
1556 print
'<table class="nobordernopadding" width="100%"><tr><td>';
1557 print $langs->trans(
'DateDeliveryPlanned');
1560 if ($action !=
'editdate_livraison' && $permissiontoadd) {
1561 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editdate_livraison&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->trans(
'SetDeliveryDate'), 1).
'</a></td>';
1563 print
'</tr></table>';
1564 print
'</td><td colspan="2">';
1565 if ($action ==
'editdate_livraison') {
1566 print
'<form name="setdate_livraison" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post">';
1567 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1568 print
'<input type="hidden" name="action" value="setdate_livraison">';
1569 print $form->selectDate(
$object->date_delivery ?
$object->date_delivery : -1,
'liv_', 1, 1, 0,
"setdate_livraison", 1, 0);
1570 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
1580 print $form->editfieldkey(
"Weight",
'trueWeight', (
string)
$object->trueWeight,
$object, $user->hasRight(
'reception',
'creer'));
1581 print
'</td><td colspan="3">';
1583 if ($action ==
'edittrueWeight') {
1584 print
'<form name="settrueweight" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
1585 print
'<input name="action" value="settrueWeight" type="hidden">';
1586 print
'<input name="id" value="'.$object->id.
'" type="hidden">';
1587 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1588 print
'<input id="trueWeight" name="trueWeight" value="'.$object->trueWeight.
'" type="text">';
1589 print $formproduct->selectMeasuringUnits(
"weight_units",
"weight", (
string)
$object->weight_units, 0, 2);
1590 print
' <input class="button" name="modify" value="'.$langs->trans(
"Modify").
'" type="submit">';
1591 print
' <input class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'" type="submit">';
1595 print (
$object->trueWeight &&
$object->weight_units !=
'') ?
' '.measuringUnitString(0,
"weight",
$object->weight_units) :
'';
1599 if ($totalWeight > 0) {
1600 if (!empty(
$object->trueWeight)) {
1601 print
' ('.$langs->trans(
"SumOfProductWeights").
': ';
1604 if (!empty(
$object->trueWeight)) {
1611 print
'<tr><td>'.$form->editfieldkey(
"Width",
'trueWidth', (
string)
$object->trueWidth,
$object, $user->hasRight(
'reception',
'creer')).
'</td><td colspan="3">';
1612 print $form->editfieldval(
"Width",
'trueWidth',
$object->trueWidth,
$object, $user->hasRight(
'reception',
'creer'));
1613 print (
$object->trueWidth &&
$object->width_units !=
'') ?
' '.measuringUnitString(0,
"size",
$object->width_units) :
'';
1617 print
'<tr><td>'.$form->editfieldkey(
"Height",
'trueHeight', (
string)
$object->trueHeight,
$object, $user->hasRight(
'reception',
'creer')).
'</td><td colspan="3">';
1618 if ($action ==
'edittrueHeight') {
1619 print
'<form name="settrueHeight" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
1620 print
'<input name="action" value="settrueHeight" type="hidden">';
1621 print
'<input name="id" value="'.$object->id.
'" type="hidden">';
1622 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1623 print
'<input id="trueHeight" name="trueHeight" value="'.$object->trueHeight.
'" type="text">';
1624 print $formproduct->selectMeasuringUnits(
"size_units",
"size",
$object->size_units, 0, 2);
1625 print
' <input class="button" name="modify" value="'.$langs->trans(
"Modify").
'" type="submit">';
1626 print
' <input class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'" type="submit">';
1630 print (
$object->trueHeight &&
$object->height_units !=
'') ?
' '.measuringUnitString(0,
"size",
$object->height_units) :
'';
1636 print
'<tr><td>'.$form->editfieldkey(
"Depth",
'trueDepth', (
string)
$object->trueDepth,
$object, $user->hasRight(
'reception',
'creer')).
'</td><td colspan="3">';
1637 print $form->editfieldval(
"Depth",
'trueDepth',
$object->trueDepth,
$object, $user->hasRight(
'reception',
'creer'));
1638 print (
$object->trueDepth &&
$object->depth_units !=
'') ?
' '.measuringUnitString(0,
"size",
$object->depth_units) :
'';
1643 print $langs->trans(
"Volume");
1645 print
'<td colspan="3">';
1646 $calculatedVolume = 0;
1650 $volumeUnit =
$object->size_units * 3;
1653 if ($calculatedVolume > 0) {
1654 if ($volumeUnit < 50) {
1660 if ($totalVolume > 0) {
1661 if ($calculatedVolume) {
1662 print
' ('.$langs->trans(
"SumOfProductVolumes").
': ';
1666 if ($calculatedVolume) {
1676 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1681 print
'<div class="fichehalfright">';
1682 print
'<div class="underbanner clearboth"></div>';
1684 print
'<table class="border centpercent tableforfield">';
1687 print
'<tr><td height="10">';
1688 print
'<table class="nobordernopadding centpercent"><tr><td>';
1689 print $langs->trans(
'ReceptionMethod');
1692 if ($action !=
'editshipping_method_id' && $permissiontoadd) {
1693 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editshipping_method_id&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->trans(
'SetReceptionMethod'), 1).
'</a></td>';
1695 print
'</tr></table>';
1696 print
'</td><td colspan="2">';
1697 if ($action ==
'editshipping_method_id') {
1698 print
'<form name="setshipping_method_id" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'" method="post">';
1699 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1700 print
'<input type="hidden" name="action" value="setshipping_method_id">';
1701 $object->fetch_delivery_methods();
1702 print $form->selectarray(
"shipping_method_id",
$object->meths,
$object->shipping_method_id, 1, 0, 0,
"", 1);
1704 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1706 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
1709 if (
$object->shipping_method_id > 0) {
1711 $code = $langs->getLabelFromKey($db, (
string)
$object->shipping_method_id,
'c_shipment_mode',
'rowid',
'code');
1712 print $langs->trans(
"SendingMethod".strtoupper($code));
1719 print
'<tr><td class="titlefield">'.$form->editfieldkey(
"TrackingNumber",
'tracking_number',
$object->tracking_number,
$object, $user->hasRight(
'reception',
'creer')).
'</td><td colspan="3">';
1720 print $form->editfieldval(
"TrackingNumber",
'tracking_number',
$object->tracking_url,
$object, $user->hasRight(
'reception',
'creer'),
'safehtmlstring',
$object->tracking_number);
1724 if (isModEnabled(
'incoterm')) {
1726 print
'<table width="100%" class="nobordernopadding"><tr><td>';
1727 print $langs->trans(
'IncotermLabel');
1728 print
'<td><td class="right">';
1729 if ($user->hasRight(
'reception',
'creer')) {
1730 print
'<a class="editfielda" href="'.DOL_URL_ROOT.
'/reception/card.php?id='.
$object->id.
'&action=editincoterm&token='.
newToken().
'">'.
img_edit().
'</a>';
1734 print
'</td></tr></table>';
1736 print
'<td colspan="3">';
1737 if ($action !=
'editincoterm') {
1738 print $form->textwithpicto(
$object->display_incoterms(),
$object->label_incoterms, 1);
1740 print $form->select_incoterms((!empty(
$object->fk_incoterms) ?
$object->fk_incoterms :
''), (!empty(
$object->location_incoterms) ?
$object->location_incoterms :
''), $_SERVER[
'PHP_SELF'].
'?id='.
$object->id);
1750 print
'<div class="clearboth"></div>';
1754 if ($action ==
'editline') {
1755 print
'<form name="updateline" id="updateline" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$line_id.
'" method="POST">
1756 <input type="hidden" name="token" value="' .
newToken().
'">
1757 <input type="hidden" name="action" value="updateline">
1758 <input type="hidden" name="mode" value="">
1759 <input type="hidden" name="id" value="' .
$object->id.
'">';
1763 print
'<div class="div-table-responsive-no-min">';
1764 print
'<table id="tablelines" class="noborder centpercent">';
1766 print
'<tr class="liste_titre">';
1769 print
'<td width="5" class="center"> </td>';
1772 print
'<td>'.$langs->trans(
"Products").
'</td>';
1774 print
'<td>'.$langs->trans(
"Comment").
'</td>';
1776 print
'<td class="center">'.$langs->trans(
"QtyOrdered").
'</td>';
1777 if ($origin && $origin_id > 0) {
1778 print
'<td class="center">'.$langs->trans(
"QtyInOtherReceptions").
'</td>';
1782 if ($action ==
'editline') {
1783 if (!isModEnabled(
'stock')) {
1786 if (empty(
$conf->productbatch->enabled)) {
1789 print
'<td class="center" colspan="'.$editColspan.
'">';
1791 print $langs->trans(
"QtyToReceive").
' - ';
1793 print $langs->trans(
"QtyReceived").
' - ';
1795 if (isModEnabled(
'stock')) {
1796 print $langs->trans(
"WarehouseTarget").
' - ';
1798 if (isModEnabled(
'productbatch')) {
1799 print $langs->trans(
"Batch");
1803 $statusreceived = $object::STATUS_CLOSED;
1805 $statusreceived = $object::STATUS_VALIDATED;
1808 $statusreceived = $object::STATUS_CLOSED;
1810 if (
$object->statut < $statusreceived) {
1811 print
'<td class="center">'.$langs->trans(
"QtyToReceive").
'</td>';
1813 print
'<td class="center">'.$langs->trans(
"QtyReceived").
'</td>';
1815 if (isModEnabled(
'stock')) {
1816 print
'<td class="left">'.$langs->trans(
"WarehouseTarget").
'</td>';
1819 if (isModEnabled(
'productbatch')) {
1820 print
'<td class="left">'.$langs->trans(
"Batch").
'</td>';
1823 print
'<td class="center">'.$langs->trans(
"CalculatedWeight").
'</td>';
1824 print
'<td class="center">'.$langs->trans(
"CalculatedVolume").
'</td>';
1827 print
'<td class="linecoledit"></td>';
1828 print
'<td class="linecoldelete" width="10"></td>';
1835 $outputlangs = $langs;
1839 if (
GETPOST(
'lang_id',
'aZ09')) {
1840 $newlang =
GETPOST(
'lang_id',
'aZ09');
1842 if (empty($newlang)) {
1843 $newlang =
$object->thirdparty->default_lang;
1845 if (!empty($newlang)) {
1847 $outputlangs->setDefaultLang($newlang);
1852 $alreadysent = array();
1854 $origin =
'commande_fournisseur';
1856 if ($origin && $origin_id > 0) {
1857 $sql =
"SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end";
1858 $sql .=
", ed.rowid as receptionline_id, ed.qty, ed.fk_reception as reception_id, ed.fk_entrepot";
1859 $sql .=
", e.rowid as reception_id, e.ref as reception_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_reception";
1861 $sql .=
', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch';
1862 $sql .=
', p.description as product_desc';
1863 $sql .=
" FROM ".MAIN_DB_PREFIX.
"receptiondet_batch as ed";
1864 $sql .=
", ".MAIN_DB_PREFIX.
"reception as e";
1865 $sql .=
", ".MAIN_DB_PREFIX.$origin.
"det as obj";
1867 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON obj.fk_product = p.rowid";
1868 $sql .=
" WHERE e.entity IN (".getEntity(
'reception').
")";
1869 $sql .=
" AND obj.fk_commande = ".((int) $origin_id);
1870 $sql .=
" AND obj.rowid = ed.fk_elementdet";
1871 $sql .=
" AND ed.fk_reception = e.rowid";
1872 $sql .=
" AND ed.fk_reception !=".((int)
$object->id);
1874 $sql .=
" ORDER BY obj.fk_product";
1876 dol_syslog(
"get list of reception lines", LOG_DEBUG);
1877 $resql = $db->query($sql);
1879 $num = $db->num_rows($resql);
1883 $obj = $db->fetch_object($resql);
1886 $alreadysent[$obj->rowid][$obj->receptionline_id] = array(
'reception_ref' => $obj->reception_ref,
'reception_id' => $obj->reception_id,
'warehouse' => $obj->fk_entrepot,
'qty' => $obj->qty,
'date_valid' => $obj->date_valid,
'date_delivery' => $obj->date_delivery);
1894 $arrayofpurchaselinealreadyoutput = array();
1898 for ($i = 0; $i < $num_prod; $i++) {
1899 print
'<!-- origin line id = '.(!empty($lines[$i]->origin_line_id) ? $lines[$i]->origin_line_id : 0).
' -->';
1900 print
'<tr class="oddeven" id="row-'.$lines[$i]->id.
'" data-id="'.$lines[$i]->id.
'" data-element="'.$lines[$i]->element.
'">';
1904 print
'<td class="center">'.($i + 1).
'</td>';
1908 if ($lines[$i]->fk_product > 0) {
1912 $prod->fetch($lines[$i]->fk_product);
1913 $label = (!empty($prod->multilangs[$outputlangs->defaultlang][
"label"])) ? $prod->multilangs[$outputlangs->defaultlang][
"label"] : $lines[$i]->product->label;
1915 $label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label);
1918 print
'<td class="linecoldescription">';
1919 if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) {
1920 $text = $lines[$i]->product->getNomUrl(1);
1921 $text .=
' - '.$label;
1923 print $form->textwithtooltip($text, $description, 3, 0,
'', (
string) $i);
1924 print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : 0, !empty($lines[$i]->date_end) ? $lines[$i]->date_end : 0);
1926 print (!empty($lines[$i]->product->description) && $lines[$i]->description != $lines[$i]->product->description) ?
'<br>'.dol_htmlentitiesbr($lines[$i]->
description) :
'';
1931 print
'<td class="linecoldescription">';
1932 if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) {
1934 $text =
img_object($langs->trans(
'Service'),
'service');
1936 $text =
img_object($langs->trans(
'Product'),
'product');
1939 if (!empty($lines[$i]->label)) {
1940 $text .=
' <strong>'.$lines[$i]->label.
'</strong>';
1941 print $form->textwithtooltip($text, $lines[$i]->
description, 3, 0,
'', (
string) $i);
1951 if ($action ==
'editline' && $lines[$i]->
id == $line_id) {
1952 print
'<td><input name="comment'.$line_id.
'" id="comment'.$line_id.
'" value="'.
dol_escape_htmltag($lines[$i]->comment).
'"></td>';
1954 print
'<td style="white-space: pre-wrap; max-width: 200px;">'.dol_escape_htmltag($lines[$i]->comment).
'</td>';
1959 print
'<td class="center linecolqty">';
1960 if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) {
1961 print $lines[$i]->qty_asked;
1966 if ($origin && $origin_id > 0) {
1967 print
'<td class="center nowrap linecolqtyinotherreceptions">';
1969 $qtyalreadyreceived = 0;
1970 if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) {
1971 foreach ($alreadysent as $key => $val) {
1972 if ($lines[$i]->fk_commandefourndet == $key) {
1974 foreach ($val as $receptionline_id => $receptionline_var) {
1975 if ($receptionline_var[
'reception_id'] == $lines[$i]->fk_reception) {
1981 $htmltooltip .=
'<br>';
1983 $reception_static->fetch($receptionline_var[
'reception_id']);
1984 $htmltooltip .= $reception_static->getNomUrl(1, 0, 0, 0, 1);
1985 $htmltooltip .=
' - '.$receptionline_var[
'qty'];
1987 $htmltext = $langs->trans(
"DateValidation").
' : '.(empty($receptionline_var[
'date_valid']) ? $langs->trans(
"Draft") :
dol_print_date($receptionline_var[
'date_valid'],
'dayhour'));
1988 if (isModEnabled(
'stock') && $receptionline_var[
'warehouse'] > 0) {
1989 $warehousestatic->fetch($receptionline_var[
'warehouse']);
1990 $htmltext .=
'<br>'.$langs->trans(
"From").
' : '.$warehousestatic->getNomUrl(1,
'', 0, 1);
1992 $htmltooltip .=
' '.$form->textwithpicto(
'', $htmltext, 1);
1994 $qtyalreadyreceived += $receptionline_var[
'qty'];
1997 $htmltooltip = $langs->trans(
"QtyInOtherReceptions").
'...<br><br>'.$htmltooltip.
'<br><input type="submit" name="dummyhiddenbuttontogetfocus" style="display:none" autofocus>';
2002 print $form->textwithpicto((
string) $qtyalreadyreceived, $htmltooltip, 1,
'info',
'', 0, 3,
'tooltip'.$lines[$i]->
id);
2006 if ($action ==
'editline' && $lines[$i]->
id == $line_id) {
2008 print
'<td colspan="'.$editColspan.
'" class="center"><table class="nobordernopadding">';
2009 if (isModEnabled(
'stock')) {
2010 if ($lines[$i]->fk_product > 0) {
2011 print
'<!-- case edit 1 -->';
2014 print
'<td><input name="qtyl'.$line_id.
'" id="qtyl'.$line_id.
'" type="text" size="4" value="'.$lines[$i]->qty.
'"></td>';
2016 print
'<td>'.$formproduct->selectWarehouses($lines[$i]->fk_entrepot,
'entl'.$line_id,
'', 1, 0, $lines[$i]->fk_product,
'', 1).
'</td>';
2018 if (
$conf->productbatch->enabled && !empty($lines[$i]->product->status_batch)) {
2019 print
'<td class="nowraponall left"><input name="batch'.$line_id.
'" id="batch'.$line_id.
'" type="text" value="'.$lines[$i]->batch.
'"><br>';
2021 print $langs->trans(
'SellByDate').
' : ';
2022 print $form->selectDate($lines[$i]->sellby,
'dlc'.$line_id, 0, 0, 1,
"").
'</br>';
2025 print $langs->trans(
'EatByDate').
' : ';
2026 print $form->selectDate($lines[$i]->eatby,
'dluo'.$line_id, 0, 0, 1,
"");
2032 print
'<!-- case edit 2 -->';
2035 print
'<td><input name="qtyl'.$line_id.
'" id="qtyl'.$line_id.
'" type="text" size="4" value="'.$lines[$i]->qty.
'"></td>';
2043 print
'</table></td>';
2046 print
'<td class="center linecolqtytoreceive">'.$lines[$i]->qty.
'</td>';
2049 if (isModEnabled(
'stock')) {
2050 if ($lines[$i]->fk_entrepot > 0) {
2052 $entrepot->fetch($lines[$i]->fk_entrepot);
2054 print
'<td class="left tdoverflowmax150" title="'.dol_escape_htmltag($entrepot->label).
'">';
2055 print $entrepot->getNomUrl(1);
2063 if (isModEnabled(
'productbatch')) {
2064 if (isset($lines[$i]->batch)) {
2065 print
'<!-- Detail of lot -->';
2066 print
'<td class="linecolbatch nowrap">';
2067 $detail = $langs->trans(
"NA");
2068 if ($lines[$i]->product->status_batch > 0 && $lines[$i]->fk_product > 0) {
2069 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/productlot.class.php';
2071 $reslot = $productlot->fetch(0, $lines[$i]->fk_product, $lines[$i]->batch);
2073 $detail = $productlot->getNomUrl(1);
2076 $batchinfo = $langs->trans(
"Batch").
': '.$lines[$i]->batch;
2078 $batchinfo .=
' - '.$langs->trans(
"SellByDate").
': '.
dol_print_date($lines[$i]->sellby,
"day");
2081 $batchinfo .=
' - '.$langs->trans(
"EatByDate").
': '.
dol_print_date($lines[$i]->eatby,
"day");
2083 $detail = $form->textwithtooltip(
img_picto(
'',
'object_barcode').
' '.$langs->trans(
"DetailBatchNumber"), $batchinfo);
2086 print $detail .
'</td>';
2094 print
'<td class="center linecolweight">';
2096 print $lines[$i]->product->weight * $lines[$i]->qty.
' '.
measuringUnitString(0,
"weight", $lines[$i]->product->weight_units);
2103 print
'<td class="center linecolvolume">';
2105 print $lines[$i]->product->volume * $lines[$i]->qty.
' '.
measuringUnitString(0,
"volume", $lines[$i]->product->volume_units);
2112 if ($action ==
'editline' && $lines[$i]->
id == $line_id) {
2113 print
'<td class="center valignmiddle" colspan="2">';
2114 print
'<input type="submit" class="button small button-save" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans(
"Save").
'"><br>';
2115 print
'<input type="submit" class="button small button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans(
"Cancel").
'"><br>';
2117 } elseif (
$object->statut == Reception::STATUS_DRAFT) {
2119 print
'<td class="linecoledit center">';
2120 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editline&token='.
newToken().
'&lineid='.$lines[$i]->id.
'">'.
img_edit().
'</a>';
2122 print
'<td class="linecoldelete" width="10">';
2123 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=deleteline&token='.
newToken().
'&lineid='.$lines[$i]->id.
'">'.
img_delete().
'</a>';
2127 if (isset($rowExtrafieldsStart, $rowExtrafieldsView, $rowEnd)) {
2128 print $rowExtrafieldsStart;
2129 print $rowExtrafieldsView;
2135 $arrayofpurchaselinealreadyoutput[$lines[$i]->fk_commandefourndet] = $lines[$i]->fk_commandefourndet;
2138 $extralabelslines = $extrafields->attributes[$lines[$i]->table_element];
2139 if (!empty($extralabelslines) && is_array($extralabelslines) && count($extralabelslines) > 0) {
2141 if (isModEnabled(
'stock')) {
2144 if (isModEnabled(
'productbatch')) {
2149 $line->id = $lines[$i]->id;
2150 $line->fetch_optionals();
2152 if ($action ==
'editline' && $lines[$i]->
id == $line_id) {
2153 print $line->showOptionals($extrafields,
'edit', array(
'colspan' => $colspan),
'');
2155 print $line->showOptionals($extrafields,
'view', array(
'colspan' => $colspan),
'');
2177 if (($user->socid == 0) && ($action !=
'presend')) {
2178 print
'<div class="tabsAction">';
2180 $parameters = array();
2181 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters,
$object, $action);
2182 if (empty($reshook)) {
2183 if (
$object->statut == Reception::STATUS_DRAFT && $num_prod > 0) {
2184 if ((!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'reception',
'creer'))
2185 || (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && $user->hasRight(
'reception',
'reception_advance',
'validate'))) {
2186 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=valid&token='.
newToken().
'">'.$langs->trans(
"Validate").
'</a>';
2188 print
'<a class="butActionRefused" href="#" title="'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"Validate").
'</a>';
2192 if (
$object->statut == Reception::STATUS_VALIDATED && $user->hasRight(
'reception',
'creer')) {
2193 print
'<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.
'&action=modif&token='.
newToken().
'">'.$langs->trans(
'SetToDraft').
'</a></div>';
2198 if (
$object->statut == Reception::STATUS_CLOSED && $user->hasRight(
'reception',
'creer')) {
2199 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=reopen&token='.
newToken().
'">'.$langs->trans(
"ReOpen").
'</a>';
2203 if (empty($user->socid)) {
2205 if (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') || $user->hasRight(
'reception',
'reception_advance',
'send')) {
2206 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans(
'SendByMail').
'</a>';
2208 print
'<a class="butActionRefused" href="#">'.$langs->trans(
'SendByMail').
'</a>';
2214 if (isModEnabled(
"supplier_invoice") && (
$object->statut == Reception::STATUS_VALIDATED ||
$object->statut == Reception::STATUS_CLOSED)) {
2215 if ($user->hasRight(
'fournisseur',
'facture',
'creer') || $user->hasRight(
'supplier_invoice',
'creer')) {
2217 print
'<a class="butAction" href="'.DOL_URL_ROOT.
'/fourn/facture/card.php?action=create&origin='.
$object->element.
'&originid='.
$object->id.
'&socid='.
$object->socid.
'">'.$langs->trans(
"CreateBill").
'</a>';
2224 if (
$object->statut == Reception::STATUS_VALIDATED) {
2225 if ($user->hasRight(
'reception',
'creer') &&
$object->statut > 0) {
2227 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=classifybilled&token='.
newToken().
'">'.$langs->trans(
'ClassifyBilled').
'</a>';
2229 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=classifyclosed&token='.
newToken().
'">'.$langs->trans(
"Close").
'</a>';
2233 if ($user->hasRight(
'reception',
'supprimer')) {
2234 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'">'.$langs->trans(
"Delete").
'</a>';
2246 if ($action !=
'presend' && $action !=
'editline') {
2247 print
'<div class="fichecenter"><div class="fichehalfleft">';
2250 $filedir =
$conf->reception->dir_output.
"/".$objectref;
2252 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".
$object->id;
2254 $genallowed = $user->hasRight(
'reception',
'lire');
2255 $delallowed = $user->hasRight(
'reception',
'creer');
2257 print $formfile->showdocuments(
'reception', $objectref, $filedir, $urlsource, $genallowed, $delallowed,
$object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $soc->default_lang);
2261 $somethingshown = $form->showLinkedObjectBlock(
$object,
'');
2263 print
'</div><div class="fichehalfright">';
2265 print
'</div></div>';
2269 $modelmail =
'reception_send';
2270 $defaulttopic =
'SendReceptionRef';
2271 $diroutput =
$conf->reception->dir_output;
2272 $trackid =
'rec'.$object->id;
2274 include DOL_DOCUMENT_ROOT.
'/core/tpl/card_presend.tpl.php';
$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.
Class to manage line orders.
Class to manage customers orders.
Class to manage a WYSIWYG editor.
Class to manage warehouses.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Class to manage the table of subscription to notifications.
Class to manage products or services.
const TYPE_PRODUCT
Regular product.
const TYPE_SERVICE
Service.
Class with list of lots and properties.
Class to manage projects.
Class to manage proposals.
Class to manage receptions.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
Class to manage Dolibarr users.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
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 '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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).
showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput='no', $use_short_label=0)
Output a dimension with best unit.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_date_range($date_start, $date_end, $format='', $outputlangs=null)
Format output for start and end date.
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_clone($object, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
measuringUnitString($unitid, $measuring_style='', $unitscale=null, $use_short_label=0, $outputlangs=null)
Return translation label of a unit key.
reception_prepare_head(Reception $object)
Prepare array with list of tabs.
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.