diff --git a/app/Controllers/Receivings.php b/app/Controllers/Receivings.php index 854ed0d47..6744e8397 100644 --- a/app/Controllers/Receivings.php +++ b/app/Controllers/Receivings.php @@ -94,7 +94,7 @@ class Receivings extends Secure_Controller /** * @return void */ - public function change_mode(): void + public function postChangeMode(): void { $stock_destination = $this->request->getPost('stock_destination', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $stock_source = $this->request->getPost('stock_source', FILTER_SANITIZE_NUMBER_INT); diff --git a/app/Controllers/Sales.php b/app/Controllers/Sales.php index baa49c316..44445cb6e 100644 --- a/app/Controllers/Sales.php +++ b/app/Controllers/Sales.php @@ -213,9 +213,12 @@ class Sales extends Secure_Controller } /** + * Changes the sale mode in the register to carry out different types of sales + * * @return void + * @noinspection PhpUnused */ - public function postChange_mode(): void + public function postChangeMode(): void { $mode = $this->request->getPost('mode', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $this->sale_lib->set_mode($mode); @@ -259,7 +262,9 @@ class Sales extends Secure_Controller if(!$stock_location || $stock_location == $this->sale_lib->get_sale_location()) { -//TODO: This has an empty body. What to do here? +//TODO: The code below was removed in 2017 by @steveireland. We either need to reinstate some of it or remove this entire if block but we can't leave an empty if block +// $dinner_table = $this->request->getPost('dinner_table'); +// $this->sale_lib->set_dinner_table($dinner_table); } elseif($this->stock_location->is_allowed_location($stock_location, 'sales')) { diff --git a/app/Database/Migrations/20210422000000_database_optimizations.php b/app/Database/Migrations/20210422000000_database_optimizations.php index 5b970022a..a8f9a9aed 100644 --- a/app/Database/Migrations/20210422000000_database_optimizations.php +++ b/app/Database/Migrations/20210422000000_database_optimizations.php @@ -45,8 +45,11 @@ class Migration_database_optimizations extends Migration $builder = $this->db->table('attribute_values'); $builder->delete(['attribute_id' => $attribute_value['attribute_id']]); - $query = 'SELECT links.definition_id, links.item_id, links.attribute_id, defs.definition_type FROM ospos_attribute_links links JOIN ospos_attribute_definitions defs ON defs.definition_id = links.definition_id where attribute_id = '; - $query .= $attribute_value['attribute_id']; + //TODO: This should be converted to using CI4 QueryBuilder + $query = 'SELECT links.definition_id, links.item_id, links.attribute_id, defs.definition_type' + . ' FROM ospos_attribute_links links' + . ' JOIN ospos_attribute_definitions defs ON defs.definition_id = links.definition_id' + . ' WHERE attribute_id = ' . $attribute_value['attribute_id']; $attribute_links = $this->db->query($query); $builder = $this->db->table('attribute_links'); diff --git a/app/Helpers/locale_helper.php b/app/Helpers/locale_helper.php index a019cba17..38f277e27 100644 --- a/app/Helpers/locale_helper.php +++ b/app/Helpers/locale_helper.php @@ -482,7 +482,7 @@ function parse_tax(string $number) * @param int|null $decimals * @return false|float|int|mixed|string */ -function parse_decimals(string $number, int $decimals = null): mixed +function parse_decimals(string $number, int $decimals = null) { if(empty($number)) { diff --git a/app/Libraries/Barcode_lib.php b/app/Libraries/Barcode_lib.php index b4e96e944..40dc6dcf1 100644 --- a/app/Libraries/Barcode_lib.php +++ b/app/Libraries/Barcode_lib.php @@ -61,7 +61,7 @@ class Barcode_lib /** * @param array $item * @param array $barcode_config - * @return object|Code128|Code39|Ean13|Ean8 + * @return object */ public static function barcode_instance(array $item, array $barcode_config): object { @@ -84,7 +84,7 @@ class Barcode_lib /** * @param string $barcode_type - * @return Code128|Code39|Ean13|Ean8 + * @return object */ private static function get_barcode_instance(string $barcode_type = 'Code128'): object { diff --git a/app/Libraries/Barcodes/BarcodeBase.php b/app/Libraries/Barcodes/BarcodeBase.php index 59b5f5dbe..b8ad191cf 100644 --- a/app/Libraries/Barcodes/BarcodeBase.php +++ b/app/Libraries/Barcodes/BarcodeBase.php @@ -66,9 +66,7 @@ abstract class BarcodeBase /** * Get the data * - * @param mixed data - (int or string) Data to be encoded - * @return instance of \emberlabs\Barcode\BarcodeInterface - * @throws OverflowException + * @return BarcodeInterface */ public function getData() { diff --git a/app/Models/Attribute.php b/app/Models/Attribute.php index cf28d3af1..4b1d2f897 100644 --- a/app/Models/Attribute.php +++ b/app/Models/Attribute.php @@ -653,7 +653,7 @@ class Attribute extends Model /** * @param int $item_id * @param int|null $definition_id - * @return object|stdClass|null + * @return object|null */ public function get_link_value(int $item_id, ?int $definition_id): ?object { @@ -712,7 +712,7 @@ class Attribute extends Model /** * @param int $item_id * @param int $definition_id - * @return object|array|stdClass|null + * @return object|null */ public function get_attribute_value(int $item_id, int $definition_id): ?object { diff --git a/app/Models/Inventory.php b/app/Models/Inventory.php index 974e6c7f2..1c77f8628 100644 --- a/app/Models/Inventory.php +++ b/app/Models/Inventory.php @@ -77,15 +77,16 @@ class Inventory extends Model } /** - * @throws ReflectionException + * @param int $item_id ID number for the item to have quantity reset. + * @return bool|int|string The row id of the inventory table on insert or false on failure */ - public function reset_quantity(int $item_id): bool + public function reset_quantity(int $item_id) { $inventory_sums = $this->get_inventory_sum($item_id); foreach($inventory_sums as $inventory_sum) { if($inventory_sum['sum'] > 0) - {//TODO: Reflection Exception + { $employee = model(Employee::class); return $this->insert([ diff --git a/app/Models/Receiving.php b/app/Models/Receiving.php index c25e61c66..8c70f5752 100644 --- a/app/Models/Receiving.php +++ b/app/Models/Receiving.php @@ -282,7 +282,7 @@ class Receiving extends Model /** * @param int $receiving_id - * @return object|array|\stdClass|null + * @return object */ public function get_supplier(int $receiving_id): object { diff --git a/app/Views/receivings/receiving.php b/app/Views/receivings/receiving.php index db251552a..bdce7eeb0 100644 --- a/app/Views/receivings/receiving.php +++ b/app/Views/receivings/receiving.php @@ -40,7 +40,7 @@ if (isset($success)) - 'mode_form', 'class' => 'form-horizontal panel panel-default']) ?> + 'mode_form', 'class' => 'form-horizontal panel panel-default']) ?>