mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-18 21:40:52 -04:00
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 <objecttothis@gmail.com>
This commit is contained in:
@@ -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'],
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
{
|
||||
<?= view('partial/bootstrap_tables_locale') ?>
|
||||
|
||||
var details_data = <?= json_encode(esc($details_data, 'js')) ?>;
|
||||
var details_data = <?= json_encode(esc($details_data)) ?>;
|
||||
<?php
|
||||
if($config['customer_reward_enable'] && !empty($details_data_rewards))
|
||||
{
|
||||
?>
|
||||
var details_data_rewards = <?= json_encode(esc($details_data_rewards, 'js')) ?>;
|
||||
var details_data_rewards = <?= json_encode(esc($details_data_rewards)) ?>;
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@@ -60,7 +60,7 @@
|
||||
.addClass("table-striped")
|
||||
.addClass("table-bordered")
|
||||
.bootstrapTable({
|
||||
columns: <?= transform_headers(esc($headers['summary'], 'js'), true) ?>,
|
||||
columns: <?= transform_headers(esc($headers['summary']), true) ?>,
|
||||
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: <?= json_encode(esc($summary_data, 'js')) ?>,
|
||||
data: <?= json_encode($summary_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('<table></table>').find("table").bootstrapTable({
|
||||
columns: <?= transform_headers_readonly(esc($headers['details'], 'js')) ?>,
|
||||
columns: <?= transform_headers_readonly(esc($headers['details'])) ?>,
|
||||
data: details_data[(!isNaN(row.id) && row.id) || $(row[0] || row.id).text().replace(/(POS|RECV)\s*/g, '')]
|
||||
});
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
{
|
||||
?>
|
||||
$detail.append('<table></table>').find("table").bootstrapTable({
|
||||
columns: <?= transform_headers_readonly(esc($headers['details_rewards'], 'js')) ?>,
|
||||
columns: <?= transform_headers_readonly(esc($headers['details_rewards'])) ?>,
|
||||
data: details_data_rewards[(!isNaN(row.id) && row.id) || $(row[0] || row.id).text().replace(/(POS|RECV)\s*/g, '')]
|
||||
});
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user