36require
'../main.inc.php';
45require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
51require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
52require_once DOL_DOCUMENT_ROOT.
'/core/lib/sendings.lib.php';
53require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
56$langs->loadLangs(array(
"sendings",
'companies',
'bills',
'products',
'orders'));
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'shipmentlist';
62$action =
GETPOST(
'action',
'alpha');
63$massaction =
GETPOST(
'massaction',
'alpha');
65$toselect =
GETPOST(
'toselect',
'array:int');
66$optioncss =
GETPOST(
'optioncss',
'alpha');
67$mode =
GETPOST(
'mode',
'alpha');
69$search_ref_exp =
GETPOST(
"search_ref_exp",
'alpha');
70$search_ref_liv =
GETPOST(
'search_ref_liv',
'alpha');
71$search_ref_customer =
GETPOST(
'search_ref_customer',
'alpha');
72$search_company =
GETPOST(
"search_company",
'alpha');
73$search_shipping_method_ids =
GETPOST(
'search_shipping_method_ids',
'array:int');
74$search_tracking =
GETPOST(
"search_tracking",
'alpha');
75$search_town =
GETPOST(
'search_town',
'alpha');
76$search_zip =
GETPOST(
'search_zip',
'alpha');
77$search_state =
GETPOST(
"search_state",
'alpha');
78$search_country =
GETPOST(
"search_country",
'aZ09');
79$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
80$search_billed =
GETPOST(
"search_billed",
'intcomma');
87$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
88$search_user =
GETPOST(
'search_user',
'intcomma');
89$search_sale =
GETPOST(
'search_sale',
'intcomma');
90$search_categ_cus =
GETPOST(
"search_categ_cus",
'intcomma');
91$search_product_category =
GETPOST(
'search_product_category',
'intcomma');
94$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
95$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
103if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
107$offset = $limit * $page;
108$pageprev = $page - 1;
109$pagenext = $page + 1;
111$search_status =
GETPOST(
'search_status',
'intcomma');
112$search_signed_status =
GETPOST(
'search_signed_status',
'alpha');
114$diroutputmassaction =
$conf->expedition->dir_output.
'/sending/temp/massgeneration/'.$user->id;
119$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';
168$parameters = array(
'arrayfields' => &$arrayfields);
169$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
177 $socid = $user->socid;
188if (
GETPOST(
'cancel',
'alpha')) {
192if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'confirm_createbills') {
196$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
197$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
199 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
202include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
205if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
208 $search_product_category =
'';
209 $search_ref_exp =
'';
210 $search_ref_liv =
'';
211 $search_ref_customer =
'';
212 $search_company =
'';
217 $search_country =
'';
218 $search_tracking =
'';
219 $search_shipping_method_ids = [];
220 $search_type_thirdparty =
'';
222 $search_dateshipping_start =
'';
223 $search_dateshipping_end =
'';
224 $search_datedelivery_start =
'';
225 $search_datedelivery_end =
'';
226 $search_datereceipt_start =
'';
227 $search_datereceipt_end =
'';
229 $search_signed_status =
'';
231 $search_array_options = array();
232 $search_categ_cus = 0;
236if (empty($reshook)) {
237 $objectclass =
'Expedition';
238 $objectlabel =
'Sendings';
239 $permissiontoread = $user->hasRight(
'expedition',
'lire');
240 $permissiontoadd = $user->hasRight(
'expedition',
'creer');
241 $permissiontodelete = $user->hasRight(
'expedition',
'supprimer');
242 $uploaddir =
$conf->expedition->dir_output.
'/sending';
243 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
245 if (!$error && $massaction ==
'confirm_createbills') {
246 $sendings = $toselect;
247 $createbills_onebythird =
GETPOST(
'createbills_onebythird',
'int');
248 $validate_invoices =
GETPOST(
'validate_invoices',
'int');
253 $TFactThird = array();
254 $TFactThirdNbLines = array();
256 $nb_bills_created = 0;
262 $nbSendings = is_array($sendings) ? count($sendings) : 1;
264 foreach ($sendings as $id_sending) {
266 if ($expd->fetch($id_sending) <= 0) {
269 $expd->fetch_thirdparty();
275 $expdCmdSrc->fetch($expd->origin_id);
277 if (!empty($createbills_onebythird) && !empty($TFactThird[$expd->socid])) {
279 $objecttmp = $TFactThird[$expd->socid];
282 $objecttmp->socid = $expd->socid;
283 $objecttmp->thirdparty = $expd->thirdparty;
285 $objecttmp->type = $objecttmp::TYPE_STANDARD;
286 $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);
287 $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);
289 $objecttmp->fk_project = $expd->fk_project;
290 $objecttmp->multicurrency_code = !empty($expdCmdSrc->multicurrency_code) ? $expdCmdSrc->multicurrency_code : (!empty($objecttmp->thirdparty->multicurrency_code) ? $objecttmp->thirdparty->multicurrency_code : $expd->multicurrency_code);
291 if (empty($createbills_onebythird)) {
292 $objecttmp->ref_customer = $expd->ref_customer;
296 if (empty($datefacture)) {
300 $objecttmp->date = $datefacture;
301 $objecttmp->origin_type =
'shipping';
302 $objecttmp->origin_id = (int) $id_sending;
304 $objecttmp->array_options = $expd->array_options;
306 $res = $objecttmp->create($user);
310 $lastref = $objecttmp->ref;
311 $lastid = $objecttmp->id;
313 $TFactThird[$expd->socid] = $objecttmp;
314 $TFactThirdNbLines[$expd->socid] = 0;
316 $langs->load(
"errors");
317 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
322 if ($objecttmp->id > 0) {
323 $res = $objecttmp->add_object_linked($objecttmp->origin_type, $id_sending);
326 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
330 $expd->fetchObjectLinked();
331 foreach ($expd->linkedObjectsIds as $sourcetype => $TIds) {
332 if ($sourcetype ==
'facture') {
335 if (!empty($createbills_onebythird) && !empty($TFactThird[$expd->socid])) {
336 $objecttmp->fetchObjectLinked(
$object->id,
'commande');
337 foreach ($objecttmp->linkedObjectsIds as $tmpSourcetype => $tmpTIds) {
338 if ($tmpSourcetype == $sourcetype) {
339 if (!empty(array_intersect($TIds, $tmpTIds))) {
346 $res = $objecttmp->add_object_linked($sourcetype, current($TIds));
349 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
355 $lines = $expd->lines;
356 if (empty($lines) && method_exists($expd,
'fetch_lines')) {
357 $expd->fetch_lines();
358 $lines = $expd->lines;
362 $num = count($lines);
364 for ($i = 0; $i < $num; $i++) {
366 if (empty($expd->origin_id)) {
370 $desc = ($lines[$i]->desc ? $lines[$i]->desc :
'');
372 if (!empty($createbills_onebythird)) {
373 $desc =
dol_concatdesc($desc, (!empty($expd->origin_id) ? $langs->trans(
"Order").
': '.$expdCmdSrc->ref.
' - ' :
'').$langs->trans(
"Shipment").
': '.$expd->
ref.($expd->date_shipping ?
' - '.
dol_print_date($expd->date_shipping,
'day') :
''));
376 if ($lines[$i]->subprice < 0 && !
getDolGlobalString(
'INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN')) {
379 $discount->socid = $objecttmp->socid;
380 $discount->amount_ht = abs($lines[$i]->total_ht);
381 $discount->amount_tva = abs($lines[$i]->total_tva);
382 $discount->amount_ttc = abs($lines[$i]->total_ttc);
383 $discount->tva_tx = $lines[$i]->tva_tx;
384 $discount->fk_user = $user->id;
385 $discount->description = $desc;
386 $discountid = $discount->create($user);
387 if ($discountid > 0) {
388 $result = $objecttmp->insert_discount($discountid);
391 setEventMessages($discount->error, $discount->errors,
'errors');
397 $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
400 if ($lines[$i]->date_debut_prevue) {
403 if ($lines[$i]->date_debut_reel) {
406 if ($lines[$i]->date_start) {
411 if ($lines[$i]->date_fin_prevue) {
412 $date_end = $lines[$i]->date_fin_prevue;
414 if ($lines[$i]->date_fin_reel) {
415 $date_end = $lines[$i]->date_fin_reel;
417 if ($lines[$i]->date_end) {
418 $date_end = $lines[$i]->date_end;
421 if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
426 if (method_exists($lines[$i],
'fetch_optionals')) {
427 $lines[$i]->fetch_optionals();
428 $array_options = $lines[$i]->array_options;
431 $objecttmp->context[
'createfromclone'] =
'createfromclone';
433 $rang = ($nbSendings > 1) ? -1 : $lines[$i]->rang;
435 if (!empty($createbills_onebythird)) {
436 $rang = $TFactThirdNbLines[$expd->socid];
439 $result = $objecttmp->addline(
441 $lines[$i]->subprice,
444 $lines[$i]->localtax1_tx,
445 $lines[$i]->localtax2_tx,
446 $lines[$i]->fk_product,
447 $lines[$i]->remise_percent,
451 (
int) $lines[$i]->info_bits,
452 $lines[$i]->fk_remise_except,
457 $lines[$i]->special_code,
458 $objecttmp->origin_type,
461 $lines[$i]->fk_fournprice,
464 !empty($array_options) ? $array_options :
'',
471 if (!empty($createbills_onebythird)) {
472 $TFactThirdNbLines[$expd->socid]++;
477 $errors[] = $objecttmp->error;
481 if ($result > 0 && $lines[$i]->product_type == 9) {
482 $fk_parent_line = $result;
489 if (!empty($createbills_onebythird) && empty($TFactThird[$expd->socid])) {
490 $TFactThird[$expd->socid] = $objecttmp;
492 $TFact[$objecttmp->id] = $objecttmp;
497 $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
500 if (!$error && $validate_invoices) {
501 $massaction = $action =
'builddoc';
503 foreach ($TAllFact as &$objecttmp) {
504 $result = $objecttmp->validate($user);
507 setEventMessages($objecttmp->error, $objecttmp->errors,
'errors');
511 $id = $objecttmp->id;
515 $upload_dir =
$conf->facture->dir_output;
516 $permissiontoadd = $user->hasRight(
'facture',
'creer');
521 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
525 $massaction = $action =
'confirm_createbills';
531 if ($nb_bills_created == 1) {
532 $texttoshow = $langs->trans(
'BillXCreated',
'{s1}');
533 $texttoshow = str_replace(
'{s1}',
'<a href="'.DOL_URL_ROOT.
'/compta/facture/card.php?id='.urlencode(strval($lastid)).
'">'.$lastref.
'</a>', $texttoshow);
534 setEventMessages($texttoshow,
null,
'mesgs');
536 setEventMessages($langs->trans(
'BillCreated', $nb_bills_created),
null,
'mesgs');
541 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
542 $param .=
'&contextpage='.urlencode($contextpage);
544 if ($limit > 0 && $limit !=
$conf->liste_limit) {
545 $param .=
'&limit='.((int) $limit);
548 $param .=
"&search_all=".urlencode($search_all);
550 if ($search_ref_exp) {
551 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
553 if ($search_ref_liv) {
554 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
556 if ($search_ref_customer) {
557 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
559 if ($search_user > 0) {
560 $param .=
'&search_user='.urlencode($search_user);
562 if ($search_sale > 0) {
563 $param .=
'&search_sale='.urlencode($search_sale);
565 if ($search_company) {
566 $param .=
"&search_company=".urlencode($search_company);
568 if ($search_shipping_method_ids) {
569 foreach ($search_shipping_method_ids as $value) {
570 $param .=
"&search_shipping_method_ids[]=".urlencode($value);
573 if ($search_tracking) {
574 $param .=
"&search_tracking=".urlencode($search_tracking);
577 $param .=
'&search_town='.urlencode($search_town);
580 $param .=
'&search_zip='.urlencode($search_zip);
582 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
583 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
585 if ($search_dateshipping_start) {
586 $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'));
588 if ($search_dateshipping_end) {
589 $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'));
591 if ($search_datedelivery_start) {
592 $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'));
594 if ($search_datedelivery_end) {
595 $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'));
597 if ($search_datereceipt_start) {
598 $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'));
600 if ($search_datereceipt_end) {
601 $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'));
603 if ($search_product_category !=
'') {
604 $param .=
'&search_product_category='.urlencode($search_product_category);
606 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
607 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
609 if ($search_status !=
'') {
610 $param .=
'&search_status='.urlencode($search_status);
612 if ($search_signed_status !=
'' && $search_signed_status >= 0) {
613 $param .=
'&search_signed_status='.urlencode($search_signed_status);
615 if ($optioncss !=
'') {
616 $param .=
'&optioncss='.urlencode($optioncss);
618 if ($search_billed !=
'') {
619 $param .=
'&billed='.urlencode($search_billed);
622 header(
"Location: ".$_SERVER[
'PHP_SELF'].
'?'.$param);
628 $_GET[
"origin"] =
GETPOST(
"origin",
'alpha');
630 if (!empty($errors)) {
631 setEventMessages(
null, $errors,
'errors');
633 setEventMessages(
"Error",
null,
'errors');
640 if ($massaction ==
'classifyclose' && $permissiontoadd) {
642 $selectids =
GETPOST(
'toselect',
'array:int');
643 foreach ($selectids as $selectid) {
646 $result =
$object->setClosed();
653 $massaction = $action =
'classifyclose';
656 setEventMessage($langs->trans(
"Close Done"));
657 header(
'Location: '.$_SERVER[
"PHP_SELF"]);
669$form =
new Form($db);
672$companystatic =
new Societe($db);
676$title = $langs->trans(
'Shipments');
677$help_url =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
680if ($search_all || $search_user > 0) {
681 $sql =
'SELECT DISTINCT';
683$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,";
686 $sql .=
" l.date_delivery as date_reception,";
688$sql .=
" s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
689$sql .=
" typent.code as typent_code,";
690$sql .=
" state.code_departement as state_code, state.nom as state_name,";
691$sql .=
" e.date_creation as date_creation, e.tms as date_modification,e.note_public, e.note_private,";
694if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
695 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
696 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
700$parameters = array();
701$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
702$sql .= $hookmanager->resPrint;
706$sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
707if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
708 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
711 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expeditiondet as ed ON e.rowid=ed.fk_expedition';
713$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
714$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
715$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
716$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
719 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
720 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
722$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON e.fk_user_author = u.rowid';
723if ($search_user > 0) {
724 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
726if ($search_user > 0) {
727 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
728 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
732$parameters = array();
733$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
734$sql .= $hookmanager->resPrint;
736$sql .=
" WHERE e.entity IN (".getEntity(
'expedition').
")";
739 $sql .=
" AND s.rowid = ".((int) $socid);
742 $sql .=
" AND e.fk_soc = ".((int) $socid);
744if ($search_status !=
'' && $search_status >= 0) {
745 $sql .=
" AND e.fk_statut = ".((int) $search_status);
747if ($search_signed_status !=
'' && $search_signed_status >= 0) {
748 $sql .=
" AND e.signed_status = ".((int) $search_signed_status);
750if ($search_ref_customer !=
'') {
753if ($search_billed !=
'' && $search_billed >= 0) {
754 $sql .=
" AND e.billed = ".((int) $search_billed);
765if ($search_country) {
766 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
768if (!empty($search_shipping_method_ids)) {
769 $sql .=
" AND e.fk_shipping_method IN (".$db->sanitize(implode(
',', $search_shipping_method_ids)).
')';
771if ($search_tracking) {
774if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
775 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
777if ($search_user > 0) {
779 $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);
781if ($search_company) {
784if ($search_ref_exp) {
787if ($search_dateshipping_start) {
788 $sql .=
" AND e.date_expedition >= '".$db->idate($search_dateshipping_start).
"'";
790if ($search_dateshipping_end) {
791 $sql .=
" AND e.date_expedition <= '".$db->idate($search_dateshipping_end).
"'";
793if ($search_datedelivery_start) {
794 $sql .=
" AND e.date_delivery >= '".$db->idate($search_datedelivery_start).
"'";
796if ($search_datedelivery_end) {
797 $sql .=
" AND e.date_delivery <= '".$db->idate($search_datedelivery_end).
"'";
800 if ($search_ref_liv) {
803 if ($search_datereceipt_start) {
804 $sql .=
" AND l.date_delivery >= '".$db->idate($search_datereceipt_start).
"'";
806 if ($search_datereceipt_end) {
807 $sql .=
" AND l.date_delivery <= '".$db->idate($search_datereceipt_end).
"'";
811 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
814if ($search_sale && $search_sale !=
'-1') {
815 if ($search_sale == -2) {
816 $sql .=
" AND ".getSalesRepresentativeSqlFilter(
'e.fk_soc', 0, 1);
817 } elseif ($search_sale > 0) {
818 $sql .=
" AND ".getSalesRepresentativeSqlFilter(
'e.fk_soc', (
int) $search_sale);
822$searchCategoryCustomerOperator =
GETPOSTINT(
'search_category_customer_operator');
823$searchCategoryCustomerList = array($search_categ_cus);
824if (!empty($searchCategoryCustomerList)) {
825 $searchCategoryCustomerSqlList = array();
826 $listofcategoryid =
'';
827 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
828 if (intval($searchCategoryCustomer) == -2) {
829 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
830 } elseif (intval($searchCategoryCustomer) > 0) {
831 if ($searchCategoryCustomerOperator == 0) {
832 $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).
")";
834 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
838 if ($listofcategoryid) {
839 $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).
"))";
841 if ($searchCategoryCustomerOperator == 1) {
842 if (!empty($searchCategoryCustomerSqlList)) {
843 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
846 if (!empty($searchCategoryCustomerSqlList)) {
847 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
852$searchCategoryProductOperator =
GETPOSTINT(
'search_category_product_operator');
853$searchCategoryProductList = array($search_product_category);
854if (!empty($searchCategoryProductList)) {
855 $searchCategoryProductSqlList = array();
856 $listofcategoryid =
'';
857 foreach ($searchCategoryProductList as $searchCategoryProduct) {
858 if (intval($searchCategoryProduct) == -2) {
859 $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)";
860 } elseif (intval($searchCategoryProduct) > 0) {
861 if ($searchCategoryProductOperator == 0) {
862 $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).
")";
864 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
868 if ($listofcategoryid) {
869 $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).
"))";
871 if ($searchCategoryProductOperator == 1) {
872 if (!empty($searchCategoryProductSqlList)) {
873 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
876 if (!empty($searchCategoryProductSqlList)) {
877 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
882include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
885$parameters = array();
886$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
887if (empty($reshook)) {
888 $sql .= $hookmanager->resPrint;
890 $sql = $hookmanager->resPrint;
894$parameters = array();
895$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
896if (empty($reshook)) {
897 $sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
899 $sql = $hookmanager->resPrint;
902$nbtotalofrecords =
'';
905 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
906 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
907 $resql = $db->query($sqlforcount);
909 $objforcount = $db->fetch_object($resql);
910 $nbtotalofrecords = $objforcount->nbtotalofrecords;
912 dol_print_error($db);
915 if (($page * $limit) > (
int) $nbtotalofrecords) {
923$sql .= $db->order($sortfield, $sortorder);
925 $sql .= $db->plimit($limit + 1, $offset);
929$resql = $db->query($sql);
931 dol_print_error($db);
935$num = $db->num_rows($resql);
938if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) {
939 $obj = $db->fetch_object($resql);
941 header(
"Location: ".DOL_URL_ROOT.
'/expedition/card.php?id='.
$id);
948 if (empty($search_company)) {
949 $search_company = $soc->name;
956llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-expedition page-list');
958$arrayofselected = is_array($toselect) ? $toselect : array();
962 $param .=
'&socid='.urlencode((
string) ($socid));
965 $param .=
'&mode='.urlencode($mode);
967if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
968 $param .=
'&contextpage='.urlencode($contextpage);
970if ($limit > 0 && $limit !=
$conf->liste_limit) {
971 $param .=
'&limit='.((int) $limit);
974 $param .=
"&search_all=".urlencode($search_all);
976if ($search_ref_exp) {
977 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
979if ($search_ref_liv) {
980 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
982if ($search_ref_customer) {
983 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
985if ($search_user > 0) {
986 $param .=
'&search_user='.urlencode((
string) ($search_user));
988if ($search_sale > 0) {
989 $param .=
'&search_sale='.urlencode((
string) ($search_sale));
991if ($search_company) {
992 $param .=
"&search_company=".urlencode($search_company);
994if ($search_shipping_method_ids) {
995 foreach ($search_shipping_method_ids as $value) {
996 $param .=
"&search_shipping_method_ids[]=".urlencode($value);
999if ($search_tracking) {
1000 $param .=
"&search_tracking=".urlencode($search_tracking);
1003 $param .=
'&search_town='.urlencode($search_town);
1006 $param .=
'&search_zip='.urlencode($search_zip);
1008if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
1009 $param .=
'&search_type_thirdparty='.urlencode((
string) ($search_type_thirdparty));
1011if ($search_dateshipping_start) {
1012 $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'));
1014if ($search_dateshipping_end) {
1015 $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'));
1017if ($search_datedelivery_start) {
1018 $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'));
1020if ($search_datedelivery_end) {
1021 $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'));
1023if ($search_datereceipt_start) {
1024 $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'));
1026if ($search_datereceipt_end) {
1027 $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'));
1029if ($search_product_category !=
'') {
1030 $param .=
'&search_product_category='.urlencode((
string) ($search_product_category));
1032if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
1033 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
1035if ($search_status !=
'') {
1036 $param .=
'&search_status='.urlencode($search_status);
1038if ($search_signed_status !=
'' && $search_signed_status >= 0) {
1039 $param .=
'&search_signed_status='.urlencode($search_signed_status);
1041if ($optioncss !=
'') {
1042 $param .=
'&optioncss='.urlencode($optioncss);
1045include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1048$parameters = array(
'param' => &$param);
1049$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1050$param .= $hookmanager->resPrint;
1052$arrayofmassactions = array(
1053 'generate_doc' => img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1054 'builddoc' => img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
1055 'presend' => img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
1057if ($user->hasRight(
'expedition',
'creer')) {
1058 $arrayofmassactions[
'classifyclose'] = img_picto(
'',
'stop-circle',
'class="pictofixedwidth"').$langs->trans(
"Close");
1060if ($user->hasRight(
'facture',
'creer')) {
1061 $arrayofmassactions[
'createbills'] = img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
"CreateInvoiceForThisCustomerFromSendings");
1063if (in_array($massaction, array(
'presend',
'createbills'))) {
1064 $arrayofmassactions = array();
1066$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1073$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'));
1074$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'));
1075$newcardbutton .=
dolGetButtonTitle($langs->trans(
'Statistics'),
'',
'fa fa-chart-bar imgforviewmode', DOL_URL_ROOT.
'/expedition/stats/index.php?mode=statistics'.preg_replace(
'/(&|\?)*(mode|groupby)=[^&]+/',
'', $param),
'', ($mode ==
'statistics' ? 2 : 1), array(
'morecss' =>
'reposition'));
1077$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSending'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/expedition/card.php?action=create',
'', $user->hasRight(
'expedition',
'creer'));
1080print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
1081if ($optioncss !=
'') {
1082 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1084print
'<input type="hidden" name="token" value="'.newToken().
'">';
1085print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1086print
'<input type="hidden" name="action" value="list">';
1087print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1088print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1089print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1090print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1093print_barre_liste($langs->trans(
'Shipments'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'dolly', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1095$topicmail =
"SendShippingRef";
1096$modelmail =
"shipping_send";
1098$trackid =
'shi'.$object->id;
1099include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1101if ($massaction ==
'createbills') {
1102 print
'<input type="hidden" name="massaction" value="confirm_createbills">';
1104 print
'<table class="noborder centpercent">';
1106 print
'<td class="titlefield">';
1107 print $langs->trans(
'DateInvoice');
1110 print $form->selectDate(
'',
'', 0, 0, 0,
'', 1, 1);
1115 print $langs->trans(
'CreateOneBillByThird');
1118 print $form->selectyesno(
'createbills_onebythird',
'', 1);
1123 print $langs->trans(
'ValidateInvoices');
1127 print $form->selectyesno(
'validate_invoices', 0, 1,
true);
1128 $langs->load(
"errors");
1129 print
' ('.$langs->trans(
"WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal").
')';
1131 print $form->selectyesno(
'validate_invoices', 0, 1);
1133 if (!empty(
$conf->workflow->enabled) &&
getDolGlobalString(
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER')) {
1134 print
' <span class="opacitymedium">'.$langs->trans(
"IfValidateInvoiceIsNoSendingStayUnbilled").
'</span>';
1136 print
' <span class="opacitymedium">'.$langs->trans(
"OptionToSetSendingBilledNotEnabled").
'</span>';
1143 print
'<div class="center">';
1144 print
'<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans(
'CreateInvoiceForThisCustomerFromSendings').
'"> ';
1145 print
'<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1151 foreach ($fieldstosearchall as $key => $val) {
1152 $fieldstosearchall[$key] = $langs->trans($val);
1154 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1160if ($user->hasRight(
'user',
'user',
'lire')) {
1161 $langs->load(
"commercial");
1162 $moreforfilter .=
'<div class="divsearchfield">';
1163 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1164 $moreforfilter .= img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1165 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
1166 $moreforfilter .=
'</div>';
1169if ($user->hasRight(
'user',
'user',
'lire')) {
1170 $moreforfilter .=
'<div class="divsearchfield">';
1171 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1172 $moreforfilter .= img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1173 $moreforfilter .= $form->select_dolusers($search_user,
'search_user', $tmptitle,
null, 0,
'',
'',
'0', 0, 0,
'', 0,
'',
'maxwidth200');
1174 $moreforfilter .=
'</div>';
1177if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
1178 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1179 $moreforfilter .=
'<div class="divsearchfield">';
1180 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1181 $moreforfilter .= img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1182 $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, (
int) $search_product_category,
'search_product_category', 1, $tmptitle);
1183 $moreforfilter .=
'</div>';
1185if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1186 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1187 $moreforfilter .=
'<div class="divsearchfield">';
1188 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
1189 $moreforfilter .= img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1190 $moreforfilter .= $formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle);
1191 $moreforfilter .=
'</div>';
1193$parameters = array();
1194$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1195if (empty($reshook)) {
1196 $moreforfilter .= $hookmanager->resPrint;
1198 $moreforfilter = $hookmanager->resPrint;
1201if (!empty($moreforfilter)) {
1202 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1203 print $moreforfilter;
1207$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1208$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
1209if ($massactionbutton) {
1210 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
1213print
'<div class="div-table-responsive">';
1214print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1218print
'<tr class="liste_titre_filter">';
1220if (
$conf->main_checkbox_left_column) {
1221 print
'<td class="liste_titre center maxwidthsearch">';
1222 $searchpicto = $form->showFilterButtons(
'left');
1227if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1228 print
'<td class="liste_titre">';
1229 print
'<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.
'">';
1233if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1234 print
'<td class="liste_titre">';
1235 print
'<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.
'">';
1239if (!empty($arrayfields[
's.nom'][
'checked'])) {
1240 print
'<td class="liste_titre left">';
1241 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag((
string) $search_company).
'">';
1245if (!empty($arrayfields[
's.town'][
'checked'])) {
1246 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
1249if (!empty($arrayfields[
's.zip'][
'checked'])) {
1250 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
1253if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1254 print
'<td class="liste_titre">';
1255 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1259if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1260 print
'<td class="liste_titre center">';
1261 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1265if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1266 print
'<td class="liste_titre maxwidthonsmartphone center">';
1267 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);
1271if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1272 print
'<td class="liste_titre maxwidthonsmartphone center">';
1277if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1278 print
'<td class="liste_titre center">';
1279 print
'<div class="nowrapfordate">';
1280 print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1,
'search_datedelivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1282 print
'<div class="nowrapfordate">';
1283 print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1,
'search_datedelivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1288if (!empty($arrayfields[
'e.date_expedition'][
'checked'])) {
1289 print
'<td class="liste_titre center">';
1290 print
'<div class="nowrapfordate">';
1291 print $form->selectDate($search_dateshipping_start ? $search_dateshipping_start : -1,
'search_dateshipping_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1293 print
'<div class="nowrapfordate">';
1294 print $form->selectDate($search_dateshipping_end ? $search_dateshipping_end : -1,
'search_dateshipping_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1298if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1300 print
'<td class="liste_titre center">';
1301 $shipment->fetch_delivery_methods();
1302 print $form->selectarray(
"search_shipping_method_ids[]", $shipment->meths, $search_shipping_method_ids, 1, 0, 0,
'multiple', 1, 0, 0,
'',
'maxwidth150');
1306if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1307 print
'<td class="liste_titre center">';
1308 print
'<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).
'">';
1311if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1313 print
'<td class="liste_titre">';
1314 print
'<input class="flat width75" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
1317if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1319 print
'<td class="liste_titre center">';
1320 print
'<div class="nowrapfordate">';
1321 print $form->selectDate($search_datereceipt_start ? $search_datereceipt_start : -1,
'search_datereceipt_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1323 print
'<div class="nowrapfordate">';
1324 print $form->selectDate($search_datereceipt_end ? $search_datereceipt_end : -1,
'search_datereceipt_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1329if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1330 print
'<td class="liste_titre">';
1334if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1335 print
'<td class="liste_titre">';
1339include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1342$parameters = array(
'arrayfields' => $arrayfields);
1343$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1344print $hookmanager->resPrint;
1346if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1347 print
'<td class="liste_titre">';
1351if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1352 print
'<td class="liste_titre">';
1356if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1357 print
'<td class="liste_titre right parentonrightofpage">';
1358 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');
1362if (!empty($arrayfields[
'e.signed_status'][
'checked'])) {
1363 print
'<td class="liste_titre center">';
1364 $list_signed_status =
$object->getSignedStatusLocalisedArray();
1365 print $form->selectarray(
'search_signed_status', $list_signed_status, $search_signed_status, 1, 0, 0,
'', 1, 0, 0,
'',
'search_status');
1369if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1370 print
'<td class="liste_titre maxwidthonsmartphone center">';
1371 print $form->selectyesno(
'search_billed', $search_billed, 1,
false, 1);
1375if (!
$conf->main_checkbox_left_column) {
1376 print
'<td class="liste_titre center maxwidthsearch">';
1377 $searchpicto = $form->showFilterButtons();
1383$totalarray = array();
1384$totalarray[
'nbfield'] = 0;
1388print
'<tr class="liste_titre">';
1390if (
$conf->main_checkbox_left_column) {
1391 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1392 $totalarray[
'nbfield']++;
1394if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1396 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
1397 $totalarray[
'nbfield']++;
1399if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1400 print_liste_field_titre($arrayfields[
'e.ref_customer'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_customer",
"", $param,
'', $sortfield, $sortorder);
1401 $totalarray[
'nbfield']++;
1403if (!empty($arrayfields[
's.nom'][
'checked'])) {
1404 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
1405 $totalarray[
'nbfield']++;
1407if (!empty($arrayfields[
's.town'][
'checked'])) {
1408 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1409 $totalarray[
'nbfield']++;
1411if (!empty($arrayfields[
's.zip'][
'checked'])) {
1412 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1413 $totalarray[
'nbfield']++;
1415if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1416 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1417 $totalarray[
'nbfield']++;
1419if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1420 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1421 $totalarray[
'nbfield']++;
1423if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1424 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1425 $totalarray[
'nbfield']++;
1427if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1428 print_liste_field_titre($arrayfields[
'e.weight'][
'label'], $_SERVER[
"PHP_SELF"],
"e.weight",
"", $param,
'', $sortfield, $sortorder,
'center ');
1429 $totalarray[
'nbfield']++;
1431if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1432 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1433 $totalarray[
'nbfield']++;
1435if (!empty($arrayfields[
'e.date_expedition'][
'checked'])) {
1436 print_liste_field_titre($arrayfields[
'e.date_expedition'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_expedition",
"", $param,
'', $sortfield, $sortorder,
'center ');
1437 $totalarray[
'nbfield']++;
1439if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1440 print_liste_field_titre($arrayfields[
'e.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder,
'center ');
1441 $totalarray[
'nbfield']++;
1443if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1444 print_liste_field_titre($arrayfields[
'e.tracking_number'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tracking_number",
"", $param,
'', $sortfield, $sortorder,
'center ');
1445 $totalarray[
'nbfield']++;
1447if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1448 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
1449 $totalarray[
'nbfield']++;
1451if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1452 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1453 $totalarray[
'nbfield']++;
1455if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1456 print_liste_field_titre($arrayfields[
'e.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"e.note_public",
"", $param,
'', $sortfield, $sortorder,
'right ');
1458if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1459 print_liste_field_titre($arrayfields[
'e.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"e.note_private",
"", $param,
'', $sortfield, $sortorder,
'right ');
1463include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1465$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'$totalarray' => &$totalarray);
1466$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1467print $hookmanager->resPrint;
1468if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1469 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1470 $totalarray[
'nbfield']++;
1472if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1473 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1474 $totalarray[
'nbfield']++;
1476if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1477 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
1478 $totalarray[
'nbfield']++;
1480if (!empty($arrayfields[
'e.signed_status'][
'checked'])) {
1481 print_liste_field_titre($arrayfields[
'e.signed_status'][
'label'], $_SERVER[
"PHP_SELF"],
"e.signed_status",
"", $param,
'', $sortfield, $sortorder,
'center ');
1482 $totalarray[
'nbfield']++;
1484if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1485 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
1486 $totalarray[
'nbfield']++;
1489if (!
$conf->main_checkbox_left_column) {
1490 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1491 $totalarray[
'nbfield']++;
1495$typenArray = $formcompany->typent_array(1);
1500$savnbfield = $totalarray[
'nbfield'];
1501$totalarray = array();
1502$totalarray[
'nbfield'] = 0;
1503$imaxinloop = ($limit ? min($num, $limit) : $num);
1504while ($i < $imaxinloop) {
1505 $obj = $db->fetch_object($resql);
1510 $companystatic->id = $obj->socid;
1511 $companystatic->ref = $obj->name;
1512 $companystatic->name = $obj->name;
1517 if ($mode ==
'kanban') {
1519 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1520 print
'<div class="box-flex-container kanban">';
1522 $object->date_delivery = $obj->delivery_date;
1527 if ($massactionbutton || $massaction) {
1529 if (in_array(
$object->id, $arrayofselected)) {
1533 print
$object->getKanbanView(
'', array(
'thirdparty' => $companystatic->getNomUrl(1),
'selected' => $selected));
1534 if ($i == min($num, $limit) - 1) {
1539 print
'<tr class="oddeven row-with-select">';
1542 if (
$conf->main_checkbox_left_column) {
1543 print
'<td class="nowrap center">';
1544 if ($massactionbutton || $massaction) {
1546 if (in_array($obj->rowid, $arrayofselected)) {
1549 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1554 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1555 print
'<td class="nowraponall">';
1556 print
$object->getNomUrl(1,
'', 0, 0, 0, -1, 1);
1559 print $formfile->getDocumentsLink(
'expedition', $filename, $filedir);
1562 $totalarray[
'nbfield']++;
1567 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1568 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->ref_customer).
'">';
1572 $totalarray[
'nbfield']++;
1577 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1578 print
'<td class="tdoverflowmax150">';
1579 print $companystatic->getNomUrl(1);
1582 $totalarray[
'nbfield']++;
1586 if (!empty($arrayfields[
's.town'][
'checked'])) {
1587 print
'<td class="nocellnopadd">';
1591 $totalarray[
'nbfield']++;
1595 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1596 print
'<td class="nocellnopadd center">';
1600 $totalarray[
'nbfield']++;
1604 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1605 print
'<td class="center">'.$obj->state_name.
"</td>\n";
1607 $totalarray[
'nbfield']++;
1611 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1612 print
'<td class="center">';
1613 $tmparray =
getCountry($obj->fk_pays,
'all');
1617 $totalarray[
'nbfield']++;
1621 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1622 print
'<td class="center">';
1623 if (isset($typenArray[$obj->typent_code])) {
1624 print $typenArray[$obj->typent_code];
1628 $totalarray[
'nbfield']++;
1632 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1633 print
'<td class="center">';
1634 if (empty(
$object->trueWeight)) {
1635 $tmparray =
$object->getTotalWeightVolume();
1637 print $form->textwithpicto(
'', $langs->trans(
'EstimatedWeight'), 1);
1640 print (
$object->trueWeight &&
$object->weight_units !=
'') ?
' '.measuringUnitString(0,
"weight",
$object->weight_units) :
'';
1644 $totalarray[
'nbfield']++;
1648 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1649 print
'<td class="center nowraponall">';
1650 print
dol_print_date($db->jdate($obj->delivery_date),
"dayhour");
1653 $totalarray[
'nbfield']++;
1657 if (!empty($arrayfields[
'e.date_expedition'][
'checked'])) {
1658 print
'<td class="center nowraponall">';
1659 print
dol_print_date($db->jdate($obj->date_expedition),
"dayhour");
1662 $totalarray[
'nbfield']++;
1665 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1667 $code = $langs->getLabelFromKey($db, (
string)
$object->shipping_method_id,
'c_shipment_mode',
'rowid',
'code');
1668 print
'<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"SendingMethod".strtoupper($code))).
'">';
1669 if (
$object->shipping_method_id > 0) {
1670 print $langs->trans(
"SendingMethod".strtoupper($code));
1674 $totalarray[
'nbfield']++;
1678 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1679 $object->getUrlTrackingStatus($obj->tracking_number);
1680 print
'<td class="center" title="'.dol_escape_htmltag(
$object->tracking_url).
'">'.
$object->tracking_url.
"</td>\n";
1682 $totalarray[
'nbfield']++;
1686 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1689 if (array_key_exists(
'delivery',
$object->linkedObjects) && count(
$object->linkedObjects[
'delivery']) > 0) {
1690 $receiving = reset(
$object->linkedObjects[
'delivery']);
1693 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1695 print
'<td class="nowraponall">';
1696 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
1700 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1702 print
'<td class="center nowraponall">';
1708 if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1709 print
'<td class="sensiblehtmlcontent center">';
1710 print
'<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(
dolGetFirstLineOfText($obj->note_public, 5)).
'</div>';
1713 $totalarray[
'nbfield']++;
1717 if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1718 print
'<td class="sensiblehtmlcontent center">';
1719 print
'<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(
dolGetFirstLineOfText($obj->note_private, 5)).
'</div>';
1722 $totalarray[
'nbfield']++;
1726 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1728 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1729 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1730 print $hookmanager->resPrint;
1732 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1733 print
'<td class="center nowraponall">';
1734 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuserrel');
1737 $totalarray[
'nbfield']++;
1741 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1742 print
'<td class="center nowraponall">';
1743 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
1746 $totalarray[
'nbfield']++;
1750 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1751 print
'<td class="right nowrap">'.$object->getLibStatut(5).
'</td>';
1753 $totalarray[
'nbfield']++;
1757 if (!empty($arrayfields[
'e.signed_status'][
'checked'])) {
1758 print
'<td class="center">'.$object->getLibSignedStatus(5).
'</td>';
1760 $totalarray[
'nbfield']++;
1764 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1765 print
'<td class="center">'.yn($obj->billed).
'</td>';
1767 $totalarray[
'nbfield']++;
1772 if (!
$conf->main_checkbox_left_column) {
1773 print
'<td class="nowrap center">';
1774 if ($massactionbutton || $massaction) {
1776 if (in_array($obj->rowid, $arrayofselected)) {
1779 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1784 $totalarray[
'nbfield']++;
1795 foreach ($arrayfields as $key => $val) {
1796 if (!empty($val[
'checked'])) {
1800 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1805$parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => $totalarray,
'sql' => $sql);
1806$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1807print $hookmanager->resPrint;
1813$hidegeneratedfilelistifempty = 1;
1814if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1815 $hidegeneratedfilelistifempty = 0;
1819$urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1820$urlsource .= str_replace(
'&',
'&', $param);
1822$filedir = $diroutputmassaction;
1823$genallowed = $user->hasRight(
'expedition',
'lire');
1824$delallowed = $user->hasRight(
'expedition',
'creer');
1827print $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.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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.
$date_start
Variables from include:
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...
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
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...
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return 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.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput='no', $use_short_label=0)
Output a dimension with best unit.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.
shippingSetStandaloneLineSellPrice($line, $buyer)
Complete a line of a standalone shipment (SHIPMENT_STANDALONE, no source order) before it is copied i...