Fix: missing object entity in fetch
This commit is contained in:
parent
03d9bf1376
commit
703d976b3b
@ -1321,7 +1321,7 @@ class Propal extends CommonObject
|
||||
function fetch($rowid,$ref='')
|
||||
{
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
|
||||
$sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
|
||||
$sql.= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht";
|
||||
$sql.= ", p.datec";
|
||||
$sql.= ", p.date_valid as datev";
|
||||
@ -1367,6 +1367,7 @@ class Propal extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->entity = $obj->entity;
|
||||
|
||||
$this->ref = $obj->ref;
|
||||
$this->ref_client = $obj->ref_client;
|
||||
|
||||
@ -1572,7 +1572,7 @@ class Commande extends CommonOrder
|
||||
// Check parameters
|
||||
if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
|
||||
|
||||
$sql = 'SELECT c.rowid, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_statut';
|
||||
$sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_statut';
|
||||
$sql.= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason';
|
||||
$sql.= ', c.fk_account';
|
||||
$sql.= ', c.date_commande';
|
||||
@ -1602,12 +1602,14 @@ class Commande extends CommonOrder
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($obj)
|
||||
{
|
||||
$this->id = $obj->rowid;
|
||||
if ($result)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($obj)
|
||||
{
|
||||
$this->id = $obj->rowid;
|
||||
$this->entity = $obj->entity;
|
||||
|
||||
$this->ref = $obj->ref;
|
||||
$this->ref_client = $obj->ref_client;
|
||||
$this->ref_customer = $obj->ref_client;
|
||||
|
||||
@ -1239,7 +1239,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
|
||||
|
||||
$sql = 'SELECT f.rowid,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount';
|
||||
$sql = 'SELECT f.rowid,f.entity,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount';
|
||||
$sql.= ', f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc, f.revenuestamp';
|
||||
$sql.= ', f.remise_percent, f.remise_absolue, f.remise';
|
||||
$sql.= ', f.datef as df, f.date_pointoftax';
|
||||
@ -1276,6 +1276,8 @@ class Facture extends CommonInvoice
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->entity = $obj->entity;
|
||||
|
||||
$this->ref = $obj->facnumber;
|
||||
$this->ref_client = $obj->ref_client;
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
|
||||
@ -218,7 +218,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
// Check parameters
|
||||
if (empty($id) && empty($ref)) return -1;
|
||||
|
||||
$sql = "SELECT c.rowid, c.ref, ref_supplier, c.fk_soc, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_vat,";
|
||||
$sql = "SELECT c.rowid, c.entity, c.ref, ref_supplier, c.fk_soc, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_vat,";
|
||||
$sql.= " c.localtax1, c.localtax2, ";
|
||||
$sql.= " c.date_creation, c.date_valid, c.date_approve, c.date_approve2,";
|
||||
$sql.= " c.fk_user_author, c.fk_user_valid, c.fk_user_approve, c.fk_user_approve2,";
|
||||
@ -253,6 +253,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
}
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->entity = $obj->entity;
|
||||
|
||||
$this->ref = $obj->ref;
|
||||
$this->ref_supplier = $obj->ref_supplier;
|
||||
$this->socid = $obj->fk_soc;
|
||||
|
||||
@ -1132,7 +1132,7 @@ class SupplierProposal extends CommonObject
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
|
||||
$sql = "SELECT p.rowid, p.entity, p.ref, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
|
||||
$sql.= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht";
|
||||
$sql.= ", p.datec";
|
||||
$sql.= ", p.date_valid as datev";
|
||||
@ -1166,6 +1166,7 @@ class SupplierProposal extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->entity = $obj->entity;
|
||||
|
||||
$this->ref = $obj->ref;
|
||||
$this->remise = $obj->remise;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user