dolibarr 22.0.5
sendings.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
4 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
5 * Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
26require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
27require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
28require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
29
30
38{
39 global $db, $langs, $conf, $user;
40
41 // Load translation files required by the page
42 $langs->loadLangs(array("sendings", "deliveries"));
43
44 $h = 0;
45 $head = array();
46
47 $head[$h][0] = DOL_URL_ROOT."/expedition/card.php?id=".$object->id;
48 $head[$h][1] = $langs->trans("SendingCard");
49 $head[$h][2] = 'shipping';
50 $h++;
51
52 if ($object->status == Expedition::STATUS_DRAFT) {
53 $head[$h][0] = DOL_URL_ROOT."/expedition/dispatch.php?id=".$object->id;
54 $head[$h][1] = $langs->trans("ShipmentDistribution");
55 $head[$h][2] = 'dispatch';
56 $h++;
57 }
58
59 if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire')) {
60 // delivery link
61 $object->fetchObjectLinked($object->id, $object->element);
62 if (isset($object->linkedObjectsIds['delivery']) && is_array($object->linkedObjectsIds['delivery']) && count($object->linkedObjectsIds['delivery']) > 0) { // If there is a delivery
63 // Take first element of array
64 $tmp = reset($object->linkedObjectsIds['delivery']);
65
66 $head[$h][0] = DOL_URL_ROOT."/delivery/card.php?id=".((int) $tmp);
67 $head[$h][1] = $langs->trans("DeliveryCard");
68 $head[$h][2] = 'delivery';
69 $h++;
70 }
71 }
72
73 if (!getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
74 $objectsrc = $object;
75 if (!getDolGlobalInt('SHIPPING_USE_ITS_OWN_CONTACTS') && $object->origin_type == 'commande' && $object->origin_id > 0) {
76 $objectsrc = new Commande($db);
77 $objectsrc->fetch($object->origin_id);
78 }
79 $nbContact = count($objectsrc->liste_contact(-1, 'internal')) + count($objectsrc->liste_contact(-1, 'external'));
80 $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".((int) $object->id);
81 $head[$h][1] = $langs->trans("ContactsAddresses");
82 if ($nbContact > 0) {
83 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
84 }
85 $head[$h][2] = 'contact';
86 $h++;
87 }
88
89 // Files
90 require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
91 require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
92 $upload_dir = $conf->expedition->dir_output . "/sending/" . dol_sanitizeFileName($object->ref);
93 $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
94 $nbLinks = Link::count($db, $object->element, $object->id);
95 $head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$object->id;
96 $head[$h][1] = $langs->trans('Documents');
97 if (($nbFiles + $nbLinks) > 0) {
98 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
99 }
100 $head[$h][2] = 'documents';
101 $h++;
102
103 // Notes
104 $nbNote = 0;
105 if (!empty($object->note_private)) {
106 $nbNote++;
107 }
108 if (!empty($object->note_public)) {
109 $nbNote++;
110 }
111 $head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id;
112 $head[$h][1] = $langs->trans("Notes");
113 if ($nbNote > 0) {
114 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
115 }
116 $head[$h][2] = 'note';
117 $h++;
118
119 // Events
120 /* available with v23 only
121 $head[$h][0] = DOL_URL_ROOT . '/expedition/agenda.php?id=' . $object->id;
122 $head[$h][1] = $langs->trans("Events");
123 if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
124 $nbEvent = 0;
125 // Enable caching of thirdparty count actioncomm
126 require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
127 $cachekey = 'count_events_expedition_' . $object->id;
128 $dataretrieved = dol_getcache($cachekey);
129 if (!is_null($dataretrieved)) {
130 $nbEvent = $dataretrieved;
131 } else {
132 $sql = "SELECT COUNT(id) as nb";
133 $sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm";
134 $sql .= " WHERE fk_element = " . ((int) $object->id);
135 $sql .= " AND elementtype = 'shipping'";
136 $resql = $db->query($sql);
137 if ($resql) {
138 $obj = $db->fetch_object($resql);
139 $nbEvent = $obj->nb;
140 } else {
141 dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
142 }
143 dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
144 }
145
146 $head[$h][1] .= '/';
147 $head[$h][1] .= $langs->trans("Agenda");
148 if ($nbEvent > 0) {
149 $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbEvent . '</span>';
150 }
151 }
152 $head[$h][2] = 'agenda';
153 $h++;
154 */
155
156 // Show more tabs from modules
157 // Entries must be declared in modules descriptor with line
158 // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
159 // $this->tabs = array('entity:-tabname); to remove a tab
160 complete_head_from_modules($conf, $langs, $object, $head, $h, 'delivery');
161
162 complete_head_from_modules($conf, $langs, $object, $head, $h, 'delivery', 'remove');
163
164 return $head;
165}
166
167
175{
176 global $langs, $db, $conf, $user;
177
178 // Load translation files required by the page
179 $langs->loadLangs(array("sendings", "deliveries"));
180
181 $h = 0;
182 $head = array();
183
184 if (getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'lire')) {
185 $head[$h][0] = DOL_URL_ROOT."/expedition/card.php?id=".$object->origin_id;
186 $head[$h][1] = $langs->trans("SendingCard");
187 $head[$h][2] = 'shipping';
188 $h++;
189 }
190
191 $head[$h][0] = DOL_URL_ROOT."/delivery/card.php?id=".$object->id;
192 $head[$h][1] = $langs->trans("DeliveryCard");
193 $head[$h][2] = 'delivery';
194 $h++;
195
196 // Show more tabs from modules
197 // Entries must be declared in modules descriptor with line
198 // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
199 // $this->tabs = array('entity:-tabname); to remove a tab
200 // complete_head_from_modules use $object->id for this link so we temporary change it
201
202 $savObjectId = $object->id;
203
204 // Get parent object
205 $tmpobject = null;
206 if ($object->origin_type) {
207 $tmpobject = new Expedition($db);
208 $tmpobject->fetch($object->origin_id);
209 } else {
210 $tmpobject = $object;
211 }
212
213 if (!getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
214 $objectsrc = $tmpobject;
215 if ($tmpobject->origin_type == 'commande' && $tmpobject->origin_id > 0) {
216 $objectsrc = new Commande($db);
217 $objectsrc->fetch($tmpobject->origin_id);
218 }
219 $nbContact = count($objectsrc->liste_contact(-1, 'internal')) + count($objectsrc->liste_contact(-1, 'external'));
220 $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$tmpobject->id;
221 $head[$h][1] = $langs->trans("ContactsAddresses");
222 if ($nbContact > 0) {
223 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
224 }
225 $head[$h][2] = 'contact';
226 $h++;
227 }
228
229 // Files
230 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
231 require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
232 $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($tmpobject->ref);
233 $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
234 $nbLinks = Link::count($db, $tmpobject->element, $tmpobject->id);
235 $head[$h][0] = DOL_URL_ROOT.'/expedition/document.php?id='.$tmpobject->id;
236 $head[$h][1] = $langs->trans('Documents');
237 if (($nbFiles + $nbLinks) > 0) {
238 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
239 }
240 $head[$h][2] = 'documents';
241 $h++;
242
243 // Notes
244 $nbNote = 0;
245 if (!empty($tmpobject->note_private)) {
246 $nbNote++;
247 }
248 if (!empty($tmpobject->note_public)) {
249 $nbNote++;
250 }
251 $head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$tmpobject->id;
252 $head[$h][1] = $langs->trans("Notes");
253 if ($nbNote > 0) {
254 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
255 }
256 $head[$h][2] = 'note';
257 $h++;
258
259 // Events
260 $head[$h][0] = DOL_URL_ROOT . '/expedition/agenda.php?id=' . $tmpobject->id;
261 $head[$h][1] = $langs->trans("Events");
262 if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
263 $nbEvent = 0;
264 // Enable caching of thirdparty count actioncomm
265 require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
266 $cachekey = 'count_events_expedition_' . $tmpobject->id;
267 $dataretrieved = dol_getcache($cachekey);
268 if (!is_null($dataretrieved)) {
269 $nbEvent = $dataretrieved;
270 } else {
271 $sql = "SELECT COUNT(id) as nb";
272 $sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm";
273 $sql .= " WHERE fk_element = " . ((int) $tmpobject->id);
274 $sql .= " AND elementtype = 'shipping'";
275 $resql = $db->query($sql);
276 if ($resql) {
277 $obj = $db->fetch_object($resql);
278 $nbEvent = $obj->nb;
279 } else {
280 dol_syslog('Failed to count actioncomm ' . $db->lasterror(), LOG_ERR);
281 }
282 dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
283 }
284
285 $head[$h][1] .= '/';
286 $head[$h][1] .= $langs->trans("Agenda");
287 if ($nbEvent > 0) {
288 $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbEvent . '</span>';
289 }
290 }
291 $head[$h][2] = 'agenda';
292 $h++;
293
294
295 $object->id = $tmpobject->id;
296
297 complete_head_from_modules($conf, $langs, $object, $head, $h, 'delivery');
298
299 complete_head_from_modules($conf, $langs, $object, $head, $h, 'delivery', 'remove');
300
301 $object->id = $savObjectId;
302 return $head;
303}
304
313function show_list_sending_receive($origin, $origin_id, $filter = '')
314{
315 global $db, $conf, $langs;
316 global $form;
317
318 $product_static = new Product($db);
319 $expedition = new Expedition($db);
320 $warehousestatic = new Entrepot($db);
321
322 $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end, obj.special_code,";
323 $sql .= " ed.rowid as edrowid, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_elementdet, ed.fk_entrepot as warehouse_id,";
324 $sql .= " e.rowid as sendingid, e.ref as exp_ref, e.date_creation, e.date_delivery, e.date_expedition, e.billed, e.fk_statut as status, e.signed_status,";
325 $sql .= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch,';
326 $sql .= ' p.description as product_desc';
327 $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed,";
328 $sql .= " ".MAIN_DB_PREFIX."expedition as e,";
329 $sql .= " ".MAIN_DB_PREFIX.$origin."det as obj"; // for example llx_commandedet
330 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid";
331 //TODO Add link to expeditiondet_batch
332 $sql .= " WHERE e.entity IN (".getEntity('expedition').")";
333 $sql .= " AND obj.fk_".$origin." = ".((int) $origin_id);
334 $sql .= " AND obj.rowid = ed.fk_elementdet";
335 if (isModEnabled('subtotals')) {
336 $sql .= " AND obj.special_code <> ".SUBTOTALS_SPECIAL_CODE;
337 }
338 $sql .= " AND ed.fk_expedition = e.rowid";
339 if ($filter) {
340 $sql .= $filter;
341 }
342 $sql .= " ORDER BY obj.rowid, obj.fk_product";
343
344 dol_syslog("show_list_sending_receive", LOG_DEBUG);
345 $resql = $db->query($sql);
346 if ($resql) {
347 $num = $db->num_rows($resql);
348 $i = 0;
349
350 if ($num) {
351 if ($filter) {
352 print load_fiche_titre($langs->trans("OtherSendingsForSameOrder"));
353 } else {
354 print load_fiche_titre($langs->trans("SendingsAndReceivingForSameOrder"));
355 }
356
357 print '<div class="div-table-responsive-no-min">';
358 print '<table class="liste centpercent">';
359 print '<tr class="liste_titre">';
360 //print '<td class="left">'.$langs->trans("QtyOrdered").'</td>';
361 print '<td>'.$langs->trans("SendingSheet").'</td>';
362 print '<td>'.$langs->trans("Description").'</td>';
363 print '<td class="center">'.$langs->trans("DateCreation").'</td>';
364 print '<td class="center">'.$langs->trans("DateDeliveryPlanned").'</td>';
365 print '<td class="center">'.$langs->trans("QtyPreparedOrShipped").'</td>';
366 if (isModEnabled('stock')) {
367 print '<td>'.$langs->trans("Warehouse").'</td>';
368 }
369 /*TODO Add link to expeditiondet_batch
370 if (isModEnabled('productbatch'))
371 {
372 print '<td>';
373 print '</td>';
374 }*/
375 if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) {
376 print '<td>'.$langs->trans("DeliveryOrder").'</td>';
377 //print '<td class="center">'.$langs->trans("QtyReceived").'</td>';
378 print '<td class="right">'.$langs->trans("DeliveryDate").'</td>';
379 }
380 print "</tr>\n";
381
382 while ($i < $num) {
383 $objp = $db->fetch_object($resql);
384
385 $expedition->id = $objp->expedition_id;
386 $expedition->ref = $objp->exp_ref;
387 $expedition->billed = $objp->billed;
388 $expedition->statut = $objp->status;
389 $expedition->status = $objp->status;
390 $expedition->signed_status = $objp->signed_status;
391
392 print '<tr class="oddeven">';
393
394 // Sending id
395 print '<td class="tdoverflowmax125">';
396 print $expedition->getNomUrl(1);
397 //print '<a href="'.DOL_URL_ROOT.'/expedition/card.php?id='.$objp->expedition_id.'">'.img_object($langs->trans("ShowSending"), 'sending').' '.$objp->exp_ref.'<a>';
398 print '</td>';
399
400 // Description
401 if ($objp->fk_product > 0) {
402 // Define output language
403 if (getDolGlobalInt('MAIN_MULTILANGS') && getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
404 $object = new $origin($db);
405 '@phan-var-force CommonObject $object';
406 $object->fetch($origin_id);
407 $object->fetch_thirdparty();
408
409 $prod = new Product($db);
410 $prod->id = $objp->fk_product;
411 $prod->getMultiLangs();
412
413 $outputlangs = $langs;
414 $newlang = '';
415 if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
416 $newlang = GETPOST('lang_id', 'aZ09');
417 }
418 if (empty($newlang)) {
419 $newlang = $object->thirdparty->default_lang;
420 }
421 if (!empty($newlang)) {
422 $outputlangs = new Translate("", $conf);
423 $outputlangs->setDefaultLang($newlang);
424 }
425
426 $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label;
427 } else {
428 $label = (!empty($objp->label) ? $objp->label : $objp->product_label);
429 }
430
431 print '<td>';
432
433 // Show product and description
434 $product_static->type = $objp->fk_product_type;
435 $product_static->id = $objp->fk_product;
436 $product_static->ref = $objp->ref;
437 $product_static->status_batch = $objp->product_tobatch;
438
439 $text = $product_static->getNomUrl(1);
440 $text .= ' - '.$label;
441 $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description));
442 print $form->textwithtooltip($text, $description, 3, 0, '', (string) $i);
443
444 // Show range
445 print_date_range($objp->date_start, $objp->date_end);
446
447 // Add description in form
448 if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
449 print(!empty($objp->description) ? ((empty($objp->product) || $objp->description != $objp->product) ? '<br>'.dol_htmlentitiesbr($objp->description) : '') : '');
450 }
451
452 print '</td>';
453 } else {
454 print "<td>";
455 if ($objp->fk_product_type == 1) {
456 $text = img_object($langs->trans('Service'), 'service');
457 } else {
458 $text = img_object($langs->trans('Product'), 'product');
459 }
460
461 if (!empty($objp->label)) {
462 $text .= ' <strong>'.$objp->label.'</strong>';
463 print $form->textwithtooltip($text, $objp->description, 3, 0, '', (string) $i);
464 } else {
465 print $text.' '.nl2br($objp->description);
466 }
467
468 // Show range
469 print_date_range($objp->date_start, $objp->date_end);
470 print "</td>\n";
471 }
472
473 //print '<td class="center">'.$objp->qty_asked.'</td>';
474
475 // Date creation
476 print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->date_creation), 'day').'</td>';
477
478 // Date shipping creation
479 print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->date_delivery), 'day').'</td>';
480
481 // Qty shipped
482 print '<td class="center">'.$objp->qty_shipped.'</td>';
483
484 // Warehouse
485 if (isModEnabled('stock')) {
486 print '<td class="tdoverflowmax125">';
487 if ($objp->warehouse_id > 0) {
488 $warehousestatic->fetch($objp->warehouse_id);
489 print $warehousestatic->getNomUrl(1);
490 }
491 print '</td>';
492 }
493
494 // Batch number management
495 /*TODO Add link to expeditiondet_batch
496 if (isModEnabled('productbatch'))
497 {
498 //var_dump($objp->edrowid);
499 $lines[$i]->detail_batch
500 if (isset($lines[$i]->detail_batch))
501 {
502 print '<td>';
503 if ($lines[$i]->product_tobatch)
504 {
505 $detail = '';
506 foreach ($lines[$i]->detail_batch as $dbatch)
507 {
508 $detail.= $langs->trans("Batch").': '.$dbatch->batch;
509 $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby,"day");
510 $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby,"day");
511 $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty;
512 $detail.= '<br>';
513 }
514 print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail);
515 }
516 else
517 {
518 print $langs->trans("NA");
519 }
520 print '</td>';
521 } else {
522 print '<td></td>';
523 }
524 }*/
525
526 // Information on receipt
527 if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) {
528 include_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php';
529 $expedition->fetchObjectLinked($expedition->id, $expedition->element, null, 'delivery');
530 //var_dump($expedition->linkedObjects);
531
532 $receiving = '';
533 if (!empty($expedition->linkedObjects['delivery'])) {
534 $receiving = reset($expedition->linkedObjects['delivery']); // Take first link
535 }
536
537 if (!empty($receiving)) {
539 '@phan-var-force Delivery $receiving';
540 // $expedition->fk_elementdet = id of det line of order
541 // $receiving->fk_origin_line = id of det line of order
542 // $receiving->origin may be 'shipping'
543 // $receiving->origin_id may be id of shipping
544
545 // Ref
546 print '<td>';
547 print $receiving->getNomUrl(1);
548 //print '<a href="'.DOL_URL_ROOT.'/delivery/card.php?id='.$livraison_id.'">'.img_object($langs->trans("ShowReceiving"),'sending').' '.$objp->livraison_ref.'<a>';
549 print '</td>';
550 // Qty received
551 //print '<td class="center">';
552 // TODO No solution for the moment to link a line det of receipt with a line det of shipping,
553 // so no way to know the qty received for this line of shipping.
554 //print $langs->trans("FeatureNotYetAvailable");
555 //print '</td>';
556 // Date shipping real
557 print '<td class="right">';
558 print dol_print_date($receiving->date_delivery, 'day');
559 print '</td>';
560 } else {
561 //print '<td>&nbsp;</td>';
562 print '<td>&nbsp;</td>';
563 print '<td>&nbsp;</td>';
564 }
565 }
566 print '</tr>';
567 $i++;
568 }
569
570 print '</table>';
571 print '</div>';
572 }
573 $db->free($resql);
574 } else {
575 dol_print_error($db);
576 }
577
578 return 1;
579}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:67
Class to manage customers orders.
Class to manage warehouses.
const STATUS_DRAFT
Draft status.
Class to manage products or services.
Class to manage translations.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
Definition files.lib.php:63
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
print_date_range($date_start, $date_end, $format='', $outputlangs=null)
Format output for start and end date.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
dol_setcache($memoryid, $data, $expire=0, $filecache=0, $replace=0)
Save data into a memory area shared by all users, all sessions on server.
dol_getcache($memoryid, $filecache=0)
Read a memory area shared by all users, all sessions on server.
delivery_prepare_head($object)
Prepare array with list of tabs.
shipping_prepare_head($object)
Prepare array with list of tabs.