From ed734c3f5e0154c360f51ec77f7c5ee30e53fab3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Dec 2022 16:45:44 +0100 Subject: [PATCH] Debug v17 --- .../movement/doc/pdf_standard.modules.php | 2 +- .../class/fournisseur.facture-rec.class.php | 2 +- .../fourn/class/fournisseur.facture.class.php | 33 +++++++++---------- .../class/supplier_proposal.class.php | 4 +-- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 064bdfbf3b7..094e19a280a 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -314,7 +314,7 @@ class pdf_standard extends ModelePDFMovement $sql .= natural_search('p.label', $search_product); } if ($search_warehouse > 0) { - $sql .= " AND e.rowid = ".((int) $this->db->escape($search_warehouse)); + $sql .= " AND e.rowid = ".((int) $search_warehouse); } if (!empty($search_user)) { $sql .= natural_search('u.login', $search_user); diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index b2b30ebe281..738e27a84e9 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -1771,7 +1771,7 @@ class FactureFournisseurRec extends CommonInvoice } $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; - $sql .= " SET frequency = ".($frequency ? ((int) $this->db->escape($frequency)) : "NULL"); + $sql .= " SET frequency = ".($frequency ? ((int) $frequency) : "NULL"); if (!empty($unit)) { $sql .= ", unit_frequency = '".$this->db->escape($unit)."'"; } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 99dabe02fe2..456eab8b0b9 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -592,7 +592,7 @@ class FactureFournisseur extends CommonInvoice $sql .= ", ".(int) $this->fk_multicurrency; $sql .= ", '".$this->db->escape($this->multicurrency_code)."'"; $sql .= ", ".(double) $this->multicurrency_tx; - $sql .= ", ".($this->fk_facture_source ? ((int) $this->db->escape($this->fk_facture_source)) : "null"); + $sql .= ", ".($this->fk_facture_source ? ((int) $this->fk_facture_source) : "null"); $sql .= ", ".(isset($this->fk_fac_rec_source) ? $this->fk_fac_rec_source : "NULL"); $sql .= ")"; @@ -1234,30 +1234,29 @@ class FactureFournisseur extends CommonInvoice $sql .= " ref=".(isset($this->ref) ? "'".$this->db->escape($this->ref)."'" : "null").","; $sql .= " ref_supplier=".(isset($this->ref_supplier) ? "'".$this->db->escape($this->ref_supplier)."'" : "null").","; $sql .= " ref_ext=".(isset($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null").","; - $sql .= " entity=".(isset($this->entity) ? $this->entity : "null").","; - $sql .= " type=".(isset($this->type) ? $this->type : "null").","; - $sql .= " fk_soc=".(isset($this->fk_soc) ? $this->fk_soc : "null").","; + $sql .= " entity=".(isset($this->entity) ? ((int) $this->entity) : "null").","; + $sql .= " type=".(isset($this->type) ? ((int) $this->type) : "null").","; + $sql .= " fk_soc=".(isset($this->fk_soc) ? ((int) $this->fk_soc) : "null").","; $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').","; $sql .= " datef=".(dol_strlen($this->date) != 0 ? "'".$this->db->idate($this->date)."'" : 'null').","; if (dol_strlen($this->tms) != 0) { $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').","; } $sql .= " libelle=".(isset($this->label) ? "'".$this->db->escape($this->label)."'" : "null").","; - $sql .= " paye=".(isset($this->paye) ? $this->paye : "null").","; + $sql .= " paye=".(isset($this->paye) ? ((int) $this->paye) : "null").","; $sql .= " close_code=".(isset($this->close_code) ? "'".$this->db->escape($this->close_code)."'" : "null").","; $sql .= " close_note=".(isset($this->close_note) ? "'".$this->db->escape($this->close_note)."'" : "null").","; - //$sql .= " tva=".(isset($this->tva) ? $this->tva : "null").","; - $sql .= " localtax1=".(isset($this->localtax1) ? $this->localtax1 : "null").","; - $sql .= " localtax2=".(isset($this->localtax2) ? $this->localtax2 : "null").","; - $sql .= " total_ht=".(isset($this->total_ht) ? $this->total_ht : "null").","; - $sql .= " total_tva=".(isset($this->total_tva) ? $this->total_tva : "null").","; - $sql .= " total_ttc=".(isset($this->total_ttc) ? $this->total_ttc : "null").","; - $sql .= " fk_statut=".(isset($this->status) ? $this->status : (isset($this->statut) ? $this->statut : "null")).","; - $sql .= " fk_user_author=".(isset($this->author) ? $this->author : "null").","; - $sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? $this->fk_user_valid : "null").","; - $sql .= " fk_facture_source=".($this->fk_facture_source ? ((int) $this->db->escape($this->fk_facture_source)) : "null").","; - $sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").","; - $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").","; + $sql .= " localtax1=".(isset($this->localtax1) ? ((float) $this->localtax1) : "null").","; + $sql .= " localtax2=".(isset($this->localtax2) ? ((float) $this->localtax2) : "null").","; + $sql .= " total_ht=".(isset($this->total_ht) ? ((float) $this->total_ht) : "null").","; + $sql .= " total_tva=".(isset($this->total_tva) ? ((float) $this->total_tva) : "null").","; + $sql .= " total_ttc=".(isset($this->total_ttc) ? ((float) $this->total_ttc) : "null").","; + $sql .= " fk_statut=".(isset($this->status) ? ((int) $this->status) : (isset($this->statut) ? ((int) $this->statut) : "null")).","; + $sql .= " fk_user_author=".(isset($this->author) ? ((int) $this->author) : "null").","; + $sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? ((int) $this->fk_user_valid) : "null").","; + $sql .= " fk_facture_source=".($this->fk_facture_source ? ((int) $this->fk_facture_source) : "null").","; + $sql .= " fk_projet=".(isset($this->fk_project) ? ((int) $this->fk_project) : "null").","; + $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? ((int) $this->cond_reglement_id) : "null").","; $sql .= " date_lim_reglement=".(dol_strlen($this->date_echeance) != 0 ? "'".$this->db->idate($this->date_echeance)."'" : 'null').","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 221700ee369..15dd1924718 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -3063,14 +3063,14 @@ class SupplierProposalLine extends CommonObjectLine $sql .= ' ref_fourn,'; $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 .= " ".($this->fk_parent_line > 0 ? ((int) $this->db->escape($this->fk_parent_line)) : "null").","; + $sql .= " ".($this->fk_parent_line > 0 ? ((int) $this->fk_parent_line) : "null").","; $sql .= " ".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null").","; $sql .= " '".$this->db->escape($this->desc)."',"; $sql .= " ".($this->fk_product ? ((int) $this->fk_product) : "null").","; $sql .= " '".$this->db->escape($this->product_type)."',"; $sql .= " ".($this->date_start ? "'".$this->db->idate($this->date_start)."'" : "null").","; $sql .= " ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null").","; - $sql .= " ".($this->fk_remise_except ? ((int) $this->db->escape($this->fk_remise_except)) : "null").","; + $sql .= " ".($this->fk_remise_except ? ((int) $this->fk_remise_except) : "null").","; $sql .= " ".price2num($this->qty, 'MS').","; $sql .= " ".price2num($this->tva_tx).","; $sql .= " ".price2num($this->localtax1_tx).",";