Fix sql error

This commit is contained in:
Laurent Destailleur
2021-09-03 21:59:13 +02:00
parent ee066ad725
commit 94e708d196

View File

@@ -929,7 +929,7 @@ class SupplierProposal extends CommonObject
$sql .= ", multicurrency_tx"; $sql .= ", multicurrency_tx";
$sql .= ") "; $sql .= ") ";
$sql .= " VALUES ("; $sql .= " VALUES (";
$sql .= $this->socid; $sql .= ((int) $this->socid);
$sql .= ", 0"; $sql .= ", 0";
$sql .= ", ".((double) $this->remise); $sql .= ", ".((double) $this->remise);
$sql .= ", ".($this->remise_percent ? ((double) $this->remise_percent) : 'null'); $sql .= ", ".($this->remise_percent ? ((double) $this->remise_percent) : 'null');
@@ -949,9 +949,9 @@ class SupplierProposal extends CommonObject
$sql .= ", ".($this->shipping_method_id > 0 ? ((int) $this->shipping_method_id) : 'NULL'); $sql .= ", ".($this->shipping_method_id > 0 ? ((int) $this->shipping_method_id) : 'NULL');
$sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : "null"); $sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : "null");
$sql .= ", ".((int) $conf->entity); $sql .= ", ".((int) $conf->entity);
$sql .= ", ".(int) $this->fk_multicurrency; $sql .= ", ".((int) $this->fk_multicurrency);
$sql .= ", '".$this->db->escape($this->multicurrency_code)."'"; $sql .= ", '".$this->db->escape($this->multicurrency_code)."'";
$sql .= ", ".(double) $this->multicurrency_tx; $sql .= ", ".((double) $this->multicurrency_tx);
$sql .= ")"; $sql .= ")";
dol_syslog(get_class($this)."::create", LOG_DEBUG); dol_syslog(get_class($this)."::create", LOG_DEBUG);
@@ -3021,29 +3021,29 @@ class SupplierProposalLine extends CommonObjectLine
$sql .= ' ref_fourn,'; $sql .= ' ref_fourn,';
$sql .= ' fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc, fk_unit)'; $sql .= ' fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc, fk_unit)';
$sql .= " VALUES (".$this->fk_supplier_proposal.","; $sql .= " VALUES (".$this->fk_supplier_proposal.",";
$sql .= " ".($this->fk_parent_line > 0 ? "'".$this->db->escape($this->fk_parent_line)."'" : "null").","; $sql .= " ".($this->fk_parent_line > 0 ? ((int) $this->db->escape($this->fk_parent_line)) : "null").",";
$sql .= " ".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null").","; $sql .= " ".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null").",";
$sql .= " '".$this->db->escape($this->desc)."',"; $sql .= " '".$this->db->escape($this->desc)."',";
$sql .= " ".($this->fk_product ? "'".$this->db->escape($this->fk_product)."'" : "null").","; $sql .= " ".($this->fk_product ? ((int) $this->fk_product) : "null").",";
$sql .= " '".$this->db->escape($this->product_type)."',"; $sql .= " '".$this->db->escape($this->product_type)."',";
$sql .= " ".($this->date_start ? "'".$this->db->idate($this->date_start)."'" : "null").","; $sql .= " ".($this->date_start ? "'".$this->db->idate($this->date_start)."'" : "null").",";
$sql .= " ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null").","; $sql .= " ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null").",";
$sql .= " ".($this->fk_remise_except ? "'".$this->db->escape($this->fk_remise_except)."'" : "null").","; $sql .= " ".($this->fk_remise_except ? ((int) $this->db->escape($this->fk_remise_except)) : "null").",";
$sql .= " ".price2num($this->qty, 'MS').","; $sql .= " ".price2num($this->qty, 'MS').",";
$sql .= " ".price2num($this->tva_tx).","; $sql .= " ".price2num($this->tva_tx).",";
$sql .= " ".price2num($this->localtax1_tx).","; $sql .= " ".price2num($this->localtax1_tx).",";
$sql .= " ".price2num($this->localtax2_tx).","; $sql .= " ".price2num($this->localtax2_tx).",";
$sql .= " '".$this->db->escape($this->localtax1_type)."',"; $sql .= " '".$this->db->escape($this->localtax1_type)."',";
$sql .= " '".$this->db->escape($this->localtax2_type)."',"; $sql .= " '".$this->db->escape($this->localtax2_type)."',";
$sql .= " ".(!empty($this->subprice) ?price2num($this->subprice, 'MU') : "null").","; $sql .= " ".(!empty($this->subprice) ? price2num($this->subprice, 'MU') : "null").",";
$sql .= " ".((float) $this->remise_percent).","; $sql .= " ".((float) $this->remise_percent).",";
$sql .= " ".(isset($this->info_bits) ? ((int) $this->info_bits)."'" : "null").","; $sql .= " ".(isset($this->info_bits) ? ((int) $this->info_bits) : "null").",";
$sql .= " ".price2num($this->total_ht, 'MT').","; $sql .= " ".price2num($this->total_ht, 'MT').",";
$sql .= " ".price2num($this->total_tva, 'MT').","; $sql .= " ".price2num($this->total_tva, 'MT').",";
$sql .= " ".price2num($this->total_localtax1, 'MT').","; $sql .= " ".price2num($this->total_localtax1, 'MT').",";
$sql .= " ".price2num($this->total_localtax2, 'MT').","; $sql .= " ".price2num($this->total_localtax2, 'MT').",";
$sql .= " ".price2num($this->total_ttc, 'MT').","; $sql .= " ".price2num($this->total_ttc, 'MT').",";
$sql .= " ".(!empty($this->fk_fournprice) ? "'".$this->db->escape($this->fk_fournprice)."'" : "null").","; $sql .= " ".(!empty($this->fk_fournprice) ? ((int) $this->fk_fournprice) : "null").",";
$sql .= " ".(isset($this->pa_ht) ? price2num($this->pa_ht, 'MU') : "null").","; $sql .= " ".(isset($this->pa_ht) ? price2num($this->pa_ht, 'MU') : "null").",";
$sql .= ' '.((int) $this->special_code).','; $sql .= ' '.((int) $this->special_code).',';
$sql .= ' '.((int) $this->rang).','; $sql .= ' '.((int) $this->rang).',';