dolibarr  20.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  * 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 
93  public $qty;
94  public $qty_asked;
95 
96  public $libelle;
97  public $label;
98  public $desc;
99  public $tva_tx;
100  public $vat_src_code;
101  public $ref_supplier;
102 
106  public $fk_entrepot;
107 
111  public $fk_user;
112 
113  public $datec = '';
114  public $comment;
115 
119  public $status;
120 
121  public $batch;
122  public $eatby = '';
123  public $sellby = '';
124  public $cost_price = 0;
125 
126 
127 
128 
134  public function __construct($db)
135  {
136  $this->db = $db;
137 
138  // List of language codes for status
139  $this->labelStatus[0] = 'Received';
140  $this->labelStatus[1] = 'Verified';
141  $this->labelStatus[2] = 'Denied';
142  $this->labelStatusShort[0] = 'Received';
143  $this->labelStatusShort[1] = 'Verified';
144  $this->labelStatusShort[2] = 'Denied';
145  }
146 
147 
155  public function create($user, $notrigger = 0)
156  {
157  $error = 0;
158 
159  // Clean parameters
160  if (isset($this->fk_element)) {
161  $this->fk_element = (int) $this->fk_element;
162  }
163  if (isset($this->fk_product)) {
164  $this->fk_product = (int) $this->fk_product;
165  }
166  if (isset($this->fk_elementdet)) {
167  $this->fk_elementdet = (int) $this->fk_elementdet;
168  }
169  if (isset($this->qty)) {
170  $this->qty = trim($this->qty);
171  }
172  if (isset($this->fk_entrepot)) {
173  $this->fk_entrepot = (int) $this->fk_entrepot;
174  }
175  if (isset($this->fk_user)) {
176  $this->fk_user = (int) $this->fk_user;
177  }
178  if (isset($this->comment)) {
179  $this->comment = trim($this->comment);
180  }
181  if (isset($this->status)) {
182  $this->status = (int) $this->status;
183  }
184  if (isset($this->batch)) {
185  $this->batch = trim($this->batch);
186  }
187  if (empty($this->datec)) {
188  $this->datec = dol_now();
189  }
190 
191  // Check parameters
192  if (empty($this->fk_product)) {
193  $this->error = 'Error, property ->fk_product must not be empty to create a line of reception';
194  return -1;
195  }
196  if (empty($this->fk_reception)) {
197  $this->error = 'Error, property ->fk_reception must not be empty to create a line of reception';
198  return -1;
199  }
200 
201  // Insert request
202  $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."(";
203  $sql .= "fk_product,";
204  $sql .= "fk_element,";
205  $sql .= "fk_elementdet,";
206  $sql .= "element_type,";
207  $sql .= "qty,";
208  $sql .= "fk_entrepot,";
209  $sql .= "fk_user,";
210  $sql .= "datec,";
211  $sql .= "comment,";
212  $sql .= "status,";
213  $sql .= "batch,";
214  $sql .= "eatby,";
215  $sql .= "sellby,";
216  $sql .= "fk_reception,";
217  $sql .= "cost_price";
218  $sql .= ") VALUES (";
219  $sql .= " ".(!isset($this->fk_product) ? 'NULL' : (int) $this->fk_product).",";
220  $sql .= " ".(!isset($this->fk_element) ? 'NULL' : (int) $this->fk_element).",";
221  $sql .= " ".(!isset($this->fk_elementdet) ? 'NULL' : (int) $this->fk_elementdet).",";
222  $sql .= " '".(!isset($this->element_type) ? "supplier_order" : $this->db->escape($this->element_type))."',";
223  $sql .= " ".(!isset($this->qty) ? 'NULL' : (float) $this->qty).",";
224  $sql .= " ".(!isset($this->fk_entrepot) ? 'NULL' : (int) $this->fk_entrepot).",";
225  $sql .= " ".(!isset($this->fk_user) ? 'NULL' : (int) $this->fk_user).",";
226  $sql .= " ".(!isset($this->datec) || dol_strlen($this->datec) == 0 ? 'NULL' : "'".$this->db->idate($this->datec)."'").",";
227  $sql .= " ".(!isset($this->comment) ? 'NULL' : "'".$this->db->escape($this->comment)."'").",";
228  $sql .= " ".(!isset($this->status) ? 'NULL' : (int) $this->status).",";
229  $sql .= " ".(!isset($this->batch) ? 'NULL' : "'".$this->db->escape($this->batch)."'").",";
230  $sql .= " ".(!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'".$this->db->idate($this->eatby)."'").",";
231  $sql .= " ".(!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'".$this->db->idate($this->sellby)."'").",";
232  $sql .= " ".((int) $this->fk_reception).",";
233  $sql .= " ".(!isset($this->cost_price) ? '0' : (float) $this->cost_price);
234  $sql .= ")";
235 
236  $this->db->begin();
237 
238  dol_syslog(__METHOD__, LOG_DEBUG);
239  $resql = $this->db->query($sql);
240  if (!$resql) {
241  $error++;
242  $this->errors[] = "Error ".$this->db->lasterror();
243  }
244 
245  if (!$error) {
246  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
247 
248  if (!$notrigger) {
249  // Call triggers
250  $result = $this->call_trigger('LINERECEPTION_CREATE', $user);
251  if ($result < 0) {
252  $error++;
253  }
254  // End call triggers
255  }
256  }
257 
258  // Create extrafields
259  if (!$error) {
260  $result = $this->insertExtraFields();
261  if ($result < 0) {
262  $error++;
263  }
264  }
265 
266  // Commit or rollback
267  if ($error) {
268  foreach ($this->errors as $errmsg) {
269  dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
270  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
271  }
272  $this->db->rollback();
273  return -1 * $error;
274  } else {
275  $this->db->commit();
276  return $this->id;
277  }
278  }
279 
280 
288  public function fetch($id, $ref = '')
289  {
290  $sql = "SELECT";
291  $sql .= " t.rowid,";
292  $sql .= " t.fk_element,";
293  $sql .= " t.fk_elementdet,";
294  $sql .= " t.element_type,";
295  $sql .= " t.fk_product,";
296  $sql .= " t.qty,";
297  $sql .= " t.fk_entrepot,";
298  $sql .= " t.fk_user,";
299  $sql .= " t.datec,";
300  $sql .= " t.comment,";
301  $sql .= " t.status,";
302  $sql .= " t.tms,";
303  $sql .= " t.batch,";
304  $sql .= " t.eatby,";
305  $sql .= " t.sellby,";
306  $sql .= " t.fk_reception";
307  $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
308  if ($ref) {
309  $sql .= " WHERE t.ref = '".$this->db->escape($ref)."'";
310  } else {
311  $sql .= " WHERE t.rowid = ".((int) $id);
312  }
313 
314  dol_syslog(get_class($this)."::fetch");
315  $resql = $this->db->query($sql);
316  if ($resql) {
317  if ($this->db->num_rows($resql)) {
318  $obj = $this->db->fetch_object($resql);
319 
320  $this->id = $obj->rowid;
321 
322  $this->fk_element = $obj->fk_element;
323  $this->origin_id = $obj->fk_element;
324  $this->fk_elementdet = $obj->fk_elementdet;
325  $this->origin_line_id = $obj->fk_elementdet;
326  $this->element_type = $obj->element_type;
327  $this->origin_type = $obj->element_type;
328 
329  $this->fk_product = $obj->fk_product;
330  $this->qty = $obj->qty;
331  $this->fk_entrepot = $obj->fk_entrepot;
332  $this->fk_user = $obj->fk_user;
333  $this->datec = $this->db->jdate($obj->datec);
334  $this->comment = $obj->comment;
335  $this->status = $obj->status;
336  $this->tms = $this->db->jdate($obj->tms);
337  $this->batch = $obj->batch;
338  $this->eatby = $this->db->jdate($obj->eatby);
339  $this->sellby = $this->db->jdate($obj->sellby);
340  $this->fk_reception = $obj->fk_reception;
341 
342  $this->fetch_optionals();
343  }
344  $this->db->free($resql);
345 
346  return 1;
347  } else {
348  $this->error = "Error ".$this->db->lasterror();
349  return -1;
350  }
351  }
352 
353 
361  public function update($user, $notrigger = 0)
362  {
363  $error = 0;
364 
365  // Clean parameters
366 
367  if (isset($this->fk_element)) {
368  $this->fk_element = (int) $this->fk_element;
369  }
370  if (isset($this->fk_product)) {
371  $this->fk_product = (int) $this->fk_product;
372  }
373  if (isset($this->fk_elementdet)) {
374  $this->fk_elementdet = (int) $this->fk_elementdet;
375  }
376  if (isset($this->qty)) {
377  $this->qty = trim($this->qty);
378  }
379  if (isset($this->fk_entrepot)) {
380  $this->fk_entrepot = (int) $this->fk_entrepot;
381  }
382  if (isset($this->fk_user)) {
383  $this->fk_user = (int) $this->fk_user;
384  }
385  if (isset($this->comment)) {
386  $this->comment = trim($this->comment);
387  }
388  if (isset($this->status)) {
389  $this->status = (int) $this->status;
390  }
391  if (isset($this->batch)) {
392  $this->batch = trim($this->batch);
393  }
394 
395 
396 
397  // Check parameters
398  // Put here code to add a control on parameters values
399 
400  // Update request
401  $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
402  $sql .= " fk_element=".(isset($this->fk_element) ? $this->fk_element : "null").",";
403  $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").",";
404  $sql .= " fk_elementdet=".(isset($this->fk_elementdet) ? $this->fk_elementdet : "null").",";
405  $sql .= " qty=".(isset($this->qty) ? $this->qty : "null").",";
406  $sql .= " fk_entrepot=".(isset($this->fk_entrepot) ? $this->fk_entrepot : "null").",";
407  $sql .= " fk_user=".(isset($this->fk_user) ? $this->fk_user : "null").",";
408  $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
409  $sql .= " comment=".(isset($this->comment) ? "'".$this->db->escape($this->comment)."'" : "null").",";
410  $sql .= " status=".(isset($this->status) ? $this->status : "null").",";
411  $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
412  $sql .= " batch=".(isset($this->batch) ? "'".$this->db->escape($this->batch)."'" : "null").",";
413  $sql .= " eatby=".(dol_strlen($this->eatby) != 0 ? "'".$this->db->idate($this->eatby)."'" : 'null').",";
414  $sql .= " sellby=".(dol_strlen($this->sellby) != 0 ? "'".$this->db->idate($this->sellby)."'" : 'null');
415  $sql .= " WHERE rowid=".((int) $this->id);
416 
417  $this->db->begin();
418 
419  dol_syslog(__METHOD__);
420  $resql = $this->db->query($sql);
421  if (!$resql) {
422  $error++;
423  $this->errors[] = "Error ".$this->db->lasterror();
424  }
425 
426  if (!$error) {
427  if (empty($this->id) && !empty($this->rowid)) {
428  $this->id = $this->rowid;
429  }
430  $result = $this->insertExtraFields();
431  if ($result < 0) {
432  $error++;
433  }
434 
435  if (!$notrigger) {
436  // Call triggers
437  $result = $this->call_trigger('LINERECEPTION_MODIFY', $user);
438  if ($result < 0) {
439  $error++;
440  }
441  // End call triggers
442  }
443  }
444 
445  // Commit or rollback
446  if ($error) {
447  foreach ($this->errors as $errmsg) {
448  dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
449  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
450  }
451  $this->db->rollback();
452  return -1 * $error;
453  } else {
454  $this->db->commit();
455  return 1;
456  }
457  }
458 
459 
467  public function delete($user, $notrigger = 0)
468  {
469  $error = 0;
470 
471  $this->db->begin();
472 
473  if (!$error) {
474  if (!$notrigger) {
475  // Call triggers
476  $result = $this->call_trigger('LINERECEPTION_DELETE', $user);
477  if ($result < 0) {
478  $error++;
479  }
480  // End call triggers
481  }
482  }
483 
484  // Remove extrafields
485  if (!$error) {
486  $result = $this->deleteExtraFields();
487  if ($result < 0) {
488  $error++;
489  dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR);
490  }
491  }
492 
493  if (!$error) {
494  $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
495  $sql .= " WHERE rowid=".((int) $this->id);
496 
497  dol_syslog(__METHOD__);
498  $resql = $this->db->query($sql);
499  if (!$resql) {
500  $error++;
501  $this->errors[] = "Error ".$this->db->lasterror();
502  }
503  }
504 
505  // Commit or rollback
506  if ($error) {
507  foreach ($this->errors as $errmsg) {
508  dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
509  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
510  }
511  $this->db->rollback();
512  return -1 * $error;
513  } else {
514  $this->db->commit();
515  return 1;
516  }
517  }
518 
519 
527  public function createFromClone(User $user, $fromid)
528  {
529  $error = 0;
530 
531  $object = new ReceptionLineBatch($this->db);
532 
533  $this->db->begin();
534 
535  // Load source object
536  $object->fetch($fromid);
537  $object->id = 0;
538  $object->statut = 0;
539 
540  // Clear fields
541  // ...
542 
543  // Create clone
544  $object->context['createfromclone'] = 'createfromclone';
545  $result = $object->create($user);
546 
547  // Other options
548  if ($result < 0) {
549  $this->error = $object->error;
550  $error++;
551  }
552 
553  if (!$error) {
554  }
555 
556  unset($object->context['createfromclone']);
557 
558  // End
559  if (!$error) {
560  $this->db->commit();
561  return $object->id;
562  } else {
563  $this->db->rollback();
564  return -1;
565  }
566  }
567 
568 
569 
576  public function getLibStatut($mode = 0)
577  {
578  return $this->LibStatut($this->status, $mode);
579  }
580 
581  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
589  public function LibStatut($status, $mode = 0)
590  {
591  // phpcs:enable
592  global $langs;
593  $langs->load('orders');
594 
595  if ($mode == 0) {
596  return $langs->trans($this->labelStatus[$status]);
597  } elseif ($mode == 1) {
598  return $langs->trans($this->labelStatusShort[$status]);
599  } elseif ($mode == 2) {
600  return $langs->trans($this->labelStatus[$status]);
601  } elseif ($mode == 3) {
602  if ($status == 0) {
603  return img_picto($langs->trans($this->labelStatus[$status]), 'statut0');
604  } elseif ($status == 1) {
605  return img_picto($langs->trans($this->labelStatus[$status]), 'statut4');
606  } elseif ($status == 2) {
607  return img_picto($langs->trans($this->labelStatus[$status]), 'statut8');
608  }
609  } elseif ($mode == 4) {
610  if ($status == 0) {
611  return img_picto($langs->trans($this->labelStatus[$status]), 'statut0').' '.$langs->trans($this->labelStatus[$status]);
612  } elseif ($status == 1) {
613  return img_picto($langs->trans($this->labelStatus[$status]), 'statut4').' '.$langs->trans($this->labelStatus[$status]);
614  } elseif ($status == 2) {
615  return img_picto($langs->trans($this->labelStatus[$status]), 'statut8').' '.$langs->trans($this->labelStatus[$status]);
616  }
617  } elseif ($mode == 5) {
618  if ($status == 0) {
619  return '<span class="hideonsmartphone">'.$langs->trans($this->labelStatusShort[$status]).' </span>'.img_picto($langs->trans($this->labelStatus[$status]), 'statut0');
620  } elseif ($status == 1) {
621  return '<span class="hideonsmartphone">'.$langs->trans($this->labelStatusShort[$status]).' </span>'.img_picto($langs->trans($this->labelStatus[$status]), 'statut4');
622  } elseif ($status == 2) {
623  return '<span class="hideonsmartphone">'.$langs->trans($this->labelStatusShort[$status]).' </span>'.img_picto($langs->trans($this->labelStatus[$status]), 'statut8');
624  }
625  }
626  return "";
627  }
628 
629 
636  public function initAsSpecimen()
637  {
638  $this->id = 0;
639 
640  $this->fk_element = 0;
641  $this->fk_product = 0;
642  $this->fk_elementdet = 0;
643  $this->qty = '';
644  $this->fk_entrepot = 0;
645  $this->fk_user = 0;
646  $this->datec = '';
647  $this->comment = '';
648  $this->status = 0;
649  $this->tms = dol_now();
650  $this->batch = '';
651  $this->eatby = '';
652  $this->sellby = '';
653 
654  return 1;
655  }
656 
668  public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
669  {
670  dol_syslog(__METHOD__, LOG_DEBUG);
671 
672  $sql = "SELECT";
673  $sql .= " t.rowid,";
674  $sql .= " t.fk_element,";
675  $sql .= " t.fk_product,";
676  $sql .= " t.fk_elementdet,";
677  $sql .= " t.qty,";
678  $sql .= " t.fk_entrepot,";
679  $sql .= " t.fk_user,";
680  $sql .= " t.datec,";
681  $sql .= " t.comment,";
682  $sql .= " t.status,";
683  $sql .= " t.tms,";
684  $sql .= " t.batch,";
685  $sql .= " t.eatby,";
686  $sql .= " t.sellby";
687  $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
688 
689  // Manage filter
690  if (is_array($filter)) {
691  $sqlwhere = array();
692  if (count($filter) > 0) {
693  foreach ($filter as $key => $value) {
694  if ($key == 't.comment') {
695  $sqlwhere [] = $this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'";
696  } elseif ($key == 't.datec' || $key == 't.tms' || $key == 't.eatby' || $key == 't.sellby' || $key == 't.batch') {
697  $sqlwhere [] = $this->db->sanitize($key)." = '".$this->db->escape($value)."'";
698  } elseif ($key == 'qty') {
699  $sqlwhere [] = $this->db->sanitize($key)." = ".((float) $value);
700  } else {
701  $sqlwhere [] = $this->db->sanitize($key)." = ".((int) $value);
702  }
703  }
704  }
705  if (count($sqlwhere) > 0) {
706  $sql .= ' WHERE '.implode(' '.$this->db->escape($filtermode).' ', $sqlwhere);
707  }
708 
709  $filter = '';
710  }
711 
712  // Manage filter
713  $errormessage = '';
714  $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
715  if ($errormessage) {
716  $this->errors[] = $errormessage;
717  dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
718  return -1;
719  }
720 
721  if (!empty($sortfield)) {
722  $sql .= $this->db->order($sortfield, $sortorder);
723  }
724  if (!empty($limit)) {
725  $sql .= $this->db->plimit($limit, $offset);
726  }
727  $this->lines = array();
728 
729  $resql = $this->db->query($sql);
730  if ($resql) {
731  $num = $this->db->num_rows($resql);
732 
733  while ($obj = $this->db->fetch_object($resql)) {
734  $line = new self($this->db);
735 
736  $line->id = $obj->rowid;
737 
738  $line->fk_element = $obj->fk_element;
739  $line->fk_product = $obj->fk_product;
740  $line->fk_elementdet = $obj->fk_elementdet;
741  $line->qty = $obj->qty;
742  $line->fk_entrepot = $obj->fk_entrepot;
743  $line->fk_user = $obj->fk_user;
744  $line->datec = $this->db->jdate($obj->datec);
745  $line->comment = $obj->comment;
746  $line->status = $obj->status;
747  $line->tms = $this->db->jdate($obj->tms);
748  $line->batch = $obj->batch;
749  $line->eatby = $this->db->jdate($obj->eatby);
750  $line->sellby = $this->db->jdate($obj->sellby);
751  $line->fetch_optionals();
752 
753  $this->lines[$line->id] = $line;
754  }
755  $this->db->free($resql);
756 
757  return $num;
758  } else {
759  $this->errors[] = 'Error '.$this->db->lasterror();
760  dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
761 
762  return -1;
763  }
764  }
765 }
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:607
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:745
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
Buy price without taxes.
Definition: style.css.php:960