diff --git a/application/helpers/table_helper.php b/application/helpers/table_helper.php index 2c2dc2855..93dd86221 100644 --- a/application/helpers/table_helper.php +++ b/application/helpers/table_helper.php @@ -121,17 +121,11 @@ function transform_headers_readonly($array) return json_encode($result); } -function transform_headers($array, $readonly = FALSE) +function transform_headers($array) { $result = array(); - - if (!readonly) - { - $array = array_merge(array(array('checkbox' => 'select', 'sortable' => FALSE)), $array); - } - - $array[] = array('edit' => ''); - + $array = array_merge(array(array('checkbox' => 'select', 'sortable' => FALSE)), + $array, array(array('edit' => ''))); foreach($array as $element) { $result[] = array('field' => key($element), diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index e5d434a7e..a1d4e7064 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -19,15 +19,16 @@ class Detailed_receivings extends Report { $columns = array( 'summary' => array( - array('id' => $this->lang->line('reports_receiving_id')), - array('receiving_date' => $this->lang->line('reports_date')), - array('quantity' => $this->lang->line('reports_quantity')), - array('employee' => $this->lang->line('reports_received_by')), - array('supplier' => $this->lang->line('reports_supplied_by')), - array('total' => $this->lang->line('reports_total')), - array('payment_type' => $this->lang->line('reports_payment_type')), - array('reference' => $this->lang->line('receivings_reference')), - array('comment' => $this->lang->line('reports_comments'))), + 'id' => $this->lang->line('reports_receiving_id'), + 'receiving_date' => $this->lang->line('reports_date'), + 'quantity' => $this->lang->line('reports_quantity'), + 'employee' => $this->lang->line('reports_received_by'), + 'supplier' => $this->lang->line('reports_supplied_by'), + 'total' => $this->lang->line('reports_total'), + 'payment_type' => $this->lang->line('reports_payment_type'), + 'reference' => $this->lang->line('receivings_reference'), + 'comment' => $this->lang->line('reports_comments'), + 'edit' => ''), 'details' => array( $this->lang->line('reports_item_number'), $this->lang->line('reports_name'), diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index f31171522..c4beef861 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -19,18 +19,19 @@ class Detailed_sales extends Report { return array( 'summary' => array( - array('id' => $this->lang->line('reports_sale_id')), - array('sale_date' => $this->lang->line('reports_date')), - array('quantity' => $this->lang->line('reports_quantity')), - array('employee' => $this->lang->line('reports_sold_by')), - array('customer' => $this->lang->line('reports_sold_to')), - array('subtotal' => $this->lang->line('reports_subtotal')), - array('total' => $this->lang->line('reports_total')), - array('tax' => $this->lang->line('reports_tax')), - array('cost' => $this->lang->line('reports_cost')), - array('profit' => $this->lang->line('reports_profit')), - array('payment_type' => $this->lang->line('sales_amount_tendered')), - array('comment' => $this->lang->line('reports_comments'))), + 'id' => $this->lang->line('reports_sale_id'), + 'sale_date' => $this->lang->line('reports_date'), + 'quantity' => $this->lang->line('reports_quantity'), + 'employee' => $this->lang->line('reports_sold_by'), + 'customer' => $this->lang->line('reports_sold_to'), + 'subtotal' => $this->lang->line('reports_subtotal'), + 'tax' => $this->lang->line('reports_tax'), + 'total' => $this->lang->line('reports_total'), + 'cost' => $this->lang->line('reports_cost'), + 'profit' => $this->lang->line('reports_profit'), + 'payment_type' => $this->lang->line('sales_amount_tendered'), + 'comment' => $this->lang->line('reports_comments'), + 'edit' => ''), 'details' => array( $this->lang->line('reports_name'), $this->lang->line('reports_category'), @@ -43,7 +44,7 @@ class Detailed_sales extends Report $this->lang->line('reports_cost'), $this->lang->line('reports_profit'), $this->lang->line('reports_discount')) - ); + ); } public function getDataBySaleId($sale_id) @@ -99,7 +100,7 @@ class Detailed_sales extends Report if($inputs['location_id'] != 'all') { - $this->db->where('item_location', $inputs['location_id']); + $this->db->where('item_location', $inputs['location_id']); } if($inputs['sale_type'] == 'sales') diff --git a/application/views/reports/tabular_details.php b/application/views/reports/tabular_details.php index 0caf7687b..fbd1cb677 100644 --- a/application/views/reports/tabular_details.php +++ b/application/views/reports/tabular_details.php @@ -35,7 +35,7 @@ }; $('#table').bootstrapTable({ - columns: , + columns: , pageSize: config->item('lines_per_page'); ?>, striped: true, pagination: true,