Revert tabular_details changes (#1003)

This commit is contained in:
jekkos committed 2016-11-26 00:12:33 +01:00
1 parent 1666a3e689
commit 4304f5ceea
4 files changed
+29 -33

No files matched your search

+3 -9
View File
@@ -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),
@@ -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'),
+15 -14
View File
@@ -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')
@@ -35,7 +35,7 @@
};
$('#table').bootstrapTable({
columns: <?php echo transform_headers($headers['summary'], TRUE); ?>,
columns: <?php echo transform_headers_readonly($headers['summary']); ?>,
pageSize: <?php echo $this->config->item('lines_per_page'); ?>,
striped: true,
pagination: true,