From f8b39ab50e1eb9dd10026d21d437ad8ac54bed36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Apr 2016 19:04:23 +0200 Subject: [PATCH] Fix errors reported by scrutinizer --- ChangeLog | 1 + .../fourn/class/fournisseur.product.class.php | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 63d2f79b531..ec9b5d50ba0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ Dolibarr 4.0 should be compatible with PHP 7 but more feedbacks are still expect Following changes may create regression for some external modules, but were necessary to make Dolibarr better: +- Function log() of class CommandeFournisseur has been removed. Using it is no more required. - Method select_type_comptes_financiers() has been renamed into selectTypeOfBankAccount() - File '/core/tpl/document_actions_pre_headers.tpl.php' were renamed into '/core/actions_linkedfiles.inc.php'. So if you included it into your module, change your code like this to be compatible with all version: diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index d346d885a4f..87c7ae259d2 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -64,7 +64,12 @@ class ProductFournisseur extends Product var $product_fourn_id; // supplier id var $fk_availability; // availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay) var $fourn_unitprice; + var $fourn_tva_tx; var $fourn_tva_npr; + /** + * @deprecated + */ + var $fourn_unitcharges; // old version used a buggy system to calculate margin of a charge field on supplier price. Now margin is on pmp, best supplier price or cost price. var $fk_supplier_price_expression; @@ -376,7 +381,10 @@ class ProductFournisseur extends Product if ($obj) { $this->product_fourn_price_id = $rowid; - $this->fourn_id = $obj->fk_soc; + $this->id = $obj->fk_product; + $this->fk_product = $obj->fk_product; + $this->product_id = $obj->fk_product; // deprecated + $this->fourn_id = $obj->fk_soc; $this->fourn_ref = $obj->ref_fourn; // deprecated $this->ref_supplier = $obj->ref_fourn; $this->fourn_price = $obj->price; @@ -386,15 +394,12 @@ class ProductFournisseur extends Product $this->fourn_remise = $obj->remise; $this->fourn_unitprice = $obj->unitprice; $this->fourn_unitcharges = $obj->unitcharges; // deprecated - $this->fourn_tva_tx = $obj->tva_tx; - $this->product_id = $obj->fk_product; // deprecated - $this->fk_product = $obj->fk_product; - $this->id = $obj->fk_product; + $this->fourn_tva_tx = $obj->tva_tx; + //$this->fourn_tva_npr = $obj->fourn_tva_npr; // TODO this field not exist in llx_product_fournisseur_price. We should add it ? $this->fk_availability = $obj->fk_availability; $this->delivery_time_days = $obj->delivery_time_days; - //$this->fourn_tva_npr = $obj->fourn_tva_npr; // TODO this field not exist in llx_product_fournisseur_price. We should add it ? $this->fk_supplier_price_expression = $obj->fk_supplier_price_expression; - $this->supplier_reputation = $obj->supplier_reputation; + $this->supplier_reputation = $obj->supplier_reputation; if (empty($ignore_expression) && !empty($this->fk_supplier_price_expression)) {