34 require
'../main.inc.php';
35 require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
42 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
45 $langs->loadLangs(array(
"sendings",
"deliveries",
'companies',
'bills',
'products'));
47 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'shipmentlist';
51 $action =
GETPOST(
'action',
'alpha');
52 $massaction =
GETPOST(
'massaction',
'alpha');
54 $toselect =
GETPOST(
'toselect',
'array');
55 $optioncss =
GETPOST(
'optioncss',
'alpha');
56 $mode =
GETPOST(
'mode',
'alpha');
58 $search_ref_exp =
GETPOST(
"search_ref_exp",
'alpha');
59 $search_ref_liv =
GETPOST(
'search_ref_liv',
'alpha');
60 $search_ref_customer =
GETPOST(
'search_ref_customer',
'alpha');
61 $search_company =
GETPOST(
"search_company",
'alpha');
62 $search_shipping_method_ids =
GETPOST(
'search_shipping_method_ids',
'array:int');
63 $search_tracking =
GETPOST(
"search_tracking",
'alpha');
64 $search_town =
GETPOST(
'search_town',
'alpha');
65 $search_zip =
GETPOST(
'search_zip',
'alpha');
66 $search_state =
GETPOST(
"search_state",
'alpha');
67 $search_country =
GETPOST(
"search_country",
'aZ09');
68 $search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
69 $search_billed =
GETPOST(
"search_billed",
'intcomma');
74 $search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
75 $search_user =
GETPOST(
'search_user',
'intcomma');
76 $search_sale =
GETPOST(
'search_sale',
'intcomma');
77 $search_categ_cus =
GETPOST(
"search_categ_cus",
'intcomma');
78 $search_product_category =
GETPOST(
'search_product_category',
'intcomma');
81 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
82 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
90 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
94 $offset = $limit * $page;
95 $pageprev = $page - 1;
96 $pagenext = $page + 1;
98 $search_status =
GETPOST(
'search_status',
'intcomma');
100 $diroutputmassaction = $conf->expedition->dir_output.
'/sending/temp/massgeneration/'.$user->id;
105 $hookmanager->initHooks(array(
'shipmentlist'));
109 $extrafields->fetch_name_optionals_label(
$object->table_element);
111 $search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
114 $fieldstosearchall = array(
116 's.nom' =>
"ThirdParty",
117 'e.note_public' =>
'NotePublic',
119 'e.tracking_number' =>
"TrackingNumber",
121 if (empty($user->socid)) {
122 $fieldstosearchall[
"e.note_private"] =
"NotePrivate";
125 $checkedtypetiers = 0;
126 $arrayfields = array(
127 'e.ref' => array(
'label' => $langs->trans(
"Ref"),
'checked' => 1,
'position' => 1),
128 'e.ref_customer' => array(
'label' => $langs->trans(
"RefCustomer"),
'checked' => 1,
'position' => 2),
129 's.nom' => array(
'label' => $langs->trans(
"ThirdParty"),
'checked' => 1,
'position' => 3),
130 's.town' => array(
'label' => $langs->trans(
"Town"),
'checked' => 1,
'position' => 4),
131 's.zip' => array(
'label' => $langs->trans(
"Zip"),
'checked' => 1,
'position' => 5),
132 'state.nom' => array(
'label' => $langs->trans(
"StateShort"),
'checked' => 0,
'position' => 6),
133 'country.code_iso' => array(
'label' => $langs->trans(
"Country"),
'checked' => 0,
'position' => 7),
134 'typent.code' => array(
'label' => $langs->trans(
"ThirdPartyType"),
'checked' => $checkedtypetiers,
'position' => 8),
135 'e.date_delivery' => array(
'label' => $langs->trans(
"DateDeliveryPlanned"),
'checked' => 1,
'position' => 9),
136 'e.fk_shipping_method' => array(
'label' => $langs->trans(
'SendingMethod'),
'checked' => 1,
'position' => 10),
137 'e.tracking_number' => array(
'label' => $langs->trans(
"TrackingNumber"),
'checked' => 1,
'position' => 11),
138 'e.weight' => array(
'label' => $langs->trans(
"Weight"),
'checked' => 0,
'position' => 12),
139 'e.datec' => array(
'label' => $langs->trans(
"DateCreation"),
'checked' => 0,
'position' => 500),
140 'e.tms' => array(
'label' => $langs->trans(
"DateModificationShort"),
'checked' => 0,
'position' => 500),
141 'e.fk_statut' => array(
'label' => $langs->trans(
"Status"),
'checked' => 1,
'position' => 1000),
142 'l.ref' => array(
'label' => $langs->trans(
"DeliveryRef"),
'checked' => 1,
'position' => 1010,
'enabled' => (
getDolGlobalInt(
'MAIN_SUBMODULE_DELIVERY') ? 1 : 0)),
143 'l.date_delivery' => array(
'label' => $langs->trans(
"DateReceived"),
'position' => 1020,
'checked' => 1,
'enabled' => (
getDolGlobalInt(
'MAIN_SUBMODULE_DELIVERY') ? 1 : 0)),
144 'e.billed' => array(
'label' => $langs->trans(
"Billed"),
'checked' => 1,
'position' => 1100,
'enabled' =>
'getDolGlobalString("WORKFLOW_BILL_ON_SHIPMENT") !== "0"'),
145 'e.note_public'=>array(
'label'=>
'NotePublic',
'checked'=>0,
'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)),
'position'=>135),
146 'e.note_private'=>array(
'label'=>
'NotePrivate',
'checked'=>0,
'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)),
'position'=>140),
150 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
154 '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
159 $socid = $user->socid;
170 if (
GETPOST(
'cancel',
'alpha')) {
174 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'confirm_createbills') {
178 $parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
179 $reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
184 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
187 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
190 $search_product_category =
'';
191 $search_ref_exp =
'';
192 $search_ref_liv =
'';
193 $search_ref_customer =
'';
194 $search_company =
'';
199 $search_country =
'';
200 $search_tracking =
'';
201 $search_shipping_method_ids = [];
202 $search_type_thirdparty =
'';
204 $search_datedelivery_start =
'';
205 $search_datedelivery_end =
'';
206 $search_datereceipt_start =
'';
207 $search_datereceipt_end =
'';
210 $search_array_options = array();
211 $search_categ_cus = 0;
215 if (empty($reshook)) {
216 $objectclass =
'Expedition';
217 $objectlabel =
'Sendings';
218 $permissiontoread = $user->hasRight(
'expedition',
'lire');
219 $permissiontoadd = $user->hasRight(
'expedition',
'creer');
220 $permissiontodelete = $user->hasRight(
'expedition',
'supprimer');
221 $uploaddir = $conf->expedition->dir_output.
'/sending';
222 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
224 if ($massaction ==
'confirm_createbills') {
225 $sendings =
GETPOST(
'toselect',
'array');
226 $createbills_onebythird =
GETPOST(
'createbills_onebythird',
'int');
227 $validate_invoices =
GETPOST(
'validate_invoices',
'int');
232 $TFactThird = array();
233 $TFactThirdNbLines = array();
235 $nb_bills_created = 0;
241 $nbSendings = is_array($sendings) ? count($sendings) : 1;
243 foreach ($sendings as $id_sending) {
245 if ($expd->fetch($id_sending) <= 0) {
248 $expd->fetch_thirdparty();
254 $expdCmdSrc->fetch($expd->origin_id);
256 if (!empty($createbills_onebythird) && !empty($TFactThird[$expd->socid])) {
258 $objecttmp = $TFactThird[$expd->socid];
261 $objecttmp->socid = $expd->socid;
262 $objecttmp->thirdparty = $expd->thirdparty;
264 $objecttmp->type = $objecttmp::TYPE_STANDARD;
265 $objecttmp->cond_reglement_id = !empty($expdCmdSrc->cond_reglement_id) ? $expdCmdSrc->cond_reglement_id : (!empty($objecttmp->thirdparty->cond_reglement_id) ? $objecttmp->thirdparty->cond_reglement_id : 1);
266 $objecttmp->mode_reglement_id = !empty($expdCmdSrc->mode_reglement_id) ? $expdCmdSrc->mode_reglement_id : (!empty($objecttmp->thirdparty->mode_reglement_id) ? $objecttmp->thirdparty->mode_reglement_id : 0);
268 $objecttmp->fk_project = $expd->fk_project;
269 $objecttmp->multicurrency_code = !empty($expdCmdSrc->multicurrency_code) ? $expdCmdSrc->multicurrency_code : (!empty($objecttmp->thirdparty->multicurrency_code) ? $objecttmp->thirdparty->multicurrency_code : $expd->multicurrency_code);
270 if (empty($createbills_onebythird)) {
271 $objecttmp->ref_client = $expd->ref_client;
275 if (empty($datefacture)) {
279 $objecttmp->date = $datefacture;
280 $objecttmp->origin =
'shipping';
281 $objecttmp->origin_id = $id_sending;
283 $objecttmp->array_options = $expd->array_options;
285 $res = $objecttmp->create($user);
289 $lastref = $objecttmp->ref;
290 $lastid = $objecttmp->id;
292 $TFactThird[$expd->socid] = $objecttmp;
293 $TFactThirdNbLines[$expd->socid] = 0;
295 $langs->load(
"errors");
296 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
301 if ($objecttmp->id > 0) {
302 $res = $objecttmp->add_object_linked($objecttmp->origin, $id_sending);
305 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
309 $expd->fetchObjectLinked();
310 foreach ($expd->linkedObjectsIds as $sourcetype => $TIds) {
311 if ($sourcetype ==
'facture') {
314 if (!empty($createbills_onebythird) && !empty($TFactThird[$expd->socid])) {
315 $objecttmp->fetchObjectLinked(
$object->id,
'commande');
316 foreach ($objecttmp->linkedObjectsIds as $tmpSourcetype => $tmpTIds) {
317 if ($tmpSourcetype == $sourcetype) {
318 if (!empty(array_intersect($TIds, $tmpTIds))) {
325 $res = $objecttmp->add_object_linked($sourcetype, current($TIds));
328 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
334 $lines = $expd->lines;
335 if (empty($lines) && method_exists($expd,
'fetch_lines')) {
336 $expd->fetch_lines();
337 $lines = $expd->lines;
341 $num = count($lines);
343 for ($i = 0; $i < $num; $i++) {
344 $desc = ($lines[$i]->desc ? $lines[$i]->desc :
'');
346 if (!empty($createbills_onebythird)) {
350 if ($lines[$i]->subprice < 0 && empty($conf->global->INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN)) {
353 $discount->fk_soc = $objecttmp->socid;
354 $discount->amount_ht = abs($lines[$i]->total_ht);
355 $discount->amount_tva = abs($lines[$i]->total_tva);
356 $discount->amount_ttc = abs($lines[$i]->total_ttc);
357 $discount->tva_tx = $lines[$i]->tva_tx;
358 $discount->fk_user = $user->id;
359 $discount->description = $desc;
360 $discountid = $discount->create($user);
361 if ($discountid > 0) {
362 $result = $objecttmp->insert_discount($discountid);
371 $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
374 if ($lines[$i]->date_debut_prevue) {
375 $date_start = $lines[$i]->date_debut_prevue;
377 if ($lines[$i]->date_debut_reel) {
378 $date_start = $lines[$i]->date_debut_reel;
380 if ($lines[$i]->date_start) {
381 $date_start = $lines[$i]->date_start;
385 if ($lines[$i]->date_fin_prevue) {
386 $date_end = $lines[$i]->date_fin_prevue;
388 if ($lines[$i]->date_fin_reel) {
389 $date_end = $lines[$i]->date_fin_reel;
391 if ($lines[$i]->date_end) {
392 $date_end = $lines[$i]->date_end;
395 if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
400 if (method_exists($lines[$i],
'fetch_optionals')) {
401 $lines[$i]->fetch_optionals();
402 $array_options = $lines[$i]->array_options;
405 $objecttmp->context[
'createfromclone'] =
'createfromclone';
407 $rang = ($nbSendings > 1) ? -1 : $lines[$i]->rang;
409 if (!empty($createbills_onebythird)) {
410 $rang = $TFactThirdNbLines[$expd->socid];
413 $result = $objecttmp->addline(
415 $lines[$i]->subprice,
418 $lines[$i]->localtax1_tx,
419 $lines[$i]->localtax2_tx,
420 $lines[$i]->fk_product,
421 $lines[$i]->remise_percent,
425 $lines[$i]->info_bits,
426 $lines[$i]->fk_remise_except,
431 $lines[$i]->special_code,
435 $lines[$i]->fk_fournprice,
438 !empty($array_options) ? $array_options :
'',
445 if (!empty($createbills_onebythird))
446 $TFactThirdNbLines[$expd->socid]++;
450 $errors[] = $objecttmp->error;
454 if ($result > 0 && $lines[$i]->product_type == 9) {
455 $fk_parent_line = $result;
462 if (!empty($createbills_onebythird) && empty($TFactThird[$expd->socid])) {
463 $TFactThird[$expd->socid] = $objecttmp;
465 $TFact[$objecttmp->id] = $objecttmp;
470 $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
473 if (!$error && $validate_invoices) {
474 $massaction = $action =
'builddoc';
476 foreach ($TAllFact as &$objecttmp) {
477 $result = $objecttmp->validate($user);
484 $id = $objecttmp->id;
488 $upload_dir = $conf->facture->dir_output;
489 $permissiontoadd = $user->hasRight(
'facture',
'creer');
494 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
498 $massaction = $action =
'confirm_createbills';
504 if ($nb_bills_created == 1) {
505 $texttoshow = $langs->trans(
'BillXCreated',
'{s1}');
506 $texttoshow = str_replace(
'{s1}',
'<a href="'.DOL_URL_ROOT.
'/compta/facture/card.php?id='.urlencode(strval($lastid)).
'">'.$lastref.
'</a>', $texttoshow);
509 setEventMessages($langs->trans(
'BillCreated', $nb_bills_created),
null,
'mesgs');
514 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
515 $param .=
'&contextpage='.urlencode($contextpage);
517 if ($limit > 0 && $limit != $conf->liste_limit) {
518 $param .=
'&limit='.urlencode(strval($limit));
521 $param .=
"&sall=".urlencode($sall);
523 if ($search_ref_exp) {
524 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
526 if ($search_ref_liv) {
527 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
529 if ($search_ref_customer) {
530 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
532 if ($search_user > 0) {
533 $param .=
'&search_user='.urlencode($search_user);
535 if ($search_sale > 0) {
536 $param .=
'&search_sale='.urlencode($search_sale);
538 if ($search_company) {
539 $param .=
"&search_company=".urlencode($search_company);
541 if ($search_shipping_method_id) {
542 $param .=
"&search_shipping_method_id=".urlencode($search_shipping_method_id);
544 if ($search_tracking) {
545 $param .=
"&search_tracking=".urlencode($search_tracking);
548 $param .=
'&search_town='.urlencode($search_town);
551 $param .=
'&search_zip='.urlencode($search_zip);
553 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
554 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
556 if ($search_datedelivery_start) {
557 $param .=
'&search_datedelivery_startday='.urlencode(
dol_print_date($search_datedelivery_start,
'%d')).
'&search_datedelivery_startmonth='.urlencode(
dol_print_date($search_datedelivery_start,
'%m')).
'&search_datedelivery_startyear='.urlencode(
dol_print_date($search_datedelivery_start,
'%Y'));
559 if ($search_datedelivery_end) {
560 $param .=
'&search_datedelivery_endday='.urlencode(
dol_print_date($search_datedelivery_end,
'%d')).
'&search_datedelivery_endmonth='.urlencode(
dol_print_date($search_datedelivery_end,
'%m')).
'&search_datedelivery_endyear='.urlencode(
dol_print_date($search_datedelivery_end,
'%Y'));
562 if ($search_datereceipt_start) {
563 $param .=
'&search_datereceipt_startday='.urlencode(
dol_print_date($search_datereceipt_start,
'%d')).
'&search_datereceipt_startmonth='.urlencode(
dol_print_date($search_datereceipt_start,
'%m')).
'&search_datereceipt_startyear='.urlencode(
dol_print_date($search_datereceipt_start,
'%Y'));
565 if ($search_datereceipt_end) {
566 $param .=
'&search_datereceipt_endday='.urlencode(
dol_print_date($search_datereceipt_end,
'%d')).
'&search_datereceipt_endmonth='.urlencode(
dol_print_date($search_datereceipt_end,
'%m')).
'&search_datereceipt_endyear='.urlencode(
dol_print_date($search_datereceipt_end,
'%Y'));
568 if ($search_product_category !=
'') {
569 $param .=
'&search_product_category='.urlencode($search_product_category);
571 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
572 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
574 if ($search_status !=
'') {
575 $param .=
'&search_status='.urlencode($search_status);
577 if ($optioncss !=
'') {
578 $param .=
'&optioncss='.urlencode($optioncss);
580 if ($search_billed !=
'') {
581 $param .=
'&billed='.urlencode($search_billed);
584 header(
"Location: ".$_SERVER[
'PHP_SELF'].
'?'.$param);
590 $_GET[
"origin"] = $_POST[
"origin"];
591 $_GET[
"originid"] = $_POST[
"originid"];
592 if (!empty($errors)) {
602 if ($massaction ==
'classifyclose') {
604 $selectids =
GETPOST(
'toselect',
'array');
605 foreach ($selectids as $selectid) {
608 $result =
$object->setClosed();
611 $massaction = $action =
'classifyclose';
622 header(
'Location: '.$_SERVER[
"PHP_SELF"]);
637 $form =
new Form($db);
640 $companystatic =
new Societe($db);
644 $helpurl =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
645 llxHeader(
'', $langs->trans(
'ListOfSendings'), $helpurl);
648 if ($search_all || $search_user > 0) {
649 $sql =
'SELECT DISTINCT';
651 $sql .=
" e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, e.fk_statut, e.billed, e.tracking_number, e.fk_shipping_method,";
654 $sql .=
" l.date_delivery as date_reception,";
656 $sql .=
" s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
657 $sql .=
" typent.code as typent_code,";
658 $sql .=
" state.code_departement as state_code, state.nom as state_name,";
659 $sql .=
" e.date_creation as date_creation, e.tms as date_modification,e.note_public, e.note_private,";
662 if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
663 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
664 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
668 $parameters = array();
669 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
670 $sql .= $hookmanager->resPrint;
674 $sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
675 if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
676 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
679 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expeditiondet as ed ON e.rowid=ed.fk_expedition';
680 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'commandedet as pd ON pd.rowid=ed.fk_elementdet';
682 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
683 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
684 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
685 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
688 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
689 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
691 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON e.fk_user_author = u.rowid';
692 if ($search_user > 0) {
693 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
695 if ($search_user > 0) {
696 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
697 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
701 $parameters = array();
702 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters,
$object);
703 $sql .= $hookmanager->resPrint;
705 $sql .=
" WHERE e.entity IN (".getEntity(
'expedition').
")";
708 $sql .=
" AND s.rowid = ".((int) $socid);
711 $sql .=
" AND e.fk_soc = ".((int) $socid);
713 if ($search_status !=
'' && $search_status >= 0) {
714 $sql .=
" AND e.fk_statut = ".((int) $search_status);
716 if ($search_ref_customer !=
'') {
719 if ($search_billed !=
'' && $search_billed >= 0) {
720 $sql .=
' AND e.billed = '.((int) $search_billed);
731 if ($search_country) {
732 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
734 if (!empty($search_shipping_method_ids)) {
735 $sql .=
" AND e.fk_shipping_method IN (".$db->sanitize(implode(
',', $search_shipping_method_ids)).
')';
737 if ($search_tracking) {
740 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
741 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
743 if ($search_user > 0) {
745 $sql .=
" AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = eesource.fk_source AND ec.fk_socpeople = ".((int) $search_user);
747 if ($search_company) {
750 if ($search_ref_exp) {
753 if ($search_datedelivery_start) {
754 $sql .=
" AND e.date_delivery >= '".$db->idate($search_datedelivery_start).
"'";
756 if ($search_datedelivery_end) {
757 $sql .=
" AND e.date_delivery <= '".$db->idate($search_datedelivery_end).
"'";
760 if ($search_ref_liv) {
763 if ($search_datereceipt_start) {
764 $sql .=
" AND l.date_delivery >= '".$db->idate($search_datereceipt_start).
"'";
766 if ($search_datereceipt_end) {
767 $sql .=
" AND l.date_delivery <= '".$db->idate($search_datereceipt_end).
"'";
774 if ($search_sale && $search_sale !=
'-1') {
775 if ($search_sale == -2) {
776 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = e.fk_soc)";
777 } elseif ($search_sale > 0) {
778 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = e.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
782 $searchCategoryCustomerOperator = -1;
783 $searchCategoryCustomerList = array($search_categ_cus);
784 if (!empty($searchCategoryCustomerList)) {
785 $searchCategoryCustomerSqlList = array();
786 $listofcategoryid =
'';
787 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
788 if (intval($searchCategoryCustomer) == -2) {
789 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
790 } elseif (intval($searchCategoryCustomer) > 0) {
791 if ($searchCategoryCustomerOperator == 0) {
792 $searchCategoryCustomerSqlList[] =
" EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = ".((int) $searchCategoryCustomer).
")";
794 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
798 if ($listofcategoryid) {
799 $searchCategoryCustomerSqlList[] =
" EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
801 if ($searchCategoryCustomerOperator == 1) {
802 if (!empty($searchCategoryCustomerSqlList)) {
803 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
806 if (!empty($searchCategoryCustomerSqlList)) {
807 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
812 $searchCategoryProductOperator = -1;
813 $searchCategoryProductList = array($search_product_category);
814 if (!empty($searchCategoryProductList)) {
815 $searchCategoryProductSqlList = array();
816 $listofcategoryid =
'';
817 foreach ($searchCategoryProductList as $searchCategoryProduct) {
818 if (intval($searchCategoryProduct) == -2) {
819 $searchCategoryProductSqlList[] =
"NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"expeditiondet as ed, ".MAIN_DB_PREFIX.
"commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_elementdet = cd.rowid AND cd.fk_product = ck.fk_product)";
820 } elseif (intval($searchCategoryProduct) > 0) {
821 if ($searchCategoryProductOperator == 0) {
822 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"expeditiondet as ed, ".MAIN_DB_PREFIX.
"commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_elementdet = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).
")";
824 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
828 if ($listofcategoryid) {
829 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"expeditiondet as ed, ".MAIN_DB_PREFIX.
"commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_elementdet = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
831 if ($searchCategoryProductOperator == 1) {
832 if (!empty($searchCategoryProductSqlList)) {
833 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
836 if (!empty($searchCategoryProductSqlList)) {
837 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
842 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
845 $parameters = array();
846 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
847 $sql .= $hookmanager->resPrint;
850 $parameters = array();
851 $reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters,
$object);
852 $sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
854 $nbtotalofrecords =
'';
857 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords',
$sql);
858 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
859 $resql = $db->query($sqlforcount);
861 $objforcount = $db->fetch_object($resql);
862 $nbtotalofrecords = $objforcount->nbtotalofrecords;
867 if (($page * $limit) > $nbtotalofrecords) {
875 $sql .= $db->order($sortfield, $sortorder);
877 $sql .= $db->plimit($limit + 1, $offset);
881 $resql = $db->query(
$sql);
887 $num = $db->num_rows($resql);
889 $arrayofselected = is_array($toselect) ? $toselect : array();
896 if (empty($search_company)) {
897 $search_company = $soc->name;
903 $param .=
'&socid='.urlencode((
string) ($socid));
906 $param .=
'&mode='.urlencode($mode);
908 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
909 $param .=
'&contextpage='.urlencode($contextpage);
911 if ($limit > 0 && $limit != $conf->liste_limit) {
912 $param .=
'&limit='.((int) $limit);
915 $param .=
"&search_all=".urlencode($search_all);
917 if ($search_ref_exp) {
918 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
920 if ($search_ref_liv) {
921 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
923 if ($search_ref_customer) {
924 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
926 if ($search_user > 0) {
927 $param .=
'&search_user='.urlencode((
string) ($search_user));
929 if ($search_sale > 0) {
930 $param .=
'&search_sale='.urlencode((
string) ($search_sale));
932 if ($search_company) {
933 $param .=
"&search_company=".urlencode($search_company);
935 if ($search_shipping_method_ids) {
936 foreach ($search_shipping_method_ids as $value) {
937 $param .=
"&search_shipping_method_ids[]=".urlencode($value);
940 if ($search_tracking) {
941 $param .=
"&search_tracking=".urlencode($search_tracking);
944 $param .=
'&search_town='.urlencode($search_town);
947 $param .=
'&search_zip='.urlencode($search_zip);
949 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
950 $param .=
'&search_type_thirdparty='.urlencode((
string) ($search_type_thirdparty));
952 if ($search_datedelivery_start) {
953 $param .=
'&search_datedelivery_startday='.urlencode(
dol_print_date($search_datedelivery_start,
'%d')).
'&search_datedelivery_startmonth='.urlencode(
dol_print_date($search_datedelivery_start,
'%m')).
'&search_datedelivery_startyear='.urlencode(
dol_print_date($search_datedelivery_start,
'%Y'));
955 if ($search_datedelivery_end) {
956 $param .=
'&search_datedelivery_endday='.urlencode(
dol_print_date($search_datedelivery_end,
'%d')).
'&search_datedelivery_endmonth='.urlencode(
dol_print_date($search_datedelivery_end,
'%m')).
'&search_datedelivery_endyear='.urlencode(
dol_print_date($search_datedelivery_end,
'%Y'));
958 if ($search_datereceipt_start) {
959 $param .=
'&search_datereceipt_startday='.urlencode(
dol_print_date($search_datereceipt_start,
'%d')).
'&search_datereceipt_startmonth='.urlencode(
dol_print_date($search_datereceipt_start,
'%m')).
'&search_datereceipt_startyear='.urlencode(
dol_print_date($search_datereceipt_start,
'%Y'));
961 if ($search_datereceipt_end) {
962 $param .=
'&search_datereceipt_endday='.urlencode(
dol_print_date($search_datereceipt_end,
'%d')).
'&search_datereceipt_endmonth='.urlencode(
dol_print_date($search_datereceipt_end,
'%m')).
'&search_datereceipt_endyear='.urlencode(
dol_print_date($search_datereceipt_end,
'%Y'));
964 if ($search_product_category !=
'') {
965 $param .=
'&search_product_category='.urlencode((
string) ($search_product_category));
967 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
968 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
970 if ($search_status !=
'') {
971 $param .=
'&search_status='.urlencode($search_status);
973 if ($optioncss !=
'') {
974 $param .=
'&optioncss='.urlencode($optioncss);
977 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
980 $parameters = array(
'param' => &$param);
981 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters,
$object, $action);
982 $param .= $hookmanager->resPrint;
984 $arrayofmassactions = array(
985 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
986 'classifyclose' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth"').$langs->trans(
"Close"),
987 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
989 if ($user->hasRight(
'facture',
'creer')) {
990 $arrayofmassactions[
'createbills'] =
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
"CreateInvoiceForThisCustomerFromSendings");
992 if (in_array($massaction, array(
'presend',
'createbills'))) {
993 $arrayofmassactions = array();
995 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1001 $newcardbutton =
'';
1002 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
1003 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
1005 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSending'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/expedition/card.php?action=create2',
'', $user->hasRight(
'expedition',
'creer'));
1008 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
1009 if ($optioncss !=
'') {
1010 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1012 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1013 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1014 print
'<input type="hidden" name="action" value="list">';
1015 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1016 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1017 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1018 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1021 print_barre_liste($langs->trans(
'ListOfSendings'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'dolly', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1023 $topicmail =
"SendShippingRef";
1024 $modelmail =
"shipping_send";
1026 $trackid =
'shi'.$object->id;
1027 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1029 if ($massaction ==
'createbills') {
1030 print
'<input type="hidden" name="massaction" value="confirm_createbills">';
1032 print
'<table class="noborder" width="100%" >';
1034 print
'<td class="titlefield">';
1035 print $langs->trans(
'DateInvoice');
1038 print $form->selectDate(
'',
'',
'',
'',
'',
'', 1, 1);
1043 print $langs->trans(
'CreateOneBillByThird');
1046 print $form->selectyesno(
'createbills_onebythird',
'', 1);
1051 print $langs->trans(
'ValidateInvoices');
1054 if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
1055 print $form->selectyesno(
'validate_invoices', 0, 1, 1);
1056 $langs->load(
"errors");
1057 print
' ('.$langs->trans(
"WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal").
')';
1059 print $form->selectyesno(
'validate_invoices', 0, 1);
1061 if (!empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) {
1062 print
' <span class="opacitymedium">'.$langs->trans(
"IfValidateInvoiceIsNoSendingStayUnbilled").
'</span>';
1064 print
' <span class="opacitymedium">'.$langs->trans(
"OptionToSetSendingBilledNotEnabled").
'</span>';
1071 print
'<div class="center">';
1072 print
'<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans(
'CreateInvoiceForThisCustomerFromSendings').
'"> ';
1073 print
'<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1079 foreach ($fieldstosearchall as $key => $val) {
1080 $fieldstosearchall[$key] = $langs->trans($val);
1082 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1085 $moreforfilter =
'';
1088 if ($user->hasRight(
'user',
'user',
'lire')) {
1089 $langs->load(
"commercial");
1090 $moreforfilter .=
'<div class="divsearchfield">';
1091 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1092 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1093 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
1094 $moreforfilter .=
'</div>';
1097 if ($user->hasRight(
'user',
'user',
'lire')) {
1098 $moreforfilter .=
'<div class="divsearchfield">';
1099 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1100 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1101 $moreforfilter .= $form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
1102 $moreforfilter .=
'</div>';
1105 if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
1106 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1107 $moreforfilter .=
'<div class="divsearchfield">';
1108 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1109 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1112 $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category,
'search_product_category', 1, $tmptitle);
1114 $moreforfilter .=
'</div>';
1116 if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1117 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1118 $moreforfilter .=
'<div class="divsearchfield">';
1119 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
1120 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1121 $moreforfilter .= $formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle);
1122 $moreforfilter .=
'</div>';
1124 $parameters = array();
1125 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
1126 if (empty($reshook)) {
1127 $moreforfilter .= $hookmanager->resPrint;
1129 $moreforfilter = $hookmanager->resPrint;
1132 if (!empty($moreforfilter)) {
1133 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1134 print $moreforfilter;
1138 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1139 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1140 if ($massactionbutton) {
1141 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
1144 print
'<div class="div-table-responsive">';
1145 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1149 print
'<tr class="liste_titre_filter">';
1152 print
'<td class="liste_titre center maxwidthsearch">';
1153 $searchpicto = $form->showFilterButtons(
'left');
1158 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1159 print
'<td class="liste_titre">';
1160 print
'<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.
'">';
1164 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1165 print
'<td class="liste_titre">';
1166 print
'<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.
'">';
1170 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1171 print
'<td class="liste_titre left">';
1172 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
1176 if (!empty($arrayfields[
's.town'][
'checked'])) {
1177 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
1180 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1181 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
1184 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1185 print
'<td class="liste_titre">';
1186 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1190 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1191 print
'<td class="liste_titre center">';
1192 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1196 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1197 print
'<td class="liste_titre maxwidthonsmartphone center">';
1198 print $form->selectarray(
"search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0,
'', 0, 0, 0,
getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT',
'ASC'),
'maxwidth75', 1);
1202 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1203 print
'<td class="liste_titre maxwidthonsmartphone center">';
1208 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1209 print
'<td class="liste_titre center">';
1210 print
'<div class="nowrapfordate">';
1211 print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1,
'search_datedelivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1213 print
'<div class="nowrapfordate">';
1214 print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1,
'search_datedelivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1218 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1220 print
'<td class="liste_titre center">';
1221 $shipment->fetch_delivery_methods();
1222 print $form->selectarray(
"search_shipping_method_ids[]", $shipment->meths, $search_shipping_method_ids, 1, 0, 0,
'multiple', 1, 0, 0,
'',
'maxwidth150');
1226 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1227 print
'<td class="liste_titre center">';
1228 print
'<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).
'">';
1231 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1233 print
'<td class="liste_titre">';
1234 print
'<input class="flat width75" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
1237 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1239 print
'<td class="liste_titre center">';
1240 print
'<div class="nowrapfordate">';
1241 print $form->selectDate($search_datereceipt_start ? $search_datereceipt_start : -1,
'search_datereceipt_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1243 print
'<div class="nowrapfordate">';
1244 print $form->selectDate($search_datereceipt_end ? $search_datereceipt_end : -1,
'search_datereceipt_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1249 if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1250 print
'<td class="liste_titre">';
1254 if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1255 print
'<td class="liste_titre">';
1259 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1262 $parameters = array(
'arrayfields' => $arrayfields);
1263 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1264 print $hookmanager->resPrint;
1266 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1267 print
'<td class="liste_titre">';
1271 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1272 print
'<td class="liste_titre">';
1276 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1277 print
'<td class="liste_titre right parentonrightofpage">';
1278 print $form->selectarray(
'search_status', array(
'0' => $langs->trans(
'StatusSendingDraftShort'),
'1' => $langs->trans(
'StatusSendingValidatedShort'),
'2' => $langs->trans(
'StatusSendingProcessedShort')), $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
1282 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1283 print
'<td class="liste_titre maxwidthonsmartphone center">';
1284 print $form->selectyesno(
'search_billed', $search_billed, 1, 0, 1);
1289 print
'<td class="liste_titre center maxwidthsearch">';
1290 $searchpicto = $form->showFilterButtons();
1296 $totalarray = array();
1297 $totalarray[
'nbfield'] = 0;
1301 print
'<tr class="liste_titre">';
1304 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1305 $totalarray[
'nbfield']++;
1307 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1308 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
1309 $totalarray[
'nbfield']++;
1311 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1312 print_liste_field_titre($arrayfields[
'e.ref_customer'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_customer",
"", $param,
'', $sortfield, $sortorder);
1313 $totalarray[
'nbfield']++;
1315 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1316 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
1317 $totalarray[
'nbfield']++;
1319 if (!empty($arrayfields[
's.town'][
'checked'])) {
1320 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1321 $totalarray[
'nbfield']++;
1323 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1324 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1325 $totalarray[
'nbfield']++;
1327 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1328 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1329 $totalarray[
'nbfield']++;
1331 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1332 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1333 $totalarray[
'nbfield']++;
1335 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1336 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1337 $totalarray[
'nbfield']++;
1339 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1340 print_liste_field_titre($arrayfields[
'e.weight'][
'label'], $_SERVER[
"PHP_SELF"],
"e.weight",
"", $param,
'', $sortfield, $sortorder,
'center ');
1341 $totalarray[
'nbfield']++;
1343 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1344 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1345 $totalarray[
'nbfield']++;
1347 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1348 print_liste_field_titre($arrayfields[
'e.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder,
'center ');
1349 $totalarray[
'nbfield']++;
1351 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1352 print_liste_field_titre($arrayfields[
'e.tracking_number'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tracking_number",
"", $param,
'', $sortfield, $sortorder,
'center ');
1353 $totalarray[
'nbfield']++;
1355 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1356 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
1357 $totalarray[
'nbfield']++;
1359 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1360 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1361 $totalarray[
'nbfield']++;
1363 if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1364 print_liste_field_titre($arrayfields[
'e.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"e.note_public",
"", $param,
'', $sortfield, $sortorder,
'right ');
1366 if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1367 print_liste_field_titre($arrayfields[
'e.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"e.note_private",
"", $param,
'', $sortfield, $sortorder,
'right ');
1371 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1373 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'$totalarray' => &$totalarray);
1374 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters,
$object);
1375 print $hookmanager->resPrint;
1376 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1377 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1378 $totalarray[
'nbfield']++;
1380 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1381 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1382 $totalarray[
'nbfield']++;
1384 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1385 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
1386 $totalarray[
'nbfield']++;
1388 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1389 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
1390 $totalarray[
'nbfield']++;
1394 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1395 $totalarray[
'nbfield']++;
1399 $typenArray = $formcompany->typent_array(1);
1404 $savnbfield = $totalarray[
'nbfield'];
1405 $totalarray = array();
1406 $totalarray[
'nbfield'] = 0;
1407 $imaxinloop = ($limit ? min($num, $limit) : $num);
1408 while ($i < $imaxinloop) {
1409 $obj = $db->fetch_object($resql);
1414 $shipment->id = $obj->rowid;
1415 $shipment->ref = $obj->ref;
1416 $shipment->shipping_method_id = $obj->fk_shipping_method;
1418 $companystatic->id = $obj->socid;
1419 $companystatic->ref = $obj->name;
1420 $companystatic->name = $obj->name;
1425 if ($mode ==
'kanban') {
1427 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1428 print
'<div class="box-flex-container kanban">';
1430 $object->date_delivery = $obj->delivery_date;
1435 if ($massactionbutton || $massaction) {
1437 if (in_array(
$object->id, $arrayofselected)) {
1441 print
$object->getKanbanView(
'', array(
'thirdparty' => $companystatic->getNomUrl(1),
'selected' => $selected));
1442 if ($i == min($num, $limit) - 1) {
1447 print
'<tr class="oddeven">';
1451 print
'<td class="nowrap center">';
1452 if ($massactionbutton || $massaction) {
1454 if (in_array($obj->rowid, $arrayofselected)) {
1457 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1462 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1463 print
'<td class="nowraponall">';
1464 print $shipment->getNomUrl(1);
1467 $totalarray[
'nbfield']++;
1472 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1473 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->ref_customer).
'">';
1477 $totalarray[
'nbfield']++;
1482 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1483 print
'<td class="tdoverflowmax150">';
1484 print $companystatic->getNomUrl(1);
1487 $totalarray[
'nbfield']++;
1491 if (!empty($arrayfields[
's.town'][
'checked'])) {
1492 print
'<td class="nocellnopadd">';
1496 $totalarray[
'nbfield']++;
1500 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1501 print
'<td class="nocellnopadd center">';
1505 $totalarray[
'nbfield']++;
1509 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1510 print
'<td class="center">'.$obj->state_name.
"</td>\n";
1512 $totalarray[
'nbfield']++;
1516 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1517 print
'<td class="center">';
1518 $tmparray =
getCountry($obj->fk_pays,
'all');
1522 $totalarray[
'nbfield']++;
1526 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1527 print
'<td class="center">';
1528 if (isset($typenArray[$obj->typent_code])) {
1529 print $typenArray[$obj->typent_code];
1533 $totalarray[
'nbfield']++;
1537 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1538 print
'<td class="center">';
1539 if (empty(
$object->trueWeight)) {
1540 $tmparray =
$object->getTotalWeightVolume();
1541 print
showDimensionInBestUnit($tmparray[
'weight'], 0,
"weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT :
'no');
1542 print $form->textwithpicto(
'', $langs->trans(
'EstimatedWeight'), 1);
1545 print (
$object->trueWeight &&
$object->weight_units !=
'') ?
' '.measuringUnitString(0,
"weight",
$object->weight_units) :
'';
1549 $totalarray[
'nbfield']++;
1553 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1554 print
'<td class="center nowraponall">';
1555 print
dol_print_date($db->jdate($obj->delivery_date),
"dayhour");
1558 $totalarray[
'nbfield']++;
1561 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1563 $code = $langs->getLabelFromKey($db, $shipment->shipping_method_id,
'c_shipment_mode',
'rowid',
'code');
1564 print
'<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"SendingMethod".strtoupper($code))).
'">';
1565 if ($shipment->shipping_method_id > 0) {
1566 print $langs->trans(
"SendingMethod".strtoupper($code));
1570 $totalarray[
'nbfield']++;
1574 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1575 $shipment->getUrlTrackingStatus($obj->tracking_number);
1576 print
'<td class="center" title="'.dol_escape_htmltag($shipment->tracking_url).
'">'.
dol_escape_htmltag($shipment->tracking_url).
"</td>\n";
1579 $totalarray[
'nbfield']++;
1583 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1584 $shipment->fetchObjectLinked($shipment->id, $shipment->element);
1586 if (array_key_exists(
'delivery', $shipment->linkedObjects) && count($shipment->linkedObjects[
'delivery']) > 0) {
1587 $receiving = reset($shipment->linkedObjects[
'delivery']);
1590 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1592 print
'<td class="nowraponall">';
1593 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
1597 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1599 print
'<td class="center nowraponall">';
1605 if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1606 print
'<td class="sensiblehtmlcontent center">';
1610 $totalarray[
'nbfield']++;
1614 if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1615 print
'<td class="sensiblehtmlcontent center">';
1619 $totalarray[
'nbfield']++;
1623 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1625 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1626 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1627 print $hookmanager->resPrint;
1629 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1630 print
'<td class="center nowraponall">';
1631 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuserrel');
1634 $totalarray[
'nbfield']++;
1638 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1639 print
'<td class="center nowraponall">';
1640 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
1643 $totalarray[
'nbfield']++;
1647 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1648 print
'<td class="right nowrap">'.$shipment->LibStatut($obj->fk_statut, 5).
'</td>';
1650 $totalarray[
'nbfield']++;
1654 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1655 print
'<td class="center">'.yn($obj->billed).
'</td>';
1657 $totalarray[
'nbfield']++;
1663 print
'<td class="nowrap center">';
1664 if ($massactionbutton || $massaction) {
1666 if (in_array($obj->rowid, $arrayofselected)) {
1669 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1674 $totalarray[
'nbfield']++;
1685 foreach ($arrayfields as $key => $val) {
1686 if (!empty($val[
'checked'])) {
1690 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1695 $parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => $totalarray,
'sql' =>
$sql);
1696 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
1697 print $hookmanager->resPrint;
1703 $hidegeneratedfilelistifempty = 1;
1704 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1705 $hidegeneratedfilelistifempty = 0;
1709 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1710 $urlsource .= str_replace(
'&',
'&', $param);
1712 $filedir = $diroutputmassaction;
1713 $genallowed = $user->hasRight(
'expedition',
'lire');
1714 $delallowed = $user->hasRight(
'expedition',
'creer');
1717 print $formfile->showdocuments(
'massfilesarea_sendings',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage customers orders.
Class to manage absolute discounts.
Class to manage shipments.
Class to manage invoices.
Class to manage third parties objects (customers, suppliers, prospects...)
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
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...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0)
Set event message in dol_events session object.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
dol_now($mode='auto')
Return date for now.
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).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput='no', $use_short_label=0)
Output a dimension with best unit.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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...
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.