|
5 | 5 | use App\Models\Item_taxes; |
6 | 6 | use App\Models\Tax_category; |
7 | 7 | use CodeIgniter\Database\ResultInterface; |
| 8 | +use CodeIgniter\HTTP\IncomingRequest; |
8 | 9 | use CodeIgniter\Session\Session; |
9 | 10 | use Config\OSPOS; |
10 | 11 | use Config\Services; |
@@ -577,8 +578,8 @@ function item_kit_headers(): array |
577 | 578 | ['item_kit_number' => lang('Item_kits.item_kit_number')], |
578 | 579 | ['name' => lang('Item_kits.name')], |
579 | 580 | ['description' => lang('Item_kits.description')], |
580 | | - ['total_cost_price' => lang('Items.cost_price'), 'sortable' => FALSE], |
581 | | - ['total_unit_price' => lang('Items.unit_price'), 'sortable' => FALSE] |
| 581 | + ['total_cost_price' => lang('Items.cost_price'), 'sortable' => false], |
| 582 | + ['total_unit_price' => lang('Items.unit_price'), 'sortable' => false] |
582 | 583 | ]; |
583 | 584 | } |
584 | 585 |
|
@@ -654,7 +655,7 @@ function expand_attribute_values(array $definition_names, array $row): array |
654 | 655 | foreach ($definition_names as $definition_id => $definitionInfo) { |
655 | 656 | if (isset($indexed_values[$definition_id])) { |
656 | 657 | $raw_value = $indexed_values[$definition_id]; |
657 | | - |
| 658 | + |
658 | 659 | // Format DECIMAL attributes according to locale |
659 | 660 | if (is_array($definitionInfo) && isset($definitionInfo['type']) && $definitionInfo['type'] === DECIMAL) { |
660 | 661 | $attribute_values["$definition_id"] = to_decimals($raw_value); |
@@ -742,7 +743,7 @@ function get_expense_category_manage_table_headers(): string |
742 | 743 | } |
743 | 744 |
|
744 | 745 | /** |
745 | | - * Gets the html data row for the expenses category |
| 746 | + * Gets the html data row for the expense category |
746 | 747 | */ |
747 | 748 | function get_expense_category_data_row(object $expense_category): array |
748 | 749 | { |
@@ -841,7 +842,7 @@ function get_expenses_data_last_row(object $expense): array |
841 | 842 | } |
842 | 843 |
|
843 | 844 | /** |
844 | | - * Get the expenses payments summary |
| 845 | + * Get the expense payments summary |
845 | 846 | */ |
846 | 847 | function get_expenses_manage_payments_summary(array $payments, ResultInterface $expenses): string // TODO: $expenses is passed but never used. |
847 | 848 | { |
@@ -933,22 +934,22 @@ function get_controller(): string |
933 | 934 | } |
934 | 935 |
|
935 | 936 | /** |
936 | | - * Restores filter values from URL query string. |
937 | | - * |
938 | | - * @param CodeIgniter\HTTP\IncomingRequest $request The request object |
| 937 | + * Restores filter values from the URL query string. |
| 938 | + * |
| 939 | + * @param IncomingRequest $request The request object |
939 | 940 | * @return array Array with 'start_date', 'end_date', and 'selected_filters' keys |
940 | 941 | */ |
941 | | -function restoreTableFilters($request): array |
| 942 | +function restoreTableFilters(IncomingRequest $request): array |
942 | 943 | { |
943 | 944 | $startDate = $request->getGet('start_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
944 | 945 | $endDate = $request->getGet('end_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
945 | 946 | $urlFilters = $request->getGet('filters', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
946 | | - |
| 947 | + |
947 | 948 | return array_filter([ |
948 | 949 | 'start_date' => $startDate ?: null, |
949 | 950 | 'end_date' => $endDate ?: null, |
950 | 951 | 'selected_filters' => $urlFilters ?? [] |
951 | | - ], function($value) { |
| 952 | + ], function ($value) { |
952 | 953 | return $value !== null && $value !== []; |
953 | 954 | }); |
954 | 955 | } |
0 commit comments