Skip to content

Commit

Permalink
Fix sql regression
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jun 25, 2019
1 parent 441b279 commit a2d50eb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions htdocs/fourn/class/fournisseur.facture.class.php
Expand Up @@ -343,7 +343,7 @@ public function create($user)
$sql.= ", '".$this->db->escape($this->ref_supplier)."'";
$sql.= ", ".$conf->entity;
$sql.= ", '".$this->db->escape($this->type)."'";
$sql.= ", '".$this->db->escape($this->libelle)."'";
$sql.= ", '".$this->db->escape($this->label?$this->label:$this->libelle)."'";
$sql.= ", ".$this->socid;
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ", '".$this->db->idate($this->date)."'";
Expand Down Expand Up @@ -484,7 +484,7 @@ public function create($user)
{
$idligne = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_det');

$this->updateline(
$this->updateline(
$idligne,
$line->description,
$line->pu_ht,
Expand All @@ -511,8 +511,6 @@ public function create($user)
$result=$this->update_price();
if ($result > 0)
{
$action='create';

// Actions on extra fields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
Expand Down Expand Up @@ -587,7 +585,7 @@ public function fetch($id = '', $ref = '')
$sql.= " t.datec,";
$sql.= " t.datef,";
$sql.= " t.tms,";
$sql.= " t.libelle,";
$sql.= " t.libelle as label,";
$sql.= " t.paye,";
$sql.= " t.amount,";
$sql.= " t.remise,";
Expand Down Expand Up @@ -646,8 +644,8 @@ public function fetch($id = '', $ref = '')
$this->date = $this->db->jdate($obj->datef);
$this->datep = $this->db->jdate($obj->datef);
$this->tms = $this->db->jdate($obj->tms);
$this->libelle = $obj->libelle; // deprecated
$this->label = $obj->libelle;
$this->libelle = $obj->label; // deprecated
$this->label = $obj->label;
$this->paye = $obj->paye;
$this->amount = $obj->amount;
$this->remise = $obj->remise;
Expand Down Expand Up @@ -2859,7 +2857,7 @@ public function __construct($db)
*/
public function fetch($rowid)
{
$sql = 'SELECT f.rowid, f.ref as ref_supplier, f.libelle as label, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx';
$sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx';
$sql.= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 ';
$sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_facture_fourn, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit';
$sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc';
Expand Down

0 comments on commit a2d50eb

Please sign in to comment.