diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8284c0cedf2..c56dc627716 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -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').",";