use barcode iso supplier_barcode

This commit is contained in:
Francis Appels 2020-11-16 18:02:54 +01:00
parent 9936d8c559
commit 57705e225b
2 changed files with 11 additions and 16 deletions

View File

@ -105,14 +105,9 @@ class ProductFournisseur extends Product
public $fourn_multicurrency_unitprice; public $fourn_multicurrency_unitprice;
/** /**
* @var string $supplier_barcode - Supplier barcode * @var string $fk_barcode_type - Supplier barcode type
*/ */
public $supplier_barcode; public $fk_barcode_type;
/**
* @var string $supplier_fk_barcode_type - Supplier barcode type
*/
public $supplier_fk_barcode_type;
/** /**
* Constructor * Constructor
@ -547,8 +542,8 @@ class ProductFournisseur extends Product
$this->fourn_multicurrency_id = $obj->fk_multicurrency; $this->fourn_multicurrency_id = $obj->fk_multicurrency;
$this->fourn_multicurrency_code = $obj->multicurrency_code; $this->fourn_multicurrency_code = $obj->multicurrency_code;
if ($conf->barcode->enabled) { if ($conf->barcode->enabled) {
$this->supplier_barcode = $obj->barcode; $this->barcode = $obj->barcode;
$this->supplier_fk_barcode_type = $obj->fk_barcode_type; $this->fk_barcode_type = $obj->fk_barcode_type;
} }
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
@ -661,8 +656,8 @@ class ProductFournisseur extends Product
} }
if ($conf->barcode->enabled) { if ($conf->barcode->enabled) {
$prodfourn->supplier_barcode = $record["barcode"]; $prodfourn->barcode = $record["barcode"];
$prodfourn->supplier_fk_barcode_type = $record["fk_barcode_type"]; $prodfourn->fk_barcode_type = $record["fk_barcode_type"];
} }
if (!empty($conf->dynamicprices->enabled) && !empty($prodfourn->fk_supplier_price_expression)) { if (!empty($conf->dynamicprices->enabled) && !empty($prodfourn->fk_supplier_price_expression)) {

View File

@ -725,7 +725,7 @@ END;
// Option to define a transport cost on supplier price // Option to define a transport cost on supplier price
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans('BarcodeValue').'</td>'; print '<td>'.$langs->trans('BarcodeValue').'</td>';
print '<td><input class="flat" name="barcode" value="'.($rowid ? $object->supplier_barcode : '').'"></td>'; print '<td><input class="flat" name="barcode" value="'.($rowid ? $object->barcode : '').'"></td>';
print '</tr>'; print '</tr>';
$formbarcode = new FormBarCode($db); $formbarcode = new FormBarCode($db);
@ -733,7 +733,7 @@ END;
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans('BarcodeType').'</td>'; print '<td>'.$langs->trans('BarcodeType').'</td>';
print '<td>'; print '<td>';
print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE), 'fk_barcode_type', 1); print $formbarcode->selectBarcodeType(($rowid ? $object->fk_barcode_type : $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE), 'fk_barcode_type', 1);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
@ -1071,16 +1071,16 @@ END;
// Barcode // Barcode
if (!empty($arrayfields['pfp.barcode']['checked'])) { if (!empty($arrayfields['pfp.barcode']['checked'])) {
print '<td align="right">'; print '<td align="right">';
print $productfourn->supplier_barcode; print $productfourn->barcode;
print '</td>'; print '</td>';
} }
// Barcode type // Barcode type
if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) { if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) {
print '<td class="center">'; print '<td class="center">';
$productfourn->barcode_type = !empty($productfourn->supplier_fk_barcode_type) ? $productfourn->supplier_fk_barcode_type : 0; $productfourn->barcode_type = !empty($productfourn->fk_barcode_type) ? $productfourn->fk_barcode_type : 0;
$productfourn->fetch_barcode(); $productfourn->fetch_barcode();
print $productfourn->barcode_type_label ? $productfourn->barcode_type_label : ($productfourn->supplier_barcode ? '<div class="warning">'.$langs->trans("SetDefaultBarcodeType").'<div>' : ''); print $productfourn->barcode_type_label ? $productfourn->barcode_type_label : ($productfourn->barcode ? '<div class="warning">'.$langs->trans("SetDefaultBarcodeType").'<div>' : '');
print '</td>'; print '</td>';
} }