29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/reception/class/reception.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.product.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
39 $langs->loadLangs(array(
"sendings",
"receptions",
"deliveries",
'companies',
'bills',
'orders'));
41 $socid =
GETPOST(
'socid',
'int');
42 $massaction =
GETPOST(
'massaction',
'alpha');
43 $toselect =
GETPOST(
'toselect',
'array');
45 $diroutputmassaction = $conf->reception->dir_output.
'/temp/massgeneration/'.$user->id;
47 $search_ref_rcp =
GETPOST(
"search_ref_rcp");
48 $search_ref_liv =
GETPOST(
'search_ref_liv');
49 $search_ref_supplier =
GETPOST(
'search_ref_supplier');
50 $search_company =
GETPOST(
"search_company");
51 $search_town =
GETPOST(
'search_town',
'alpha');
52 $search_zip =
GETPOST(
'search_zip',
'alpha');
53 $search_state =
GETPOST(
"search_state");
54 $search_country =
GETPOST(
"search_country",
'int');
55 $search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'int');
56 $search_date_delivery_startday =
GETPOST(
'search_date_delivery_startday',
'int');
57 $search_date_delivery_startmonth =
GETPOST(
'search_date_delivery_startmonth',
'int');
58 $search_date_delivery_startyear =
GETPOST(
'search_date_delivery_startyear',
'int');
59 $search_date_delivery_endday =
GETPOST(
'search_date_delivery_endday',
'int');
60 $search_date_delivery_endmonth =
GETPOST(
'search_date_delivery_endmonth',
'int');
61 $search_date_delivery_endyear =
GETPOST(
'search_date_delivery_endyear',
'int');
62 $search_date_delivery_start =
dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
63 $search_date_delivery_end =
dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
64 $search_date_create_startday =
GETPOST(
'search_date_create_startday',
'int');
65 $search_date_create_startmonth =
GETPOST(
'search_date_create_startmonth',
'int');
66 $search_date_create_startyear =
GETPOST(
'search_date_create_startyear',
'int');
67 $search_date_create_endday =
GETPOST(
'search_date_create_endday',
'int');
68 $search_date_create_endmonth =
GETPOST(
'search_date_create_endmonth',
'int');
69 $search_date_create_endyear =
GETPOST(
'search_date_create_endyear',
'int');
70 $search_date_create_start =
dol_mktime(0, 0, 0, $search_date_create_startmonth, $search_date_create_startday, $search_date_create_startyear);
71 $search_date_create_end =
dol_mktime(23, 59, 59, $search_date_create_endmonth, $search_date_create_endday, $search_date_create_endyear);
72 $search_billed =
GETPOST(
"search_billed",
'int');
73 $sall =
GETPOST(
'sall',
'alphanohtml');
74 $optioncss =
GETPOST(
'optioncss',
'alpha');
76 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
77 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
78 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
86 if (empty($page) || $page == -1) {
89 $offset = $limit * $page;
90 $pageprev = $page - 1;
91 $pagenext = $page + 1;
94 $contextpage =
'receptionlist';
96 $search_status =
GETPOST(
'search_status',
'intcomma');
101 $hookmanager->initHooks(array(
'receptionlist'));
105 $extrafields->fetch_name_optionals_label($object->table_element);
106 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
109 $fieldstosearchall = array(
111 's.nom'=>
"ThirdParty",
112 'e.note_public'=>
'NotePublic',
114 if (empty($user->socid)) {
115 $fieldstosearchall[
"e.note_private"] =
"NotePrivate";
118 $checkedtypetiers = 0;
119 $arrayfields = array(
120 'e.ref'=>array(
'label'=>$langs->trans(
"Ref"),
'checked'=>1),
121 'e.ref_supplier'=>array(
'label'=>$langs->trans(
"RefSupplier"),
'checked'=>1),
122 's.nom'=>array(
'label'=>$langs->trans(
"ThirdParty"),
'checked'=>1),
123 's.town'=>array(
'label'=>$langs->trans(
"Town"),
'checked'=>1),
124 's.zip'=>array(
'label'=>$langs->trans(
"Zip"),
'checked'=>1),
125 'state.nom'=>array(
'label'=>$langs->trans(
"StateShort"),
'checked'=>0),
126 'country.code_iso'=>array(
'label'=>$langs->trans(
"Country"),
'checked'=>0),
127 'typent.code'=>array(
'label'=>$langs->trans(
"ThirdPartyType"),
'checked'=>$checkedtypetiers),
128 'e.date_delivery'=>array(
'label'=>$langs->trans(
"DateDeliveryPlanned"),
'checked'=>1),
129 'e.datec'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0,
'position'=>500),
130 'e.tms'=>array(
'label'=>$langs->trans(
"DateModificationShort"),
'checked'=>0,
'position'=>500),
131 'e.fk_statut'=>array(
'label'=>$langs->trans(
"Status"),
'checked'=>1,
'position'=>1000),
132 'e.billed'=>array(
'label'=>$langs->trans(
"Billed"),
'checked'=>1,
'position'=>1000,
'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)))
136 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
144 $receptionid =
GETPOST(
'id',
'int');
146 $socid = $user->socid;
156 $action =
'list'; $massaction =
'';
158 if (!
GETPOST(
'confirmmassaction') && $massaction !=
'confirm_createbills') {
162 $parameters = array(
'socid'=>$socid);
163 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
168 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
171 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
172 $search_ref_supplier =
'';
173 $search_ref_rcp =
'';
174 $search_ref_liv =
'';
175 $search_company =
'';
179 $search_country =
'';
180 $search_type_thirdparty =
'';
181 $search_date_delivery_startday =
'';
182 $search_date_delivery_startmonth =
'';
183 $search_date_delivery_startyear =
'';
184 $search_date_delivery_endday =
'';
185 $search_date_delivery_endmonth =
'';
186 $search_date_delivery_endyear =
'';
187 $search_date_delivery_start =
'';
188 $search_date_delivery_end =
'';
189 $search_date_create_startday =
'';
190 $search_date_create_startmonth =
'';
191 $search_date_create_startyear =
'';
192 $search_date_create_endday =
'';
193 $search_date_create_endmonth =
'';
194 $search_date_create_endyear =
'';
195 $search_date_create_start =
'';
196 $search_date_create_end =
'';
199 $search_array_options = array();
202 if (empty($reshook)) {
204 $objectclass =
'Reception';
205 $objectlabel =
'Receptions';
206 $permissiontoread = $user->rights->reception->lire;
207 $permissiontoadd = $user->rights->reception->creer;
208 $permissiontodelete = $user->rights->reception->supprimer;
209 $uploaddir = $conf->reception->multidir_output[$conf->entity];
210 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
212 if ($massaction ==
'confirm_createbills') {
213 $receptions =
GETPOST(
'toselect',
'array');
214 $createbills_onebythird =
GETPOST(
'createbills_onebythird',
'int');
215 $validate_invoices =
GETPOST(
'validate_invoices',
'int');
220 $TFactThird = array();
221 $TFactThirdNbLines = array();
223 $nb_bills_created = 0;
231 foreach ($receptions as $id_reception) {
234 if ($rcp->fetch($id_reception) <= 0 || $rcp->statut == $rcp::STATUS_DRAFT) {
235 $errors[] = $langs->trans(
'StatusOfRefMustBe', $rcp->ref, $langs->transnoentities(
"StatusReceptionValidatedShort"));
241 if (!empty($createbills_onebythird) && !empty($TFactThird[$rcp->socid])) {
243 $objecttmp = $TFactThird[$rcp->socid];
246 $objecttmp->fetchObjectLinked();
247 $rcp->fetchObjectLinked();
248 if (count($rcp->linkedObjectsIds[
'order_supplier']) > 0) {
249 foreach ($rcp->linkedObjectsIds[
'order_supplier'] as $key => $value) {
250 if (empty($objecttmp->linkedObjectsIds[
'order_supplier']) || !in_array($value, $objecttmp->linkedObjectsIds[
'order_supplier'])) {
251 $objecttmp->add_object_linked(
'order_supplier', $value);
256 $cond_reglement_id = 0;
257 $mode_reglement_id = 0;
261 $transport_mode_id = 0;
262 if (!empty($rcp->cond_reglement_id)) {
263 $cond_reglement_id = $rcp->cond_reglement_id;
265 if (!empty($rcp->mode_reglement_id)) {
266 $mode_reglement_id = $rcp->mode_reglement_id;
268 if (!empty($rcp->fk_account)) {
269 $fk_account = $rcp->fk_account;
271 if (!empty($rcp->remise_percent)) {
272 $remise_percent = $rcp->remise_percent;
274 if (!empty($rcp->remise_absolue)) {
275 $remise_absolue = $rcp->remise_absolue;
277 if (!empty($rcp->transport_mode_id)) {
278 $transport_mode_id = $rcp->transport_mode_id;
281 if (empty($cond_reglement_id)
282 || empty($mode_reglement_id)
283 || empty($fk_account)
284 || empty($remise_percent)
285 || empty($remise_absolue)
286 || empty($transport_mode_id)
288 if (!isset($rcp->supplier_order)) {
289 $rcp->fetch_origin();
293 if (!empty($rcp->commandeFournisseur)) {
294 $supplierOrder = $rcp->commandeFournisseur;
295 if (empty($cond_reglement_id) && !empty($supplierOrder->cond_reglement_id)) {
296 $cond_reglement_id = $supplierOrder->cond_reglement_id;
298 if (empty($mode_reglement_id) && !empty($supplierOrder->mode_reglement_id)) {
299 $mode_reglement_id = $supplierOrder->mode_reglement_id;
301 if (empty($fk_account) && !empty($supplierOrder->fk_account)) {
302 $fk_account = $supplierOrder->fk_account;
304 if (empty($remise_percent) && !empty($supplierOrder->remise_percent)) {
305 $remise_percent = $supplierOrder->remise_percent;
307 if (empty($remise_absolue) && !empty($supplierOrder->remise_absolue)) {
308 $remise_absolue = $supplierOrder->remise_absolue;
310 if (empty($transport_mode_id) && !empty($supplierOrder->transport_mode_id)) {
311 $transport_mode_id = $supplierOrder->transport_mode_id;
316 if (!empty($rcp->thirdparty)) {
317 $soc = $rcp->thirdparty;
318 if (empty($cond_reglement_id) && !empty($soc->cond_reglement_supplier_id)) {
319 $cond_reglement_id = $soc->cond_reglement_supplier_id;
321 if (empty($mode_reglement_id) && !empty($soc->mode_reglement_supplier_id)) {
322 $mode_reglement_id = $soc->mode_reglement_supplier_id;
324 if (empty($fk_account) && !empty($soc->fk_account)) {
325 $fk_account = $soc->fk_account;
327 if (empty($remise_percent) && !empty($soc->remise_supplier_percent)) {
328 $remise_percent = $soc->remise_supplier_percent;
330 if (empty($remise_absolue) && !empty($soc->remise_absolue)) {
331 $remise_absolue = $soc->remise_absolue;
333 if (empty($transport_mode_id) && !empty($soc->transport_mode_id)) {
334 $transport_mode_id = $soc->transport_mode_id;
340 $objecttmp->socid = $rcp->socid;
341 $objecttmp->type = $objecttmp::TYPE_STANDARD;
342 $objecttmp->cond_reglement_id = $cond_reglement_id;
343 $objecttmp->mode_reglement_id = $mode_reglement_id;
344 $objecttmp->fk_account = $fk_account;
345 $objecttmp->remise_percent = $remise_percent;
346 $objecttmp->remise_absolue = $remise_absolue;
347 $objecttmp->transport_mode_id = $transport_mode_id;
350 $objecttmp->vat_reverse_charge = $soc->vat_reverse_charge;
352 $objecttmp->fk_project = $rcp->fk_project;
354 if (empty($createbills_onebythird)) {
355 $objecttmp->ref_supplier = $rcp->ref;
358 $objecttmp->ref_supplier = $langs->trans(
"Reception").
' '.
dol_print_date(
dol_now(),
'dayhourlog').
'-'.$rcp->socid;
362 if (empty($datefacture)) {
366 $objecttmp->date = $datefacture;
367 $objecttmp->origin =
'reception';
368 $objecttmp->origin_id = $id_reception;
371 if (empty($objecttmp->date_echeance)) {
372 $objecttmp->date_echeance = $objecttmp->calculate_date_lim_reglement();
375 $objecttmp->array_options = $rcp->array_options;
378 $rcp->fetchObjectLinked();
379 if (count($rcp->linkedObjectsIds[
'order_supplier']) > 0) {
380 foreach ($rcp->linkedObjectsIds[
'order_supplier'] as $key => $value) {
381 $objecttmp->linked_objects[
'order_supplier'] = $value;
385 $res = $objecttmp->create($user);
390 $lastref = $objecttmp->ref;
391 $lastid = $objecttmp->id;
393 $TFactThird[$rcp->socid] = $objecttmp;
394 $TFactThirdNbLines[$rcp->socid] = 0;
396 $langs->load(
"errors");
397 $errors[] = $rcp->ref.
' : '.$langs->trans($objecttmp->error);
402 if ($objecttmp->id > 0) {
403 $res = $objecttmp->add_object_linked($objecttmp->origin, $id_reception);
406 $errors[] = $objecttmp->error;
411 $lines = $rcp->lines;
412 if (empty($lines) && method_exists($rcp,
'fetch_lines')) {
414 $lines = $rcp->lines;
418 $num = count($lines);
420 for ($i = 0; $i < $num; $i++) {
421 $desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle);
423 if (!empty($createbills_onebythird)) {
427 if ($lines[$i]->subprice < 0) {
430 $discount->fk_soc = $objecttmp->socid;
431 $discount->amount_ht = abs($lines[$i]->total_ht);
432 $discount->amount_tva = abs($lines[$i]->total_tva);
433 $discount->amount_ttc = abs($lines[$i]->total_ttc);
434 $discount->tva_tx = $lines[$i]->tva_tx;
435 $discount->fk_user = $user->id;
436 $discount->description = $desc;
437 $discountid = $discount->create($user);
438 if ($discountid > 0) {
439 $result = $objecttmp->insert_discount($discountid);
448 $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
451 if ($lines[$i]->date_debut_prevue) {
452 $date_start = $lines[$i]->date_debut_prevue;
454 if ($lines[$i]->date_debut_reel) {
455 $date_start = $lines[$i]->date_debut_reel;
457 if ($lines[$i]->date_start) {
458 $date_start = $lines[$i]->date_start;
462 if ($lines[$i]->date_fin_prevue) {
463 $date_end = $lines[$i]->date_fin_prevue;
465 if ($lines[$i]->date_fin_reel) {
466 $date_end = $lines[$i]->date_fin_reel;
468 if ($lines[$i]->date_end) {
469 $date_end = $lines[$i]->date_end;
472 if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
477 if (method_exists($lines[$i],
'fetch_optionals')) {
478 $lines[$i]->fetch_optionals();
479 $array_options = $lines[$i]->array_options;
482 $objecttmp->context[
'createfromclone'];
486 if (!empty($createbills_onebythird))
487 $rang = $TFactThirdNbLines[$rcp->socid];
489 $result = $objecttmp->addline(
491 $lines[$i]->subprice,
493 $lines[$i]->localtax1_tx,
494 $lines[$i]->localtax2_tx,
496 $lines[$i]->fk_product,
497 $lines[$i]->remise_percent,
501 $lines[$i]->info_bits,
510 $lines[$i]->ref_supplier
513 $rcp->add_object_linked(
'facture_fourn_det', $result);
517 if (!empty($createbills_onebythird))
518 $TFactThirdNbLines[$rcp->socid]++;
525 if ($result > 0 && $lines[$i]->product_type == 9) {
526 $fk_parent_line = $result;
535 if (!empty($createbills_onebythird) && empty($TFactThird[$rcp->socid])) {
536 $TFactThird[$rcp->socid] = $objecttmp;
538 $TFact[$objecttmp->id] = $objecttmp;
543 $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
546 if (!$error && $validate_invoices) {
547 $massaction = $action =
'builddoc';
548 foreach ($TAllFact as &$objecttmp) {
549 $result = $objecttmp->validate($user);
556 $id = $objecttmp->id;
561 $upload_dir = $conf->fournisseur->facture->dir_output;
562 $permissiontoadd = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer);
565 $savobject = $object;
566 $object = $objecttmp;
567 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
568 $object = $savobject;
571 $massaction = $action =
'confirm_createbills';
577 if ($nb_bills_created == 1) {
578 $texttoshow = $langs->trans(
'BillXCreated',
'{s1}');
579 $texttoshow = str_replace(
'{s1}',
'<a href="'.DOL_URL_ROOT.
'/fourn/facture/card.php?id='.urlencode($lastid).
'">'.$lastref.
'</a>', $texttoshow);
582 setEventMessages($langs->trans(
'BillCreated', $nb_bills_created),
null,
'mesgs');
588 $_GET[
"origin"] = $_POST[
"origin"];
589 $_GET[
"originid"] = $_POST[
"originid"];
602 $companystatic =
new Societe($db);
608 $helpurl =
'EN:Module_Receptions|FR:Module_Receptions|ES:Módulo_Receptiones';
609 llxHeader(
'', $langs->trans(
'ListOfReceptions'), $helpurl);
611 $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,";
612 $sql .=
' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
613 $sql .=
" typent.code as typent_code,";
614 $sql .=
" state.code_departement as state_code, state.nom as state_name,";
615 $sql .=
' e.date_creation as date_creation, e.tms as date_update';
617 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
618 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
619 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
623 $parameters = array();
624 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
625 $sql .= $hookmanager->resPrint;
629 $sql .=
" FROM ".MAIN_DB_PREFIX.
"reception as e";
630 if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
631 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
633 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
634 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
635 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
636 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
637 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'reception' AND ee.targettype = 'delivery'";
638 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
639 if (empty($user->rights->societe->client->voir) && !$socid) {
640 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
643 $parameters = array();
644 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
645 $sql .= $hookmanager->resPrint;
646 $sql .=
" WHERE e.entity IN (".getEntity(
'reception').
")";
647 if (empty($user->rights->societe->client->voir) && !$socid) {
648 $sql .=
" AND e.fk_soc = sc.fk_soc";
649 $sql .=
" AND sc.fk_user = ".((int) $user->id);
652 $sql .=
" AND e.fk_soc = ".((int) $socid);
654 if ($search_status <>
'' && $search_status >= 0) {
655 $sql .=
" AND e.fk_statut = ".((int) $search_status);
657 if ($search_billed !=
'' && $search_billed >= 0) {
658 $sql .=
' AND e.billed = '.((int) $search_billed);
669 if ($search_country) {
670 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
672 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
673 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
675 if ($search_date_delivery_start) {
676 $sql .=
" AND e.date_delivery >= '".$db->idate($search_date_delivery_start).
"'";
678 if ($search_date_delivery_end) {
679 $sql .=
" AND e.date_delivery <= '".$db->idate($search_date_delivery_end).
"'";
681 if ($search_date_create_start) {
682 $sql .=
" AND e.date_creation >= '".$db->idate($search_date_create_start).
"'";
684 if ($search_date_create_end) {
685 $sql .=
" AND e.date_creation <= '".$db->idate($search_date_create_end).
"'";
687 if ($search_ref_rcp) {
690 if ($search_ref_liv) {
693 if ($search_company) {
696 if ($search_ref_supplier) {
704 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
706 $parameters = array();
707 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
708 $sql .= $hookmanager->resPrint;
710 $nbtotalofrecords =
'';
713 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords',
$sql);
714 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
715 $resql = $db->query($sqlforcount);
717 $objforcount = $db->fetch_object($resql);
718 $nbtotalofrecords = $objforcount->nbtotalofrecords;
723 if (($page * $limit) > $nbtotalofrecords) {
731 $sql .= $db->order($sortfield, $sortorder);
733 $sql .= $db->plimit($limit + 1, $offset);
737 $resql = $db->query(
$sql);
743 $num = $db->num_rows($resql);
747 $arrayofselected = is_array($toselect) ? $toselect : array();
750 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
751 $param .=
'&contextpage='.urlencode($contextpage);
753 if ($limit > 0 && $limit != $conf->liste_limit) {
754 $param .=
'&limit='.((int) $limit);
757 $param .=
"&sall=".urlencode($sall);
759 if ($search_ref_rcp) {
760 $param .=
"&search_ref_rcp=".urlencode($search_ref_rcp);
762 if ($search_ref_liv) {
763 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
765 if ($search_company) {
766 $param .=
"&search_company=".urlencode($search_company);
768 if ($optioncss !=
'') {
769 $param .=
'&optioncss='.urlencode($optioncss);
771 if ($search_billed !=
'' && $search_billed >= 0) {
772 $param .=
"&search_billed=".urlencode($search_billed);
775 $param .=
"&search_town=".urlencode($search_town);
778 $param .=
"&search_zip=".urlencode($search_zip);
781 $param .=
"&search_state=".urlencode($search_state);
783 if ($search_status !=
'') {
784 $param .=
"&search_status=".urlencode($search_status);
786 if ($search_country) {
787 $param .=
"&search_country=".urlencode($search_country);
789 if ($search_type_thirdparty) {
790 $param .=
"&search_type_thirdparty=".urlencode($search_type_thirdparty);
792 if ($search_date_delivery_startday) {
793 $param .=
'&search_date_delivery_startday='.urlencode($search_date_delivery_startday);
795 if ($search_date_delivery_startmonth) {
796 $param .=
'&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth);
798 if ($search_date_delivery_startyear) {
799 $param .=
'&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear);
801 if ($search_date_delivery_endday) {
802 $param .=
'&search_date_delivery_endday='.urlencode($search_date_delivery_endday);
804 if ($search_date_delivery_endmonth) {
805 $param .=
'&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth);
807 if ($search_date_delivery_endyear) {
808 $param .=
'&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear);
810 if ($search_date_create_startday) {
811 $param .=
'&search_date_create_startday='.urlencode($search_date_create_startday);
813 if ($search_date_create_startmonth) {
814 $param .=
'&search_date_create_startmonth='.urlencode($search_date_create_startmonth);
816 if ($search_date_create_startyear) {
817 $param .=
'&search_date_create_startyear='.urlencode($search_date_create_startyear);
819 if ($search_date_create_endday) {
820 $param .=
'&search_date_create_endday='.urlencode($search_date_create_endday);
822 if ($search_date_create_endmonth) {
823 $param .=
'&search_date_create_endmonth='.urlencode($search_date_create_endmonth);
825 if ($search_date_create_endyear) {
826 $param .=
'&search_date_create_endyear='.urlencode($search_date_create_endyear);
828 if ($search_ref_supplier) {
829 $param .=
"&search_ref_supplier=".urlencode($search_ref_supplier);
832 if ($search_array_options) {
833 foreach ($search_array_options as $key => $val) {
835 $tmpkey = preg_replace(
'/search_options_/',
'', $key);
836 if (is_array($val) && array_key_exists(
'start', $val) && array_key_exists(
'end', $val)) {
839 $param .=
'&search_options_'.$tmpkey.
'_startyear='.
dol_print_date($val[
'start'],
'%Y');
840 $param .=
'&search_options_'.$tmpkey.
'_startmonth='.
dol_print_date($val[
'start'],
'%m');
841 $param .=
'&search_options_'.$tmpkey.
'_startday='.
dol_print_date($val[
'start'],
'%d');
842 $param .=
'&search_options_'.$tmpkey.
'_starthour='.
dol_print_date($val[
'start'],
'%H');
843 $param .=
'&search_options_'.$tmpkey.
'_startmin='.
dol_print_date($val[
'start'],
'%M');
845 $param .=
'&search_options_'.$tmpkey.
'_endyear='.
dol_print_date($val[
'end'],
'%Y');
846 $param .=
'&search_options_'.$tmpkey.
'_endmonth='.
dol_print_date($val[
'end'],
'%m');
847 $param .=
'&search_options_'.$tmpkey.
'_endday='.
dol_print_date($val[
'end'],
'%d');
848 $param .=
'&search_options_'.$tmpkey.
'_endhour='.
dol_print_date($val[
'end'],
'%H');
849 $param .=
'&search_options_'.$tmpkey.
'_endmin='.
dol_print_date($val[
'end'],
'%M');
853 $param .=
'&search_options_'.$tmpkey.
'='.urlencode($val);
859 $arrayofmassactions = array(
863 if ($user->hasRight(
'fournisseur',
'facture',
'creer') || $user->rights->supplier_invoice->creer) {
864 $arrayofmassactions[
'createbills'] = $langs->trans(
"CreateInvoiceForThisReceptions");
866 if ($massaction ==
'createbills') {
867 $arrayofmassactions = array();
869 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
873 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
874 if ($optioncss !=
'') {
875 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
877 print
'<input type="hidden" name="token" value="'.newToken().
'">';
878 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
879 print
'<input type="hidden" name="action" value="list">';
880 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
881 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
883 print_barre_liste($langs->trans(
'ListOfReceptions'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'dollyrevert', 0,
'',
'', $limit, 0, 0, 1);
885 if ($massaction ==
'createbills') {
887 print
'<input type="hidden" name="massaction" value="confirm_createbills">';
889 print
'<table class="noborder" width="100%" >';
891 print
'<td class="titlefieldmiddle">';
892 print $langs->trans(
'DateInvoice');
895 print
$form->selectDate(
'',
'',
'',
'',
'',
'', 1, 1);
900 print $langs->trans(
'CreateOneBillByThird');
903 print
$form->selectyesno(
'createbills_onebythird',
'', 1);
908 print $langs->trans(
'ValidateInvoices');
911 if (
isModEnabled(
'stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
912 print
$form->selectyesno(
'validate_invoices', 0, 1, 1);
913 print
' ('.$langs->trans(
"AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").
')';
915 print
$form->selectyesno(
'validate_invoices', 0, 1);
922 print
'<div class="center">';
923 print
'<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans(
'CreateInvoiceForThisReceptions').
'"> ';
924 print
'<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
930 foreach ($fieldstosearchall as $key => $val) {
931 $fieldstosearchall[$key] = $langs->trans($val);
933 print $langs->trans(
"FilterOnInto", $sall).join(
', ', $fieldstosearchall);
937 if (!empty($moreforfilter)) {
938 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
939 print $moreforfilter;
940 $parameters = array(
'type'=>$type);
941 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
942 print $hookmanager->resPrint;
946 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
947 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
948 $selectedfields .=
$form->showCheckAddButtons(
'checkforselect', 1);
951 print
'<div class="div-table-responsive">';
952 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
956 print
'<tr class="liste_titre_filter">';
958 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
959 print
'<td class="liste_titre middle">';
960 $searchpicto =
$form->showFilterButtons(
'left');
965 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
966 print
'<td class="liste_titre">';
967 print
'<input class="flat" size="6" type="text" name="search_ref_rcp" value="'.$search_ref_rcp.
'">';
971 if (!empty($arrayfields[
'e.ref_supplier'][
'checked'])) {
972 print
'<td class="liste_titre">';
973 print
'<input class="flat" size="6" type="text" name="search_ref_supplier" value="'.$search_ref_supplier.
'">';
977 if (!empty($arrayfields[
's.nom'][
'checked'])) {
978 print
'<td class="liste_titre left">';
979 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
983 if (!empty($arrayfields[
's.town'][
'checked'])) {
984 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
987 if (!empty($arrayfields[
's.zip'][
'checked'])) {
988 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
991 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
992 print
'<td class="liste_titre">';
993 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
997 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
998 print
'<td class="liste_titre center">';
999 print
$form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1003 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1004 print
'<td class="liste_titre maxwidthonsmartphone center">';
1005 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);
1009 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1010 print
'<td class="liste_titre center">';
1011 print
'<div class="nowrap">';
1012 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'));
1014 print
'<div class="nowrap">';
1015 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'));
1019 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1021 print
'<td class="liste_titre">';
1022 print
'<input class="flat" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
1025 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1027 print
'<td class="liste_titre"> </td>';
1030 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1033 $parameters = array(
'arrayfields'=>$arrayfields);
1034 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1035 print $hookmanager->resPrint;
1037 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1038 print
'<td class="liste_titre center">';
1039 print
'<div class="nowrap">';
1040 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'));
1042 print
'<div class="nowrap">';
1043 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'));
1048 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1049 print
'<td class="liste_titre">';
1053 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1054 print
'<td class="liste_titre right parentonrightofpage">';
1055 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 width100 onrightofpage');
1059 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1060 print
'<td class="liste_titre maxwidthonsmartphone center">';
1061 print
$form->selectyesno(
'search_billed', $search_billed, 1, 0, 1);
1065 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1066 print
'<td class="liste_titre middle">';
1067 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
1073 print
'<tr class="liste_titre">';
1074 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1075 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1077 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1078 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
1080 if (!empty($arrayfields[
'e.ref_supplier'][
'checked'])) {
1081 print_liste_field_titre($arrayfields[
'e.ref_supplier'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_supplier",
"", $param,
'', $sortfield, $sortorder);
1083 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1084 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
1086 if (!empty($arrayfields[
's.town'][
'checked'])) {
1087 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1089 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1090 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1092 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1093 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1095 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1096 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1098 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1099 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1101 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1102 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1104 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1105 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
1107 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1108 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1111 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1113 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
1114 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
1115 print $hookmanager->resPrint;
1116 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1117 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1119 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1120 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1122 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1123 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
1125 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1126 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
1128 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1129 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1134 $totalarray = array();
1135 $totalarray[
'nbfield'] = 0;
1136 while ($i < min($num, $limit)) {
1137 $obj = $db->fetch_object($resql);
1139 $reception->id = $obj->rowid;
1140 $reception->ref = $obj->ref;
1142 $companystatic->id = $obj->socid;
1143 $companystatic->ref = $obj->name;
1144 $companystatic->name = $obj->name;
1147 print
'<tr class="oddeven">';
1150 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1151 print
'<td class="center">';
1152 if ($massactionbutton || $massaction) {
1155 if (in_array($obj->rowid, $arrayofselected)) {
1158 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1163 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1164 print
'<td class="nowraponall">';
1165 print $reception->getNomUrl(1);
1168 $urlsource = $_SERVER[
'PHP_SELF'].
'?id='.$reception->id;
1169 print $formfile->getDocumentsLink($reception->element, $filename, $filedir);
1173 $totalarray[
'nbfield']++;
1178 if (!empty($arrayfields[
'e.ref_supplier'][
'checked'])) {
1179 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->ref_supplier).
'">';
1183 $totalarray[
'nbfield']++;
1188 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1189 print
'<td class="tdoverflowmax150">';
1190 print $companystatic->getNomUrl(1);
1193 $totalarray[
'nbfield']++;
1197 if (!empty($arrayfields[
's.town'][
'checked'])) {
1198 print
'<td class="nocellnopadd tdoverflowmax200" title="'.dol_escape_htmltag($obj->town).
'">';
1202 $totalarray[
'nbfield']++;
1206 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1207 print
'<td class="nocellnopadd center"">';
1211 $totalarray[
'nbfield']++;
1215 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1216 print
"<td>".dol_escape_htmltag($obj->state_name).
"</td>\n";
1218 $totalarray[
'nbfield']++;
1222 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1223 print
'<td class="center">';
1224 $tmparray =
getCountry($obj->fk_pays,
'all');
1228 $totalarray[
'nbfield']++;
1232 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1233 print
'<td class="center">';
1234 if (!isset($typenArray) || empty($typenArray)) {
1235 $typenArray = $formcompany->typent_array(1);
1237 if (isset($typenArray[$obj->typent_code])) {
1238 print $typenArray[$obj->typent_code];
1242 $totalarray[
'nbfield']++;
1247 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1248 print
'<td class="center">';
1256 $totalarray[
'nbfield']++;
1260 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1261 $reception->fetchObjectLinked($reception->id, $reception->element);
1263 if (count($reception->linkedObjects[
'delivery']) > 0) {
1264 $receiving = reset($reception->linkedObjects[
'delivery']);
1267 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1270 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
1274 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1276 print
'<td class="center">';
1283 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1286 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1287 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1288 print $hookmanager->resPrint;
1290 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1291 print
'<td class="center nowrap">';
1292 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour');
1295 $totalarray[
'nbfield']++;
1299 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1300 print
'<td class="center nowrap">';
1304 $totalarray[
'nbfield']++;
1308 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1309 print
'<td class="right nowrap">'.$reception->LibStatut($obj->fk_statut, 5).
'</td>';
1311 $totalarray[
'nbfield']++;
1315 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1316 print
'<td class="center">'.yn($obj->billed).
'</td>';
1318 $totalarray[
'nbfield']++;
1323 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1324 print
'<td class="center">';
1325 if ($massactionbutton || $massaction) {
1328 if (in_array($obj->rowid, $arrayofselected)) {
1331 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1336 $totalarray[
'nbfield']++;
1347 foreach ($arrayfields as $key => $val) {
1348 if (!empty($val[
'checked'])) {
1352 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
1356 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1358 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>
$sql);
1359 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
1360 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') && $user->hasRight('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') && $user->hasRight('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)) $sql
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_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...
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.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
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.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.