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",
'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:int');
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' => (string) (int) (!
getDolGlobalString(
'MAIN_LIST_HIDE_PUBLIC_NOTES')),
'position' => 135),
161 'e.note_private' => array(
'label' =>
'NotePrivate',
'checked' =>
'0',
'enabled' => (string) (int) (!
getDolGlobalString(
'MAIN_LIST_HIDE_PRIVATE_NOTES')),
'position' => 140),
165include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
173 $socid = $user->socid;
184if (
GETPOST(
'cancel',
'alpha')) {
188if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'confirm_createbills') {
192$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
193$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
198include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
201if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
204 $search_product_category =
'';
205 $search_ref_exp =
'';
206 $search_ref_liv =
'';
207 $search_ref_customer =
'';
208 $search_company =
'';
213 $search_country =
'';
214 $search_tracking =
'';
215 $search_shipping_method_ids = [];
216 $search_type_thirdparty =
'';
218 $search_dateshipping_start =
'';
219 $search_dateshipping_end =
'';
220 $search_datedelivery_start =
'';
221 $search_datedelivery_end =
'';
222 $search_datereceipt_start =
'';
223 $search_datereceipt_end =
'';
225 $search_signed_status =
'';
227 $search_array_options = array();
228 $search_categ_cus = 0;
232if (empty($reshook)) {
233 $objectclass =
'Expedition';
234 $objectlabel =
'Sendings';
235 $permissiontoread = $user->hasRight(
'expedition',
'lire');
236 $permissiontoadd = $user->hasRight(
'expedition',
'creer');
237 $permissiontodelete = $user->hasRight(
'expedition',
'supprimer');
238 $uploaddir = $conf->expedition->dir_output.
'/sending';
239 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
241 if ($massaction ==
'confirm_createbills') {
242 $sendings =
GETPOST(
'toselect',
'array:int');
243 $createbills_onebythird =
GETPOST(
'createbills_onebythird',
'int');
244 $validate_invoices =
GETPOST(
'validate_invoices',
'int');
249 $TFactThird = array();
250 $TFactThirdNbLines = array();
252 $nb_bills_created = 0;
258 $nbSendings = is_array($sendings) ? count($sendings) : 1;
260 foreach ($sendings as $id_sending) {
262 if ($expd->fetch($id_sending) <= 0) {
265 $expd->fetch_thirdparty();
271 $expdCmdSrc->fetch($expd->origin_id);
273 if (!empty($createbills_onebythird) && !empty($TFactThird[$expd->socid])) {
275 $objecttmp = $TFactThird[$expd->socid];
278 $objecttmp->socid = $expd->socid;
279 $objecttmp->thirdparty = $expd->thirdparty;
281 $objecttmp->type = $objecttmp::TYPE_STANDARD;
282 $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);
283 $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);
285 $objecttmp->fk_project = $expd->fk_project;
286 $objecttmp->multicurrency_code = !empty($expdCmdSrc->multicurrency_code) ? $expdCmdSrc->multicurrency_code : (!empty($objecttmp->thirdparty->multicurrency_code) ? $objecttmp->thirdparty->multicurrency_code : $expd->multicurrency_code);
287 if (empty($createbills_onebythird)) {
288 $objecttmp->ref_customer = $expd->ref_customer;
292 if (empty($datefacture)) {
296 $objecttmp->date = $datefacture;
297 $objecttmp->origin_type =
'shipping';
298 $objecttmp->origin_id = (int) $id_sending;
300 $objecttmp->array_options = $expd->array_options;
302 $res = $objecttmp->create($user);
306 $lastref = $objecttmp->ref;
307 $lastid = $objecttmp->id;
309 $TFactThird[$expd->socid] = $objecttmp;
310 $TFactThirdNbLines[$expd->socid] = 0;
312 $langs->load(
"errors");
313 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
318 if ($objecttmp->id > 0) {
319 $res = $objecttmp->add_object_linked($objecttmp->origin_type, $id_sending);
322 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
326 $expd->fetchObjectLinked();
327 foreach ($expd->linkedObjectsIds as $sourcetype => $TIds) {
328 if ($sourcetype ==
'facture') {
331 if (!empty($createbills_onebythird) && !empty($TFactThird[$expd->socid])) {
332 $objecttmp->fetchObjectLinked(
$object->id,
'commande');
333 foreach ($objecttmp->linkedObjectsIds as $tmpSourcetype => $tmpTIds) {
334 if ($tmpSourcetype == $sourcetype) {
335 if (!empty(array_intersect($TIds, $tmpTIds))) {
342 $res = $objecttmp->add_object_linked($sourcetype, current($TIds));
345 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
351 $lines = $expd->lines;
352 if (empty($lines) && method_exists($expd,
'fetch_lines')) {
353 $expd->fetch_lines();
354 $lines = $expd->lines;
358 $num = count($lines);
360 for ($i = 0; $i < $num; $i++) {
361 $desc = ($lines[$i]->desc ? $lines[$i]->desc :
'');
363 if (!empty($createbills_onebythird)) {
364 $desc =
dol_concatdesc($desc, $langs->trans(
"Order").
': '.$expdCmdSrc->ref.
' - '. $langs->trans(
"Shipment").
': '.$expd->ref.($expd->date_shipping ?
' - '.dol_print_date($expd->date_shipping,
'day') :
''));
367 if ($lines[$i]->subprice < 0 && !
getDolGlobalString(
'INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN')) {
370 $discount->socid = $objecttmp->socid;
371 $discount->amount_ht = abs($lines[$i]->total_ht);
372 $discount->amount_tva = abs($lines[$i]->total_tva);
373 $discount->amount_ttc = abs($lines[$i]->total_ttc);
374 $discount->tva_tx = $lines[$i]->tva_tx;
375 $discount->fk_user = $user->id;
376 $discount->description = $desc;
377 $discountid = $discount->create($user);
378 if ($discountid > 0) {
379 $result = $objecttmp->insert_discount($discountid);
388 $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
391 if ($lines[$i]->date_debut_prevue) {
392 $date_start = $lines[$i]->date_debut_prevue;
394 if ($lines[$i]->date_debut_reel) {
395 $date_start = $lines[$i]->date_debut_reel;
397 if ($lines[$i]->date_start) {
398 $date_start = $lines[$i]->date_start;
402 if ($lines[$i]->date_fin_prevue) {
403 $date_end = $lines[$i]->date_fin_prevue;
405 if ($lines[$i]->date_fin_reel) {
406 $date_end = $lines[$i]->date_fin_reel;
408 if ($lines[$i]->date_end) {
409 $date_end = $lines[$i]->date_end;
412 if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
417 if (method_exists($lines[$i],
'fetch_optionals')) {
418 $lines[$i]->fetch_optionals();
419 $array_options = $lines[$i]->array_options;
422 $objecttmp->context[
'createfromclone'] =
'createfromclone';
424 $rang = ($nbSendings > 1) ? -1 : $lines[$i]->rang;
426 if (!empty($createbills_onebythird)) {
427 $rang = $TFactThirdNbLines[$expd->socid];
430 $result = $objecttmp->addline(
432 $lines[$i]->subprice,
435 $lines[$i]->localtax1_tx,
436 $lines[$i]->localtax2_tx,
437 $lines[$i]->fk_product,
438 $lines[$i]->remise_percent,
442 (
int) $lines[$i]->info_bits,
443 $lines[$i]->fk_remise_except,
448 $lines[$i]->special_code,
449 $objecttmp->origin_type,
452 $lines[$i]->fk_fournprice,
455 !empty($array_options) ? $array_options :
'',
462 if (!empty($createbills_onebythird)) {
463 $TFactThirdNbLines[$expd->socid]++;
468 $errors[] = $objecttmp->error;
472 if ($result > 0 && $lines[$i]->product_type == 9) {
473 $fk_parent_line = $result;
480 if (!empty($createbills_onebythird) && empty($TFactThird[$expd->socid])) {
481 $TFactThird[$expd->socid] = $objecttmp;
483 $TFact[$objecttmp->id] = $objecttmp;
488 $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
491 if (!$error && $validate_invoices) {
492 $massaction = $action =
'builddoc';
494 foreach ($TAllFact as &$objecttmp) {
495 $result = $objecttmp->validate($user);
502 $id = $objecttmp->id;
506 $upload_dir = $conf->facture->dir_output;
507 $permissiontoadd = $user->hasRight(
'facture',
'creer');
512 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
516 $massaction = $action =
'confirm_createbills';
522 if ($nb_bills_created == 1) {
523 $texttoshow = $langs->trans(
'BillXCreated',
'{s1}');
524 $texttoshow = str_replace(
'{s1}',
'<a href="'.DOL_URL_ROOT.
'/compta/facture/card.php?id='.urlencode(strval($lastid)).
'">'.$lastref.
'</a>', $texttoshow);
527 setEventMessages($langs->trans(
'BillCreated', $nb_bills_created),
null,
'mesgs');
532 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
533 $param .=
'&contextpage='.urlencode($contextpage);
535 if ($limit > 0 && $limit != $conf->liste_limit) {
536 $param .=
'&limit='.urlencode(strval($limit));
539 $param .=
"&search_all=".urlencode($search_all);
541 if ($search_ref_exp) {
542 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
544 if ($search_ref_liv) {
545 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
547 if ($search_ref_customer) {
548 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
550 if ($search_user > 0) {
551 $param .=
'&search_user='.urlencode($search_user);
553 if ($search_sale > 0) {
554 $param .=
'&search_sale='.urlencode($search_sale);
556 if ($search_company) {
557 $param .=
"&search_company=".urlencode($search_company);
559 if ($search_shipping_method_ids) {
560 foreach ($search_shipping_method_ids as $value) {
561 $param .=
"&search_shipping_method_ids[]=".urlencode($value);
564 if ($search_tracking) {
565 $param .=
"&search_tracking=".urlencode($search_tracking);
568 $param .=
'&search_town='.urlencode($search_town);
571 $param .=
'&search_zip='.urlencode($search_zip);
573 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
574 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
576 if ($search_dateshipping_start) {
577 $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'));
579 if ($search_dateshipping_end) {
580 $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'));
582 if ($search_datedelivery_start) {
583 $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'));
585 if ($search_datedelivery_end) {
586 $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'));
588 if ($search_datereceipt_start) {
589 $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'));
591 if ($search_datereceipt_end) {
592 $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'));
594 if ($search_product_category !=
'') {
595 $param .=
'&search_product_category='.urlencode($search_product_category);
597 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
598 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
600 if ($search_status !=
'') {
601 $param .=
'&search_status='.urlencode($search_status);
603 if ($search_signed_status !=
'' && $search_signed_status >= 0) {
604 $param .=
'&search_signed_status='.urlencode($search_signed_status);
606 if ($optioncss !=
'') {
607 $param .=
'&optioncss='.urlencode($optioncss);
609 if ($search_billed !=
'') {
610 $param .=
'&billed='.urlencode($search_billed);
613 header(
"Location: ".$_SERVER[
'PHP_SELF'].
'?'.$param);
619 $_GET[
"origin"] = $_POST[
"origin"];
620 $_GET[
"originid"] = $_POST[
"originid"];
621 if (!empty($errors)) {
631 if ($massaction ==
'classifyclose') {
633 $selectids =
GETPOST(
'toselect',
'array:int');
634 foreach ($selectids as $selectid) {
637 $result =
$object->setClosed();
640 $massaction = $action =
'classifyclose';
651 header(
'Location: '.$_SERVER[
"PHP_SELF"]);
666$form =
new Form($db);
669$companystatic =
new Societe($db);
673$title = $langs->trans(
'Shipments');
674$help_url =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
677if ($search_all || $search_user > 0) {
678 $sql =
'SELECT DISTINCT';
680$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,";
683 $sql .=
" l.date_delivery as date_reception,";
685$sql .=
" s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
686$sql .=
" typent.code as typent_code,";
687$sql .=
" state.code_departement as state_code, state.nom as state_name,";
688$sql .=
" e.date_creation as date_creation, e.tms as date_modification,e.note_public, e.note_private,";
691if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
692 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
693 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
697$parameters = array();
698$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
699$sql .= $hookmanager->resPrint;
703$sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
704if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
705 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
708 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expeditiondet as ed ON e.rowid=ed.fk_expedition';
710$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
711$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
712$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
713$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
716 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
717 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
719$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON e.fk_user_author = u.rowid';
720if ($search_user > 0) {
721 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
723if ($search_user > 0) {
724 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
725 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
729$parameters = array();
730$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
731$sql .= $hookmanager->resPrint;
733$sql .=
" WHERE e.entity IN (".getEntity(
'expedition').
")";
736 $sql .=
" AND s.rowid = ".((int) $socid);
739 $sql .=
" AND e.fk_soc = ".((int) $socid);
741if ($search_status !=
'' && $search_status >= 0) {
742 $sql .=
" AND e.fk_statut = ".((int) $search_status);
744if ($search_signed_status !=
'' && $search_signed_status >= 0) {
745 $sql .=
" AND e.signed_status = ".((int) $search_signed_status);
747if ($search_ref_customer !=
'') {
750if ($search_billed !=
'' && $search_billed >= 0) {
751 $sql .=
" AND e.billed = ".((int) $search_billed);
762if ($search_country) {
763 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
765if (!empty($search_shipping_method_ids)) {
766 $sql .=
" AND e.fk_shipping_method IN (".$db->sanitize(implode(
',', $search_shipping_method_ids)).
')';
768if ($search_tracking) {
771if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
772 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
774if ($search_user > 0) {
776 $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);
778if ($search_company) {
781if ($search_ref_exp) {
784if ($search_dateshipping_start) {
785 $sql .=
" AND e.date_expedition >= '".$db->idate($search_dateshipping_start).
"'";
787if ($search_dateshipping_end) {
788 $sql .=
" AND e.date_expedition <= '".$db->idate($search_dateshipping_end).
"'";
790if ($search_datedelivery_start) {
791 $sql .=
" AND e.date_delivery >= '".$db->idate($search_datedelivery_start).
"'";
793if ($search_datedelivery_end) {
794 $sql .=
" AND e.date_delivery <= '".$db->idate($search_datedelivery_end).
"'";
797 if ($search_ref_liv) {
800 if ($search_datereceipt_start) {
801 $sql .=
" AND l.date_delivery >= '".$db->idate($search_datereceipt_start).
"'";
803 if ($search_datereceipt_end) {
804 $sql .=
" AND l.date_delivery <= '".$db->idate($search_datereceipt_end).
"'";
808 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
811if ($search_sale && $search_sale !=
'-1') {
812 if ($search_sale == -2) {
813 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = e.fk_soc)";
814 } elseif ($search_sale > 0) {
815 $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).
")";
819$searchCategoryCustomerOperator =
GETPOSTINT(
'search_category_customer_operator');
820$searchCategoryCustomerList = array($search_categ_cus);
821if (!empty($searchCategoryCustomerList)) {
822 $searchCategoryCustomerSqlList = array();
823 $listofcategoryid =
'';
824 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
825 if (intval($searchCategoryCustomer) == -2) {
826 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
827 } elseif (intval($searchCategoryCustomer) > 0) {
828 if ($searchCategoryCustomerOperator == 0) {
829 $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).
")";
831 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
835 if ($listofcategoryid) {
836 $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).
"))";
838 if ($searchCategoryCustomerOperator == 1) {
839 if (!empty($searchCategoryCustomerSqlList)) {
840 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
843 if (!empty($searchCategoryCustomerSqlList)) {
844 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
849$searchCategoryProductOperator =
GETPOSTINT(
'search_category_product_operator');
850$searchCategoryProductList = array($search_product_category);
851if (!empty($searchCategoryProductList)) {
852 $searchCategoryProductSqlList = array();
853 $listofcategoryid =
'';
854 foreach ($searchCategoryProductList as $searchCategoryProduct) {
855 if (intval($searchCategoryProduct) == -2) {
856 $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)";
857 } elseif (intval($searchCategoryProduct) > 0) {
858 if ($searchCategoryProductOperator == 0) {
859 $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).
")";
861 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
865 if ($listofcategoryid) {
866 $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).
"))";
868 if ($searchCategoryProductOperator == 1) {
869 if (!empty($searchCategoryProductSqlList)) {
870 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
873 if (!empty($searchCategoryProductSqlList)) {
874 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
879include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
882$parameters = array();
883$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
884if (empty($reshook)) {
885 $sql .= $hookmanager->resPrint;
887 $sql = $hookmanager->resPrint;
891$parameters = array();
892$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
893if (empty($reshook)) {
894 $sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
896 $sql = $hookmanager->resPrint;
899$nbtotalofrecords =
'';
902 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
903 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
904 $resql = $db->query($sqlforcount);
906 $objforcount = $db->fetch_object($resql);
907 $nbtotalofrecords = $objforcount->nbtotalofrecords;
912 if (($page * $limit) > (
int) $nbtotalofrecords) {
920$sql .= $db->order($sortfield, $sortorder);
922 $sql .= $db->plimit($limit + 1, $offset);
926$resql = $db->query($sql);
932$num = $db->num_rows($resql);
935if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) {
936 $obj = $db->fetch_object($resql);
938 header(
"Location: ".DOL_URL_ROOT.
'/expedition/card.php?id='.
$id);
945 if (empty($search_company)) {
946 $search_company = $soc->name;
953llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-expedition page-list');
955$arrayofselected = is_array($toselect) ? $toselect : array();
959 $param .=
'&socid='.urlencode((
string) ($socid));
962 $param .=
'&mode='.urlencode($mode);
964if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
965 $param .=
'&contextpage='.urlencode($contextpage);
967if ($limit > 0 && $limit != $conf->liste_limit) {
968 $param .=
'&limit='.((int) $limit);
971 $param .=
"&search_all=".urlencode($search_all);
973if ($search_ref_exp) {
974 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
976if ($search_ref_liv) {
977 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
979if ($search_ref_customer) {
980 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
982if ($search_user > 0) {
983 $param .=
'&search_user='.urlencode((
string) ($search_user));
985if ($search_sale > 0) {
986 $param .=
'&search_sale='.urlencode((
string) ($search_sale));
988if ($search_company) {
989 $param .=
"&search_company=".urlencode($search_company);
991if ($search_shipping_method_ids) {
992 foreach ($search_shipping_method_ids as $value) {
993 $param .=
"&search_shipping_method_ids[]=".urlencode($value);
996if ($search_tracking) {
997 $param .=
"&search_tracking=".urlencode($search_tracking);
1000 $param .=
'&search_town='.urlencode($search_town);
1003 $param .=
'&search_zip='.urlencode($search_zip);
1005if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
1006 $param .=
'&search_type_thirdparty='.urlencode((
string) ($search_type_thirdparty));
1008if ($search_dateshipping_start) {
1009 $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'));
1011if ($search_dateshipping_end) {
1012 $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'));
1014if ($search_datedelivery_start) {
1015 $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'));
1017if ($search_datedelivery_end) {
1018 $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'));
1020if ($search_datereceipt_start) {
1021 $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'));
1023if ($search_datereceipt_end) {
1024 $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'));
1026if ($search_product_category !=
'') {
1027 $param .=
'&search_product_category='.urlencode((
string) ($search_product_category));
1029if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
1030 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
1032if ($search_status !=
'') {
1033 $param .=
'&search_status='.urlencode($search_status);
1035if ($search_signed_status !=
'' && $search_signed_status >= 0) {
1036 $param .=
'&search_signed_status='.urlencode($search_signed_status);
1038if ($optioncss !=
'') {
1039 $param .=
'&optioncss='.urlencode($optioncss);
1042include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1045$parameters = array(
'param' => &$param);
1046$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1047$param .= $hookmanager->resPrint;
1049$arrayofmassactions = array(
1050 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1051 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
1052 'classifyclose' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth"').$langs->trans(
"Close"),
1053 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
1055if ($user->hasRight(
'facture',
'creer')) {
1056 $arrayofmassactions[
'createbills'] =
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
"CreateInvoiceForThisCustomerFromSendings");
1058if (in_array($massaction, array(
'presend',
'createbills'))) {
1059 $arrayofmassactions = array();
1061$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1068$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'));
1069$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'));
1071$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSending'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/expedition/card.php?action=create2',
'', $user->hasRight(
'expedition',
'creer'));
1074print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
1075if ($optioncss !=
'') {
1076 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1078print
'<input type="hidden" name="token" value="'.newToken().
'">';
1079print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1080print
'<input type="hidden" name="action" value="list">';
1081print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1082print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1083print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1084print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1087print_barre_liste($langs->trans(
'Shipments'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'dolly', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1089$topicmail =
"SendShippingRef";
1090$modelmail =
"shipping_send";
1092$trackid =
'shi'.$object->id;
1093include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1095if ($massaction ==
'createbills') {
1096 print
'<input type="hidden" name="massaction" value="confirm_createbills">';
1098 print
'<table class="noborder centpercent">';
1100 print
'<td class="titlefield">';
1101 print $langs->trans(
'DateInvoice');
1104 print $form->selectDate(
'',
'', 0, 0, 0,
'', 1, 1);
1109 print $langs->trans(
'CreateOneBillByThird');
1112 print $form->selectyesno(
'createbills_onebythird',
'', 1);
1117 print $langs->trans(
'ValidateInvoices');
1120 if (!empty($conf->stock->enabled) &&
getDolGlobalString(
'STOCK_CALCULATE_ON_BILL')) {
1121 print $form->selectyesno(
'validate_invoices', 0, 1,
true);
1122 $langs->load(
"errors");
1123 print
' ('.$langs->trans(
"WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal").
')';
1125 print $form->selectyesno(
'validate_invoices', 0, 1);
1127 if (!empty($conf->workflow->enabled) &&
getDolGlobalString(
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER')) {
1128 print
' <span class="opacitymedium">'.$langs->trans(
"IfValidateInvoiceIsNoSendingStayUnbilled").
'</span>';
1130 print
' <span class="opacitymedium">'.$langs->trans(
"OptionToSetSendingBilledNotEnabled").
'</span>';
1137 print
'<div class="center">';
1138 print
'<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans(
'CreateInvoiceForThisCustomerFromSendings').
'"> ';
1139 print
'<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1145 foreach ($fieldstosearchall as $key => $val) {
1146 $fieldstosearchall[$key] = $langs->trans($val);
1148 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1154if ($user->hasRight(
'user',
'user',
'lire')) {
1155 $langs->load(
"commercial");
1156 $moreforfilter .=
'<div class="divsearchfield">';
1157 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1158 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1159 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
1160 $moreforfilter .=
'</div>';
1163if ($user->hasRight(
'user',
'user',
'lire')) {
1164 $moreforfilter .=
'<div class="divsearchfield">';
1165 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1166 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1167 $moreforfilter .= $form->select_dolusers($search_user,
'search_user', $tmptitle,
null, 0,
'',
'',
'0', 0, 0,
'', 0,
'',
'maxwidth200');
1168 $moreforfilter .=
'</div>';
1171if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
1172 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1173 $moreforfilter .=
'<div class="divsearchfield">';
1174 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1175 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1176 $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, (
int) $search_product_category,
'search_product_category', 1, $tmptitle);
1177 $moreforfilter .=
'</div>';
1179if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1180 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1181 $moreforfilter .=
'<div class="divsearchfield">';
1182 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
1183 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1184 $moreforfilter .= $formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle);
1185 $moreforfilter .=
'</div>';
1187$parameters = array();
1188$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1189if (empty($reshook)) {
1190 $moreforfilter .= $hookmanager->resPrint;
1192 $moreforfilter = $hookmanager->resPrint;
1195if (!empty($moreforfilter)) {
1196 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1197 print $moreforfilter;
1201$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1202$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1203if ($massactionbutton) {
1204 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
1207print
'<div class="div-table-responsive">';
1208print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1212print
'<tr class="liste_titre_filter">';
1215 print
'<td class="liste_titre center maxwidthsearch">';
1216 $searchpicto = $form->showFilterButtons(
'left');
1221if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1222 print
'<td class="liste_titre">';
1223 print
'<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.
'">';
1227if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1228 print
'<td class="liste_titre">';
1229 print
'<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.
'">';
1233if (!empty($arrayfields[
's.nom'][
'checked'])) {
1234 print
'<td class="liste_titre left">';
1235 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag((
string) $search_company).
'">';
1239if (!empty($arrayfields[
's.town'][
'checked'])) {
1240 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
1243if (!empty($arrayfields[
's.zip'][
'checked'])) {
1244 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
1247if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1248 print
'<td class="liste_titre">';
1249 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1253if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1254 print
'<td class="liste_titre center">';
1255 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1259if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1260 print
'<td class="liste_titre maxwidthonsmartphone center">';
1261 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);
1265if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1266 print
'<td class="liste_titre maxwidthonsmartphone center">';
1271if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1272 print
'<td class="liste_titre center">';
1273 print
'<div class="nowrapfordate">';
1274 print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1,
'search_datedelivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1276 print
'<div class="nowrapfordate">';
1277 print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1,
'search_datedelivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1282if (!empty($arrayfields[
'e.date_expedition'][
'checked'])) {
1283 print
'<td class="liste_titre center">';
1284 print
'<div class="nowrapfordate">';
1285 print $form->selectDate($search_dateshipping_start ? $search_dateshipping_start : -1,
'search_dateshipping_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1287 print
'<div class="nowrapfordate">';
1288 print $form->selectDate($search_dateshipping_end ? $search_dateshipping_end : -1,
'search_dateshipping_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1292if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1294 print
'<td class="liste_titre center">';
1295 $shipment->fetch_delivery_methods();
1296 print $form->selectarray(
"search_shipping_method_ids[]", $shipment->meths, $search_shipping_method_ids, 1, 0, 0,
'multiple', 1, 0, 0,
'',
'maxwidth150');
1300if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1301 print
'<td class="liste_titre center">';
1302 print
'<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).
'">';
1305if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1307 print
'<td class="liste_titre">';
1308 print
'<input class="flat width75" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
1311if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1313 print
'<td class="liste_titre center">';
1314 print
'<div class="nowrapfordate">';
1315 print $form->selectDate($search_datereceipt_start ? $search_datereceipt_start : -1,
'search_datereceipt_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1317 print
'<div class="nowrapfordate">';
1318 print $form->selectDate($search_datereceipt_end ? $search_datereceipt_end : -1,
'search_datereceipt_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1323if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1324 print
'<td class="liste_titre">';
1328if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1329 print
'<td class="liste_titre">';
1333include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1336$parameters = array(
'arrayfields' => $arrayfields);
1337$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1338print $hookmanager->resPrint;
1340if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1341 print
'<td class="liste_titre">';
1345if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1346 print
'<td class="liste_titre">';
1350if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1351 print
'<td class="liste_titre right parentonrightofpage">';
1352 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');
1356if (!empty($arrayfields[
'e.signed_status'][
'checked'])) {
1357 print
'<td class="liste_titre center">';
1358 $list_signed_status =
$object->getSignedStatusLocalisedArray();
1359 print $form->selectarray(
'search_signed_status', $list_signed_status, $search_signed_status, 1, 0, 0,
'', 1, 0, 0,
'',
'search_status');
1363if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1364 print
'<td class="liste_titre maxwidthonsmartphone center">';
1365 print $form->selectyesno(
'search_billed', $search_billed, 1,
false, 1);
1370 print
'<td class="liste_titre center maxwidthsearch">';
1371 $searchpicto = $form->showFilterButtons();
1382print
'<tr class="liste_titre">';
1385 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1388if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1390 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
1393if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1394 print_liste_field_titre($arrayfields[
'e.ref_customer'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_customer",
"", $param,
'', $sortfield, $sortorder);
1397if (!empty($arrayfields[
's.nom'][
'checked'])) {
1398 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
1401if (!empty($arrayfields[
's.town'][
'checked'])) {
1402 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1405if (!empty($arrayfields[
's.zip'][
'checked'])) {
1406 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1409if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1410 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1413if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1414 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1417if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1418 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1421if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1422 print_liste_field_titre($arrayfields[
'e.weight'][
'label'], $_SERVER[
"PHP_SELF"],
"e.weight",
"", $param,
'', $sortfield, $sortorder,
'center ');
1425if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1426 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1429if (!empty($arrayfields[
'e.date_expedition'][
'checked'])) {
1430 print_liste_field_titre($arrayfields[
'e.date_expedition'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_expedition",
"", $param,
'', $sortfield, $sortorder,
'center ');
1433if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1434 print_liste_field_titre($arrayfields[
'e.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder,
'center ');
1437if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1438 print_liste_field_titre($arrayfields[
'e.tracking_number'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tracking_number",
"", $param,
'', $sortfield, $sortorder,
'center ');
1441if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1442 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
1445if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1446 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1449if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1450 print_liste_field_titre($arrayfields[
'e.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"e.note_public",
"", $param,
'', $sortfield, $sortorder,
'right ');
1452if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1453 print_liste_field_titre($arrayfields[
'e.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"e.note_private",
"", $param,
'', $sortfield, $sortorder,
'right ');
1457include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1459$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'$totalarray' => &$totalarray);
1460$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1461print $hookmanager->resPrint;
1462if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1463 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1466if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1467 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1470if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1471 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
1474if (!empty($arrayfields[
'e.signed_status'][
'checked'])) {
1475 print_liste_field_titre($arrayfields[
'e.signed_status'][
'label'], $_SERVER[
"PHP_SELF"],
"e.signed_status",
"", $param,
'', $sortfield, $sortorder,
'center ');
1478if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1479 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
1484 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1489$typenArray = $formcompany->typent_array(1);
1497$imaxinloop = ($limit ? min($num, $limit) : $num);
1498while ($i < $imaxinloop) {
1499 $obj = $db->fetch_object($resql);
1504 $companystatic->id = $obj->socid;
1505 $companystatic->ref = $obj->name;
1506 $companystatic->name = $obj->name;
1511 if ($mode ==
'kanban') {
1513 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1514 print
'<div class="box-flex-container kanban">';
1516 $object->date_delivery = $obj->delivery_date;
1521 if ($massactionbutton || $massaction) {
1523 if (in_array(
$object->id, $arrayofselected)) {
1527 print
$object->getKanbanView(
'', array(
'thirdparty' => $companystatic->getNomUrl(1),
'selected' => $selected));
1528 if ($i == min($num, $limit) - 1) {
1533 print
'<tr class="oddeven row-with-select">';
1537 print
'<td class="nowrap center">';
1538 if ($massactionbutton || $massaction) {
1540 if (in_array($obj->rowid, $arrayofselected)) {
1543 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1548 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1549 print
'<td class="nowraponall">';
1551 $filedir = ($conf->expedition->multidir_output[
$object->entity ?? $conf->entity] ? $conf->expedition->multidir_output[
$object->entity ?? $conf->entity] : $conf->expedition->dir_output).
'/sending/'.
get_exdir(0, 0, 0, 1, $object,
'');
1553 print $formfile->getDocumentsLink(
'expedition', $filename, $filedir);
1561 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1562 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->ref_customer).
'">';
1571 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1572 print
'<td class="tdoverflowmax150">';
1573 print $companystatic->getNomUrl(1);
1580 if (!empty($arrayfields[
's.town'][
'checked'])) {
1581 print
'<td class="nocellnopadd">';
1589 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1590 print
'<td class="nocellnopadd center">';
1598 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1599 print
'<td class="center">'.$obj->state_name.
"</td>\n";
1605 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1606 print
'<td class="center">';
1607 $tmparray =
getCountry($obj->fk_pays,
'all');
1615 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1616 print
'<td class="center">';
1617 if (isset($typenArray[$obj->typent_code])) {
1618 print $typenArray[$obj->typent_code];
1626 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1627 print
'<td class="center">';
1628 if (empty(
$object->trueWeight)) {
1629 $tmparray =
$object->getTotalWeightVolume();
1631 print $form->textwithpicto(
'', $langs->trans(
'EstimatedWeight'), 1);
1634 print (
$object->trueWeight &&
$object->weight_units !=
'') ?
' '.measuringUnitString(0,
"weight",
$object->weight_units) :
'';
1642 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1643 print
'<td class="center nowraponall">';
1644 print
dol_print_date($db->jdate($obj->delivery_date),
"dayhour");
1651 if (!empty($arrayfields[
'e.date_expedition'][
'checked'])) {
1652 print
'<td class="center nowraponall">';
1653 print
dol_print_date($db->jdate($obj->date_expedition),
"dayhour");
1659 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1661 $code = $langs->getLabelFromKey($db, (
string)
$object->shipping_method_id,
'c_shipment_mode',
'rowid',
'code');
1662 print
'<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"SendingMethod".strtoupper($code))).
'">';
1663 if (
$object->shipping_method_id > 0) {
1664 print $langs->trans(
"SendingMethod".strtoupper($code));
1672 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1673 $object->getUrlTrackingStatus($obj->tracking_number);
1674 print
'<td class="center" title="'.dol_escape_htmltag(
$object->tracking_url).
'">'.
$object->tracking_url.
"</td>\n";
1680 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1683 if (array_key_exists(
'delivery',
$object->linkedObjects) && count(
$object->linkedObjects[
'delivery']) > 0) {
1684 $receiving = reset(
$object->linkedObjects[
'delivery']);
1687 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1689 print
'<td class="nowraponall">';
1690 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
1694 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1696 print
'<td class="center nowraponall">';
1702 if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1703 print
'<td class="sensiblehtmlcontent center">';
1704 print
'<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(
dolGetFirstLineOfText($obj->note_public, 5)).
'</div>';
1711 if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1712 print
'<td class="sensiblehtmlcontent center">';
1713 print
'<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(
dolGetFirstLineOfText($obj->note_private, 5)).
'</div>';
1720 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1722 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1723 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1724 print $hookmanager->resPrint;
1726 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1727 print
'<td class="center nowraponall">';
1728 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuserrel');
1735 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1736 print
'<td class="center nowraponall">';
1737 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
1744 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1745 print
'<td class="right nowrap">'.$object->getLibStatut(5).
'</td>';
1751 if (!empty($arrayfields[
'e.signed_status'][
'checked'])) {
1752 print
'<td class="center">'.$object->getLibSignedStatus(5).
'</td>';
1758 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1759 print
'<td class="center">'.yn($obj->billed).
'</td>';
1767 print
'<td class="nowrap center">';
1768 if ($massactionbutton || $massaction) {
1770 if (in_array($obj->rowid, $arrayofselected)) {
1773 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1789 foreach ($arrayfields as $key => $val) {
1790 if (!empty($val[
'checked'])) {
1794 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1799$parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => $totalarray,
'sql' => $sql);
1800$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1801print $hookmanager->resPrint;
1807$hidegeneratedfilelistifempty = 1;
1808if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1809 $hidegeneratedfilelistifempty = 0;
1813$urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1814$urlsource .= str_replace(
'&',
'&', $param);
1816$filedir = $diroutputmassaction;
1817$genallowed = $user->hasRight(
'expedition',
'lire');
1818$delallowed = $user->hasRight(
'expedition',
'creer');
1821print $formfile->showdocuments(
'massfilesarea_sendings',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $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_now($mode='gmt')
Return date for now.
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_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
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, $attop=0)
Set event message in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
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_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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...
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.