From 658a9ce553b58c44cd45d3417b12504abc654585 Mon Sep 17 00:00:00 2001 From: objecttothis Date: Tue, 23 Apr 2024 15:43:32 +0400 Subject: [PATCH] Fixing routes - Refactored function name to match the route. - Added null check on sale date. - enabled escaping in bootstrap-tables - removed the esc() function from the Signed-off-by: objecttothis --- app/Controllers/Reports.php | 4 ++-- app/Views/reports/tabular_details.php | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Controllers/Reports.php b/app/Controllers/Reports.php index ce8747e72..98ad47055 100644 --- a/app/Controllers/Reports.php +++ b/app/Controllers/Reports.php @@ -1723,7 +1723,7 @@ class Reports extends Secure_Controller * @param string $location_id * @return void */ - public function getDetailed_sales(string $start_date, string $end_date, string $sale_type, string $location_id = 'all'): void + public function detailed_sales(string $start_date, string $end_date, string $sale_type, string $location_id = 'all'): void { $this->clearCache(); @@ -1768,7 +1768,7 @@ class Reports extends Secure_Controller $summary_data[] = [ 'id' => $row['sale_id'], 'type_code' => $row['type_code'], - 'sale_date' => to_date(strtotime($row['sale_date'])), + 'sale_date' => isset($row['sale_date']) ? to_date(strtotime($row['sale_date'])) : null, 'quantity' => to_quantity_decimals($row['items_purchased']), 'employee_name' => $row['employee_name'], 'customer_name' => $row['customer_name'], diff --git a/app/Views/reports/tabular_details.php b/app/Views/reports/tabular_details.php index 66ce5d15d..7bd8f8a36 100644 --- a/app/Views/reports/tabular_details.php +++ b/app/Views/reports/tabular_details.php @@ -35,12 +35,12 @@ { - var details_data = ; + var details_data = ; - var details_data_rewards = ; + var details_data_rewards = ; @@ -60,7 +60,7 @@ .addClass("table-striped") .addClass("table-bordered") .bootstrapTable({ - columns: , + columns: , stickyHeader: true, stickyHeaderOffsetLeft: $('#table').offset().left + 'px', stickyHeaderOffsetRight: $('#table').offset().right + 'px', @@ -72,11 +72,11 @@ showExport: true, exportDataType: 'all', exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel', 'pdf'], - data: , + data: , iconSize: 'sm', paginationVAlign: 'bottom', detailView: true, - escape: false, + escape: true, search: true, onPageChange: init_dialog, onPostBody: function() { @@ -84,7 +84,7 @@ }, onExpandRow: function (index, row, $detail) { $detail.html('
').find("table").bootstrapTable({ - columns: , + columns: , data: details_data[(!isNaN(row.id) && row.id) || $(row[0] || row.id).text().replace(/(POS|RECV)\s*/g, '')] }); @@ -93,7 +93,7 @@ { ?> $detail.append('
').find("table").bootstrapTable({ - columns: , + columns: , data: details_data_rewards[(!isNaN(row.id) && row.id) || $(row[0] || row.id).text().replace(/(POS|RECV)\s*/g, '')] });