36require
'../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
55$langs->loadLangs(array(
"sendings",
"deliveries",
'companies',
'bills',
'products',
'orders'));
57$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'shipmentlist';
61$action =
GETPOST(
'action',
'alpha');
62$massaction =
GETPOST(
'massaction',
'alpha');
64$toselect =
GETPOST(
'toselect',
'array');
65$optioncss =
GETPOST(
'optioncss',
'alpha');
66$mode =
GETPOST(
'mode',
'alpha');
68$search_ref_exp =
GETPOST(
"search_ref_exp",
'alpha');
69$search_ref_liv =
GETPOST(
'search_ref_liv',
'alpha');
70$search_ref_customer =
GETPOST(
'search_ref_customer',
'alpha');
71$search_company =
GETPOST(
"search_company",
'alpha');
72$search_shipping_method_ids =
GETPOST(
'search_shipping_method_ids',
'array:int');
73$search_tracking =
GETPOST(
"search_tracking",
'alpha');
74$search_town =
GETPOST(
'search_town',
'alpha');
75$search_zip =
GETPOST(
'search_zip',
'alpha');
76$search_state =
GETPOST(
"search_state",
'alpha');
77$search_country =
GETPOST(
"search_country",
'aZ09');
78$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
79$search_billed =
GETPOST(
"search_billed",
'intcomma');
86$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
87$search_user =
GETPOST(
'search_user',
'intcomma');
88$search_sale =
GETPOST(
'search_sale',
'intcomma');
89$search_categ_cus =
GETPOST(
"search_categ_cus",
'intcomma');
90$search_product_category =
GETPOST(
'search_product_category',
'intcomma');
93$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
94$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
102if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
106$offset = $limit * $page;
107$pageprev = $page - 1;
108$pagenext = $page + 1;
110$search_status =
GETPOST(
'search_status',
'intcomma');
111$search_signed_status =
GETPOST(
'search_signed_status',
'alpha');
113$diroutputmassaction =
$conf->expedition->dir_output.
'/sending/temp/massgeneration/'.$user->id;
118$hookmanager->initHooks(array(
'shipmentlist'));
122$extrafields->fetch_name_optionals_label(
$object->table_element);
124$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
127$fieldstosearchall = array(
129 's.nom' =>
"ThirdParty",
130 'e.note_public' =>
'NotePublic',
132 'e.tracking_number' =>
"TrackingNumber",
134if (empty($user->socid)) {
135 $fieldstosearchall[
"e.note_private"] =
"NotePrivate";
138$checkedtypetiers = 0;
140 'e.ref' => array(
'label' => $langs->trans(
"Ref"),
'checked' => 1,
'position' => 1),
141 'e.ref_customer' => array(
'label' => $langs->trans(
"RefCustomer"),
'checked' => 1,
'position' => 2),
142 's.nom' => array(
'label' => $langs->trans(
"ThirdParty"),
'checked' => 1,
'position' => 3),
143 's.town' => array(
'label' => $langs->trans(
"Town"),
'checked' => 1,
'position' => 4),
144 's.zip' => array(
'label' => $langs->trans(
"Zip"),
'checked' => -1,
'position' => 5),
145 'state.nom' => array(
'label' => $langs->trans(
"StateShort"),
'checked' => 0,
'position' => 6),
146 'country.code_iso' => array(
'label' => $langs->trans(
"Country"),
'checked' => 0,
'position' => 7),
147 'typent.code' => array(
'label' => $langs->trans(
"ThirdPartyType"),
'checked' => $checkedtypetiers,
'position' => 8),
148 'e.date_delivery' => array(
'label' => $langs->trans(
"DateDeliveryPlanned"),
'checked' => 1,
'position' => 9),
149 'e.date_expedition' => array(
'label' => $langs->trans(
"DateShipping"),
'checked' => 1,
'position' => 10),
150 'e.fk_shipping_method' => array(
'label' => $langs->trans(
'SendingMethod'),
'checked' => 1,
'position' => 11),
151 'e.tracking_number' => array(
'label' => $langs->trans(
"TrackingNumber"),
'checked' => 1,
'position' => 12),
152 'e.weight' => array(
'label' => $langs->trans(
"Weight"),
'checked' => 0,
'position' => 13),
153 'e.datec' => array(
'label' => $langs->trans(
"DateCreation"),
'checked' => 0,
'position' => 500),
154 'e.tms' => array(
'label' => $langs->trans(
"DateModificationShort"),
'checked' => 0,
'position' => 500),
155 'e.fk_statut' => array(
'label' => $langs->trans(
"Status"),
'checked' => 1,
'position' => 1000),
156 'e.signed_status' => array(
'label' =>
'Signed status',
'checked' => 0,
'position' => 1001),
157 'l.ref' => array(
'label' => $langs->trans(
"DeliveryRef"),
'checked' => 1,
'position' => 1010,
'enabled' => (
getDolGlobalInt(
'MAIN_SUBMODULE_DELIVERY') ? 1 : 0)),
158 'l.date_delivery' => array(
'label' => $langs->trans(
"DateReceived"),
'position' => 1020,
'checked' => 1,
'enabled' => (
getDolGlobalInt(
'MAIN_SUBMODULE_DELIVERY') ? 1 : 0)),
159 'e.billed' => array(
'label' => $langs->trans(
"Billed"),
'checked' => 1,
'position' => 1100,
'enabled' =>
'getDolGlobalString("WORKFLOW_BILL_ON_SHIPMENT") !== "0"'),
160 'e.note_public' => array(
'label' =>
'NotePublic',
'checked' => 0,
'enabled' => (empty(
$conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)),
'position' => 135),
161 'e.note_private' => array(
'label' =>
'NotePrivate',
'checked' => 0,
'enabled' => (empty(
$conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)),
'position' => 140),
165include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
169'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
174 $socid = $user->socid;
185if (
GETPOST(
'cancel',
'alpha')) {
189if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'confirm_createbills') {
193$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
194$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
199include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
202if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
205 $search_product_category =
'';
206 $search_ref_exp =
'';
207 $search_ref_liv =
'';
208 $search_ref_customer =
'';
209 $search_company =
'';
214 $search_country =
'';
215 $search_tracking =
'';
216 $search_shipping_method_ids = [];
217 $search_type_thirdparty =
'';
219 $search_dateshipping_start =
'';
220 $search_dateshipping_end =
'';
221 $search_datedelivery_start =
'';
222 $search_datedelivery_end =
'';
223 $search_datereceipt_start =
'';
224 $search_datereceipt_end =
'';
226 $search_signed_status =
'';
228 $search_array_options = array();
229 $search_categ_cus = 0;
233if (empty($reshook)) {
234 $objectclass =
'Expedition';
235 $objectlabel =
'Sendings';
236 $permissiontoread = $user->hasRight(
'expedition',
'lire');
237 $permissiontoadd = $user->hasRight(
'expedition',
'creer');
238 $permissiontodelete = $user->hasRight(
'expedition',
'supprimer');
239 $uploaddir =
$conf->expedition->dir_output.
'/sending';
240 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
242 if ($massaction ==
'confirm_createbills') {
243 $sendings =
GETPOST(
'toselect',
'array');
244 $createbills_onebythird =
GETPOST(
'createbills_onebythird',
'int');
245 $validate_invoices =
GETPOST(
'validate_invoices',
'int');
250 $TFactThird = array();
251 $TFactThirdNbLines = array();
253 $nb_bills_created = 0;
259 $nbSendings = is_array($sendings) ? count($sendings) : 1;
261 foreach ($sendings as $id_sending) {
263 if ($expd->fetch($id_sending) <= 0) {
266 $expd->fetch_thirdparty();
272 $expdCmdSrc->fetch($expd->origin_id);
274 if (!empty($createbills_onebythird) && !empty($TFactThird[$expd->socid])) {
276 $objecttmp = $TFactThird[$expd->socid];
279 $objecttmp->socid = $expd->socid;
280 $objecttmp->thirdparty = $expd->thirdparty;
282 $objecttmp->type = $objecttmp::TYPE_STANDARD;
283 $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);
284 $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);
286 $objecttmp->fk_project = $expd->fk_project;
287 $objecttmp->multicurrency_code = !empty($expdCmdSrc->multicurrency_code) ? $expdCmdSrc->multicurrency_code : (!empty($objecttmp->thirdparty->multicurrency_code) ? $objecttmp->thirdparty->multicurrency_code : $expd->multicurrency_code);
288 if (empty($createbills_onebythird)) {
289 $objecttmp->ref_customer = $expd->ref_customer;
293 if (empty($datefacture)) {
297 $objecttmp->date = $datefacture;
298 $objecttmp->origin_type =
'shipping';
299 $objecttmp->origin_id = $id_sending;
301 $objecttmp->array_options = $expd->array_options;
303 $res = $objecttmp->create($user);
307 $lastref = $objecttmp->ref;
308 $lastid = $objecttmp->id;
310 $TFactThird[$expd->socid] = $objecttmp;
311 $TFactThirdNbLines[$expd->socid] = 0;
313 $langs->load(
"errors");
314 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
319 if ($objecttmp->id > 0) {
320 $res = $objecttmp->add_object_linked($objecttmp->origin_type, $id_sending);
323 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
327 $expd->fetchObjectLinked();
328 foreach ($expd->linkedObjectsIds as $sourcetype => $TIds) {
329 if ($sourcetype ==
'facture') {
332 if (!empty($createbills_onebythird) && !empty($TFactThird[$expd->socid])) {
333 $objecttmp->fetchObjectLinked(
$object->id,
'commande');
334 foreach ($objecttmp->linkedObjectsIds as $tmpSourcetype => $tmpTIds) {
335 if ($tmpSourcetype == $sourcetype) {
336 if (!empty(array_intersect($TIds, $tmpTIds))) {
343 $res = $objecttmp->add_object_linked($sourcetype, current($TIds));
346 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
352 $lines = $expd->lines;
353 if (empty($lines) && method_exists($expd,
'fetch_lines')) {
354 $expd->fetch_lines();
355 $lines = $expd->lines;
359 $num = count($lines);
361 for ($i = 0; $i < $num; $i++) {
362 $desc = ($lines[$i]->desc ? $lines[$i]->desc :
'');
364 if (!empty($createbills_onebythird)) {
365 $desc =
dol_concatdesc($desc, $langs->trans(
"Order").
': '.$expdCmdSrc->ref.
' - '. $langs->trans(
"Shipment").
': '.$expd->ref.($expd->date_shipping ?
' - '.dol_print_date($expd->date_shipping,
'day') :
''));
368 if ($lines[$i]->subprice < 0 && empty(
$conf->global->INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN)) {
371 $discount->socid = $objecttmp->socid;
372 $discount->amount_ht = abs($lines[$i]->total_ht);
373 $discount->amount_tva = abs($lines[$i]->total_tva);
374 $discount->amount_ttc = abs($lines[$i]->total_ttc);
375 $discount->tva_tx = $lines[$i]->tva_tx;
376 $discount->fk_user = $user->id;
377 $discount->description = $desc;
378 $discountid = $discount->create($user);
379 if ($discountid > 0) {
380 $result = $objecttmp->insert_discount($discountid);
389 $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
392 if ($lines[$i]->date_debut_prevue) {
393 $date_start = $lines[$i]->date_debut_prevue;
395 if ($lines[$i]->date_debut_reel) {
396 $date_start = $lines[$i]->date_debut_reel;
398 if ($lines[$i]->date_start) {
399 $date_start = $lines[$i]->date_start;
403 if ($lines[$i]->date_fin_prevue) {
404 $date_end = $lines[$i]->date_fin_prevue;
406 if ($lines[$i]->date_fin_reel) {
407 $date_end = $lines[$i]->date_fin_reel;
409 if ($lines[$i]->date_end) {
410 $date_end = $lines[$i]->date_end;
413 if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
418 if (method_exists($lines[$i],
'fetch_optionals')) {
419 $lines[$i]->fetch_optionals();
420 $array_options = $lines[$i]->array_options;
423 $objecttmp->context[
'createfromclone'] =
'createfromclone';
425 $rang = ($nbSendings > 1) ? -1 : $lines[$i]->rang;
427 if (!empty($createbills_onebythird)) {
428 $rang = $TFactThirdNbLines[$expd->socid];
431 $result = $objecttmp->addline(
433 $lines[$i]->subprice,
436 $lines[$i]->localtax1_tx,
437 $lines[$i]->localtax2_tx,
438 $lines[$i]->fk_product,
439 $lines[$i]->remise_percent,
443 $lines[$i]->info_bits,
444 $lines[$i]->fk_remise_except,
449 $lines[$i]->special_code,
450 $objecttmp->origin_type,
453 $lines[$i]->fk_fournprice,
456 !empty($array_options) ? $array_options :
'',
463 if (!empty($createbills_onebythird)) {
464 $TFactThirdNbLines[$expd->socid]++;
469 $errors[] = $objecttmp->error;
473 if ($result > 0 && $lines[$i]->product_type == 9) {
474 $fk_parent_line = $result;
481 if (!empty($createbills_onebythird) && empty($TFactThird[$expd->socid])) {
482 $TFactThird[$expd->socid] = $objecttmp;
484 $TFact[$objecttmp->id] = $objecttmp;
489 $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
492 if (!$error && $validate_invoices) {
493 $massaction = $action =
'builddoc';
495 foreach ($TAllFact as &$objecttmp) {
496 $result = $objecttmp->validate($user);
503 $id = $objecttmp->id;
507 $upload_dir =
$conf->facture->dir_output;
508 $permissiontoadd = $user->hasRight(
'facture',
'creer');
513 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
517 $massaction = $action =
'confirm_createbills';
523 if ($nb_bills_created == 1) {
524 $texttoshow = $langs->trans(
'BillXCreated',
'{s1}');
525 $texttoshow = str_replace(
'{s1}',
'<a href="'.DOL_URL_ROOT.
'/compta/facture/card.php?id='.urlencode(strval($lastid)).
'">'.$lastref.
'</a>', $texttoshow);
528 setEventMessages($langs->trans(
'BillCreated', $nb_bills_created),
null,
'mesgs');
533 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
534 $param .=
'&contextpage='.urlencode($contextpage);
536 if ($limit > 0 && $limit !=
$conf->liste_limit) {
537 $param .=
'&limit='.urlencode(strval($limit));
540 $param .=
"&search_all=".urlencode($search_all);
542 if ($search_ref_exp) {
543 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
545 if ($search_ref_liv) {
546 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
548 if ($search_ref_customer) {
549 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
551 if ($search_user > 0) {
552 $param .=
'&search_user='.urlencode($search_user);
554 if ($search_sale > 0) {
555 $param .=
'&search_sale='.urlencode($search_sale);
557 if ($search_company) {
558 $param .=
"&search_company=".urlencode($search_company);
560 if ($search_shipping_method_ids) {
561 foreach ($search_shipping_method_ids as $value) {
562 $param .=
"&search_shipping_method_ids[]=".urlencode($value);
565 if ($search_tracking) {
566 $param .=
"&search_tracking=".urlencode($search_tracking);
569 $param .=
'&search_town='.urlencode($search_town);
572 $param .=
'&search_zip='.urlencode($search_zip);
574 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
575 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
577 if ($search_dateshipping_start) {
578 $param .=
'&search_dateshipping_startday='.urlencode(
dol_print_date($search_dateshipping_start,
'%d')).
'&search_dateshipping_startmonth='.urlencode(
dol_print_date($search_dateshipping_start,
'%m')).
'&search_dateshipping_startyear='.urlencode(
dol_print_date($search_dateshipping_start,
'%Y'));
580 if ($search_dateshipping_end) {
581 $param .=
'&search_dateshipping_endday='.urlencode(
dol_print_date($search_dateshipping_end,
'%d')).
'&search_dateshipping_endmonth='.urlencode(
dol_print_date($search_dateshipping_end,
'%m')).
'&search_dateshipping_endyear='.urlencode(
dol_print_date($search_dateshipping_end,
'%Y'));
583 if ($search_datedelivery_start) {
584 $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'));
586 if ($search_datedelivery_end) {
587 $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'));
589 if ($search_datereceipt_start) {
590 $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'));
592 if ($search_datereceipt_end) {
593 $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'));
595 if ($search_product_category !=
'') {
596 $param .=
'&search_product_category='.urlencode($search_product_category);
598 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
599 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
601 if ($search_status !=
'') {
602 $param .=
'&search_status='.urlencode($search_status);
604 if ($search_signed_status !=
'' && $search_signed_status >= 0) {
605 $param .=
'&search_signed_status='.urlencode($search_signed_status);
607 if ($optioncss !=
'') {
608 $param .=
'&optioncss='.urlencode($optioncss);
610 if ($search_billed !=
'') {
611 $param .=
'&billed='.urlencode($search_billed);
614 header(
"Location: ".$_SERVER[
'PHP_SELF'].
'?'.$param);
620 $_GET[
"origin"] = $_POST[
"origin"];
621 $_GET[
"originid"] = $_POST[
"originid"];
622 if (!empty($errors)) {
632 if ($massaction ==
'classifyclose') {
634 $selectids =
GETPOST(
'toselect',
'array');
635 foreach ($selectids as $selectid) {
638 $result =
$object->setClosed();
641 $massaction = $action =
'classifyclose';
652 header(
'Location: '.$_SERVER[
"PHP_SELF"]);
667$form =
new Form($db);
670$companystatic =
new Societe($db);
674$title = $langs->trans(
'Shipments');
675$help_url =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
678if ($search_all || $search_user > 0) {
679 $sql =
'SELECT DISTINCT';
681$sql .=
" e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_expedition, e.date_delivery as delivery_date, e.fk_statut, e.signed_status, e.billed, e.tracking_number, e.fk_shipping_method,";
684 $sql .=
" l.date_delivery as date_reception,";
686$sql .=
" s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
687$sql .=
" typent.code as typent_code,";
688$sql .=
" state.code_departement as state_code, state.nom as state_name,";
689$sql .=
" e.date_creation as date_creation, e.tms as date_modification,e.note_public, e.note_private,";
692if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
693 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
694 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
698$parameters = array();
699$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
700$sql .= $hookmanager->resPrint;
704$sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
705if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
706 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
709 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expeditiondet as ed ON e.rowid=ed.fk_expedition';
711$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
712$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
713$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
714$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
717 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
718 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
720$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON e.fk_user_author = u.rowid';
721if ($search_user > 0) {
722 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
724if ($search_user > 0) {
725 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
726 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
730$parameters = array();
731$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
732$sql .= $hookmanager->resPrint;
734$sql .=
" WHERE e.entity IN (".getEntity(
'expedition').
")";
737 $sql .=
" AND s.rowid = ".((int) $socid);
740 $sql .=
" AND e.fk_soc = ".((int) $socid);
742if ($search_status !=
'' && $search_status >= 0) {
743 $sql .=
" AND e.fk_statut = ".((int) $search_status);
745if ($search_signed_status !=
'' && $search_signed_status >= 0) {
746 $sql .=
' AND e.signed_status = '.urlencode($search_signed_status);
748if ($search_ref_customer !=
'') {
751if ($search_billed !=
'' && $search_billed >= 0) {
752 $sql .=
' AND e.billed = '.((int) $search_billed);
763if ($search_country) {
764 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
766if (!empty($search_shipping_method_ids)) {
767 $sql .=
" AND e.fk_shipping_method IN (".$db->sanitize(implode(
',', $search_shipping_method_ids)).
')';
769if ($search_tracking) {
772if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
773 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
775if ($search_user > 0) {
777 $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);
779if ($search_company) {
782if ($search_ref_exp) {
785if ($search_dateshipping_start) {
786 $sql .=
" AND e.date_expedition >= '".$db->idate($search_dateshipping_start).
"'";
788if ($search_dateshipping_end) {
789 $sql .=
" AND e.date_expedition <= '".$db->idate($search_dateshipping_end).
"'";
791if ($search_datedelivery_start) {
792 $sql .=
" AND e.date_delivery >= '".$db->idate($search_datedelivery_start).
"'";
794if ($search_datedelivery_end) {
795 $sql .=
" AND e.date_delivery <= '".$db->idate($search_datedelivery_end).
"'";
798 if ($search_ref_liv) {
801 if ($search_datereceipt_start) {
802 $sql .=
" AND l.date_delivery >= '".$db->idate($search_datereceipt_start).
"'";
804 if ($search_datereceipt_end) {
805 $sql .=
" AND l.date_delivery <= '".$db->idate($search_datereceipt_end).
"'";
809 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
812if ($search_sale && $search_sale !=
'-1') {
813 if ($search_sale == -2) {
814 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = e.fk_soc)";
815 } elseif ($search_sale > 0) {
816 $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).
")";
820$searchCategoryCustomerOperator = -1;
821$searchCategoryCustomerList = array($search_categ_cus);
822if (!empty($searchCategoryCustomerList)) {
823 $searchCategoryCustomerSqlList = array();
824 $listofcategoryid =
'';
825 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
826 if (intval($searchCategoryCustomer) == -2) {
827 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
828 } elseif (intval($searchCategoryCustomer) > 0) {
829 if ($searchCategoryCustomerOperator == 0) {
830 $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).
")";
832 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
836 if ($listofcategoryid) {
837 $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).
"))";
839 if ($searchCategoryCustomerOperator == 1) {
840 if (!empty($searchCategoryCustomerSqlList)) {
841 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
844 if (!empty($searchCategoryCustomerSqlList)) {
845 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
850$searchCategoryProductOperator = -1;
851$searchCategoryProductList = array($search_product_category);
852if (!empty($searchCategoryProductList)) {
853 $searchCategoryProductSqlList = array();
854 $listofcategoryid =
'';
855 foreach ($searchCategoryProductList as $searchCategoryProduct) {
856 if (intval($searchCategoryProduct) == -2) {
857 $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)";
858 } elseif (intval($searchCategoryProduct) > 0) {
859 if ($searchCategoryProductOperator == 0) {
860 $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).
")";
862 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
866 if ($listofcategoryid) {
867 $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).
"))";
869 if ($searchCategoryProductOperator == 1) {
870 if (!empty($searchCategoryProductSqlList)) {
871 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
874 if (!empty($searchCategoryProductSqlList)) {
875 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
880include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
883$parameters = array();
884$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
885$sql .= $hookmanager->resPrint;
888$parameters = array();
889$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
890$sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
892$nbtotalofrecords =
'';
895 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
896 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
897 $resql = $db->query($sqlforcount);
899 $objforcount = $db->fetch_object($resql);
900 $nbtotalofrecords = $objforcount->nbtotalofrecords;
905 if (($page * $limit) > $nbtotalofrecords) {
913$sql .= $db->order($sortfield, $sortorder);
915 $sql .= $db->plimit($limit + 1, $offset);
919$resql = $db->query($sql);
925$num = $db->num_rows($resql);
928if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) {
929 $obj = $db->fetch_object($resql);
931 header(
"Location: ".DOL_URL_ROOT.
'/expedition/card.php?id='.
$id);
938 if (empty($search_company)) {
939 $search_company = $soc->name;
946llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-expedition page-list');
948$arrayofselected = is_array($toselect) ? $toselect : array();
952 $param .=
'&socid='.urlencode((
string) ($socid));
955 $param .=
'&mode='.urlencode($mode);
957if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
958 $param .=
'&contextpage='.urlencode($contextpage);
960if ($limit > 0 && $limit !=
$conf->liste_limit) {
961 $param .=
'&limit='.((int) $limit);
964 $param .=
"&search_all=".urlencode($search_all);
966if ($search_ref_exp) {
967 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
969if ($search_ref_liv) {
970 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
972if ($search_ref_customer) {
973 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
975if ($search_user > 0) {
976 $param .=
'&search_user='.urlencode((
string) ($search_user));
978if ($search_sale > 0) {
979 $param .=
'&search_sale='.urlencode((
string) ($search_sale));
981if ($search_company) {
982 $param .=
"&search_company=".urlencode($search_company);
984if ($search_shipping_method_ids) {
985 foreach ($search_shipping_method_ids as $value) {
986 $param .=
"&search_shipping_method_ids[]=".urlencode($value);
989if ($search_tracking) {
990 $param .=
"&search_tracking=".urlencode($search_tracking);
993 $param .=
'&search_town='.urlencode($search_town);
996 $param .=
'&search_zip='.urlencode($search_zip);
998if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
999 $param .=
'&search_type_thirdparty='.urlencode((
string) ($search_type_thirdparty));
1001if ($search_dateshipping_start) {
1002 $param .=
'&search_dateshipping_startday='.urlencode(
dol_print_date($search_dateshipping_start,
'%d')).
'&search_dateshipping_startmonth='.urlencode(
dol_print_date($search_dateshipping_start,
'%m')).
'&search_dateshipping_startyear='.urlencode(
dol_print_date($search_dateshipping_start,
'%Y'));
1004if ($search_dateshipping_end) {
1005 $param .=
'&search_dateshipping_endday='.urlencode(
dol_print_date($search_dateshipping_end,
'%d')).
'&search_dateshipping_endmonth='.urlencode(
dol_print_date($search_dateshipping_end,
'%m')).
'&search_dateshipping_endyear='.urlencode(
dol_print_date($search_dateshipping_end,
'%Y'));
1007if ($search_datedelivery_start) {
1008 $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'));
1010if ($search_datedelivery_end) {
1011 $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'));
1013if ($search_datereceipt_start) {
1014 $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'));
1016if ($search_datereceipt_end) {
1017 $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'));
1019if ($search_product_category !=
'') {
1020 $param .=
'&search_product_category='.urlencode((
string) ($search_product_category));
1022if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
1023 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
1025if ($search_status !=
'') {
1026 $param .=
'&search_status='.urlencode($search_status);
1028if ($search_signed_status !=
'' && $search_signed_status >= 0) {
1029 $param .=
'&search_signed_status='.urlencode($search_signed_status);
1031if ($optioncss !=
'') {
1032 $param .=
'&optioncss='.urlencode($optioncss);
1035include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1038$parameters = array(
'param' => &$param);
1039$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1040$param .= $hookmanager->resPrint;
1042$arrayofmassactions = array(
1043 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1044 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
1045 'classifyclose' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth"').$langs->trans(
"Close"),
1046 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
1048if ($user->hasRight(
'facture',
'creer')) {
1049 $arrayofmassactions[
'createbills'] =
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
"CreateInvoiceForThisCustomerFromSendings");
1051if (in_array($massaction, array(
'presend',
'createbills'))) {
1052 $arrayofmassactions = array();
1054$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1061$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'));
1062$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'));
1064$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSending'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/expedition/card.php?action=create2',
'', $user->hasRight(
'expedition',
'creer'));
1067print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
1068if ($optioncss !=
'') {
1069 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1071print
'<input type="hidden" name="token" value="'.newToken().
'">';
1072print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1073print
'<input type="hidden" name="action" value="list">';
1074print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1075print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1076print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1077print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1080print_barre_liste($langs->trans(
'Shipments'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'dolly', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1082$topicmail =
"SendShippingRef";
1083$modelmail =
"shipping_send";
1085$trackid =
'shi'.$object->id;
1086include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1088if ($massaction ==
'createbills') {
1089 print
'<input type="hidden" name="massaction" value="confirm_createbills">';
1091 print
'<table class="noborder centpercent">';
1093 print
'<td class="titlefield">';
1094 print $langs->trans(
'DateInvoice');
1097 print $form->selectDate(
'',
'',
'',
'',
'',
'', 1, 1);
1102 print $langs->trans(
'CreateOneBillByThird');
1105 print $form->selectyesno(
'createbills_onebythird',
'', 1);
1110 print $langs->trans(
'ValidateInvoices');
1113 if (!empty(
$conf->stock->enabled) && !empty(
$conf->global->STOCK_CALCULATE_ON_BILL)) {
1114 print $form->selectyesno(
'validate_invoices', 0, 1, 1);
1115 $langs->load(
"errors");
1116 print
' ('.$langs->trans(
"WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal").
')';
1118 print $form->selectyesno(
'validate_invoices', 0, 1);
1120 if (!empty(
$conf->workflow->enabled) && !empty(
$conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) {
1121 print
' <span class="opacitymedium">'.$langs->trans(
"IfValidateInvoiceIsNoSendingStayUnbilled").
'</span>';
1123 print
' <span class="opacitymedium">'.$langs->trans(
"OptionToSetSendingBilledNotEnabled").
'</span>';
1130 print
'<div class="center">';
1131 print
'<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans(
'CreateInvoiceForThisCustomerFromSendings').
'"> ';
1132 print
'<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1138 foreach ($fieldstosearchall as $key => $val) {
1139 $fieldstosearchall[$key] = $langs->trans($val);
1141 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1147if ($user->hasRight(
'user',
'user',
'lire')) {
1148 $langs->load(
"commercial");
1149 $moreforfilter .=
'<div class="divsearchfield">';
1150 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1151 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1152 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
1153 $moreforfilter .=
'</div>';
1156if ($user->hasRight(
'user',
'user',
'lire')) {
1157 $moreforfilter .=
'<div class="divsearchfield">';
1158 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1159 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1160 $moreforfilter .= $form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
1161 $moreforfilter .=
'</div>';
1164if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
1165 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1166 $moreforfilter .=
'<div class="divsearchfield">';
1167 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1168 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1171 $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category,
'search_product_category', 1, $tmptitle);
1173 $moreforfilter .=
'</div>';
1175if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1176 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1177 $moreforfilter .=
'<div class="divsearchfield">';
1178 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
1179 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1180 $moreforfilter .= $formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle);
1181 $moreforfilter .=
'</div>';
1183$parameters = array();
1184$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1185if (empty($reshook)) {
1186 $moreforfilter .= $hookmanager->resPrint;
1188 $moreforfilter = $hookmanager->resPrint;
1191if (!empty($moreforfilter)) {
1192 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1193 print $moreforfilter;
1197$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1198$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1199if ($massactionbutton) {
1200 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
1203print
'<div class="div-table-responsive">';
1204print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1208print
'<tr class="liste_titre_filter">';
1211 print
'<td class="liste_titre center maxwidthsearch">';
1212 $searchpicto = $form->showFilterButtons(
'left');
1217if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1218 print
'<td class="liste_titre">';
1219 print
'<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.
'">';
1223if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1224 print
'<td class="liste_titre">';
1225 print
'<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.
'">';
1229if (!empty($arrayfields[
's.nom'][
'checked'])) {
1230 print
'<td class="liste_titre left">';
1231 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
1235if (!empty($arrayfields[
's.town'][
'checked'])) {
1236 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
1239if (!empty($arrayfields[
's.zip'][
'checked'])) {
1240 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
1243if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1244 print
'<td class="liste_titre">';
1245 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1249if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1250 print
'<td class="liste_titre center">';
1251 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1255if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1256 print
'<td class="liste_titre maxwidthonsmartphone center">';
1257 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);
1261if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1262 print
'<td class="liste_titre maxwidthonsmartphone center">';
1267if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1268 print
'<td class="liste_titre center">';
1269 print
'<div class="nowrapfordate">';
1270 print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1,
'search_datedelivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1272 print
'<div class="nowrapfordate">';
1273 print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1,
'search_datedelivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1278if (!empty($arrayfields[
'e.date_expedition'][
'checked'])) {
1279 print
'<td class="liste_titre center">';
1280 print
'<div class="nowrapfordate">';
1281 print $form->selectDate($search_dateshipping_start ? $search_dateshipping_start : -1,
'search_dateshipping_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1283 print
'<div class="nowrapfordate">';
1284 print $form->selectDate($search_dateshipping_end ? $search_dateshipping_end : -1,
'search_dateshipping_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1288if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1290 print
'<td class="liste_titre center">';
1291 $shipment->fetch_delivery_methods();
1292 print $form->selectarray(
"search_shipping_method_ids[]", $shipment->meths, $search_shipping_method_ids, 1, 0, 0,
'multiple', 1, 0, 0,
'',
'maxwidth150');
1296if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1297 print
'<td class="liste_titre center">';
1298 print
'<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).
'">';
1301if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1303 print
'<td class="liste_titre">';
1304 print
'<input class="flat width75" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
1307if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1309 print
'<td class="liste_titre center">';
1310 print
'<div class="nowrapfordate">';
1311 print $form->selectDate($search_datereceipt_start ? $search_datereceipt_start : -1,
'search_datereceipt_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1313 print
'<div class="nowrapfordate">';
1314 print $form->selectDate($search_datereceipt_end ? $search_datereceipt_end : -1,
'search_datereceipt_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1319if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1320 print
'<td class="liste_titre">';
1324if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1325 print
'<td class="liste_titre">';
1329include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1332$parameters = array(
'arrayfields' => $arrayfields);
1333$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1334print $hookmanager->resPrint;
1336if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1337 print
'<td class="liste_titre">';
1341if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1342 print
'<td class="liste_titre">';
1346if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1347 print
'<td class="liste_titre right parentonrightofpage">';
1348 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');
1352if (!empty($arrayfields[
'e.signed_status'][
'checked'])) {
1353 print
'<td class="liste_titre center">';
1354 $list_signed_status =
$object->getSignedStatusLocalisedArray();
1355 print $form->selectarray(
'search_signed_status', $list_signed_status, $search_signed_status, 1, 0, 0,
'', 1, 0, 0,
'',
'search_status');
1359if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1360 print
'<td class="liste_titre maxwidthonsmartphone center">';
1361 print $form->selectyesno(
'search_billed', $search_billed, 1, 0, 1);
1366 print
'<td class="liste_titre center maxwidthsearch">';
1367 $searchpicto = $form->showFilterButtons();
1373$totalarray = array();
1374$totalarray[
'nbfield'] = 0;
1378print
'<tr class="liste_titre">';
1381 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1382 $totalarray[
'nbfield']++;
1384if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1386 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
1387 $totalarray[
'nbfield']++;
1389if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1390 print_liste_field_titre($arrayfields[
'e.ref_customer'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_customer",
"", $param,
'', $sortfield, $sortorder);
1391 $totalarray[
'nbfield']++;
1393if (!empty($arrayfields[
's.nom'][
'checked'])) {
1394 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
1395 $totalarray[
'nbfield']++;
1397if (!empty($arrayfields[
's.town'][
'checked'])) {
1398 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1399 $totalarray[
'nbfield']++;
1401if (!empty($arrayfields[
's.zip'][
'checked'])) {
1402 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1403 $totalarray[
'nbfield']++;
1405if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1406 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1407 $totalarray[
'nbfield']++;
1409if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1410 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1411 $totalarray[
'nbfield']++;
1413if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1414 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1415 $totalarray[
'nbfield']++;
1417if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1418 print_liste_field_titre($arrayfields[
'e.weight'][
'label'], $_SERVER[
"PHP_SELF"],
"e.weight",
"", $param,
'', $sortfield, $sortorder,
'center ');
1419 $totalarray[
'nbfield']++;
1421if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1422 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1423 $totalarray[
'nbfield']++;
1425if (!empty($arrayfields[
'e.date_expedition'][
'checked'])) {
1426 print_liste_field_titre($arrayfields[
'e.date_expedition'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_expedition",
"", $param,
'', $sortfield, $sortorder,
'center ');
1427 $totalarray[
'nbfield']++;
1429if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1430 print_liste_field_titre($arrayfields[
'e.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder,
'center ');
1431 $totalarray[
'nbfield']++;
1433if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1434 print_liste_field_titre($arrayfields[
'e.tracking_number'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tracking_number",
"", $param,
'', $sortfield, $sortorder,
'center ');
1435 $totalarray[
'nbfield']++;
1437if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1438 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
1439 $totalarray[
'nbfield']++;
1441if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1442 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1443 $totalarray[
'nbfield']++;
1445if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1446 print_liste_field_titre($arrayfields[
'e.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"e.note_public",
"", $param,
'', $sortfield, $sortorder,
'right ');
1448if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1449 print_liste_field_titre($arrayfields[
'e.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"e.note_private",
"", $param,
'', $sortfield, $sortorder,
'right ');
1453include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1455$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'$totalarray' => &$totalarray);
1456$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1457print $hookmanager->resPrint;
1458if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1459 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1460 $totalarray[
'nbfield']++;
1462if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1463 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1464 $totalarray[
'nbfield']++;
1466if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1467 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
1468 $totalarray[
'nbfield']++;
1470if (!empty($arrayfields[
'e.signed_status'][
'checked'])) {
1471 print_liste_field_titre($arrayfields[
'e.signed_status'][
'label'], $_SERVER[
"PHP_SELF"],
"e.signed_status",
"", $param,
'', $sortfield, $sortorder,
'center ');
1472 $totalarray[
'nbfield']++;
1474if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1475 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
1476 $totalarray[
'nbfield']++;
1480 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1481 $totalarray[
'nbfield']++;
1485$typenArray = $formcompany->typent_array(1);
1490$savnbfield = $totalarray[
'nbfield'];
1491$totalarray = array();
1492$totalarray[
'nbfield'] = 0;
1493$imaxinloop = ($limit ? min($num, $limit) : $num);
1494while ($i < $imaxinloop) {
1495 $obj = $db->fetch_object($resql);
1500 $companystatic->id = $obj->socid;
1501 $companystatic->ref = $obj->name;
1502 $companystatic->name = $obj->name;
1507 if ($mode ==
'kanban') {
1509 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1510 print
'<div class="box-flex-container kanban">';
1512 $object->date_delivery = $obj->delivery_date;
1517 if ($massactionbutton || $massaction) {
1519 if (in_array(
$object->id, $arrayofselected)) {
1523 print
$object->getKanbanView(
'', array(
'thirdparty' => $companystatic->getNomUrl(1),
'selected' => $selected));
1524 if ($i == min($num, $limit) - 1) {
1529 print
'<tr class="oddeven">';
1533 print
'<td class="nowrap center">';
1534 if ($massactionbutton || $massaction) {
1536 if (in_array($obj->rowid, $arrayofselected)) {
1539 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1544 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1545 print
'<td class="nowraponall">';
1547 $filedir = (
$conf->expedition->multidir_output[
$object->entity] ?
$conf->expedition->multidir_output[
$object->entity] :
$conf->expedition->dir_output).
'/sending/'.
get_exdir(0, 0, 0, 1, $object,
'');
1549 print $formfile->getDocumentsLink(
'expedition', $filename, $filedir);
1552 $totalarray[
'nbfield']++;
1557 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1558 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->ref_customer).
'">';
1562 $totalarray[
'nbfield']++;
1567 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1568 print
'<td class="tdoverflowmax150">';
1569 print $companystatic->getNomUrl(1);
1572 $totalarray[
'nbfield']++;
1576 if (!empty($arrayfields[
's.town'][
'checked'])) {
1577 print
'<td class="nocellnopadd">';
1581 $totalarray[
'nbfield']++;
1585 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1586 print
'<td class="nocellnopadd center">';
1590 $totalarray[
'nbfield']++;
1594 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1595 print
'<td class="center">'.$obj->state_name.
"</td>\n";
1597 $totalarray[
'nbfield']++;
1601 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1602 print
'<td class="center">';
1603 $tmparray =
getCountry($obj->fk_pays,
'all');
1607 $totalarray[
'nbfield']++;
1611 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1612 print
'<td class="center">';
1613 if (isset($typenArray[$obj->typent_code])) {
1614 print $typenArray[$obj->typent_code];
1618 $totalarray[
'nbfield']++;
1622 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1623 print
'<td class="center">';
1624 if (empty(
$object->trueWeight)) {
1625 $tmparray =
$object->getTotalWeightVolume();
1627 print $form->textwithpicto(
'', $langs->trans(
'EstimatedWeight'), 1);
1630 print (
$object->trueWeight &&
$object->weight_units !=
'') ?
' '.measuringUnitString(0,
"weight", (
string)
$object->weight_units) :
'';
1634 $totalarray[
'nbfield']++;
1638 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1639 print
'<td class="center nowraponall">';
1640 print
dol_print_date($db->jdate($obj->delivery_date),
"dayhour");
1643 $totalarray[
'nbfield']++;
1647 if (!empty($arrayfields[
'e.date_expedition'][
'checked'])) {
1648 print
'<td class="center nowraponall">';
1649 print
dol_print_date($db->jdate($obj->date_expedition),
"dayhour");
1652 $totalarray[
'nbfield']++;
1655 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1657 $code = $langs->getLabelFromKey($db,
$object->shipping_method_id,
'c_shipment_mode',
'rowid',
'code');
1658 print
'<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"SendingMethod".strtoupper($code))).
'">';
1659 if (
$object->shipping_method_id > 0) {
1660 print $langs->trans(
"SendingMethod".strtoupper($code));
1664 $totalarray[
'nbfield']++;
1668 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1669 $object->getUrlTrackingStatus($obj->tracking_number);
1670 print
'<td class="center" title="'.dol_escape_htmltag(
$object->tracking_url).
'">'.
$object->tracking_url.
"</td>\n";
1672 $totalarray[
'nbfield']++;
1676 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1679 if (array_key_exists(
'delivery',
$object->linkedObjects) && count(
$object->linkedObjects[
'delivery']) > 0) {
1680 $receiving = reset(
$object->linkedObjects[
'delivery']);
1683 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1685 print
'<td class="nowraponall">';
1686 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
1690 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1692 print
'<td class="center nowraponall">';
1698 if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1699 print
'<td class="sensiblehtmlcontent center">';
1703 $totalarray[
'nbfield']++;
1707 if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1708 print
'<td class="sensiblehtmlcontent center">';
1712 $totalarray[
'nbfield']++;
1716 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1718 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1719 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1720 print $hookmanager->resPrint;
1722 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1723 print
'<td class="center nowraponall">';
1724 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuserrel');
1727 $totalarray[
'nbfield']++;
1731 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1732 print
'<td class="center nowraponall">';
1733 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
1736 $totalarray[
'nbfield']++;
1740 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1741 print
'<td class="right nowrap">'.$object->getLibStatut(5).
'</td>';
1743 $totalarray[
'nbfield']++;
1747 if (!empty($arrayfields[
'e.signed_status'][
'checked'])) {
1748 print
'<td class="center">'.$object->getLibSignedStatus(5).
'</td>';
1750 $totalarray[
'nbfield']++;
1754 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1755 print
'<td class="center">'.yn($obj->billed).
'</td>';
1757 $totalarray[
'nbfield']++;
1763 print
'<td class="nowrap center">';
1764 if ($massactionbutton || $massaction) {
1766 if (in_array($obj->rowid, $arrayofselected)) {
1769 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1774 $totalarray[
'nbfield']++;
1785 foreach ($arrayfields as $key => $val) {
1786 if (!empty($val[
'checked'])) {
1790 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1795$parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => $totalarray,
'sql' => $sql);
1796$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1797print $hookmanager->resPrint;
1803$hidegeneratedfilelistifempty = 1;
1804if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1805 $hidegeneratedfilelistifempty = 0;
1809$urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1810$urlsource .= str_replace(
'&',
'&', $param);
1812$filedir = $diroutputmassaction;
1813$genallowed = $user->hasRight(
'expedition',
'lire');
1814$delallowed = $user->hasRight(
'expedition',
'creer');
1817print $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
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 customers orders.
Class to manage absolute discounts.
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.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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)
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.
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...
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
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...
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
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...
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.