Merge pull request #15474 from fappels/13_supplier_barcode
Fix PR #15429 supplier barcode
This commit is contained in:
commit
f2d9499f44
@ -559,7 +559,7 @@ class ProductFournisseur extends Product
|
|||||||
$this->fourn_multicurrency_code = $obj->multicurrency_code;
|
$this->fourn_multicurrency_code = $obj->multicurrency_code;
|
||||||
if ($conf->barcode->enabled) {
|
if ($conf->barcode->enabled) {
|
||||||
$this->fourn_barcode = $obj->barcode; // deprecated
|
$this->fourn_barcode = $obj->barcode; // deprecated
|
||||||
$this->fourn_fk_barcode_type = $obj->barcode; // deprecated
|
$this->fourn_fk_barcode_type = $obj->fk_barcode_type; // deprecated
|
||||||
$this->supplier_barcode = $obj->barcode;
|
$this->supplier_barcode = $obj->barcode;
|
||||||
$this->supplier_fk_barcode_type = $obj->fk_barcode_type;
|
$this->supplier_fk_barcode_type = $obj->fk_barcode_type;
|
||||||
}
|
}
|
||||||
@ -674,8 +674,8 @@ class ProductFournisseur extends Product
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->barcode->enabled) {
|
if ($conf->barcode->enabled) {
|
||||||
$prodfourn->barcode = $record["barcode"];
|
$prodfourn->supplier_barcode = $record["barcode"];
|
||||||
$prodfourn->fk_barcode_type = $record["fk_barcode_type"];
|
$prodfourn->supplier_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)) {
|
||||||
|
|||||||
@ -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->fourn_barcode : '').'"></td>';
|
print '<td><input class="flat" name="barcode" value="'.($rowid ? $object->supplier_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->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 '</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->barcode;
|
print $productfourn->supplier_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->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();
|
$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>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user