28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/reception/class/reception.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.product.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38 $langs->loadLangs(array(
"sendings",
"receptions",
"deliveries",
'companies',
'bills',
'orders'));
40 $socid =
GETPOST(
'socid',
'int');
41 $massaction =
GETPOST(
'massaction',
'alpha');
42 $toselect =
GETPOST(
'toselect',
'array');
44 $diroutputmassaction = $conf->reception->dir_output.
'/temp/massgeneration/'.$user->id;
46 $search_ref_rcp =
GETPOST(
"search_ref_rcp");
47 $search_ref_liv =
GETPOST(
'search_ref_liv');
48 $search_ref_supplier =
GETPOST(
'search_ref_supplier');
49 $search_company =
GETPOST(
"search_company");
50 $search_town =
GETPOST(
'search_town',
'alpha');
51 $search_zip =
GETPOST(
'search_zip',
'alpha');
52 $search_state =
GETPOST(
"search_state");
53 $search_country =
GETPOST(
"search_country",
'int');
54 $search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'int');
55 $search_date_delivery_startday =
GETPOST(
'search_date_delivery_startday',
'int');
56 $search_date_delivery_startmonth =
GETPOST(
'search_date_delivery_startmonth',
'int');
57 $search_date_delivery_startyear =
GETPOST(
'search_date_delivery_startyear',
'int');
58 $search_date_delivery_endday =
GETPOST(
'search_date_delivery_endday',
'int');
59 $search_date_delivery_endmonth =
GETPOST(
'search_date_delivery_endmonth',
'int');
60 $search_date_delivery_endyear =
GETPOST(
'search_date_delivery_endyear',
'int');
61 $search_date_delivery_start =
dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
62 $search_date_delivery_end =
dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
63 $search_date_create_startday =
GETPOST(
'search_date_create_startday',
'int');
64 $search_date_create_startmonth =
GETPOST(
'search_date_create_startmonth',
'int');
65 $search_date_create_startyear =
GETPOST(
'search_date_create_startyear',
'int');
66 $search_date_create_endday =
GETPOST(
'search_date_create_endday',
'int');
67 $search_date_create_endmonth =
GETPOST(
'search_date_create_endmonth',
'int');
68 $search_date_create_endyear =
GETPOST(
'search_date_create_endyear',
'int');
69 $search_date_create_start =
dol_mktime(0, 0, 0, $search_date_create_startmonth, $search_date_create_startday, $search_date_create_startyear);
70 $search_date_create_end =
dol_mktime(23, 59, 59, $search_date_create_endmonth, $search_date_create_endday, $search_date_create_endyear);
71 $search_billed =
GETPOST(
"search_billed",
'int');
72 $sall =
GETPOST(
'sall',
'alphanohtml');
73 $optioncss =
GETPOST(
'optioncss',
'alpha');
75 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
76 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
77 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
85 if (empty($page) || $page == -1) {
88 $offset = $limit * $page;
89 $pageprev = $page - 1;
90 $pagenext = $page + 1;
93 $contextpage =
'receptionlist';
95 $search_status =
GETPOST(
'search_status',
'intcomma');
100 $hookmanager->initHooks(array(
'receptionlist'));
104 $extrafields->fetch_name_optionals_label($object->table_element);
105 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
108 $fieldstosearchall = array(
110 's.nom'=>
"ThirdParty",
111 'e.note_public'=>
'NotePublic',
113 if (empty($user->socid)) {
114 $fieldstosearchall[
"e.note_private"] =
"NotePrivate";
117 $checkedtypetiers = 0;
118 $arrayfields = array(
119 'e.ref'=>array(
'label'=>$langs->trans(
"Ref"),
'checked'=>1),
120 'e.ref_supplier'=>array(
'label'=>$langs->trans(
"RefSupplier"),
'checked'=>1),
121 's.nom'=>array(
'label'=>$langs->trans(
"ThirdParty"),
'checked'=>1),
122 's.town'=>array(
'label'=>$langs->trans(
"Town"),
'checked'=>1),
123 's.zip'=>array(
'label'=>$langs->trans(
"Zip"),
'checked'=>1),
124 'state.nom'=>array(
'label'=>$langs->trans(
"StateShort"),
'checked'=>0),
125 'country.code_iso'=>array(
'label'=>$langs->trans(
"Country"),
'checked'=>0),
126 'typent.code'=>array(
'label'=>$langs->trans(
"ThirdPartyType"),
'checked'=>$checkedtypetiers),
127 'e.date_delivery'=>array(
'label'=>$langs->trans(
"DateDeliveryPlanned"),
'checked'=>1),
128 'e.datec'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0,
'position'=>500),
129 'e.tms'=>array(
'label'=>$langs->trans(
"DateModificationShort"),
'checked'=>0,
'position'=>500),
130 'e.fk_statut'=>array(
'label'=>$langs->trans(
"Status"),
'checked'=>1,
'position'=>1000),
131 'e.billed'=>array(
'label'=>$langs->trans(
"Billed"),
'checked'=>1,
'position'=>1000,
'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)))
135 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
143 $receptionid =
GETPOST(
'id',
'int');
145 $socid = $user->socid;
155 $action =
'list'; $massaction =
'';
157 if (!
GETPOST(
'confirmmassaction') && $massaction !=
'confirm_createbills') {
161 $parameters = array(
'socid'=>$socid);
162 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
167 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
170 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
171 $search_ref_supplier =
'';
172 $search_ref_rcp =
'';
173 $search_ref_liv =
'';
174 $search_company =
'';
178 $search_country =
'';
179 $search_type_thirdparty =
'';
180 $search_date_delivery_startday =
'';
181 $search_date_delivery_startmonth =
'';
182 $search_date_delivery_startyear =
'';
183 $search_date_delivery_endday =
'';
184 $search_date_delivery_endmonth =
'';
185 $search_date_delivery_endyear =
'';
186 $search_date_delivery_start =
'';
187 $search_date_delivery_end =
'';
188 $search_date_create_startday =
'';
189 $search_date_create_startmonth =
'';
190 $search_date_create_startyear =
'';
191 $search_date_create_endday =
'';
192 $search_date_create_endmonth =
'';
193 $search_date_create_endyear =
'';
194 $search_date_create_start =
'';
195 $search_date_create_end =
'';
198 $search_array_options = array();
201 if (empty($reshook)) {
203 $objectclass =
'Reception';
204 $objectlabel =
'Receptions';
205 $permissiontoread = $user->rights->reception->lire;
206 $permissiontoadd = $user->rights->reception->creer;
207 $permissiontodelete = $user->rights->reception->supprimer;
208 $uploaddir = $conf->reception->multidir_output[$conf->entity];
209 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
211 if ($massaction ==
'confirm_createbills') {
212 $receptions =
GETPOST(
'toselect',
'array');
213 $createbills_onebythird =
GETPOST(
'createbills_onebythird',
'int');
214 $validate_invoices =
GETPOST(
'validate_invoices',
'int');
219 $TFactThird = array();
220 $TFactThirdNbLines = array();
222 $nb_bills_created = 0;
230 foreach ($receptions as $id_reception) {
233 if ($rcp->fetch($id_reception) <= 0 || $rcp->statut != $rcp::STATUS_VALIDATED) {
234 $errors[] = $langs->trans(
'StatusOfRefMustBe', $rcp->ref, $langs->transnoentities(
"StatusSupplierOrderValidatedShort"));
240 if (!empty($createbills_onebythird) && !empty($TFactThird[$rcp->socid])) {
242 $objecttmp = $TFactThird[$rcp->socid];
245 $objecttmp->fetchObjectLinked();
246 $rcp->fetchObjectLinked();
247 if (count($rcp->linkedObjectsIds[
'order_supplier']) > 0) {
248 foreach ($rcp->linkedObjectsIds[
'order_supplier'] as $key => $value) {
249 if (empty($objecttmp->linkedObjectsIds[
'order_supplier']) || !in_array($value, $objecttmp->linkedObjectsIds[
'order_supplier'])) {
250 $objecttmp->add_object_linked(
'order_supplier', $value);
256 $objecttmp->socid = $rcp->socid;
257 $objecttmp->type = $objecttmp::TYPE_STANDARD;
258 $objecttmp->cond_reglement_id = $rcp->cond_reglement_id || $rcp->thirdparty->cond_reglement_supplier_id;
259 $objecttmp->mode_reglement_id = $rcp->mode_reglement_id || $rcp->thirdparty->mode_reglement_supplier_id;
261 $objecttmp->fk_account = !empty($rcp->thirdparty->fk_account) ? $rcp->thirdparty->fk_account : 0;
262 $objecttmp->remise_percent = !empty($rcp->thirdparty->remise_percent) ? $rcp->thirdparty->remise_percent : 0;
263 $objecttmp->remise_absolue = !empty($rcp->thirdparty->remise_absolue) ? $rcp->thirdparty->remise_absolue : 0;
265 $objecttmp->fk_project = $rcp->fk_project;
267 if (empty($createbills_onebythird)) {
268 $objecttmp->ref_supplier = $rcp->ref;
271 $objecttmp->ref_supplier = $langs->trans(
"Reception").
' '.
dol_print_date(
dol_now(),
'dayhourlog').
'-'.$rcp->socid;
275 if (empty($datefacture)) {
279 $objecttmp->date = $datefacture;
280 $objecttmp->origin =
'reception';
281 $objecttmp->origin_id = $id_reception;
283 $objecttmp->array_options = $rcp->array_options;
286 $rcp->fetchObjectLinked();
287 if (count($rcp->linkedObjectsIds[
'order_supplier']) > 0) {
288 foreach ($rcp->linkedObjectsIds[
'order_supplier'] as $key => $value) {
289 $objecttmp->linked_objects[
'order_supplier'] = $value;
293 $res = $objecttmp->create($user);
298 $lastref = $objecttmp->ref;
299 $lastid = $objecttmp->id;
301 $TFactThird[$rcp->socid] = $objecttmp;
302 $TFactThirdNbLines[$rcp->socid] = 0;
304 $langs->load(
"errors");
305 $errors[] = $rcp->ref.
' : '.$langs->trans($objecttmp->error);
310 if ($objecttmp->id > 0) {
311 $res = $objecttmp->add_object_linked($objecttmp->origin, $id_reception);
314 $errors[] = $objecttmp->error;
319 $lines = $rcp->lines;
320 if (empty($lines) && method_exists($rcp,
'fetch_lines')) {
322 $lines = $rcp->lines;
326 $num = count($lines);
328 for ($i = 0; $i < $num; $i++) {
329 $desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle);
331 if (!empty($createbills_onebythird)) {
335 if ($lines[$i]->subprice < 0) {
338 $discount->fk_soc = $objecttmp->socid;
339 $discount->amount_ht = abs($lines[$i]->total_ht);
340 $discount->amount_tva = abs($lines[$i]->total_tva);
341 $discount->amount_ttc = abs($lines[$i]->total_ttc);
342 $discount->tva_tx = $lines[$i]->tva_tx;
343 $discount->fk_user = $user->id;
344 $discount->description = $desc;
345 $discountid = $discount->create($user);
346 if ($discountid > 0) {
347 $result = $objecttmp->insert_discount($discountid);
356 $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
359 if ($lines[$i]->date_debut_prevue) {
360 $date_start = $lines[$i]->date_debut_prevue;
362 if ($lines[$i]->date_debut_reel) {
363 $date_start = $lines[$i]->date_debut_reel;
365 if ($lines[$i]->date_start) {
366 $date_start = $lines[$i]->date_start;
370 if ($lines[$i]->date_fin_prevue) {
371 $date_end = $lines[$i]->date_fin_prevue;
373 if ($lines[$i]->date_fin_reel) {
374 $date_end = $lines[$i]->date_fin_reel;
376 if ($lines[$i]->date_end) {
377 $date_end = $lines[$i]->date_end;
380 if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
385 if (method_exists($lines[$i],
'fetch_optionals')) {
386 $lines[$i]->fetch_optionals();
387 $array_options = $lines[$i]->array_options;
390 $objecttmp->context[
'createfromclone'];
394 if (!empty($createbills_onebythird))
395 $rang = $TFactThirdNbLines[$rcp->socid];
397 $result = $objecttmp->addline(
399 $lines[$i]->subprice,
401 $lines[$i]->localtax1_tx,
402 $lines[$i]->localtax2_tx,
404 $lines[$i]->fk_product,
405 $lines[$i]->remise_percent,
409 $lines[$i]->info_bits,
418 $lines[$i]->ref_supplier
421 $rcp->add_object_linked(
'facture_fourn_det', $result);
425 if (!empty($createbills_onebythird))
426 $TFactThirdNbLines[$rcp->socid]++;
433 if ($result > 0 && $lines[$i]->product_type == 9) {
434 $fk_parent_line = $result;
443 if (!empty($createbills_onebythird) && empty($TFactThird[$rcp->socid])) {
444 $TFactThird[$rcp->socid] = $objecttmp;
446 $TFact[$objecttmp->id] = $objecttmp;
451 $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
454 if (!$error && $validate_invoices) {
455 $massaction = $action =
'builddoc';
456 foreach ($TAllFact as &$objecttmp) {
457 $result = $objecttmp->validate($user);
464 $id = $objecttmp->id;
469 $upload_dir = $conf->fournisseur->facture->dir_output;
470 $permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer);
473 $savobject = $object;
474 $object = $objecttmp;
475 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
476 $object = $savobject;
479 $massaction = $action =
'confirm_createbills';
485 if ($nb_bills_created == 1) {
486 $texttoshow = $langs->trans(
'BillXCreated',
'{s1}');
487 $texttoshow = str_replace(
'{s1}',
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/card.php?id='.urlencode($lastid).
'">'.$lastref.
'</a>', $texttoshow);
490 setEventMessages($langs->trans(
'BillCreated', $nb_bills_created),
null,
'mesgs');
496 $_GET[
"origin"] = $_POST[
"origin"];
497 $_GET[
"originid"] = $_POST[
"originid"];
510 $companystatic =
new Societe($db);
516 $helpurl =
'EN:Module_Receptions|FR:Module_Receptions|ES:Módulo_Receptiones';
517 llxHeader(
'', $langs->trans(
'ListOfReceptions'), $helpurl);
519 $sql =
"SELECT e.rowid, e.ref, e.ref_supplier, e.date_reception as date_reception, e.date_delivery as delivery_date, l.date_delivery as date_reception2, e.fk_statut, e.billed,";
520 $sql .=
' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
521 $sql .=
" typent.code as typent_code,";
522 $sql .=
" state.code_departement as state_code, state.nom as state_name,";
523 $sql .=
' e.date_creation as date_creation, e.tms as date_update';
525 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
526 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
527 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
531 $parameters = array();
532 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
533 $sql .= $hookmanager->resPrint;
537 $sql .=
" FROM ".MAIN_DB_PREFIX.
"reception as e";
538 if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
539 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
541 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
542 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
543 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
544 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
545 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'reception' AND ee.targettype = 'delivery'";
546 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
547 if (empty($user->rights->societe->client->voir) && !$socid) {
548 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
551 $parameters = array();
552 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
553 $sql .= $hookmanager->resPrint;
554 $sql .=
" WHERE e.entity IN (".getEntity(
'reception').
")";
555 if (empty($user->rights->societe->client->voir) && !$socid) {
556 $sql .=
" AND e.fk_soc = sc.fk_soc";
557 $sql .=
" AND sc.fk_user = ".((int) $user->id);
560 $sql .=
" AND e.fk_soc = ".((int) $socid);
562 if ($search_status <>
'' && $search_status >= 0) {
563 $sql .=
" AND e.fk_statut = ".((int) $search_status);
565 if ($search_billed !=
'' && $search_billed >= 0) {
566 $sql .=
' AND e.billed = '.((int) $search_billed);
577 if ($search_country) {
578 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
580 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
581 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
583 if ($search_date_delivery_start) {
584 $sql .=
" AND e.date_delivery >= '".$db->idate($search_date_delivery_start).
"'";
586 if ($search_date_delivery_end) {
587 $sql .=
" AND e.date_delivery <= '".$db->idate($search_date_delivery_end).
"'";
589 if ($search_date_create_start) {
590 $sql .=
" AND e.date_creation >= '".$db->idate($search_date_create_start).
"'";
592 if ($search_date_create_end) {
593 $sql .=
" AND e.date_creation <= '".$db->idate($search_date_create_end).
"'";
595 if ($search_ref_rcp) {
598 if ($search_ref_liv) {
601 if ($search_company) {
604 if ($search_ref_supplier) {
612 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
614 $parameters = array();
615 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
616 $sql .= $hookmanager->resPrint;
619 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
621 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
622 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
623 $resql = $db->query($sqlforcount);
625 $objforcount = $db->fetch_object(
$resql);
639 $sql .= $db->order($sortfield, $sortorder);
641 $sql .= $db->plimit($limit + 1, $offset);
645 $resql = $db->query($sql);
651 $num = $db->num_rows(
$resql);
655 $arrayofselected = is_array($toselect) ? $toselect : array();
658 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
659 $param .=
'&contextpage='.urlencode($contextpage);
661 if ($limit > 0 && $limit != $conf->liste_limit) {
662 $param .=
'&limit='.urlencode($limit);
665 $param .=
"&sall=".urlencode($sall);
667 if ($search_ref_rcp) {
668 $param .=
"&search_ref_rcp=".urlencode($search_ref_rcp);
670 if ($search_ref_liv) {
671 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
673 if ($search_company) {
674 $param .=
"&search_company=".urlencode($search_company);
676 if ($optioncss !=
'') {
677 $param .=
'&optioncss='.urlencode($optioncss);
679 if ($search_billed !=
'' && $search_billed >= 0) {
680 $param .=
"&search_billed=".urlencode($search_billed);
683 $param .=
"&search_town=".urlencode($search_town);
686 $param .=
"&search_zip=".urlencode($search_zip);
689 $param .=
"&search_state=".urlencode($search_state);
691 if ($search_status !=
'') {
692 $param .=
"&search_status=".urlencode($search_status);
694 if ($search_country) {
695 $param .=
"&search_country=".urlencode($search_country);
697 if ($search_type_thirdparty) {
698 $param .=
"&search_type_thirdparty=".urlencode($search_type_thirdparty);
700 if ($search_date_delivery_startday) {
701 $param .=
'&search_date_delivery_startday='.urlencode($search_date_delivery_startday);
703 if ($search_date_delivery_startmonth) {
704 $param .=
'&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth);
706 if ($search_date_delivery_startyear) {
707 $param .=
'&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear);
709 if ($search_date_delivery_endday) {
710 $param .=
'&search_date_delivery_endday='.urlencode($search_date_delivery_endday);
712 if ($search_date_delivery_endmonth) {
713 $param .=
'&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth);
715 if ($search_date_delivery_endyear) {
716 $param .=
'&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear);
718 if ($search_date_create_startday) {
719 $param .=
'&search_date_create_startday='.urlencode($search_date_create_startday);
721 if ($search_date_create_startmonth) {
722 $param .=
'&search_date_create_startmonth='.urlencode($search_date_create_startmonth);
724 if ($search_date_create_startyear) {
725 $param .=
'&search_date_create_startyear='.urlencode($search_date_create_startyear);
727 if ($search_date_create_endday) {
728 $param .=
'&search_date_create_endday='.urlencode($search_date_create_endday);
730 if ($search_date_create_endmonth) {
731 $param .=
'&search_date_create_endmonth='.urlencode($search_date_create_endmonth);
733 if ($search_date_create_endyear) {
734 $param .=
'&search_date_create_endyear='.urlencode($search_date_create_endyear);
736 if ($search_ref_supplier) {
737 $param .=
"&search_ref_supplier=".urlencode($search_ref_supplier);
740 if ($search_array_options) {
741 foreach ($search_array_options as $key => $val) {
743 $tmpkey = preg_replace(
'/search_options_/',
'', $key);
744 if (is_array($val) && array_key_exists(
'start', $val) && array_key_exists(
'end', $val)) {
747 $param .=
'&search_options_'.$tmpkey.
'_startyear='.
dol_print_date($val[
'start'],
'%Y');
748 $param .=
'&search_options_'.$tmpkey.
'_startmonth='.
dol_print_date($val[
'start'],
'%m');
749 $param .=
'&search_options_'.$tmpkey.
'_startday='.
dol_print_date($val[
'start'],
'%d');
750 $param .=
'&search_options_'.$tmpkey.
'_starthour='.
dol_print_date($val[
'start'],
'%H');
751 $param .=
'&search_options_'.$tmpkey.
'_startmin='.
dol_print_date($val[
'start'],
'%M');
753 $param .=
'&search_options_'.$tmpkey.
'_endyear='.
dol_print_date($val[
'end'],
'%Y');
754 $param .=
'&search_options_'.$tmpkey.
'_endmonth='.
dol_print_date($val[
'end'],
'%m');
755 $param .=
'&search_options_'.$tmpkey.
'_endday='.
dol_print_date($val[
'end'],
'%d');
756 $param .=
'&search_options_'.$tmpkey.
'_endhour='.
dol_print_date($val[
'end'],
'%H');
757 $param .=
'&search_options_'.$tmpkey.
'_endmin='.
dol_print_date($val[
'end'],
'%M');
761 $param .=
'&search_options_'.$tmpkey.
'='.urlencode($val);
767 $arrayofmassactions = array(
771 if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
772 $arrayofmassactions[
'createbills'] = $langs->trans(
"CreateInvoiceForThisReceptions");
774 if ($massaction ==
'createbills') {
775 $arrayofmassactions = array();
777 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
781 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
782 if ($optioncss !=
'') {
783 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
785 print
'<input type="hidden" name="token" value="'.newToken().
'">';
786 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
787 print
'<input type="hidden" name="action" value="list">';
788 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
789 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
791 print_barre_liste($langs->trans(
'ListOfReceptions'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'dollyrevert', 0,
'',
'', $limit, 0, 0, 1);
793 if ($massaction ==
'createbills') {
795 print
'<input type="hidden" name="massaction" value="confirm_createbills">';
797 print
'<table class="noborder" width="100%" >';
799 print
'<td class="titlefieldmiddle">';
800 print $langs->trans(
'DateInvoice');
803 print
$form->selectDate(
'',
'',
'',
'',
'',
'', 1, 1);
808 print $langs->trans(
'CreateOneBillByThird');
811 print
$form->selectyesno(
'createbills_onebythird',
'', 1);
816 print $langs->trans(
'ValidateInvoices');
819 if (
isModEnabled(
'stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
820 print
$form->selectyesno(
'validate_invoices', 0, 1, 1);
821 print
' ('.$langs->trans(
"AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").
')';
823 print
$form->selectyesno(
'validate_invoices', 0, 1);
830 print
'<div class="center">';
831 print
'<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans(
'CreateInvoiceForThisReceptions').
'"> ';
832 print
'<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
838 foreach ($fieldstosearchall as $key => $val) {
839 $fieldstosearchall[$key] = $langs->trans($val);
841 print $langs->trans(
"FilterOnInto", $sall).join(
', ', $fieldstosearchall);
845 if (!empty($moreforfilter)) {
846 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
847 print $moreforfilter;
848 $parameters = array(
'type'=>$type);
849 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
850 print $hookmanager->resPrint;
854 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
855 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
856 $selectedfields .=
$form->showCheckAddButtons(
'checkforselect', 1);
859 print
'<div class="div-table-responsive">';
860 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
864 print
'<tr class="liste_titre_filter">';
866 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
867 print
'<td class="liste_titre middle">';
868 $searchpicto =
$form->showFilterButtons(
'left');
873 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
874 print
'<td class="liste_titre">';
875 print
'<input class="flat" size="6" type="text" name="search_ref_rcp" value="'.$search_ref_rcp.
'">';
879 if (!empty($arrayfields[
'e.ref_supplier'][
'checked'])) {
880 print
'<td class="liste_titre">';
881 print
'<input class="flat" size="6" type="text" name="search_ref_supplier" value="'.$search_ref_supplier.
'">';
885 if (!empty($arrayfields[
's.nom'][
'checked'])) {
886 print
'<td class="liste_titre left">';
887 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
891 if (!empty($arrayfields[
's.town'][
'checked'])) {
892 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
895 if (!empty($arrayfields[
's.zip'][
'checked'])) {
896 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
899 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
900 print
'<td class="liste_titre">';
901 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
905 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
906 print
'<td class="liste_titre center">';
907 print
$form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
911 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
912 print
'<td class="liste_titre maxwidthonsmartphone center">';
913 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);
917 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
918 print
'<td class="liste_titre center">';
919 print
'<div class="nowrap">';
920 print
$form->selectDate($search_date_delivery_start ? $search_date_delivery_start : -1,
'search_date_delivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
922 print
'<div class="nowrap">';
923 print
$form->selectDate($search_date_delivery_end ? $search_date_delivery_end : -1,
'search_date_delivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
927 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
929 print
'<td class="liste_titre">';
930 print
'<input class="flat" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
933 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
935 print
'<td class="liste_titre"> </td>';
938 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
941 $parameters = array(
'arrayfields'=>$arrayfields);
942 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
943 print $hookmanager->resPrint;
945 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
946 print
'<td class="liste_titre center">';
947 print
'<div class="nowrap">';
948 print
$form->selectDate($search_date_create_start ? $search_date_create_start : -1,
'search_date_create_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
950 print
'<div class="nowrap">';
951 print
$form->selectDate($search_date_create_end ? $search_date_create_end : -1,
'search_date_create_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
956 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
957 print
'<td class="liste_titre">';
961 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
962 print
'<td class="liste_titre maxwidthonsmartphone right">';
963 print
$form->selectarray(
'search_status', array(
'0'=>$langs->trans(
'StatusReceptionDraftShort'),
'1'=>$langs->trans(
'StatusReceptionValidatedShort'),
'2'=>$langs->trans(
'StatusReceptionProcessedShort')), $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status onrightofpage');
967 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
968 print
'<td class="liste_titre maxwidthonsmartphone center">';
969 print
$form->selectyesno(
'search_billed', $search_billed, 1, 0, 1);
973 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
974 print
'<td class="liste_titre middle">';
975 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
981 print
'<tr class="liste_titre">';
982 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
983 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
985 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
986 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
988 if (!empty($arrayfields[
'e.ref_supplier'][
'checked'])) {
989 print_liste_field_titre($arrayfields[
'e.ref_supplier'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_supplier",
"", $param,
'', $sortfield, $sortorder);
991 if (!empty($arrayfields[
's.nom'][
'checked'])) {
992 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
994 if (!empty($arrayfields[
's.town'][
'checked'])) {
995 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
997 if (!empty($arrayfields[
's.zip'][
'checked'])) {
998 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1000 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1001 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1003 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1004 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1006 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1007 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1009 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1010 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1012 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1013 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
1015 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1016 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1019 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1021 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
1022 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
1023 print $hookmanager->resPrint;
1024 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1025 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1027 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1028 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1030 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1031 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
1033 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1034 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
1036 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1037 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1042 $totalarray = array();
1043 $totalarray[
'nbfield'] = 0;
1044 while ($i < min($num, $limit)) {
1045 $obj = $db->fetch_object(
$resql);
1047 $reception->id = $obj->rowid;
1048 $reception->ref = $obj->ref;
1050 $companystatic->id = $obj->socid;
1051 $companystatic->ref = $obj->name;
1052 $companystatic->name = $obj->name;
1055 print
'<tr class="oddeven">';
1058 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1059 print
'<td class="center">';
1060 if ($massactionbutton || $massaction) {
1063 if (in_array($obj->rowid, $arrayofselected)) {
1066 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1071 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1072 print
'<td class="nowraponall">';
1073 print $reception->getNomUrl(1);
1076 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$reception->id;
1077 print $formfile->getDocumentsLink($reception->element, $filename, $filedir);
1081 $totalarray[
'nbfield']++;
1086 if (!empty($arrayfields[
'e.ref_supplier'][
'checked'])) {
1087 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->ref_supplier).
'">';
1091 $totalarray[
'nbfield']++;
1096 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1097 print
'<td class="tdoverflowmax150">';
1098 print $companystatic->getNomUrl(1);
1101 $totalarray[
'nbfield']++;
1105 if (!empty($arrayfields[
's.town'][
'checked'])) {
1106 print
'<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->town).
'">';
1110 $totalarray[
'nbfield']++;
1114 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1115 print
'<td class="nocellnopadd center"">';
1119 $totalarray[
'nbfield']++;
1123 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1124 print
"<td>".dol_escape_htmltag($obj->state_name).
"</td>\n";
1126 $totalarray[
'nbfield']++;
1130 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1131 print
'<td class="center">';
1132 $tmparray =
getCountry($obj->fk_pays,
'all');
1136 $totalarray[
'nbfield']++;
1140 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1141 print
'<td class="center">';
1142 if (!isset($typenArray) || empty($typenArray)) {
1143 $typenArray = $formcompany->typent_array(1);
1145 if (isset($typenArray[$obj->typent_code])) {
1146 print $typenArray[$obj->typent_code];
1150 $totalarray[
'nbfield']++;
1155 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1156 print
'<td class="center">';
1164 $totalarray[
'nbfield']++;
1168 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1169 $reception->fetchObjectLinked($reception->id, $reception->element);
1171 if (count($reception->linkedObjects[
'delivery']) > 0) {
1172 $receiving = reset($reception->linkedObjects[
'delivery']);
1175 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1178 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
1182 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1184 print
'<td class="center">';
1191 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1194 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1195 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1196 print $hookmanager->resPrint;
1198 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1199 print
'<td class="center nowrap">';
1200 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour');
1203 $totalarray[
'nbfield']++;
1207 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1208 print
'<td class="center nowrap">';
1212 $totalarray[
'nbfield']++;
1216 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1217 print
'<td class="right nowrap">'.$reception->LibStatut($obj->fk_statut, 5).
'</td>';
1219 $totalarray[
'nbfield']++;
1223 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1224 print
'<td class="center">'.yn($obj->billed).
'</td>';
1226 $totalarray[
'nbfield']++;
1231 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1232 print
'<td class="center">';
1233 if ($massactionbutton || $massaction) {
1236 if (in_array($obj->rowid, $arrayofselected)) {
1239 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1244 $totalarray[
'nbfield']++;
1255 foreach ($arrayfields as $key => $val) {
1256 if (!empty($val[
'checked'])) {
1260 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
1264 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1266 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
1267 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
1268 print $hookmanager->resPrint;
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage absolute discounts.
Class to manage suppliers invoices.
Class to manage receptions.
Class to manage third parties objects (customers, suppliers, prospects...)
getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("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->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
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...
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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_now($mode='auto')
Return date for now.
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...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
$nbtotalofrecords
Count total nb of records.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.