FIX : we need to fetch fourn invoice with ref in current entity
This commit is contained in:
parent
20e00ca290
commit
7331e43db8
@ -504,7 +504,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
*/
|
||||
public function fetch($id='',$ref='')
|
||||
{
|
||||
global $langs;
|
||||
global $langs, $conf;
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
@ -555,7 +555,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON t.fk_mode_reglement = p.id";
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON t.fk_incoterms = i.rowid';
|
||||
if ($id) $sql.= " WHERE t.rowid=".$id;
|
||||
if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."'";
|
||||
if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."' AND t.entity = ".$conf->entity;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user