dolibarr 21.0.0-beta
receptionlinebatch.class.php
1<?php
2/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
4 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
5 * Copyright (C) 2024 Christophe Battarel <christophe@altairis.fr>
6 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
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
28// Put here all includes required by your class file
29require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
30require_once DOL_DOCUMENT_ROOT."/reception/class/reception.class.php";
31
32
37{
41 public $db;
42
46 public $element = 'receptionlinebatch';
47
51 public $table_element = 'receptiondet_batch';
52 public $lines = array();
53
57 public $id;
58
62 public $fk_reception;
63
67 public $fk_element;
68
72 public $origin_id;
73
77 public $fk_elementdet;
78
82 public $origin_line_id;
83
87 public $element_type;
88
92 public $fk_product;
93
97 public $qty;
98
102 public $qty_asked;
103
107 public $libelle;
111 public $label;
115 public $desc;
119 public $tva_tx;
123 public $vat_src_code;
127 public $ref_supplier;
128
132 public $fk_entrepot;
133
137 public $fk_user;
138
142 public $datec = '';
146 public $comment;
147
151 public $status;
152
156 public $batch;
160 public $eatby = null;
164 public $sellby = null;
168 public $cost_price = 0;
169
170
171
172
178 public function __construct($db)
179 {
180 $this->db = $db;
181
182 // List of language codes for status
183 $this->labelStatus[0] = 'Received';
184 $this->labelStatus[1] = 'Verified';
185 $this->labelStatus[2] = 'Denied';
186 $this->labelStatusShort[0] = 'Received';
187 $this->labelStatusShort[1] = 'Verified';
188 $this->labelStatusShort[2] = 'Denied';
189 }
190
191
199 public function create($user, $notrigger = 0)
200 {
201 $error = 0;
202
203 // Clean parameters
204 if (isset($this->fk_element)) {
205 $this->fk_element = (int) $this->fk_element;
206 }
207 if (isset($this->fk_product)) {
208 $this->fk_product = (int) $this->fk_product;
209 }
210 if (isset($this->fk_elementdet)) {
211 $this->fk_elementdet = (int) $this->fk_elementdet;
212 }
213 if (isset($this->qty)) {
214 $this->qty = (float) $this->qty;
215 }
216 if (isset($this->fk_entrepot)) {
217 $this->fk_entrepot = (int) $this->fk_entrepot;
218 }
219 if (isset($this->fk_user)) {
220 $this->fk_user = (int) $this->fk_user;
221 }
222 if (isset($this->comment)) {
223 $this->comment = trim($this->comment);
224 }
225 if (isset($this->status)) {
226 $this->status = (int) $this->status;
227 }
228 if (isset($this->batch)) {
229 $this->batch = trim($this->batch);
230 }
231 if (empty($this->datec)) {
232 $this->datec = dol_now();
233 }
234
235 // Check parameters
236 if (empty($this->fk_product)) {
237 $this->error = 'Error, property ->fk_product must not be empty to create a line of reception';
238 return -1;
239 }
240 if (empty($this->fk_reception)) {
241 $this->error = 'Error, property ->fk_reception must not be empty to create a line of reception';
242 return -1;
243 }
244
245 // Insert request
246 $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."(";
247 $sql .= "fk_product,";
248 $sql .= "fk_element,";
249 $sql .= "fk_elementdet,";
250 $sql .= "element_type,";
251 $sql .= "qty,";
252 $sql .= "fk_entrepot,";
253 $sql .= "fk_user,";
254 $sql .= "datec,";
255 $sql .= "comment,";
256 $sql .= "status,";
257 $sql .= "batch,";
258 $sql .= "eatby,";
259 $sql .= "sellby,";
260 $sql .= "fk_reception,";
261 $sql .= "cost_price";
262 $sql .= ") VALUES (";
263 $sql .= " ".(!isset($this->fk_product) ? 'NULL' : (int) $this->fk_product).",";
264 $sql .= " ".(!isset($this->fk_element) ? 'NULL' : (int) $this->fk_element).",";
265 $sql .= " ".(!isset($this->fk_elementdet) ? 'NULL' : (int) $this->fk_elementdet).",";
266 $sql .= " '".(!isset($this->element_type) ? "supplier_order" : $this->db->escape($this->element_type))."',";
267 $sql .= " ".(!isset($this->qty) ? 'NULL' : (float) $this->qty).",";
268 $sql .= " ".(!isset($this->fk_entrepot) ? 'NULL' : (int) $this->fk_entrepot).",";
269 $sql .= " ".(!isset($this->fk_user) ? 'NULL' : (int) $this->fk_user).",";
270 $sql .= " ".(!isset($this->datec) || dol_strlen($this->datec) == 0 ? 'NULL' : "'".$this->db->idate($this->datec)."'").",";
271 $sql .= " ".(!isset($this->comment) ? 'NULL' : "'".$this->db->escape($this->comment)."'").",";
272 $sql .= " ".(!isset($this->status) ? 'NULL' : (int) $this->status).",";
273 $sql .= " ".(!isset($this->batch) ? 'NULL' : "'".$this->db->escape($this->batch)."'").",";
274 $sql .= " ".(!isset($this->eatby) || dol_strlen((string) $this->eatby) == 0 ? 'NULL' : "'".$this->db->idate($this->eatby)."'").",";
275 $sql .= " ".(!isset($this->sellby) || dol_strlen((string) $this->sellby) == 0 ? 'NULL' : "'".$this->db->idate($this->sellby)."'").",";
276 $sql .= " ".((int) $this->fk_reception).",";
277 $sql .= " ".(!isset($this->cost_price) ? '0' : (float) $this->cost_price);
278 $sql .= ")";
279
280 $this->db->begin();
281
282 dol_syslog(__METHOD__, LOG_DEBUG);
283 $resql = $this->db->query($sql);
284 if (!$resql) {
285 $error++;
286 $this->errors[] = "Error ".$this->db->lasterror();
287 }
288
289 if (!$error) {
290 $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
291
292 if (!$notrigger) {
293 // Call triggers
294 $result = $this->call_trigger('LINERECEPTION_CREATE', $user);
295 if ($result < 0) {
296 $error++;
297 }
298 // End call triggers
299 }
300 }
301
302 // Create extrafields
303 if (!$error) {
304 $result = $this->insertExtraFields();
305 if ($result < 0) {
306 $error++;
307 }
308 }
309
310 // Commit or rollback
311 if ($error) {
312 foreach ($this->errors as $errmsg) {
313 dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
314 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
315 }
316 $this->db->rollback();
317 return -1 * $error;
318 } else {
319 $this->db->commit();
320 return $this->id;
321 }
322 }
323
324
332 public function fetch($id, $ref = '')
333 {
334 $sql = "SELECT";
335 $sql .= " t.rowid,";
336 $sql .= " t.fk_element,";
337 $sql .= " t.fk_elementdet,";
338 $sql .= " t.element_type,";
339 $sql .= " t.fk_product,";
340 $sql .= " t.qty,";
341 $sql .= " t.fk_entrepot,";
342 $sql .= " t.fk_user,";
343 $sql .= " t.datec,";
344 $sql .= " t.comment,";
345 $sql .= " t.status,";
346 $sql .= " t.tms,";
347 $sql .= " t.batch,";
348 $sql .= " t.eatby,";
349 $sql .= " t.sellby,";
350 $sql .= " t.fk_reception";
351 $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
352 if ($ref) {
353 $sql .= " WHERE t.ref = '".$this->db->escape($ref)."'";
354 } else {
355 $sql .= " WHERE t.rowid = ".((int) $id);
356 }
357
358 dol_syslog(get_class($this)."::fetch");
359 $resql = $this->db->query($sql);
360 if ($resql) {
361 if ($this->db->num_rows($resql)) {
362 $obj = $this->db->fetch_object($resql);
363
364 $this->id = $obj->rowid;
365
366 $this->fk_element = $obj->fk_element;
367 $this->origin_id = $obj->fk_element;
368 $this->fk_elementdet = $obj->fk_elementdet;
369 $this->origin_line_id = $obj->fk_elementdet;
370 $this->element_type = $obj->element_type;
371 $this->origin_type = $obj->element_type;
372
373 $this->fk_product = $obj->fk_product;
374 $this->qty = $obj->qty;
375 $this->fk_entrepot = $obj->fk_entrepot;
376 $this->fk_user = $obj->fk_user;
377 $this->datec = $this->db->jdate($obj->datec);
378 $this->comment = $obj->comment;
379 $this->status = $obj->status;
380 $this->tms = $this->db->jdate($obj->tms);
381 $this->batch = $obj->batch;
382 $this->eatby = $this->db->jdate($obj->eatby);
383 $this->sellby = $this->db->jdate($obj->sellby);
384 $this->fk_reception = $obj->fk_reception;
385
386 $this->fetch_optionals();
387 }
388 $this->db->free($resql);
389
390 return 1;
391 } else {
392 $this->error = "Error ".$this->db->lasterror();
393 return -1;
394 }
395 }
396
397
405 public function update($user, $notrigger = 0)
406 {
407 $error = 0;
408
409 // Clean parameters
410
411 if (isset($this->fk_element)) {
412 $this->fk_element = (int) $this->fk_element;
413 }
414 if (isset($this->fk_product)) {
415 $this->fk_product = (int) $this->fk_product;
416 }
417 if (isset($this->fk_elementdet)) {
418 $this->fk_elementdet = (int) $this->fk_elementdet;
419 }
420 if (isset($this->qty)) {
421 $this->qty = (float) $this->qty;
422 }
423 if (isset($this->fk_entrepot)) {
424 $this->fk_entrepot = (int) $this->fk_entrepot;
425 }
426 if (isset($this->fk_user)) {
427 $this->fk_user = (int) $this->fk_user;
428 }
429 if (isset($this->comment)) {
430 $this->comment = trim($this->comment);
431 }
432 if (isset($this->status)) {
433 $this->status = (int) $this->status;
434 }
435 if (isset($this->batch)) {
436 $this->batch = trim($this->batch);
437 }
438
439
440
441 // Check parameters
442 // Put here code to add a control on parameters values
443
444 // Update request
445 $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
446 $sql .= " fk_element=".(isset($this->fk_element) ? $this->fk_element : "null").",";
447 $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").",";
448 $sql .= " fk_elementdet=".(isset($this->fk_elementdet) ? $this->fk_elementdet : "null").",";
449 $sql .= " qty=".(isset($this->qty) ? $this->qty : "null").",";
450 $sql .= " fk_entrepot=".(isset($this->fk_entrepot) ? $this->fk_entrepot : "null").",";
451 $sql .= " fk_user=".(isset($this->fk_user) ? $this->fk_user : "null").",";
452 $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
453 $sql .= " comment=".(isset($this->comment) ? "'".$this->db->escape($this->comment)."'" : "null").",";
454 $sql .= " status=".(isset($this->status) ? $this->status : "null").",";
455 $sql .= " tms=".(dol_strlen((string) $this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
456 $sql .= " batch=".(isset($this->batch) ? "'".$this->db->escape($this->batch)."'" : "null").",";
457 $sql .= " eatby=".(dol_strlen((string) $this->eatby) != 0 ? "'".$this->db->idate($this->eatby)."'" : 'null').",";
458 $sql .= " sellby=".(dol_strlen((string) $this->sellby) != 0 ? "'".$this->db->idate($this->sellby)."'" : 'null');
459 $sql .= " WHERE rowid=".((int) $this->id);
460
461 $this->db->begin();
462
463 dol_syslog(__METHOD__);
464 $resql = $this->db->query($sql);
465 if (!$resql) {
466 $error++;
467 $this->errors[] = "Error ".$this->db->lasterror();
468 }
469
470 if (!$error) {
471 if (empty($this->id) && !empty($this->rowid)) {
472 $this->id = $this->rowid;
473 }
474 $result = $this->insertExtraFields();
475 if ($result < 0) {
476 $error++;
477 }
478
479 if (!$notrigger) {
480 // Call triggers
481 $result = $this->call_trigger('LINERECEPTION_MODIFY', $user);
482 if ($result < 0) {
483 $error++;
484 }
485 // End call triggers
486 }
487 }
488
489 // Commit or rollback
490 if ($error) {
491 foreach ($this->errors as $errmsg) {
492 dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
493 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
494 }
495 $this->db->rollback();
496 return -1 * $error;
497 } else {
498 $this->db->commit();
499 return 1;
500 }
501 }
502
503
511 public function delete($user, $notrigger = 0)
512 {
513 $error = 0;
514
515 $this->db->begin();
516
517 if (!$error) {
518 if (!$notrigger) {
519 // Call triggers
520 $result = $this->call_trigger('LINERECEPTION_DELETE', $user);
521 if ($result < 0) {
522 $error++;
523 }
524 // End call triggers
525 }
526 }
527
528 // Remove extrafields
529 if (!$error) {
530 $result = $this->deleteExtraFields();
531 if ($result < 0) {
532 $error++;
533 dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR);
534 }
535 }
536
537 if (!$error) {
538 $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
539 $sql .= " WHERE rowid=".((int) $this->id);
540
541 dol_syslog(__METHOD__);
542 $resql = $this->db->query($sql);
543 if (!$resql) {
544 $error++;
545 $this->errors[] = "Error ".$this->db->lasterror();
546 }
547 }
548
549 // Commit or rollback
550 if ($error) {
551 foreach ($this->errors as $errmsg) {
552 dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
553 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
554 }
555 $this->db->rollback();
556 return -1 * $error;
557 } else {
558 $this->db->commit();
559 return 1;
560 }
561 }
562
563
571 public function createFromClone(User $user, $fromid)
572 {
573 $error = 0;
574
575 $object = new ReceptionLineBatch($this->db);
576
577 $this->db->begin();
578
579 // Load source object
580 $object->fetch($fromid);
581 $object->id = 0;
582 $object->statut = 0;
583
584 // Clear fields
585 // ...
586
587 // Create clone
588 $object->context['createfromclone'] = 'createfromclone';
589 $result = $object->create($user);
590
591 // Other options
592 if ($result < 0) {
593 $this->error = $object->error;
594 $error++;
595 }
596
597 if (!$error) {
598 }
599
600 unset($object->context['createfromclone']);
601
602 // End
603 if (!$error) {
604 $this->db->commit();
605 return $object->id;
606 } else {
607 $this->db->rollback();
608 return -1;
609 }
610 }
611
612
613
620 public function getLibStatut($mode = 0)
621 {
622 return $this->LibStatut($this->status, $mode);
623 }
624
625 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
633 public function LibStatut($status, $mode = 0)
634 {
635 // phpcs:enable
636 global $langs;
637 $langs->load('orders');
638
639 if ($mode == 0) {
640 return $langs->trans($this->labelStatus[$status]);
641 } elseif ($mode == 1) {
642 return $langs->trans($this->labelStatusShort[$status]);
643 } elseif ($mode == 2) {
644 return $langs->trans($this->labelStatus[$status]);
645 } elseif ($mode == 3) {
646 if ($status == 0) {
647 return img_picto($langs->trans($this->labelStatus[$status]), 'statut0');
648 } elseif ($status == 1) {
649 return img_picto($langs->trans($this->labelStatus[$status]), 'statut4');
650 } elseif ($status == 2) {
651 return img_picto($langs->trans($this->labelStatus[$status]), 'statut8');
652 }
653 } elseif ($mode == 4) {
654 if ($status == 0) {
655 return img_picto($langs->trans($this->labelStatus[$status]), 'statut0').' '.$langs->trans($this->labelStatus[$status]);
656 } elseif ($status == 1) {
657 return img_picto($langs->trans($this->labelStatus[$status]), 'statut4').' '.$langs->trans($this->labelStatus[$status]);
658 } elseif ($status == 2) {
659 return img_picto($langs->trans($this->labelStatus[$status]), 'statut8').' '.$langs->trans($this->labelStatus[$status]);
660 }
661 } elseif ($mode == 5) {
662 if ($status == 0) {
663 return '<span class="hideonsmartphone">'.$langs->trans($this->labelStatusShort[$status]).' </span>'.img_picto($langs->trans($this->labelStatus[$status]), 'statut0');
664 } elseif ($status == 1) {
665 return '<span class="hideonsmartphone">'.$langs->trans($this->labelStatusShort[$status]).' </span>'.img_picto($langs->trans($this->labelStatus[$status]), 'statut4');
666 } elseif ($status == 2) {
667 return '<span class="hideonsmartphone">'.$langs->trans($this->labelStatusShort[$status]).' </span>'.img_picto($langs->trans($this->labelStatus[$status]), 'statut8');
668 }
669 }
670 return "";
671 }
672
673
680 public function initAsSpecimen()
681 {
682 $this->id = 0;
683
684 $this->fk_element = 0;
685 $this->fk_product = 0;
686 $this->fk_elementdet = 0;
687 $this->qty = 0;
688 $this->fk_entrepot = 0;
689 $this->fk_user = 0;
690 $this->datec = '';
691 $this->comment = '';
692 $this->status = 0;
693 $this->tms = dol_now();
694 $this->batch = '';
695 $this->eatby = null;
696 $this->sellby = null;
697
698 return 1;
699 }
700
712 public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
713 {
714 dol_syslog(__METHOD__, LOG_DEBUG);
715
716 $sql = "SELECT";
717 $sql .= " t.rowid,";
718 $sql .= " t.fk_element,";
719 $sql .= " t.fk_product,";
720 $sql .= " t.fk_elementdet,";
721 $sql .= " t.qty,";
722 $sql .= " t.fk_entrepot,";
723 $sql .= " t.fk_user,";
724 $sql .= " t.datec,";
725 $sql .= " t.comment,";
726 $sql .= " t.status,";
727 $sql .= " t.tms,";
728 $sql .= " t.batch,";
729 $sql .= " t.eatby,";
730 $sql .= " t.sellby";
731 $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
732
733 // Manage filter
734 if (is_array($filter)) {
735 $sqlwhere = array();
736 if (count($filter) > 0) {
737 foreach ($filter as $key => $value) {
738 if ($key == 't.comment') {
739 $sqlwhere [] = $this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'";
740 } elseif ($key == 't.datec' || $key == 't.tms' || $key == 't.eatby' || $key == 't.sellby' || $key == 't.batch') {
741 $sqlwhere [] = $this->db->sanitize($key)." = '".$this->db->escape($value)."'";
742 } elseif ($key == 'qty') {
743 $sqlwhere [] = $this->db->sanitize($key)." = ".((float) $value);
744 } else {
745 $sqlwhere [] = $this->db->sanitize($key)." = ".((int) $value);
746 }
747 }
748 }
749 if (count($sqlwhere) > 0) {
750 $sql .= ' WHERE '.implode(' '.$this->db->escape($filtermode).' ', $sqlwhere);
751 }
752
753 $filter = '';
754 }
755
756 // Manage filter
757 $errormessage = '';
758 $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
759 if ($errormessage) {
760 $this->errors[] = $errormessage;
761 dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
762 return -1;
763 }
764
765 if (!empty($sortfield)) {
766 $sql .= $this->db->order($sortfield, $sortorder);
767 }
768 if (!empty($limit)) {
769 $sql .= $this->db->plimit($limit, $offset);
770 }
771 $this->lines = array();
772
773 $resql = $this->db->query($sql);
774 if ($resql) {
775 $num = $this->db->num_rows($resql);
776
777 while ($obj = $this->db->fetch_object($resql)) {
778 $line = new self($this->db);
779
780 $line->id = $obj->rowid;
781
782 $line->fk_element = $obj->fk_element;
783 $line->fk_product = $obj->fk_product;
784 $line->fk_elementdet = $obj->fk_elementdet;
785 $line->qty = $obj->qty;
786 $line->fk_entrepot = $obj->fk_entrepot;
787 $line->fk_user = $obj->fk_user;
788 $line->datec = $this->db->jdate($obj->datec);
789 $line->comment = $obj->comment;
790 $line->status = $obj->status;
791 $line->tms = $this->db->jdate($obj->tms);
792 $line->batch = $obj->batch;
793 $line->eatby = $this->db->jdate($obj->eatby);
794 $line->sellby = $this->db->jdate($obj->sellby);
795 $line->fetch_optionals();
796
797 $this->lines[$line->id] = $line;
798 }
799 $this->db->free($resql);
800
801 return $num;
802 } else {
803 $this->errors[] = 'Error '.$this->db->lasterror();
804 dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
805
806 return -1;
807 }
808 }
809}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
fetch_optionals($rowid=null, $optionsArray=null)
Function to get extra fields of an object into $this->array_options This method is in most cases call...
deleteExtraFields()
Delete all extra fields values for the current object.
insertExtraFields($trigger='', $userused=null)
Add/Update all extra fields values for the current object.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
Class to manage table commandefournisseurdispatch.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
createFromClone(User $user, $fromid)
Load an object from its id and create a new one in database.
update($user, $notrigger=0)
Update object into database.
LibStatut($status, $mode=0)
Return label of a status.
$table_element
Name of table without prefix where object is stored.
create($user, $notrigger=0)
Create object into database.
getLibStatut($mode=0)
Return label of the status of object.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
Load object in memory from the database.
fetch($id, $ref='')
Load object in memory from the database.
Class to manage Dolibarr users.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
Definition index.php:171
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0)
forgeSQLFromUniversalSearchCriteria
dol_now($mode='auto')
Return date for now.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.