Fix supplier barcode should be same in fetch and fetch list.
Refactor fourn to supplier for barcode
This commit is contained in:
parent
548a25b005
commit
5af557c902
@ -104,6 +104,16 @@ class ProductFournisseur extends Product
|
||||
public $fourn_multicurrency_price;
|
||||
public $fourn_multicurrency_unitprice;
|
||||
|
||||
/**
|
||||
* @var string $supplier_barcode - Supplier barcode
|
||||
*/
|
||||
public $supplier_barcode;
|
||||
|
||||
/**
|
||||
* @var string $supplier_fk_barcode_type - Supplier barcode type
|
||||
*/
|
||||
public $supplier_fk_barcode_type;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -537,8 +547,8 @@ class ProductFournisseur extends Product
|
||||
$this->fourn_multicurrency_id = $obj->fk_multicurrency;
|
||||
$this->fourn_multicurrency_code = $obj->multicurrency_code;
|
||||
if ($conf->barcode->enabled) {
|
||||
$this->fourn_barcode = $obj->barcode;
|
||||
$this->fourn_fk_barcode_type = $obj->fk_barcode_type;
|
||||
$this->supplier_barcode = $obj->barcode;
|
||||
$this->supplier_fk_barcode_type = $obj->fk_barcode_type;
|
||||
}
|
||||
|
||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||
@ -651,8 +661,8 @@ class ProductFournisseur extends Product
|
||||
}
|
||||
|
||||
if ($conf->barcode->enabled) {
|
||||
$prodfourn->barcode = $record["barcode"];
|
||||
$prodfourn->fk_barcode_type = $record["fk_barcode_type"];
|
||||
$prodfourn->supplier_barcode = $record["barcode"];
|
||||
$prodfourn->supplier_fk_barcode_type = $record["fk_barcode_type"];
|
||||
}
|
||||
|
||||
if (!empty($conf->dynamicprices->enabled) && !empty($prodfourn->fk_supplier_price_expression)) {
|
||||
|
||||
@ -725,7 +725,7 @@ END;
|
||||
// Option to define a transport cost on supplier price
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BarcodeValue').'</td>';
|
||||
print '<td><input class="flat" name="barcode" value="'.($rowid ? $object->fourn_barcode : '').'"></td>';
|
||||
print '<td><input class="flat" name="barcode" value="'.($rowid ? $object->supplier_barcode : '').'"></td>';
|
||||
print '</tr>';
|
||||
$formbarcode = new FormBarCode($db);
|
||||
|
||||
@ -733,7 +733,7 @@ END;
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BarcodeType').'</td>';
|
||||
print '<td>';
|
||||
print $formbarcode->selectBarcodeType(($rowid ? $object->fourn_fk_barcode_type : $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE), 'fk_barcode_type', 1);
|
||||
print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE), 'fk_barcode_type', 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@ -1071,16 +1071,16 @@ END;
|
||||
// Barcode
|
||||
if (!empty($arrayfields['pfp.barcode']['checked'])) {
|
||||
print '<td align="right">';
|
||||
print $productfourn->barcode;
|
||||
print $productfourn->supplier_barcode;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Barcode type
|
||||
if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) {
|
||||
print '<td class="center">';
|
||||
$productfourn->barcode_type = !empty($productfourn->fk_barcode_type) ? $productfourn->fk_barcode_type : 0;
|
||||
$productfourn->barcode_type = !empty($productfourn->supplier_fk_barcode_type) ? $productfourn->supplier_fk_barcode_type : 0;
|
||||
$productfourn->fetch_barcode();
|
||||
print $productfourn->barcode_type_label ? $productfourn->barcode_type_label : ($productfourn->barcode ? '<div class="warning">'.$langs->trans("SetDefaultBarcodeType").'<div>' : '');
|
||||
print $productfourn->barcode_type_label ? $productfourn->barcode_type_label : ($productfourn->supplier_barcode ? '<div class="warning">'.$langs->trans("SetDefaultBarcodeType").'<div>' : '');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user