|
@@ -208,18 +208,18 @@ if (empty($reshook))
|
|
|
$object->barcode_type = GETPOST('fk_barcode_type');
|
|
|
$object->barcode = GETPOST('barcode');
|
|
|
// Set barcode_type_xxx from barcode_type id
|
|
|
- $stdobject=new GenericObject($db);
|
|
|
+ $stdobject=new GenericObject($db);
|
|
|
$stdobject->element='product';
|
|
|
- $stdobject->barcode_type=GETPOST('fk_barcode_type');
|
|
|
- $result=$stdobject->fetch_barcode();
|
|
|
- if ($result < 0)
|
|
|
- {
|
|
|
- $error++;
|
|
|
- setEventMessage('Failed to get bar code type information '.$stdobject->error, 'errors');
|
|
|
- }
|
|
|
+ $stdobject->barcode_type=GETPOST('fk_barcode_type');
|
|
|
+ $result=$stdobject->fetch_barcode();
|
|
|
+ if ($result < 0)
|
|
|
+ {
|
|
|
+ $error++;
|
|
|
+ setEventMessage('Failed to get bar code type information '.$stdobject->error, 'errors');
|
|
|
+ }
|
|
|
$object->barcode_type_code = $stdobject->barcode_type_code;
|
|
|
$object->barcode_type_coder = $stdobject->barcode_type_coder;
|
|
|
- $object->barcode_type_label = $stdobject->barcode_type_label;
|
|
|
+ $object->barcode_type_label = $stdobject->barcode_type_label;
|
|
|
|
|
|
$object->description = dol_htmlcleanlastbr(GETPOST('desc'));
|
|
|
$object->url = GETPOST('url');
|
|
@@ -321,19 +321,19 @@ if (empty($reshook))
|
|
|
|
|
|
$object->barcode_type = GETPOST('fk_barcode_type');
|
|
|
$object->barcode = GETPOST('barcode');
|
|
|
- // Set barcode_type_xxx from barcode_type id
|
|
|
+ // Set barcode_type_xxx from barcode_type id
|
|
|
$stdobject=new GenericObject($db);
|
|
|
- $stdobject->element='product';
|
|
|
- $stdobject->barcode_type=GETPOST('fk_barcode_type');
|
|
|
- $result=$stdobject->fetch_barcode();
|
|
|
- if ($result < 0)
|
|
|
- {
|
|
|
- $error++;
|
|
|
- setEventMessage('Failed to get bar code type information '.$stdobject->error, 'errors');
|
|
|
- }
|
|
|
- $object->barcode_type_code = $stdobject->barcode_type_code;
|
|
|
- $object->barcode_type_coder = $stdobject->barcode_type_coder;
|
|
|
- $object->barcode_type_label = $stdobject->barcode_type_label;
|
|
|
+ $stdobject->element='product';
|
|
|
+ $stdobject->barcode_type=GETPOST('fk_barcode_type');
|
|
|
+ $result=$stdobject->fetch_barcode();
|
|
|
+ if ($result < 0)
|
|
|
+ {
|
|
|
+ $error++;
|
|
|
+ setEventMessage('Failed to get bar code type information '.$stdobject->error, 'errors');
|
|
|
+ }
|
|
|
+ $object->barcode_type_code = $stdobject->barcode_type_code;
|
|
|
+ $object->barcode_type_coder = $stdobject->barcode_type_coder;
|
|
|
+ $object->barcode_type_label = $stdobject->barcode_type_label;
|
|
|
|
|
|
$object->accountancy_code_sell = GETPOST('accountancy_code_sell');
|
|
|
$object->accountancy_code_buy = GETPOST('accountancy_code_buy');
|