Skip to content

Commit

Permalink
Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 25, 2018
2 parents 251136b + 502f219 commit 7ff94c8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
3 changes: 2 additions & 1 deletion htdocs/comm/propal/class/propal.class.php
Expand Up @@ -1321,7 +1321,7 @@ function createFromClone($socid=0)
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";
Expand Down Expand Up @@ -1367,6 +1367,7 @@ function fetch($rowid,$ref='')
$obj = $this->db->fetch_object($resql);

$this->id = $obj->rowid;
$this->entity = $obj->entity;

$this->ref = $obj->ref;
$this->ref_client = $obj->ref_client;
Expand Down
16 changes: 9 additions & 7 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -1572,7 +1572,7 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='')
// 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';
Expand Down Expand Up @@ -1602,12 +1602,14 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='')

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;
Expand Down
4 changes: 3 additions & 1 deletion htdocs/compta/facture/class/facture.class.php
Expand Up @@ -1239,7 +1239,7 @@ function fetch($rowid, $ref='', $ref_ext='', $ref_int='', $fetch_situation=false

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';
Expand Down Expand Up @@ -1276,6 +1276,8 @@ function fetch($rowid, $ref='', $ref_ext='', $ref_int='', $fetch_situation=false
$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;
Expand Down
4 changes: 3 additions & 1 deletion htdocs/fourn/class/fournisseur.commande.class.php
Expand Up @@ -218,7 +218,7 @@ public function fetch($id,$ref='')
// 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,";
Expand Down Expand Up @@ -253,6 +253,8 @@ public function fetch($id,$ref='')
}

$this->id = $obj->rowid;
$this->entity = $obj->entity;

$this->ref = $obj->ref;
$this->ref_supplier = $obj->ref_supplier;
$this->socid = $obj->fk_soc;
Expand Down
3 changes: 2 additions & 1 deletion htdocs/supplier_proposal/class/supplier_proposal.class.php
Expand Up @@ -1132,7 +1132,7 @@ function fetch($rowid,$ref='')
{
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";
Expand Down Expand Up @@ -1166,6 +1166,7 @@ function fetch($rowid,$ref='')
$obj = $this->db->fetch_object($resql);

$this->id = $obj->rowid;
$this->entity = $obj->entity;

$this->ref = $obj->ref;
$this->remise = $obj->remise;
Expand Down

0 comments on commit 7ff94c8

Please sign in to comment.