Fix phpcs
This commit is contained in:
parent
49689fc56f
commit
9f486716c1
@ -71,7 +71,7 @@ class ProductFournisseur extends Product
|
|||||||
|
|
||||||
var $fk_supplier_price_expression;
|
var $fk_supplier_price_expression;
|
||||||
var $supplier_reputation; // reputation of supplier
|
var $supplier_reputation; // reputation of supplier
|
||||||
var $reputations=array(); // list of available supplier reputations
|
var $reputations=array(); // list of available supplier reputations
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -81,7 +81,7 @@ class ProductFournisseur extends Product
|
|||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
$this->reputations= array('-1'=>'', 'FAVORITE'=>$langs->trans('Favorite'),'NOTTHGOOD'=>$langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER'=>$langs->trans('DoNotOrderThisProductToThisSupplier'));
|
$this->reputations= array('-1'=>'', 'FAVORITE'=>$langs->trans('Favorite'),'NOTTHGOOD'=>$langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER'=>$langs->trans('DoNotOrderThisProductToThisSupplier'));
|
||||||
@ -134,9 +134,9 @@ class ProductFournisseur extends Product
|
|||||||
function remove_product_fournisseur_price($rowid)
|
function remove_product_fournisseur_price($rowid)
|
||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
@ -236,7 +236,7 @@ class ProductFournisseur extends Product
|
|||||||
$sql.= " info_bits = ".$newnpr.",";
|
$sql.= " info_bits = ".$newnpr.",";
|
||||||
$sql.= " charges = ".$charges.","; // deprecated
|
$sql.= " charges = ".$charges.","; // deprecated
|
||||||
$sql.= " delivery_time_days = ".($delivery_time_days != '' ? $delivery_time_days : 'null').",";
|
$sql.= " delivery_time_days = ".($delivery_time_days != '' ? $delivery_time_days : 'null').",";
|
||||||
$sql.= " supplier_reputation = ".(empty($supplier_reputation) ? 'NULL' : "'".$this->db->escape($supplier_reputation)."'");
|
$sql.= " supplier_reputation = ".(empty($supplier_reputation) ? 'NULL' : "'".$this->db->escape($supplier_reputation)."'");
|
||||||
$sql.= " WHERE rowid = ".$this->product_fourn_price_id;
|
$sql.= " WHERE rowid = ".$this->product_fourn_price_id;
|
||||||
// TODO Add price_base_type and price_ttc
|
// TODO Add price_base_type and price_ttc
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ class ProductFournisseur extends Product
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this) . '::update_buyprice without knowing id of line, so we delete from company, quantity and supplier_ref and insert again', LOG_DEBUG);
|
dol_syslog(get_class($this) . '::update_buyprice without knowing id of line, so we delete from company, quantity and supplier_ref and insert again', LOG_DEBUG);
|
||||||
|
|
||||||
// Delete price for this quantity
|
// Delete price for this quantity
|
||||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "product_fournisseur_price";
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "product_fournisseur_price";
|
||||||
$sql .= " WHERE fk_soc = " . $fourn->id . " AND ref_fourn = '" . $this->db->escape($ref_fourn) . "' AND quantity = " . $qty . " AND entity = " . $conf->entity;
|
$sql .= " WHERE fk_soc = " . $fourn->id . " AND ref_fourn = '" . $this->db->escape($ref_fourn) . "' AND quantity = " . $qty . " AND entity = " . $conf->entity;
|
||||||
@ -299,9 +299,9 @@ class ProductFournisseur extends Product
|
|||||||
$sql .= $delivery_time_days . ",";
|
$sql .= $delivery_time_days . ",";
|
||||||
$sql .= (empty($supplier_reputation) ? 'NULL' : "'" . $this->db->escape($supplier_reputation) . "'");
|
$sql .= (empty($supplier_reputation) ? 'NULL' : "'" . $this->db->escape($supplier_reputation) . "'");
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|
||||||
$idinserted = 0;
|
$idinserted = 0;
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$idinserted = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price");
|
$idinserted = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price");
|
||||||
@ -309,7 +309,7 @@ class ProductFournisseur extends Product
|
|||||||
else {
|
else {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error && ! empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) {
|
if (! $error && ! empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) {
|
||||||
// Add record into log table
|
// Add record into log table
|
||||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price_log(";
|
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price_log(";
|
||||||
@ -320,20 +320,20 @@ class ProductFournisseur extends Product
|
|||||||
$sql .= " " . price2num($buyprice) . ",";
|
$sql .= " " . price2num($buyprice) . ",";
|
||||||
$sql .= " " . $qty;
|
$sql .= " " . $qty;
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_CREATE', $user);
|
$result = $this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_CREATE', $user);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
$error++;
|
$error++;
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
|
||||||
if (empty($error)) {
|
if (empty($error)) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $idinserted;
|
return $idinserted;
|
||||||
@ -398,7 +398,7 @@ class ProductFournisseur extends Product
|
|||||||
$this->fk_supplier_price_expression = $obj->fk_supplier_price_expression;
|
$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))
|
if (empty($ignore_expression) && !empty($this->fk_supplier_price_expression))
|
||||||
{
|
{
|
||||||
$priceparser = new PriceParser($this->db);
|
$priceparser = new PriceParser($this->db);
|
||||||
$price_result = $priceparser->parseProductSupplier($this->fk_product, $this->fk_supplier_price_expression, $this->fourn_qty, $this->fourn_tva_tx);
|
$price_result = $priceparser->parseProductSupplier($this->fk_product, $this->fk_supplier_price_expression, $this->fourn_qty, $this->fourn_tva_tx);
|
||||||
@ -700,10 +700,10 @@ class ProductFournisseur extends Product
|
|||||||
* Display price of product
|
* Display price of product
|
||||||
*
|
*
|
||||||
* @param int $showunitprice Show "Unit price" into output string
|
* @param int $showunitprice Show "Unit price" into output string
|
||||||
* @param int $showsuptitl Show "Supplier" into output string
|
* @param int $showsuptitle Show "Supplier" into output string
|
||||||
* @param int $maxlen Max length of name
|
* @param int $maxlen Max length of name
|
||||||
* @param integer $notooltip 1=Disable tooltip
|
* @param integer $notooltip 1=Disable tooltip
|
||||||
* @param array $productFournList list of ProductFournisseur objects
|
* @param array $productFournList list of ProductFournisseur objects
|
||||||
* to display in table format.
|
* to display in table format.
|
||||||
* @return string String with supplier price
|
* @return string String with supplier price
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user