dolibarr  21.0.0-alpha
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  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
27 // Put here all includes required by your class file
28 require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
29 require_once DOL_DOCUMENT_ROOT."/reception/class/reception.class.php";
30 
31 
36 {
40  public $db;
41 
45  public $element = 'receptionlinebatch';
46 
50  public $table_element = 'receptiondet_batch';
51  public $lines = array();
52 
56  public $id;
57 
61  public $fk_reception;
62 
66  public $fk_element;
67 
71  public $origin_id;
72 
76  public $fk_elementdet;
77 
81  public $origin_line_id;
82 
86  public $element_type;
87 
91  public $fk_product;
92 
96  public $qty;
97 
101  public $qty_asked;
102 
103  public $libelle;
104  public $label;
105  public $desc;
106  public $tva_tx;
107  public $vat_src_code;
108  public $ref_supplier;
109 
113  public $fk_entrepot;
114 
118  public $fk_user;
119 
120  public $datec = '';
121  public $comment;
122 
126  public $status;
127 
128  public $batch;
129  public $eatby = '';
130  public $sellby = '';
131  public $cost_price = 0;
132 
133 
134 
135 
141  public function __construct($db)
142  {
143  $this->db = $db;
144 
145  // List of language codes for status
146  $this->labelStatus[0] = 'Received';
147  $this->labelStatus[1] = 'Verified';
148  $this->labelStatus[2] = 'Denied';
149  $this->labelStatusShort[0] = 'Received';
150  $this->labelStatusShort[1] = 'Verified';
151  $this->labelStatusShort[2] = 'Denied';
152  }
153 
154 
162  public function create($user, $notrigger = 0)
163  {
164  $error = 0;
165 
166  // Clean parameters
167  if (isset($this->fk_element)) {
168  $this->fk_element = (int) $this->fk_element;
169  }
170  if (isset($this->fk_product)) {
171  $this->fk_product = (int) $this->fk_product;
172  }
173  if (isset($this->fk_elementdet)) {
174  $this->fk_elementdet = (int) $this->fk_elementdet;
175  }
176  if (isset($this->qty)) {
177  $this->qty = (float) $this->qty;
178  }
179  if (isset($this->fk_entrepot)) {
180  $this->fk_entrepot = (int) $this->fk_entrepot;
181  }
182  if (isset($this->fk_user)) {
183  $this->fk_user = (int) $this->fk_user;
184  }
185  if (isset($this->comment)) {
186  $this->comment = trim($this->comment);
187  }
188  if (isset($this->status)) {
189  $this->status = (int) $this->status;
190  }
191  if (isset($this->batch)) {
192  $this->batch = trim($this->batch);
193  }
194  if (empty($this->datec)) {
195  $this->datec = dol_now();
196  }
197 
198  // Check parameters
199  if (empty($this->fk_product)) {
200  $this->error = 'Error, property ->fk_product must not be empty to create a line of reception';
201  return -1;
202  }
203  if (empty($this->fk_reception)) {
204  $this->error = 'Error, property ->fk_reception must not be empty to create a line of reception';
205  return -1;
206  }
207 
208  // Insert request
209  $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."(";
210  $sql .= "fk_product,";
211  $sql .= "fk_element,";
212  $sql .= "fk_elementdet,";
213  $sql .= "element_type,";
214  $sql .= "qty,";
215  $sql .= "fk_entrepot,";
216  $sql .= "fk_user,";
217  $sql .= "datec,";
218  $sql .= "comment,";
219  $sql .= "status,";
220  $sql .= "batch,";
221  $sql .= "eatby,";
222  $sql .= "sellby,";
223  $sql .= "fk_reception,";
224  $sql .= "cost_price";
225  $sql .= ") VALUES (";
226  $sql .= " ".(!isset($this->fk_product) ? 'NULL' : (int) $this->fk_product).",";
227  $sql .= " ".(!isset($this->fk_element) ? 'NULL' : (int) $this->fk_element).",";
228  $sql .= " ".(!isset($this->fk_elementdet) ? 'NULL' : (int) $this->fk_elementdet).",";
229  $sql .= " '".(!isset($this->element_type) ? "supplier_order" : $this->db->escape($this->element_type))."',";
230  $sql .= " ".(!isset($this->qty) ? 'NULL' : (float) $this->qty).",";
231  $sql .= " ".(!isset($this->fk_entrepot) ? 'NULL' : (int) $this->fk_entrepot).",";
232  $sql .= " ".(!isset($this->fk_user) ? 'NULL' : (int) $this->fk_user).",";
233  $sql .= " ".(!isset($this->datec) || dol_strlen($this->datec) == 0 ? 'NULL' : "'".$this->db->idate($this->datec)."'").",";
234  $sql .= " ".(!isset($this->comment) ? 'NULL' : "'".$this->db->escape($this->comment)."'").",";
235  $sql .= " ".(!isset($this->status) ? 'NULL' : (int) $this->status).",";
236  $sql .= " ".(!isset($this->batch) ? 'NULL' : "'".$this->db->escape($this->batch)."'").",";
237  $sql .= " ".(!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'".$this->db->idate($this->eatby)."'").",";
238  $sql .= " ".(!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'".$this->db->idate($this->sellby)."'").",";
239  $sql .= " ".((int) $this->fk_reception).",";
240  $sql .= " ".(!isset($this->cost_price) ? '0' : (float) $this->cost_price);
241  $sql .= ")";
242 
243  $this->db->begin();
244 
245  dol_syslog(__METHOD__, LOG_DEBUG);
246  $resql = $this->db->query($sql);
247  if (!$resql) {
248  $error++;
249  $this->errors[] = "Error ".$this->db->lasterror();
250  }
251 
252  if (!$error) {
253  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
254 
255  if (!$notrigger) {
256  // Call triggers
257  $result = $this->call_trigger('LINERECEPTION_CREATE', $user);
258  if ($result < 0) {
259  $error++;
260  }
261  // End call triggers
262  }
263  }
264 
265  // Create extrafields
266  if (!$error) {
267  $result = $this->insertExtraFields();
268  if ($result < 0) {
269  $error++;
270  }
271  }
272 
273  // Commit or rollback
274  if ($error) {
275  foreach ($this->errors as $errmsg) {
276  dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
277  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
278  }
279  $this->db->rollback();
280  return -1 * $error;
281  } else {
282  $this->db->commit();
283  return $this->id;
284  }
285  }
286 
287 
295  public function fetch($id, $ref = '')
296  {
297  $sql = "SELECT";
298  $sql .= " t.rowid,";
299  $sql .= " t.fk_element,";
300  $sql .= " t.fk_elementdet,";
301  $sql .= " t.element_type,";
302  $sql .= " t.fk_product,";
303  $sql .= " t.qty,";
304  $sql .= " t.fk_entrepot,";
305  $sql .= " t.fk_user,";
306  $sql .= " t.datec,";
307  $sql .= " t.comment,";
308  $sql .= " t.status,";
309  $sql .= " t.tms,";
310  $sql .= " t.batch,";
311  $sql .= " t.eatby,";
312  $sql .= " t.sellby,";
313  $sql .= " t.fk_reception";
314  $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
315  if ($ref) {
316  $sql .= " WHERE t.ref = '".$this->db->escape($ref)."'";
317  } else {
318  $sql .= " WHERE t.rowid = ".((int) $id);
319  }
320 
321  dol_syslog(get_class($this)."::fetch");
322  $resql = $this->db->query($sql);
323  if ($resql) {
324  if ($this->db->num_rows($resql)) {
325  $obj = $this->db->fetch_object($resql);
326 
327  $this->id = $obj->rowid;
328 
329  $this->fk_element = $obj->fk_element;
330  $this->origin_id = $obj->fk_element;
331  $this->fk_elementdet = $obj->fk_elementdet;
332  $this->origin_line_id = $obj->fk_elementdet;
333  $this->element_type = $obj->element_type;
334  $this->origin_type = $obj->element_type;
335 
336  $this->fk_product = $obj->fk_product;
337  $this->qty = $obj->qty;
338  $this->fk_entrepot = $obj->fk_entrepot;
339  $this->fk_user = $obj->fk_user;
340  $this->datec = $this->db->jdate($obj->datec);
341  $this->comment = $obj->comment;
342  $this->status = $obj->status;
343  $this->tms = $this->db->jdate($obj->tms);
344  $this->batch = $obj->batch;
345  $this->eatby = $this->db->jdate($obj->eatby);
346  $this->sellby = $this->db->jdate($obj->sellby);
347  $this->fk_reception = $obj->fk_reception;
348 
349  $this->fetch_optionals();
350  }
351  $this->db->free($resql);
352 
353  return 1;
354  } else {
355  $this->error = "Error ".$this->db->lasterror();
356  return -1;
357  }
358  }
359 
360 
368  public function update($user, $notrigger = 0)
369  {
370  $error = 0;
371 
372  // Clean parameters
373 
374  if (isset($this->fk_element)) {
375  $this->fk_element = (int) $this->fk_element;
376  }
377  if (isset($this->fk_product)) {
378  $this->fk_product = (int) $this->fk_product;
379  }
380  if (isset($this->fk_elementdet)) {
381  $this->fk_elementdet = (int) $this->fk_elementdet;
382  }
383  if (isset($this->qty)) {
384  $this->qty = (float) $this->qty;
385  }
386  if (isset($this->fk_entrepot)) {
387  $this->fk_entrepot = (int) $this->fk_entrepot;
388  }
389  if (isset($this->fk_user)) {
390  $this->fk_user = (int) $this->fk_user;
391  }
392  if (isset($this->comment)) {
393  $this->comment = trim($this->comment);
394  }
395  if (isset($this->status)) {
396  $this->status = (int) $this->status;
397  }
398  if (isset($this->batch)) {
399  $this->batch = trim($this->batch);
400  }
401 
402 
403 
404  // Check parameters
405  // Put here code to add a control on parameters values
406 
407  // Update request
408  $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
409  $sql .= " fk_element=".(isset($this->fk_element) ? $this->fk_element : "null").",";
410  $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").",";
411  $sql .= " fk_elementdet=".(isset($this->fk_elementdet) ? $this->fk_elementdet : "null").",";
412  $sql .= " qty=".(isset($this->qty) ? $this->qty : "null").",";
413  $sql .= " fk_entrepot=".(isset($this->fk_entrepot) ? $this->fk_entrepot : "null").",";
414  $sql .= " fk_user=".(isset($this->fk_user) ? $this->fk_user : "null").",";
415  $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
416  $sql .= " comment=".(isset($this->comment) ? "'".$this->db->escape($this->comment)."'" : "null").",";
417  $sql .= " status=".(isset($this->status) ? $this->status : "null").",";
418  $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
419  $sql .= " batch=".(isset($this->batch) ? "'".$this->db->escape($this->batch)."'" : "null").",";
420  $sql .= " eatby=".(dol_strlen($this->eatby) != 0 ? "'".$this->db->idate($this->eatby)."'" : 'null').",";
421  $sql .= " sellby=".(dol_strlen($this->sellby) != 0 ? "'".$this->db->idate($this->sellby)."'" : 'null');
422  $sql .= " WHERE rowid=".((int) $this->id);
423 
424  $this->db->begin();
425 
426  dol_syslog(__METHOD__);
427  $resql = $this->db->query($sql);
428  if (!$resql) {
429  $error++;
430  $this->errors[] = "Error ".$this->db->lasterror();
431  }
432 
433  if (!$error) {
434  if (empty($this->id) && !empty($this->rowid)) {
435  $this->id = $this->rowid;
436  }
437  $result = $this->insertExtraFields();
438  if ($result < 0) {
439  $error++;
440  }
441 
442  if (!$notrigger) {
443  // Call triggers
444  $result = $this->call_trigger('LINERECEPTION_MODIFY', $user);
445  if ($result < 0) {
446  $error++;
447  }
448  // End call triggers
449  }
450  }
451 
452  // Commit or rollback
453  if ($error) {
454  foreach ($this->errors as $errmsg) {
455  dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
456  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
457  }
458  $this->db->rollback();
459  return -1 * $error;
460  } else {
461  $this->db->commit();
462  return 1;
463  }
464  }
465 
466 
474  public function delete($user, $notrigger = 0)
475  {
476  $error = 0;
477 
478  $this->db->begin();
479 
480  if (!$error) {
481  if (!$notrigger) {
482  // Call triggers
483  $result = $this->call_trigger('LINERECEPTION_DELETE', $user);
484  if ($result < 0) {
485  $error++;
486  }
487  // End call triggers
488  }
489  }
490 
491  // Remove extrafields
492  if (!$error) {
493  $result = $this->deleteExtraFields();
494  if ($result < 0) {
495  $error++;
496  dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR);
497  }
498  }
499 
500  if (!$error) {
501  $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
502  $sql .= " WHERE rowid=".((int) $this->id);
503 
504  dol_syslog(__METHOD__);
505  $resql = $this->db->query($sql);
506  if (!$resql) {
507  $error++;
508  $this->errors[] = "Error ".$this->db->lasterror();
509  }
510  }
511 
512  // Commit or rollback
513  if ($error) {
514  foreach ($this->errors as $errmsg) {
515  dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
516  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
517  }
518  $this->db->rollback();
519  return -1 * $error;
520  } else {
521  $this->db->commit();
522  return 1;
523  }
524  }
525 
526 
534  public function createFromClone(User $user, $fromid)
535  {
536  $error = 0;
537 
538  $object = new ReceptionLineBatch($this->db);
539 
540  $this->db->begin();
541 
542  // Load source object
543  $object->fetch($fromid);
544  $object->id = 0;
545  $object->statut = 0;
546 
547  // Clear fields
548  // ...
549 
550  // Create clone
551  $object->context['createfromclone'] = 'createfromclone';
552  $result = $object->create($user);
553 
554  // Other options
555  if ($result < 0) {
556  $this->error = $object->error;
557  $error++;
558  }
559 
560  if (!$error) {
561  }
562 
563  unset($object->context['createfromclone']);
564 
565  // End
566  if (!$error) {
567  $this->db->commit();
568  return $object->id;
569  } else {
570  $this->db->rollback();
571  return -1;
572  }
573  }
574 
575 
576 
583  public function getLibStatut($mode = 0)
584  {
585  return $this->LibStatut($this->status, $mode);
586  }
587 
588  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
596  public function LibStatut($status, $mode = 0)
597  {
598  // phpcs:enable
599  global $langs;
600  $langs->load('orders');
601 
602  if ($mode == 0) {
603  return $langs->trans($this->labelStatus[$status]);
604  } elseif ($mode == 1) {
605  return $langs->trans($this->labelStatusShort[$status]);
606  } elseif ($mode == 2) {
607  return $langs->trans($this->labelStatus[$status]);
608  } elseif ($mode == 3) {
609  if ($status == 0) {
610  return img_picto($langs->trans($this->labelStatus[$status]), 'statut0');
611  } elseif ($status == 1) {
612  return img_picto($langs->trans($this->labelStatus[$status]), 'statut4');
613  } elseif ($status == 2) {
614  return img_picto($langs->trans($this->labelStatus[$status]), 'statut8');
615  }
616  } elseif ($mode == 4) {
617  if ($status == 0) {
618  return img_picto($langs->trans($this->labelStatus[$status]), 'statut0').' '.$langs->trans($this->labelStatus[$status]);
619  } elseif ($status == 1) {
620  return img_picto($langs->trans($this->labelStatus[$status]), 'statut4').' '.$langs->trans($this->labelStatus[$status]);
621  } elseif ($status == 2) {
622  return img_picto($langs->trans($this->labelStatus[$status]), 'statut8').' '.$langs->trans($this->labelStatus[$status]);
623  }
624  } elseif ($mode == 5) {
625  if ($status == 0) {
626  return '<span class="hideonsmartphone">'.$langs->trans($this->labelStatusShort[$status]).' </span>'.img_picto($langs->trans($this->labelStatus[$status]), 'statut0');
627  } elseif ($status == 1) {
628  return '<span class="hideonsmartphone">'.$langs->trans($this->labelStatusShort[$status]).' </span>'.img_picto($langs->trans($this->labelStatus[$status]), 'statut4');
629  } elseif ($status == 2) {
630  return '<span class="hideonsmartphone">'.$langs->trans($this->labelStatusShort[$status]).' </span>'.img_picto($langs->trans($this->labelStatus[$status]), 'statut8');
631  }
632  }
633  return "";
634  }
635 
636 
643  public function initAsSpecimen()
644  {
645  $this->id = 0;
646 
647  $this->fk_element = 0;
648  $this->fk_product = 0;
649  $this->fk_elementdet = 0;
650  $this->qty = 0;
651  $this->fk_entrepot = 0;
652  $this->fk_user = 0;
653  $this->datec = '';
654  $this->comment = '';
655  $this->status = 0;
656  $this->tms = dol_now();
657  $this->batch = '';
658  $this->eatby = '';
659  $this->sellby = '';
660 
661  return 1;
662  }
663 
675  public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
676  {
677  dol_syslog(__METHOD__, LOG_DEBUG);
678 
679  $sql = "SELECT";
680  $sql .= " t.rowid,";
681  $sql .= " t.fk_element,";
682  $sql .= " t.fk_product,";
683  $sql .= " t.fk_elementdet,";
684  $sql .= " t.qty,";
685  $sql .= " t.fk_entrepot,";
686  $sql .= " t.fk_user,";
687  $sql .= " t.datec,";
688  $sql .= " t.comment,";
689  $sql .= " t.status,";
690  $sql .= " t.tms,";
691  $sql .= " t.batch,";
692  $sql .= " t.eatby,";
693  $sql .= " t.sellby";
694  $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
695 
696  // Manage filter
697  if (is_array($filter)) {
698  $sqlwhere = array();
699  if (count($filter) > 0) {
700  foreach ($filter as $key => $value) {
701  if ($key == 't.comment') {
702  $sqlwhere [] = $this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'";
703  } elseif ($key == 't.datec' || $key == 't.tms' || $key == 't.eatby' || $key == 't.sellby' || $key == 't.batch') {
704  $sqlwhere [] = $this->db->sanitize($key)." = '".$this->db->escape($value)."'";
705  } elseif ($key == 'qty') {
706  $sqlwhere [] = $this->db->sanitize($key)." = ".((float) $value);
707  } else {
708  $sqlwhere [] = $this->db->sanitize($key)." = ".((int) $value);
709  }
710  }
711  }
712  if (count($sqlwhere) > 0) {
713  $sql .= ' WHERE '.implode(' '.$this->db->escape($filtermode).' ', $sqlwhere);
714  }
715 
716  $filter = '';
717  }
718 
719  // Manage filter
720  $errormessage = '';
721  $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
722  if ($errormessage) {
723  $this->errors[] = $errormessage;
724  dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
725  return -1;
726  }
727 
728  if (!empty($sortfield)) {
729  $sql .= $this->db->order($sortfield, $sortorder);
730  }
731  if (!empty($limit)) {
732  $sql .= $this->db->plimit($limit, $offset);
733  }
734  $this->lines = array();
735 
736  $resql = $this->db->query($sql);
737  if ($resql) {
738  $num = $this->db->num_rows($resql);
739 
740  while ($obj = $this->db->fetch_object($resql)) {
741  $line = new self($this->db);
742 
743  $line->id = $obj->rowid;
744 
745  $line->fk_element = $obj->fk_element;
746  $line->fk_product = $obj->fk_product;
747  $line->fk_elementdet = $obj->fk_elementdet;
748  $line->qty = $obj->qty;
749  $line->fk_entrepot = $obj->fk_entrepot;
750  $line->fk_user = $obj->fk_user;
751  $line->datec = $this->db->jdate($obj->datec);
752  $line->comment = $obj->comment;
753  $line->status = $obj->status;
754  $line->tms = $this->db->jdate($obj->tms);
755  $line->batch = $obj->batch;
756  $line->eatby = $this->db->jdate($obj->eatby);
757  $line->sellby = $this->db->jdate($obj->sellby);
758  $line->fetch_optionals();
759 
760  $this->lines[$line->id] = $line;
761  }
762  $this->db->free($resql);
763 
764  return $num;
765  } else {
766  $this->errors[] = 'Error '.$this->db->lasterror();
767  dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
768 
769  return -1;
770  }
771  }
772 }
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition: card.php:58
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
Or an array listing all the potential status of the object: array: int of the status => translated la...
Definition: security.php:624
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.
Definition: user.class.php:50
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('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') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
Definition: index.php:751
print *****$script_file(".$version.") pid c cd cd cd description as p label as s rowid
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.
div float
Unit price before taxes.
Definition: style.css.php:963