Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item Kits updates for form and Barcodes to show #3949

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/Controllers/Item_kits.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public function getView(int $item_kit_id = NEW_ENTRY): void
$info->print_option = PRINT_ALL;
$info->kit_item_id = 0;
$info->item_number = '';
$info->kit_discount = 0;
}

foreach(get_object_vars($info) as $property => $value)
Expand Down Expand Up @@ -170,7 +171,7 @@ public function postSave(int $item_kit_id = NEW_ENTRY): void
$item_kit_data = [
'name' => $this->request->getPost('name'),
'item_kit_number' => $this->request->getPost('item_kit_number'),
'item_id' => empty($this->request->getPost('kit_item_id')) ? null : intval($this->request->getPost('kit_item_id')),
'item_id' => $this->request->getPost('kit_item_id') ? null : intval($this->request->getPost('kit_item_id')),
'kit_discount' => parse_decimals($this->request->getPost('kit_discount')),
'kit_discount_type' => $this->request->getPost('kit_discount_type') === null ? PERCENT : intval($this->request->getPost('kit_discount_type')),
'price_option' => $this->request->getPost('price_option') === null ? PRICE_ALL : intval($this->request->getPost('price_option')),
Expand Down Expand Up @@ -302,9 +303,9 @@ public function getGenerateBarcodes(string $item_kit_ids): void
$barcode_config = $barcode_lib->get_barcode_config();
// in case the selected barcode type is not Code39 or Code128 we set by default Code128
// the rationale for this is that EAN codes cannot have strings as seed, so 'KIT ' is not allowed
if($barcode_config['barcode_type'] != 'Code39' && $barcode_config['barcode_type'] != 'Code128')
if($barcode_config['barcode_type'] != 'C39' && $barcode_config['barcode_type'] != 'C128')
{
$barcode_config['barcode_type'] = 'Code128';
$barcode_config['barcode_type'] = 'C128';
}
$data['barcode_config'] = $barcode_config;

Expand Down