Fix: Restore backward compatibility

This commit is contained in:
Laurent Destailleur 2013-04-01 23:47:48 +02:00
parent 147032edcb
commit 6b13e8242a

View File

@ -310,7 +310,7 @@ class FactureFournisseur extends CommonInvoice
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->ref; $this->ref = $obj->ref?$obj->ref:$obj->rowid; // We take rowid if ref is empty for backward compatibility
$this->ref_supplier = $obj->ref_supplier; $this->ref_supplier = $obj->ref_supplier;
$this->entity = $obj->entity; $this->entity = $obj->entity;
@ -1316,8 +1316,11 @@ class FactureFournisseur extends CommonInvoice
$label=$langs->trans("ShowInvoice").': '.$this->ref; $label=$langs->trans("ShowInvoice").': '.$this->ref;
if ($this->ref_supplier) $label.=' / '.$this->ref_supplier; if ($this->ref_supplier) $label.=' / '.$this->ref_supplier;
$ref=$this->ref;
if (empty($ref)) $ref=$this->id;
if ($withpicto) $result.=($lien.img_object($label,'bill').$lienfin.' '); if ($withpicto) $result.=($lien.img_object($label,'bill').$lienfin.' ');
$result.=$lien.($max?dol_trunc($this->ref,$max):$this->ref).$lienfin; $result.=$lien.($max?dol_trunc($ref,$max):$ref).$lienfin;
return $result; return $result;
} }