dolibarr  17.0.3
fournisseur.commande.dispatch.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
26 // Put here all includes required by your class file
27 require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
28 require_once DOL_DOCUMENT_ROOT."/reception/class/reception.class.php";
29 
30 
35 {
39  public $db;
40 
44  public $error;
45 
49  public $errors = array();
50 
54  public $element = 'commandefournisseurdispatch';
55 
59  public $table_element = 'commande_fournisseur_dispatch';
60  public $lines = array();
61 
65  public $id;
66 
70  public $fk_commande;
71 
75  public $fk_product;
76 
80  public $fk_commandefourndet;
81 
82  public $fk_reception;
83 
84 
85  public $qty;
86  public $qty_asked;
87 
88  public $libelle;
89  public $desc;
90  public $tva_tx;
91  public $vat_src_code;
92  public $ref_supplier;
93 
97  public $fk_entrepot;
98 
102  public $fk_user;
103 
104  public $datec = '';
105  public $comment;
106 
110  public $status;
111 
112  public $tms = '';
113  public $batch;
114  public $eatby = '';
115  public $sellby = '';
116  public $cost_price = 0;
117 
118 
119 
120 
126  public function __construct($db)
127  {
128  $this->db = $db;
129 
130  // List of language codes for status
131  $this->statuts[0] = 'Received';
132  $this->statuts[1] = 'Verified';
133  $this->statuts[2] = 'Denied';
134  $this->statuts_short[0] = 'Received';
135  $this->statuts_short[1] = 'Verified';
136  $this->statuts_short[2] = 'Denied';
137  }
138 
139 
147  public function create($user, $notrigger = 0)
148  {
149  global $conf, $langs, $hookmanager;
150  $error = 0;
151 
152  // Clean parameters
153 
154  if (isset($this->fk_commande)) {
155  $this->fk_commande = trim($this->fk_commande);
156  }
157  if (isset($this->fk_product)) {
158  $this->fk_product = trim($this->fk_product);
159  }
160  if (isset($this->fk_commandefourndet)) {
161  $this->fk_commandefourndet = trim($this->fk_commandefourndet);
162  }
163  if (isset($this->qty)) {
164  $this->qty = trim($this->qty);
165  }
166  if (isset($this->fk_entrepot)) {
167  $this->fk_entrepot = trim($this->fk_entrepot);
168  }
169  if (isset($this->fk_user)) {
170  $this->fk_user = trim($this->fk_user);
171  }
172  if (isset($this->comment)) {
173  $this->comment = trim($this->comment);
174  }
175  if (isset($this->status)) {
176  $this->status = trim($this->status);
177  }
178  if (isset($this->batch)) {
179  $this->batch = trim($this->batch);
180  }
181  if (empty($this->datec)) {
182  $this->datec = dol_now();
183  }
184 
185 
186  // Check parameters
187  // Put here code to add control on parameters values
188 
189  // Insert request
190  $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."(";
191  $sql .= "fk_commande,";
192  $sql .= "fk_product,";
193  $sql .= "fk_commandefourndet,";
194  $sql .= "qty,";
195  $sql .= "fk_entrepot,";
196  $sql .= "fk_user,";
197  $sql .= "datec,";
198  $sql .= "comment,";
199  $sql .= "status,";
200  $sql .= "batch,";
201  $sql .= "eatby,";
202  $sql .= "sellby,";
203  $sql .= "fk_reception,";
204  $sql .= "cost_price";
205 
206 
207  $sql .= ") VALUES (";
208  $sql .= " ".(!isset($this->fk_commande) ? 'NULL' : "'".$this->db->escape($this->fk_commande)."'").",";
209  $sql .= " ".(!isset($this->fk_product) ? 'NULL' : "'".$this->db->escape($this->fk_product)."'").",";
210  $sql .= " ".(!isset($this->fk_commandefourndet) ? 'NULL' : "'".$this->db->escape($this->fk_commandefourndet)."'").",";
211  $sql .= " ".(!isset($this->qty) ? 'NULL' : "'".$this->db->escape($this->qty)."'").",";
212  $sql .= " ".(!isset($this->fk_entrepot) ? 'NULL' : "'".$this->db->escape($this->fk_entrepot)."'").",";
213  $sql .= " ".(!isset($this->fk_user) ? 'NULL' : "'".$this->db->escape($this->fk_user)."'").",";
214  $sql .= " ".(!isset($this->datec) || dol_strlen($this->datec) == 0 ? 'NULL' : "'".$this->db->idate($this->datec)."'").",";
215  $sql .= " ".(!isset($this->comment) ? 'NULL' : "'".$this->db->escape($this->comment)."'").",";
216  $sql .= " ".(!isset($this->status) ? 'NULL' : "'".$this->db->escape($this->status)."'").",";
217  $sql .= " ".(!isset($this->batch) ? 'NULL' : "'".$this->db->escape($this->batch)."'").",";
218  $sql .= " ".(!isset($this->eatby) || dol_strlen($this->eatby) == 0 ? 'NULL' : "'".$this->db->idate($this->eatby)."'").",";
219  $sql .= " ".(!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : "'".$this->db->idate($this->sellby)."'").",";
220  $sql .= " ".(!isset($this->fk_reception) ? 'NULL' : "'".$this->db->escape($this->fk_reception)."'").",";
221  $sql .= " ".(!isset($this->cost_price) ? '0' : "'".$this->db->escape($this->cost_price)."'")."";
222  $sql .= ")";
223 
224  $this->db->begin();
225 
226  dol_syslog(__METHOD__, LOG_DEBUG);
227  $resql = $this->db->query($sql);
228  if (!$resql) {
229  $error++; $this->errors[] = "Error ".$this->db->lasterror();
230  }
231 
232  if (!$error) {
233  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
234 
235  if (!$notrigger) {
236  // Call triggers
237  $result=$this->call_trigger('LINERECEPTION_CREATE', $user);
238  if ($result < 0) {
239  $error++;
240  }
241  // End call triggers
242  }
243  }
244 
245  // Create extrafields
246  if (!$error) {
247  $result = $this->insertExtraFields();
248  if ($result < 0) {
249  $error++;
250  }
251  }
252 
253  // Commit or rollback
254  if ($error) {
255  foreach ($this->errors as $errmsg) {
256  dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
257  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
258  }
259  $this->db->rollback();
260  return -1 * $error;
261  } else {
262  $this->db->commit();
263  return $this->id;
264  }
265  }
266 
267 
275  public function fetch($id, $ref = '')
276  {
277  global $langs;
278  $sql = "SELECT";
279  $sql .= " t.rowid,";
280 
281  $sql .= " t.fk_commande,";
282  $sql .= " t.fk_product,";
283  $sql .= " t.fk_commandefourndet,";
284  $sql .= " t.qty,";
285  $sql .= " t.fk_entrepot,";
286  $sql .= " t.fk_user,";
287  $sql .= " t.datec,";
288  $sql .= " t.comment,";
289  $sql .= " t.status,";
290  $sql .= " t.tms,";
291  $sql .= " t.batch,";
292  $sql .= " t.eatby,";
293  $sql .= " t.sellby,";
294  $sql .= " t.fk_reception";
295 
296 
297  $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
298  if ($ref) {
299  $sql .= " WHERE t.ref = '".$this->db->escape($ref)."'";
300  } else {
301  $sql .= " WHERE t.rowid = ".((int) $id);
302  }
303 
304  dol_syslog(get_class($this)."::fetch");
305  $resql = $this->db->query($sql);
306  if ($resql) {
307  if ($this->db->num_rows($resql)) {
308  $obj = $this->db->fetch_object($resql);
309 
310  $this->id = $obj->rowid;
311 
312  $this->fk_commande = $obj->fk_commande;
313  $this->fk_product = $obj->fk_product;
314  $this->fk_commandefourndet = $obj->fk_commandefourndet;
315  $this->qty = $obj->qty;
316  $this->fk_entrepot = $obj->fk_entrepot;
317  $this->fk_user = $obj->fk_user;
318  $this->datec = $this->db->jdate($obj->datec);
319  $this->comment = $obj->comment;
320  $this->status = $obj->status;
321  $this->tms = $this->db->jdate($obj->tms);
322  $this->batch = $obj->batch;
323  $this->eatby = $this->db->jdate($obj->eatby);
324  $this->sellby = $this->db->jdate($obj->sellby);
325  $this->fk_reception = $obj->fk_reception;
326 
327  $this->fetch_optionals();
328  }
329  $this->db->free($resql);
330 
331  return 1;
332  } else {
333  $this->error = "Error ".$this->db->lasterror();
334  return -1;
335  }
336  }
337 
338 
346  public function update($user, $notrigger = 0)
347  {
348  $error = 0;
349 
350  // Clean parameters
351 
352  if (isset($this->fk_commande)) {
353  $this->fk_commande = trim($this->fk_commande);
354  }
355  if (isset($this->fk_product)) {
356  $this->fk_product = trim($this->fk_product);
357  }
358  if (isset($this->fk_commandefourndet)) {
359  $this->fk_commandefourndet = trim($this->fk_commandefourndet);
360  }
361  if (isset($this->qty)) {
362  $this->qty = trim($this->qty);
363  }
364  if (isset($this->fk_entrepot)) {
365  $this->fk_entrepot = trim($this->fk_entrepot);
366  }
367  if (isset($this->fk_user)) {
368  $this->fk_user = trim($this->fk_user);
369  }
370  if (isset($this->comment)) {
371  $this->comment = trim($this->comment);
372  }
373  if (isset($this->status)) {
374  $this->status = trim($this->status);
375  }
376  if (isset($this->batch)) {
377  $this->batch = trim($this->batch);
378  }
379 
380 
381 
382  // Check parameters
383  // Put here code to add a control on parameters values
384 
385  // Update request
386  $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
387  $sql .= " fk_commande=".(isset($this->fk_commande) ? $this->fk_commande : "null").",";
388  $sql .= " fk_product=".(isset($this->fk_product) ? $this->fk_product : "null").",";
389  $sql .= " fk_commandefourndet=".(isset($this->fk_commandefourndet) ? $this->fk_commandefourndet : "null").",";
390  $sql .= " qty=".(isset($this->qty) ? $this->qty : "null").",";
391  $sql .= " fk_entrepot=".(isset($this->fk_entrepot) ? $this->fk_entrepot : "null").",";
392  $sql .= " fk_user=".(isset($this->fk_user) ? $this->fk_user : "null").",";
393  $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
394  $sql .= " comment=".(isset($this->comment) ? "'".$this->db->escape($this->comment)."'" : "null").",";
395  $sql .= " status=".(isset($this->status) ? $this->status : "null").",";
396  $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
397  $sql .= " batch=".(isset($this->batch) ? "'".$this->db->escape($this->batch)."'" : "null").",";
398  $sql .= " eatby=".(dol_strlen($this->eatby) != 0 ? "'".$this->db->idate($this->eatby)."'" : 'null').",";
399  $sql .= " sellby=".(dol_strlen($this->sellby) != 0 ? "'".$this->db->idate($this->sellby)."'" : 'null')."";
400  $sql .= " WHERE rowid=".((int) $this->id);
401 
402  $this->db->begin();
403 
404  dol_syslog(__METHOD__);
405  $resql = $this->db->query($sql);
406  if (!$resql) {
407  $error++; $this->errors[] = "Error ".$this->db->lasterror();
408  }
409 
410  if (!$error) {
411  if (!$error) {
412  if (empty($this->id) && !empty($this->rowid)) {
413  $this->id = $this->rowid;
414  }
415  $result = $this->insertExtraFields();
416  if ($result < 0) {
417  $error++;
418  }
419  }
420 
421  if (!$notrigger) {
422  // Call triggers
423  $result = $this->call_trigger('LINERECEPTION_MODIFY', $user);
424  if ($result < 0) {
425  $error++;
426  }
427  // End call triggers
428  }
429  }
430 
431  // Commit or rollback
432  if ($error) {
433  foreach ($this->errors as $errmsg) {
434  dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
435  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
436  }
437  $this->db->rollback();
438  return -1 * $error;
439  } else {
440  $this->db->commit();
441  return 1;
442  }
443  }
444 
445 
453  public function delete($user, $notrigger = 0)
454  {
455  $error = 0;
456 
457  $this->db->begin();
458 
459  if (!$error) {
460  if (!$notrigger) {
461  // Call triggers
462  $result = $this->call_trigger('LINERECEPTION_DELETE', $user);
463  if ($result < 0) {
464  $error++;
465  }
466  // End call triggers
467  }
468  }
469 
470  // Remove extrafields
471  if (!$error) {
472  $result = $this->deleteExtraFields();
473  if ($result < 0) {
474  $error++;
475  dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR);
476  }
477  }
478 
479  if (!$error) {
480  $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
481  $sql .= " WHERE rowid=".((int) $this->id);
482 
483  dol_syslog(__METHOD__);
484  $resql = $this->db->query($sql);
485  if (!$resql) {
486  $error++; $this->errors[] = "Error ".$this->db->lasterror();
487  }
488  }
489 
490  // Commit or rollback
491  if ($error) {
492  foreach ($this->errors as $errmsg) {
493  dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
494  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
495  }
496  $this->db->rollback();
497  return -1 * $error;
498  } else {
499  $this->db->commit();
500  return 1;
501  }
502  }
503 
504 
512  public function createFromClone(User $user, $fromid)
513  {
514  $error = 0;
515 
516  $object = new Commandefournisseurdispatch($this->db);
517 
518  $this->db->begin();
519 
520  // Load source object
521  $object->fetch($fromid);
522  $object->id = 0;
523  $object->statut = 0;
524 
525  // Clear fields
526  // ...
527 
528  // Create clone
529  $object->context['createfromclone'] = 'createfromclone';
530  $result = $object->create($user);
531 
532  // Other options
533  if ($result < 0) {
534  $this->error = $object->error;
535  $error++;
536  }
537 
538  if (!$error) {
539  }
540 
541  unset($object->context['createfromclone']);
542 
543  // End
544  if (!$error) {
545  $this->db->commit();
546  return $object->id;
547  } else {
548  $this->db->rollback();
549  return -1;
550  }
551  }
552 
553 
554 
561  public function getLibStatut($mode = 0)
562  {
563  return $this->LibStatut($this->status, $mode);
564  }
565 
566  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
574  public function LibStatut($status, $mode = 0)
575  {
576  // phpcs:enable
577  global $langs;
578  $langs->load('orders');
579 
580  if ($mode == 0) {
581  return $langs->trans($this->statuts[$status]);
582  } elseif ($mode == 1) {
583  return $langs->trans($this->statuts_short[$status]);
584  } elseif ($mode == 2) {
585  return $langs->trans($this->statuts[$status]);
586  } elseif ($mode == 3) {
587  if ($status == 0) {
588  return img_picto($langs->trans($this->statuts[$status]), 'statut0');
589  } elseif ($status == 1) {
590  return img_picto($langs->trans($this->statuts[$status]), 'statut4');
591  } elseif ($status == 2) {
592  return img_picto($langs->trans($this->statuts[$status]), 'statut8');
593  }
594  } elseif ($mode == 4) {
595  if ($status == 0) {
596  return img_picto($langs->trans($this->statuts[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
597  } elseif ($status == 1) {
598  return img_picto($langs->trans($this->statuts[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
599  } elseif ($status == 2) {
600  return img_picto($langs->trans($this->statuts[$status]), 'statut8').' '.$langs->trans($this->statuts[$status]);
601  }
602  } elseif ($mode == 5) {
603  if ($status == 0) {
604  return '<span class="hideonsmartphone">'.$langs->trans($this->statuts_short[$status]).' </span>'.img_picto($langs->trans($this->statuts[$status]), 'statut0');
605  } elseif ($status == 1) {
606  return '<span class="hideonsmartphone">'.$langs->trans($this->statuts_short[$status]).' </span>'.img_picto($langs->trans($this->statuts[$status]), 'statut4');
607  } elseif ($status == 2) {
608  return '<span class="hideonsmartphone">'.$langs->trans($this->statuts_short[$status]).' </span>'.img_picto($langs->trans($this->statuts[$status]), 'statut8');
609  }
610  }
611  }
612 
613 
620  public function initAsSpecimen()
621  {
622  $this->id = 0;
623 
624  $this->fk_commande = '';
625  $this->fk_product = '';
626  $this->fk_commandefourndet = '';
627  $this->qty = '';
628  $this->fk_entrepot = '';
629  $this->fk_user = '';
630  $this->datec = '';
631  $this->comment = '';
632  $this->status = '';
633  $this->tms = '';
634  $this->batch = '';
635  $this->eatby = '';
636  $this->sellby = '';
637  }
638 
651  public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
652  {
653  dol_syslog(__METHOD__, LOG_DEBUG);
654 
655  $sql = "SELECT";
656  $sql .= " t.rowid,";
657 
658  $sql .= " t.fk_commande,";
659  $sql .= " t.fk_product,";
660  $sql .= " t.fk_commandefourndet,";
661  $sql .= " t.qty,";
662  $sql .= " t.fk_entrepot,";
663  $sql .= " t.fk_user,";
664  $sql .= " t.datec,";
665  $sql .= " t.comment,";
666  $sql .= " t.status,";
667  $sql .= " t.tms,";
668  $sql .= " t.batch,";
669  $sql .= " t.eatby,";
670  $sql .= " t.sellby";
671 
672  $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
673 
674  // Manage filter
675  $sqlwhere = array();
676  if (count($filter) > 0) {
677  foreach ($filter as $key => $value) {
678  if ($key == 't.comment') {
679  $sqlwhere [] = $key." LIKE '%".$this->db->escape($value)."%'";
680  } elseif ($key == 't.datec' || $key == 't.tms' || $key == 't.eatby' || $key == 't.sellby' || $key == 't.batch') {
681  $sqlwhere [] = $key." = '".$this->db->escape($value)."'";
682  } elseif ($key == 'qty') {
683  $sqlwhere [] = $key." = ".((float) $value);
684  } else {
685  $sqlwhere [] = $key." = ".((int) $value);
686  }
687  }
688  }
689  if (count($sqlwhere) > 0) {
690  $sql .= ' WHERE '.implode(' '.$this->db->escape($filtermode).' ', $sqlwhere);
691  }
692 
693  if (!empty($sortfield)) {
694  $sql .= $this->db->order($sortfield, $sortorder);
695  }
696  if (!empty($limit)) {
697  $sql .= $this->db->plimit($limit, $offset);
698  }
699  $this->lines = array();
700 
701  $resql = $this->db->query($sql);
702  if ($resql) {
703  $num = $this->db->num_rows($resql);
704 
705  while ($obj = $this->db->fetch_object($resql)) {
706  $line = new self($this->db);
707 
708  $line->id = $obj->rowid;
709 
710  $line->fk_commande = $obj->fk_commande;
711  $line->fk_product = $obj->fk_product;
712  $line->fk_commandefourndet = $obj->fk_commandefourndet;
713  $line->qty = $obj->qty;
714  $line->fk_entrepot = $obj->fk_entrepot;
715  $line->fk_user = $obj->fk_user;
716  $line->datec = $this->db->jdate($obj->datec);
717  $line->comment = $obj->comment;
718  $line->status = $obj->status;
719  $line->tms = $this->db->jdate($obj->tms);
720  $line->batch = $obj->batch;
721  $line->eatby = $this->db->jdate($obj->eatby);
722  $line->sellby = $this->db->jdate($obj->sellby);
723  $line->fetch_optionals();
724 
725  $this->lines[$line->id] = $line;
726  }
727  $this->db->free($resql);
728 
729  return $num;
730  } else {
731  $this->errors[] = 'Error '.$this->db->lasterror();
732  dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
733 
734  return -1;
735  }
736  }
737 }
db
$conf db
API class for accounts.
Definition: inc.php:41
CommandeFournisseurDispatch\__construct
__construct($db)
Constructor.
Definition: fournisseur.commande.dispatch.class.php:126
CommandeFournisseurDispatch\fetchAll
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load object in memory from the database.
Definition: fournisseur.commande.dispatch.class.php:651
CommandeFournisseurDispatch\LibStatut
LibStatut($status, $mode=0)
Return label of a status.
Definition: fournisseur.commande.dispatch.class.php:574
CommandeFournisseurDispatch
Class to manage table commandefournisseurdispatch.
Definition: fournisseur.commande.dispatch.class.php:34
rowid
print *****$script_file(".$version.") pid c cd cd cd description as p label as s rowid
Definition: email_expire_services_to_representatives.php:79
CommonObjectLine
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
Definition: commonobjectline.class.php:32
CommandeFournisseurDispatch\getLibStatut
getLibStatut($mode=0)
Return label of the status of object.
Definition: fournisseur.commande.dispatch.class.php:561
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:4024
CommonObject\insertExtraFields
insertExtraFields($trigger='', $userused=null)
Add/Update all extra fields values for the current object.
Definition: commonobject.class.php:6185
$resql
if(isModEnabled('facture') &&!empty($user->rights->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') &&!empty($user->rights->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)) $resql
Social contributions to pay.
Definition: index.php:745
CommandeFournisseurDispatch\$table_element
$table_element
Name of table without prefix where object is stored.
Definition: fournisseur.commande.dispatch.class.php:59
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1628
CommonObject\fetch_optionals
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...
Definition: commonobject.class.php:6034
CommandeFournisseurDispatch\initAsSpecimen
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
Definition: fournisseur.commande.dispatch.class.php:620
dol_strlen
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
Definition: functions.lib.php:3887
User
Class to manage Dolibarr users.
Definition: user.class.php:46
CommonObject\deleteExtraFields
deleteExtraFields()
Delete all extra fields values for the current object.
Definition: commonobject.class.php:6145
CommandeFournisseurDispatch\update
update($user, $notrigger=0)
Update object into database.
Definition: fournisseur.commande.dispatch.class.php:346
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2951
CommandeFournisseurDispatch\createFromClone
createFromClone(User $user, $fromid)
Load an object from its id and create a new one in database.
Definition: fournisseur.commande.dispatch.class.php:512
CommonObject\call_trigger
call_trigger($triggerName, $user)
Call trigger based on this instance.
Definition: commonobject.class.php:5818
CommandeFournisseurDispatch\create
create($user, $notrigger=0)
Create object into database.
Definition: fournisseur.commande.dispatch.class.php:147
CommandeFournisseurDispatch\fetch
fetch($id, $ref='')
Load object in memory from the database.
Definition: fournisseur.commande.dispatch.class.php:275
float
div float
Buy price without taxes.
Definition: style.css.php:913