29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
39 $langs->loadLangs(array(
"sendings",
"deliveries",
'companies',
'bills',
'products'));
41 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'shipmentlist';
43 $socid =
GETPOST(
'socid',
'int');
45 $action =
GETPOST(
'action',
'alpha');
46 $massaction =
GETPOST(
'massaction',
'alpha');
47 $show_files =
GETPOST(
'show_files',
'int');
48 $toselect =
GETPOST(
'toselect',
'array');
51 $expeditionid =
GETPOST(
'id',
'int');
53 $socid = $user->socid;
57 $search_ref_exp =
GETPOST(
"search_ref_exp",
'alpha');
58 $search_ref_liv =
GETPOST(
'search_ref_liv',
'alpha');
59 $search_ref_customer =
GETPOST(
'search_ref_customer',
'alpha');
60 $search_company =
GETPOST(
"search_company",
'alpha');
61 $search_shipping_method_id =
GETPOST(
'search_shipping_method_id');
62 $search_tracking =
GETPOST(
"search_tracking",
'alpha');
63 $search_town =
GETPOST(
'search_town',
'alpha');
64 $search_zip =
GETPOST(
'search_zip',
'alpha');
65 $search_state =
GETPOST(
"search_state");
66 $search_country =
GETPOST(
"search_country",
'int');
67 $search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'int');
68 $search_billed =
GETPOST(
"search_billed",
'int');
69 $search_datedelivery_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_datedelivery_startmonth',
'int'),
GETPOST(
'search_datedelivery_startday',
'int'),
GETPOST(
'search_datedelivery_startyear',
'int'));
70 $search_datedelivery_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_datedelivery_endmonth',
'int'),
GETPOST(
'search_datedelivery_endday',
'int'),
GETPOST(
'search_datedelivery_endyear',
'int'));
71 $search_datereceipt_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_datereceipt_startmonth',
'int'),
GETPOST(
'search_datereceipt_startday',
'int'),
GETPOST(
'search_datereceipt_startyear',
'int'));
72 $search_datereceipt_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_datereceipt_endmonth',
'int'),
GETPOST(
'search_datereceipt_endday',
'int'),
GETPOST(
'search_datereceipt_endyear',
'int'));
73 $sall = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
74 $socid =
GETPOST(
'socid',
'int');
75 $search_user =
GETPOST(
'search_user',
'int');
76 $search_sale =
GETPOST(
'search_sale',
'int');
77 $search_categ_cus =
GETPOST(
"search_categ_cus",
'int');
78 $search_product_category =
GETPOST(
'search_product_category',
'int');
79 $optioncss =
GETPOST(
'optioncss',
'alpha');
81 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
82 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
83 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
91 if (empty($page) || $page == -1 || (empty($toselect) && $massaction ===
'0')) {
94 $offset = $limit * $page;
95 $pageprev = $page - 1;
96 $pagenext = $page + 1;
98 $search_status =
GETPOST(
'search_status',
'intcomma');
100 $diroutputmassaction = $conf->expedition->dir_output.
'/sending/temp/massgeneration/'.$user->id;
106 $hookmanager->initHooks(array(
'shipmentlist'));
110 $extrafields->fetch_name_optionals_label($object->table_element);
112 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
115 $fieldstosearchall = array(
117 's.nom'=>
"ThirdParty",
118 'e.note_public'=>
'NotePublic',
120 'e.tracking_number'=>
"TrackingNumber",
122 if (empty($user->socid)) {
123 $fieldstosearchall[
"e.note_private"] =
"NotePrivate";
126 $checkedtypetiers = 0;
127 $arrayfields = array(
128 'e.ref'=>array(
'label'=>$langs->trans(
"Ref"),
'checked'=>1,
'position'=>1),
129 'e.ref_customer'=>array(
'label'=>$langs->trans(
"RefCustomer"),
'checked'=>1,
'position'=>2),
130 's.nom'=>array(
'label'=>$langs->trans(
"ThirdParty"),
'checked'=>1,
'position'=>3),
131 's.town'=>array(
'label'=>$langs->trans(
"Town"),
'checked'=>1,
'position'=>4),
132 's.zip'=>array(
'label'=>$langs->trans(
"Zip"),
'checked'=>1,
'position'=>5),
133 'state.nom'=>array(
'label'=>$langs->trans(
"StateShort"),
'checked'=>0,
'position'=>6),
134 'country.code_iso'=>array(
'label'=>$langs->trans(
"Country"),
'checked'=>0,
'position'=>7),
135 'typent.code'=>array(
'label'=>$langs->trans(
"ThirdPartyType"),
'checked'=>$checkedtypetiers,
'position'=>8),
136 'e.date_delivery'=>array(
'label'=>$langs->trans(
"DateDeliveryPlanned"),
'checked'=>1,
'position'=>9),
137 'e.fk_shipping_method'=>array(
'label'=>$langs->trans(
'SendingMethod'),
'checked'=>1,
'position'=>10),
138 'e.tracking_number'=>array(
'label'=>$langs->trans(
"TrackingNumber"),
'checked'=>1,
'position'=>11),
139 'e.weight'=>array(
'label'=>$langs->trans(
"Weight"),
'checked'=>0,
'position'=>12),
140 'e.datec'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0,
'position'=>500),
141 'e.tms'=>array(
'label'=>$langs->trans(
"DateModificationShort"),
'checked'=>0,
'position'=>500),
142 'e.fk_statut'=>array(
'label'=>$langs->trans(
"Status"),
'checked'=>1,
'position'=>1000),
143 'l.ref'=>array(
'label'=>$langs->trans(
"DeliveryRef"),
'checked'=>1,
'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)),
144 'l.date_delivery'=>array(
'label'=>$langs->trans(
"DateReceived"),
'checked'=>1,
'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)),
145 'e.billed'=>array(
'label'=>$langs->trans(
"Billed"),
'checked'=>1,
'position'=>1000,
'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)))
149 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
160 if (
GETPOST(
'cancel',
'alpha')) {
161 $action =
'list'; $massaction =
'';
163 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
167 $parameters = array(
'socid'=>$socid);
168 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
173 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
176 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
180 $search_product_category =
'';
181 $search_ref_exp =
'';
182 $search_ref_liv =
'';
183 $search_ref_customer =
'';
184 $search_company =
'';
189 $search_country =
'';
190 $search_tracking =
'';
191 $search_shipping_method_id =
'';
192 $search_type_thirdparty =
'';
194 $search_datedelivery_start =
'';
195 $search_datedelivery_end =
'';
196 $search_datereceipt_start =
'';
197 $search_datereceipt_end =
'';
200 $search_array_options = array();
201 $search_categ_cus = 0;
204 if (empty($reshook)) {
205 $objectclass =
'Expedition';
206 $objectlabel =
'Sendings';
207 $permissiontoread = $user->rights->expedition->lire;
208 $permissiontoadd = $user->rights->expedition->creer;
209 $permissiontodelete = $user->rights->expedition->supprimer;
210 $uploaddir = $conf->expedition->dir_output.
'/sending';
211 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
215 if ($massaction ==
'classifyclose') {
217 $selectids =
GETPOST(
'toselect',
'array');
218 foreach ($selectids as $selectid) {
220 $object->fetch($selectid);
221 $result = $object->setClosed();
224 $massaction = $action =
'classifyclose';
235 header(
'Location: '.$_SERVER[
"PHP_SELF"]);
252 $companystatic =
new Societe($db);
256 $helpurl =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
257 llxHeader(
'', $langs->trans(
'ListOfSendings'), $helpurl);
260 if ($sall || $search_product_category > 0 || $search_user > 0) {
261 $sql =
'SELECT DISTINCT';
263 $sql .=
" e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, e.fk_statut, e.billed, e.tracking_number, e.fk_shipping_method,";
264 $sql .=
" l.date_delivery as date_reception,";
265 $sql .=
" s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
266 $sql .=
" typent.code as typent_code,";
267 $sql .=
" state.code_departement as state_code, state.nom as state_name,";
268 $sql .=
" e.date_creation as date_creation, e.tms as date_update,";
270 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
271 $sql .=
", cc.fk_categorie, cc.fk_soc";
274 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
275 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
276 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
280 $parameters = array();
281 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
282 $sql .= $hookmanager->resPrint;
283 $sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
284 if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
285 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
287 if ($sall || $search_product_category > 0) {
288 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expeditiondet as ed ON e.rowid=ed.fk_expedition';
289 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'commandedet as pd ON pd.rowid=ed.fk_origin_line';
291 if ($search_product_category > 0) {
292 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'categorie_product as cp ON cp.fk_product=pd.fk_product';
294 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
295 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
296 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"categorie_societe as cc ON s.rowid = cc.fk_soc";
298 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
299 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
300 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
301 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
302 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
303 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON e.fk_user_author = u.rowid';
304 if ($search_user > 0) {
305 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
308 if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) {
309 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
311 if ($search_user > 0) {
312 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
313 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
317 $parameters = array();
318 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
319 $sql .= $hookmanager->resPrint;
321 $sql .=
" WHERE e.entity IN (".getEntity(
'expedition').
")";
322 if ($search_product_category > 0) {
323 $sql .=
" AND cp.fk_categorie = ".((int) $search_product_category);
326 $sql .=
" AND s.rowid = ".((int) $socid);
328 if (empty($user->rights->societe->client->voir) && !$socid) {
329 $sql .=
" AND e.fk_soc = sc.fk_soc";
330 $sql .=
" AND sc.fk_user = ".((int) $user->id);
333 $sql .=
" AND e.fk_soc = ".((int) $socid);
335 if ($search_status <>
'' && $search_status >= 0) {
336 $sql .=
" AND e.fk_statut = ".((int) $search_status);
338 if ($search_ref_customer !=
'') {
341 if ($search_billed !=
'' && $search_billed >= 0) {
342 $sql .=
' AND e.billed = '.((int) $search_billed);
353 if ($search_country) {
354 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
356 if ($search_shipping_method_id > 0) {
357 $sql .=
" AND e.fk_shipping_method = ".((int) $search_shipping_method_id);
359 if ($search_tracking) {
362 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
363 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
365 if ($search_sale > 0) {
366 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
368 if ($search_user > 0) {
370 $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);
372 if ($search_ref_exp) {
375 if ($search_ref_liv) {
378 if ($search_company) {
381 if ($search_datedelivery_start) {
382 $sql .=
" AND e.date_delivery >= '".$db->idate($search_datedelivery_start).
"'";
384 if ($search_datedelivery_end) {
385 $sql .=
" AND e.date_delivery <= '".$db->idate($search_datedelivery_end).
"'";
387 if ($search_datereceipt_start) {
388 $sql .=
" AND l.date_delivery >= '".$db->idate($search_datereceipt_start).
"'";
390 if ($search_datereceipt_end) {
391 $sql .=
" AND l.date_delivery <= '".$db->idate($search_datereceipt_end).
"'";
396 if ($search_categ_cus > 0) {
397 $sql .=
" AND cc.fk_categorie = ".((int) $search_categ_cus);
399 if ($search_categ_cus == -2) {
400 $sql .=
" AND cc.fk_categorie IS NULL";
404 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
407 $parameters = array();
408 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
409 $sql .= $hookmanager->resPrint;
412 $parameters = array();
413 $reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object);
414 $sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
416 $sql .= $db->order($sortfield, $sortorder);
418 $nbtotalofrecords =
'';
419 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
420 $result = $db->query($sql);
421 $nbtotalofrecords = $db->num_rows($result);
422 if (($page * $limit) > $nbtotalofrecords) {
428 $sql .= $db->plimit($limit + 1, $offset);
431 $resql = $db->query($sql);
437 $num = $db->num_rows(
$resql);
439 $arrayofselected = is_array($toselect) ? $toselect : array();
444 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
445 $param .=
'&contextpage='.urlencode($contextpage);
447 if ($limit > 0 && $limit != $conf->liste_limit) {
448 $param .=
'&limit='.urlencode($limit);
451 $param .=
"&sall=".urlencode($sall);
453 if ($search_ref_exp) {
454 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
456 if ($search_ref_liv) {
457 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
459 if ($search_ref_customer) {
460 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
462 if ($search_user > 0) {
463 $param .=
'&search_user='.urlencode($search_user);
465 if ($search_sale > 0) {
466 $param .=
'&search_sale='.urlencode($search_sale);
468 if ($search_company) {
469 $param .=
"&search_company=".urlencode($search_company);
471 if ($search_shipping_method_id) {
472 $param .=
"&search_shipping_method_id=".urlencode($search_shipping_method_id);
474 if ($search_tracking) {
475 $param .=
"&search_tracking=".urlencode($search_tracking);
478 $param .=
'&search_town='.urlencode($search_town);
481 $param .=
'&search_zip='.urlencode($search_zip);
483 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
484 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
486 if ($search_datedelivery_start) {
487 $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'));
489 if ($search_datedelivery_end) {
490 $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'));
492 if ($search_datereceipt_start) {
493 $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'));
495 if ($search_datereceipt_end) {
496 $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'));
498 if ($search_product_category !=
'') {
499 $param .=
'&search_product_category='.urlencode($search_product_category);
501 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
502 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
504 if ($search_status !=
'') {
505 $param .=
'&search_status='.urlencode($search_status);
507 if ($optioncss !=
'') {
508 $param .=
'&optioncss='.urlencode($optioncss);
511 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
514 $parameters = array();
515 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
516 $param .= $hookmanager->resPrint;
518 $arrayofmassactions = array(
519 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
520 'classifyclose'=>$langs->trans(
"Close"),
521 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
523 if (in_array($massaction, array(
'presend'))) {
524 $arrayofmassactions = array();
526 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
532 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewSending'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/expedition/card.php?action=create2',
'', $user->rights->expedition->creer);
535 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
536 if ($optioncss !=
'') {
537 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
539 print
'<input type="hidden" name="token" value="'.newToken().
'">';
540 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
541 print
'<input type="hidden" name="action" value="list">';
542 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
543 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
545 print_barre_liste($langs->trans(
'ListOfSendings'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'dolly', 0, $newcardbutton,
'', $limit, 0, 0, 1);
547 $topicmail =
"SendShippingRef";
548 $modelmail =
"shipping_send";
550 $trackid =
'shi'.$object->id;
551 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
554 foreach ($fieldstosearchall as $key => $val) {
555 $fieldstosearchall[$key] = $langs->trans($val);
557 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $sall).join(
', ', $fieldstosearchall).
'</div>';
563 if ($user->rights->user->user->lire) {
564 $langs->load(
"commercial");
565 $moreforfilter .=
'<div class="divsearchfield">';
566 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
567 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
568 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
569 $moreforfilter .=
'</div>';
572 if ($user->rights->user->user->lire) {
573 $moreforfilter .=
'<div class="divsearchfield">';
574 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
575 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
576 $moreforfilter .=
$form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
577 $moreforfilter .=
'</div>';
580 if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
581 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
582 $moreforfilter .=
'<div class="divsearchfield">';
583 $tmptitle = $langs->trans(
'IncludingProductWithTag');
584 $moreforfilter .=
img_picto($tmptitle,
'category');
587 $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category,
'parent', 1, $tmptitle);
589 $moreforfilter .=
'</div>';
591 if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
592 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
593 $moreforfilter .=
'<div class="divsearchfield">';
594 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
595 $moreforfilter .=
img_picto($tmptitle,
'category');
596 $moreforfilter .= $formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle);
597 $moreforfilter .=
'</div>';
599 $parameters = array();
600 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
601 if (empty($reshook)) {
602 $moreforfilter .= $hookmanager->resPrint;
604 $moreforfilter = $hookmanager->resPrint;
607 if (!empty($moreforfilter)) {
608 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
609 print $moreforfilter;
613 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
614 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
615 if ($massactionbutton) {
616 $selectedfields .=
$form->showCheckAddButtons(
'checkforselect', 1);
619 print
'<div class="div-table-responsive">';
620 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
623 print
'<tr class="liste_titre_filter">';
625 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
626 print
'<td class="liste_titre">';
627 print
'<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.
'">';
631 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
632 print
'<td class="liste_titre">';
633 print
'<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.
'">';
637 if (!empty($arrayfields[
's.nom'][
'checked'])) {
638 print
'<td class="liste_titre left">';
639 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
643 if (!empty($arrayfields[
's.town'][
'checked'])) {
644 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
647 if (!empty($arrayfields[
's.zip'][
'checked'])) {
648 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
651 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
652 print
'<td class="liste_titre">';
653 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
657 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
658 print
'<td class="liste_titre center">';
659 print
$form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
663 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
664 print
'<td class="liste_titre maxwidthonsmartphone center">';
665 print
$form->selectarray(
"search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0,
'', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT),
'', 1);
669 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
670 print
'<td class="liste_titre maxwidthonsmartphone center">';
675 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
676 print
'<td class="liste_titre center">';
677 print
'<div class="nowrap">';
678 print
$form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1,
'search_datedelivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
680 print
'<div class="nowrap">';
681 print
$form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1,
'search_datedelivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
685 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
687 print
'<td class="liste_titre center">';
688 $shipment->fetch_delivery_methods();
689 print
$form->selectarray(
"search_shipping_method_id", $shipment->meths, $search_shipping_method_id, 1, 0, 0,
"", 1, 0, 0,
'',
'maxwidth150');
693 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
694 print
'<td class="liste_titre center">';
695 print
'<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).
'">';
698 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
700 print
'<td class="liste_titre">';
701 print
'<input class="flat" size="10" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
704 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
706 print
'<td class="liste_titre center">';
707 print
'<div class="nowrap">';
708 print
$form->selectDate($search_datereceipt_start ? $search_datereceipt_start : -1,
'search_datereceipt_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
710 print
'<div class="nowrap">';
711 print
$form->selectDate($search_datereceipt_end ? $search_datereceipt_end : -1,
'search_datereceipt_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
716 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
719 $parameters = array(
'arrayfields'=>$arrayfields);
720 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
721 print $hookmanager->resPrint;
723 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
724 print
'<td class="liste_titre">';
728 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
729 print
'<td class="liste_titre">';
733 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
734 print
'<td class="liste_titre maxwidthonsmartphone right">';
735 print
$form->selectarray(
'search_status', array(
'0'=>$langs->trans(
'StatusSendingDraftShort'),
'1'=>$langs->trans(
'StatusSendingValidatedShort'),
'2'=>$langs->trans(
'StatusSendingProcessedShort')), $search_status, 1);
739 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
740 print
'<td class="liste_titre maxwidthonsmartphone center">';
741 print
$form->selectyesno(
'search_billed', $search_billed, 1, 0, 1);
745 print
'<td class="liste_titre middle">';
746 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
751 print
'<tr class="liste_titre">';
752 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
753 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
755 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
756 print_liste_field_titre($arrayfields[
'e.ref_customer'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_customer",
"", $param,
'', $sortfield, $sortorder);
758 if (!empty($arrayfields[
's.nom'][
'checked'])) {
759 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
761 if (!empty($arrayfields[
's.town'][
'checked'])) {
762 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
764 if (!empty($arrayfields[
's.zip'][
'checked'])) {
765 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
767 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
768 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
770 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
771 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
773 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
774 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
776 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
777 print_liste_field_titre($arrayfields[
'e.weight'][
'label'], $_SERVER[
"PHP_SELF"],
"e.weight",
"", $param,
'', $sortfield, $sortorder,
'center ');
779 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
780 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
782 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
783 print_liste_field_titre($arrayfields[
'e.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder,
'center ');
785 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
786 print_liste_field_titre($arrayfields[
'e.tracking_number'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tracking_number",
"", $param,
'', $sortfield, $sortorder,
'center ');
788 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
789 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
791 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
792 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
795 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
797 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
798 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
799 print $hookmanager->resPrint;
800 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
801 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
803 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
804 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
806 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
807 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
809 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
810 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
812 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
815 $typenArray = $formcompany->typent_array(1);
817 $totalarray = array();
818 $totalarray[
'nbfield'] = 0;
819 while ($i < min($num, $limit)) {
820 $obj = $db->fetch_object(
$resql);
822 $shipment->id = $obj->rowid;
823 $shipment->ref = $obj->ref;
824 $shipment->shipping_method_id=$obj->fk_shipping_method;
826 $companystatic->id = $obj->socid;
827 $companystatic->ref = $obj->name;
828 $companystatic->name = $obj->name;
831 $object->fetch($obj->rowid);
833 print
'<tr class="oddeven">';
836 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
837 print
'<td class="nowraponall">';
838 print $shipment->getNomUrl(1);
841 $totalarray[
'nbfield']++;
846 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
848 print $obj->ref_customer;
851 $totalarray[
'nbfield']++;
856 if (!empty($arrayfields[
's.nom'][
'checked'])) {
857 print
'<td class="tdoverflowmax150">';
858 print $companystatic->getNomUrl(1);
861 $totalarray[
'nbfield']++;
865 if (!empty($arrayfields[
's.town'][
'checked'])) {
866 print
'<td class="nocellnopadd">';
870 $totalarray[
'nbfield']++;
874 if (!empty($arrayfields[
's.zip'][
'checked'])) {
875 print
'<td class="nocellnopadd center">';
879 $totalarray[
'nbfield']++;
883 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
884 print
'<td class="center">'.$obj->state_name.
"</td>\n";
886 $totalarray[
'nbfield']++;
890 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
891 print
'<td class="center">';
893 print $tmparray[
'label'];
896 $totalarray[
'nbfield']++;
900 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
901 print
'<td class="center">';
902 if (isset($typenArray[$obj->typent_code])) {
903 print $typenArray[$obj->typent_code];
907 $totalarray[
'nbfield']++;
911 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
912 print
'<td class="center">';
913 if (empty($object->trueWeight)) {
914 $tmparray = $object->getTotalWeightVolume();
915 print
showDimensionInBestUnit($tmparray[
'weight'], 0,
"weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT :
'no');
916 print
$form->textwithpicto(
'', $langs->trans(
'EstimatedWeight'), 1);
918 print $object->trueWeight;
919 print ($object->trueWeight && $object->weight_units !=
'') ?
' '.measuringUnitString(0,
"weight", $object->weight_units) :
'';
923 $totalarray[
'nbfield']++;
927 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
928 print
'<td class="center">';
932 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
934 $code=$langs->getLabelFromKey($db, $shipment->shipping_method_id,
'c_shipment_mode',
'rowid',
'code');
935 print
'<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"SendingMethod".strtoupper($code))).
'">';
936 if ($shipment->shipping_method_id > 0) print $langs->trans(
"SendingMethod".strtoupper($code));
940 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
941 $shipment->getUrlTrackingStatus($obj->tracking_number);
942 print
'<td class="center">'.$shipment->tracking_url.
"</td>\n";
945 $totalarray[
'nbfield']++;
949 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
950 $shipment->fetchObjectLinked($shipment->id, $shipment->element);
952 if (is_array($shipment->linkedObjects[
'delivery']) && count($shipment->linkedObjects[
'delivery']) > 0) {
953 $receiving = reset($shipment->linkedObjects[
'delivery']);
956 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
959 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
963 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
965 print
'<td class="center">';
972 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
974 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
975 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
976 print $hookmanager->resPrint;
978 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
979 print
'<td class="center nowrap">';
980 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
983 $totalarray[
'nbfield']++;
987 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
988 print
'<td class="center nowrap">';
989 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
992 $totalarray[
'nbfield']++;
996 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
997 print
'<td class="right nowrap">'.$shipment->LibStatut($obj->fk_statut, 5).
'</td>';
999 $totalarray[
'nbfield']++;
1003 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1004 print
'<td class="center">'.yn($obj->billed).
'</td>';
1006 $totalarray[
'nbfield']++;
1011 print
'<td class="nowrap" align="center">';
1012 if ($massactionbutton || $massaction) {
1014 if (in_array($obj->rowid, $arrayofselected)) {
1017 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1021 $totalarray[
'nbfield']++;
1032 foreach ($arrayfields as $key => $val) {
1033 if (!empty($val[
'checked'])) {
1037 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
1042 $parameters = array(
'arrayfields'=>$arrayfields,
'totalarray' => $totalarray,
'sql'=>$sql);
1043 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
1044 print $hookmanager->resPrint;
1050 $hidegeneratedfilelistifempty = 1;
1051 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1052 $hidegeneratedfilelistifempty = 0;
1056 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1057 $urlsource .= str_replace(
'&',
'&', $param);
1059 $filedir = $diroutputmassaction;
1060 $genallowed = $user->rights->expedition->lire;
1061 $delallowed = $user->rights->expedition->creer;
1064 print $formfile->showdocuments(
'massfilesarea_sendings',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'', null, $hidegeneratedfilelistifempty);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
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.
dol_now($mode= 'auto')
Return date for now.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
setEventMessage($mesgs, $style= 'mesgs')
Set event message in dol_events session object.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput= 'no', $use_short_label=0)
Output a dimension with best unit.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form...
Class to manage third parties objects (customers, suppliers, prospects...)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
Class to manage shipments.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
restrictedArea($user, $features, $objectid=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.
if(isModEnabled('facture')&&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur')&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)&&$user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice')&&$user->rights->supplier_invoice->lire)) if(isModEnabled('don')&&!empty($user->rights->don->lire)) if(isModEnabled('tax')&&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture')&&isModEnabled('commande')&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dol_sort_array(&$array, $index, $order= 'asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getCountry($searchkey, $withcode= '', $dbtouse=0, $outputlangs= '', $entconv=1, $searchlabel= '')
Return country label, code or id from an id, code or label.