Skip to content

Commit

Permalink
Item Kits updates for form and Barcodes to show (#3949)
Browse files Browse the repository at this point in the history
* Update Item_kits.php

* Update Item_kits.php Barcode Issue

public function Generate Barcodes
changed Code to just c and it started working
  • Loading branch information
odiea authored and jekkos committed Jun 10, 2024
1 parent cafa560 commit e6212ff
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit e6212ff

Please sign in to comment.