subtype is not nullable int, reflect this in code

This commit is contained in:
MDW 2024-03-27 19:24:19 +01:00
parent b84281d285
commit 27546808fc
No known key found for this signature in database

View file

@ -178,7 +178,7 @@ class FactureFournisseur extends CommonInvoice
/**
* @var double $amount
* @deprecated
* @deprecated See $total_ttc, $total_ht, $total_tva
*/
public $amount = 0;
/**
@ -558,7 +558,7 @@ class FactureFournisseur extends CommonInvoice
$sql .= ", '".$this->db->escape($this->ref_ext)."'";
$sql .= ", ".((int) $conf->entity);
$sql .= ", '".$this->db->escape($this->type)."'";
$sql .= ", ".($this->subtype ? "'".$this->db->escape($this->subtype)."'" : "null");
$sql .= ", ".((int) $this->subtype);
$sql .= ", '".$this->db->escape(isset($this->label) ? $this->label : (isset($this->libelle) ? $this->libelle : ''))."'";
$sql .= ", ".((int) $this->socid);
$sql .= ", '".$this->db->idate($now)."'";
@ -927,7 +927,7 @@ class FactureFournisseur extends CommonInvoice
$this->ref_ext = $obj->ref_ext;
$this->entity = $obj->entity;
$this->type = empty($obj->type) ? self::TYPE_STANDARD : $obj->type;
$this->subtype = $obj->subtype;
$this->subtype = (int) $obj->subtype;
$this->socid = $obj->fk_soc;
$this->datec = $this->db->jdate($obj->datec);
$this->date = $this->db->jdate($obj->datef);
@ -1231,7 +1231,7 @@ class FactureFournisseur extends CommonInvoice
$sql .= " ref_ext=".(isset($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null").",";
$sql .= " entity=".(isset($this->entity) ? ((int) $this->entity) : "null").",";
$sql .= " type=".(isset($this->type) ? ((int) $this->type) : "null").",";
$sql .= " subtype=".(isset($this->subtype) ? $this->db->escape($this->subtype) : "null").",";
$sql .= " subtype=".((int) $this->subtype).",";
$sql .= " fk_soc=".(isset($this->socid) ? ((int) $this->socid) : "null").",";
$sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
$sql .= " datef=".(dol_strlen($this->date) != 0 ? "'".$this->db->idate($this->date)."'" : 'null').",";