Merge pull request #11368 from atm-gauthier/8.0_fix_facfourn_fetch_in_right_entity

FIX : we need to fetch fourn invoice with ref in current entity
This commit is contained in:
Laurent Destailleur
2019-06-20 02:48:42 +02:00
committed by GitHub

View File

@@ -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 IN (".getEntity('supplier_invoice').")";
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);