clean code

This commit is contained in:
Frédéric France 2022-09-21 21:01:18 +02:00
parent caa54f7f11
commit 2247bc2ae4

View File

@ -255,6 +255,14 @@ class Product extends CommonObject
*/
public $status = 0;
/**
* Status indicates whether the product is on sale '1' or not '0'
* @var int
* @deprecated
* @see $status
*/
public $tosell;
/**
* Status indicate whether the product is available for purchase '1' or not '0'
*
@ -262,6 +270,14 @@ class Product extends CommonObject
*/
public $status_buy = 0;
/**
* Status indicate whether the product is available for purchase '1' or not '0'
* @var int
* @deprecated
* @see $status_buy
*/
public $tobuy;
/**
* Status indicates whether the product is a finished product '1' or a raw material '0'
*
@ -1977,11 +1993,11 @@ class Product extends CommonObject
$this->remise_percent = $obj->remise_percent; // remise percent if present and not typed
$this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier
$this->default_vat_code = $obj->default_vat_code; // Vat code supplier
$this->fourn_multicurrency_price = $obj->multicurrency_price;
$this->fourn_multicurrency_unitprice = $obj->multicurrency_unitprice;
$this->fourn_multicurrency_tx = $obj->multicurrency_tx;
$this->fourn_multicurrency_id = $obj->fk_multicurrency;
$this->fourn_multicurrency_code = $obj->multicurrency_code;
$this->fourn_multicurrency_price = $obj->multicurrency_price;
$this->fourn_multicurrency_unitprice = $obj->multicurrency_unitprice;
$this->fourn_multicurrency_tx = $obj->multicurrency_tx;
$this->fourn_multicurrency_id = $obj->fk_multicurrency;
$this->fourn_multicurrency_code = $obj->multicurrency_code;
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$this->packaging = $obj->packaging;
}
@ -2042,11 +2058,11 @@ class Product extends CommonObject
$this->remise_percent = $obj->remise_percent; // remise percent if present and not typed
$this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier
$this->default_vat_code = $obj->default_vat_code; // Vat code supplier
$this->fourn_multicurrency_price = $obj->multicurrency_price;
$this->fourn_multicurrency_unitprice = $obj->multicurrency_unitprice;
$this->fourn_multicurrency_tx = $obj->multicurrency_tx;
$this->fourn_multicurrency_id = $obj->fk_multicurrency;
$this->fourn_multicurrency_code = $obj->multicurrency_code;
$this->fourn_multicurrency_price = $obj->multicurrency_price;
$this->fourn_multicurrency_unitprice = $obj->multicurrency_unitprice;
$this->fourn_multicurrency_tx = $obj->multicurrency_tx;
$this->fourn_multicurrency_id = $obj->fk_multicurrency;
$this->fourn_multicurrency_code = $obj->multicurrency_code;
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$this->packaging = $obj->packaging;
}
@ -2383,57 +2399,57 @@ class Product extends CommonObject
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
$this->ref = $obj->ref;
$this->ref_ext = $obj->ref_ext;
$this->label = $obj->label;
$this->description = $obj->description;
$this->url = $obj->url;
$this->note_public = $obj->note_public;
$this->note_private = $obj->note_private;
$this->note = $obj->note_private; // deprecated
$this->ref = $obj->ref;
$this->ref_ext = $obj->ref_ext;
$this->label = $obj->label;
$this->description = $obj->description;
$this->url = $obj->url;
$this->note_public = $obj->note_public;
$this->note_private = $obj->note_private;
$this->note = $obj->note_private; // deprecated
$this->type = $obj->fk_product_type;
$this->status = $obj->tosell;
$this->status_buy = $obj->tobuy;
$this->status_batch = $obj->tobatch;
$this->batch_mask = $obj->batch_mask;
$this->type = $obj->fk_product_type;
$this->status = $obj->tosell;
$this->status_buy = $obj->tobuy;
$this->status_batch = $obj->tobatch;
$this->batch_mask = $obj->batch_mask;
$this->customcode = $obj->customcode;
$this->country_id = $obj->fk_country;
$this->customcode = $obj->customcode;
$this->country_id = $obj->fk_country;
$this->country_code = getCountry($this->country_id, 2, $this->db);
$this->state_id = $obj->fk_state;
$this->lifetime = $obj->lifetime;
$this->qc_frequency = $obj->qc_frequency;
$this->price = $obj->price;
$this->price_ttc = $obj->price_ttc;
$this->price_min = $obj->price_min;
$this->price_min_ttc = $obj->price_min_ttc;
$this->lifetime = $obj->lifetime;
$this->qc_frequency = $obj->qc_frequency;
$this->price = $obj->price;
$this->price_ttc = $obj->price_ttc;
$this->price_min = $obj->price_min;
$this->price_min_ttc = $obj->price_min_ttc;
$this->price_base_type = $obj->price_base_type;
$this->cost_price = $obj->cost_price;
$this->cost_price = $obj->cost_price;
$this->default_vat_code = $obj->default_vat_code;
$this->tva_tx = $obj->tva_tx;
$this->tva_tx = $obj->tva_tx;
//! French VAT NPR
$this->tva_npr = $obj->tva_npr;
$this->recuperableonly = $obj->tva_npr; // For backward compatibility
$this->tva_npr = $obj->tva_npr;
$this->recuperableonly = $obj->tva_npr; // For backward compatibility
//! Local taxes
$this->localtax1_tx = $obj->localtax1_tx;
$this->localtax2_tx = $obj->localtax2_tx;
$this->localtax1_type = $obj->localtax1_type;
$this->localtax2_type = $obj->localtax2_type;
$this->localtax1_tx = $obj->localtax1_tx;
$this->localtax2_tx = $obj->localtax2_tx;
$this->localtax1_type = $obj->localtax1_type;
$this->localtax2_type = $obj->localtax2_type;
$this->finished = $obj->finished;
$this->fk_default_bom = $obj->fk_default_bom;
$this->finished = $obj->finished;
$this->fk_default_bom = $obj->fk_default_bom;
$this->duration = $obj->duration;
$this->duration_value = substr($obj->duration, 0, dol_strlen($obj->duration) - 1);
$this->duration = $obj->duration;
$this->duration_value = substr($obj->duration, 0, dol_strlen($obj->duration) - 1);
$this->duration_unit = substr($obj->duration, -1);
$this->canvas = $obj->canvas;
$this->canvas = $obj->canvas;
$this->net_measure = $obj->net_measure;
$this->net_measure_units = $obj->net_measure_units;
$this->weight = $obj->weight;
$this->weight_units = $obj->weight_units;
$this->length = $obj->length;
$this->length_units = $obj->length_units;
$this->weight = $obj->weight;
$this->weight_units = $obj->weight_units;
$this->length = $obj->length;
$this->length_units = $obj->length_units;
$this->width = $obj->width;
$this->width_units = $obj->width_units;
$this->height = $obj->height;
@ -2442,32 +2458,32 @@ class Product extends CommonObject
$this->surface = $obj->surface;
$this->surface_units = $obj->surface_units;
$this->volume = $obj->volume;
$this->volume_units = $obj->volume_units;
$this->volume_units = $obj->volume_units;
$this->barcode = $obj->barcode;
$this->barcode_type = $obj->fk_barcode_type;
$this->barcode_type = $obj->fk_barcode_type;
$this->accountancy_code_buy = $obj->accountancy_code_buy;
$this->accountancy_code_buy_intra = $obj->accountancy_code_buy_intra;
$this->accountancy_code_buy_export = $obj->accountancy_code_buy_export;
$this->accountancy_code_sell = $obj->accountancy_code_sell;
$this->accountancy_code_sell_intra = $obj->accountancy_code_sell_intra;
$this->accountancy_code_sell_export = $obj->accountancy_code_sell_export;
$this->accountancy_code_buy = $obj->accountancy_code_buy;
$this->accountancy_code_buy_intra = $obj->accountancy_code_buy_intra;
$this->accountancy_code_buy_export = $obj->accountancy_code_buy_export;
$this->accountancy_code_sell = $obj->accountancy_code_sell;
$this->accountancy_code_sell_intra = $obj->accountancy_code_sell_intra;
$this->accountancy_code_sell_export = $obj->accountancy_code_sell_export;
$this->fk_default_warehouse = $obj->fk_default_warehouse;
$this->fk_default_workstation = $obj->fk_default_workstation;
$this->seuil_stock_alerte = $obj->seuil_stock_alerte;
$this->desiredstock = $obj->desiredstock;
$this->stock_reel = $obj->stock;
$this->fk_default_warehouse = $obj->fk_default_warehouse;
$this->fk_default_workstation = $obj->fk_default_workstation;
$this->seuil_stock_alerte = $obj->seuil_stock_alerte;
$this->desiredstock = $obj->desiredstock;
$this->stock_reel = $obj->stock;
$this->pmp = $obj->pmp;
$this->date_creation = $obj->datec;
$this->date_modification = $obj->tms;
$this->import_key = $obj->import_key;
$this->entity = $obj->entity;
$this->date_creation = $obj->datec;
$this->date_modification = $obj->tms;
$this->import_key = $obj->import_key;
$this->entity = $obj->entity;
$this->ref_ext = $obj->ref_ext;
$this->fk_price_expression = $obj->fk_price_expression;
$this->fk_unit = $obj->fk_unit;
$this->ref_ext = $obj->ref_ext;
$this->fk_price_expression = $obj->fk_price_expression;
$this->fk_unit = $obj->fk_unit;
$this->price_autogen = $obj->price_autogen;
$this->model_pdf = $obj->model_pdf;