Use bootstrap tables for detailed and summary reports (#293, #507)

This commit is contained in:
jekkos
2016-05-06 00:36:37 +02:00
parent 18764d5caf
commit eca4b4ffb8
27 changed files with 318 additions and 381 deletions

View File

@@ -43,22 +43,25 @@ class Reports extends Secure_area
$report_data = $model->getDataBySaleId($sale_id);
$summary_data = array(anchor('#',
'POS '.$report_data['sale_id'],
array('class'=>'modal-dlg modal-btn-submit')),
$report_data['sale_date'],
to_quantity_decimals($report_data['items_purchased']),
$report_data['employee_name'],
$report_data['customer_name'],
to_currency($report_data['subtotal']),
to_currency($report_data['total']),
to_currency($report_data['tax']),
to_currency($report_data['cost']),
to_currency($report_data['profit']),
$report_data['payment_type'],
$report_data['comment']);
$summary_data = array(
'id' => $report_data['sale_id'],
'sale_date' => $report_data['sale_date'],
'quantity' => to_quantity_decimals($report_data['items_purchased']),
'employee' => $report_data['employee_name'],
'customer' => $report_data['customer_name'],
'subtotal' => to_currency($report_data['subtotal']),
'total' => to_currency($report_data['total']),
'tax' => to_currency($report_data['tax']),
'cost' => to_currency($report_data['cost']),
'profit' => to_currency($report_data['profit']),
'payment_type' => $report_data['payment_type'],
'comment' => $report_data['comment'],
'edit' => anchor("sales/edit/". $report_data['receiving_id'], '<span class="glyphicon glyphicon-edit"></span>',
array('class'=>"modal-dlg modal-btn-delete modal-btn-submit print_hide", 'title'=>$CI->lang->line('sales_update'))
)
);
echo get_detailed_data_row($summary_data, $this);
echo json_encode($summary_data);
}
function get_detailed_receivings_row($receiving_id)
@@ -68,23 +71,27 @@ class Reports extends Secure_area
$report_data = $model->getDataByReceivingId($receiving_id);
$summary_data = array('RECV '.$report_data['receiving_id'],
$report_data['receiving_date'],
to_quantity_decimals($report_data['items_purchased']),
$report_data['employee_name'],
$report_data['supplier_name'],
to_currency($report_data['total']),
$report_data['payment_type']
$summary_data = array(
'id' => $report_data['receiving_id'],
'receiving_date' => $report_data['receiving_date'],
'quantity' => to_quantity_decimals($report_data['items_purchased']),
'employee' => $report_data['employee_name'],
'supplier' => $report_data['supplier_name'],
'total' => to_currency($report_data['total']),
'payment_type' => $report_data['payment_type'],
'edit' => anchor("receivings/edit/". $report_data['receiving_id'], '<span class="glyphicon glyphicon-edit"></span>',
array('class'=>"modal-dlg modal-btn-delete modal-btn-submit print_hide", 'title'=>$CI->lang->line('receivings_update'))
)
);
if($this->config->item('invoice_enable') == TRUE)
{
$summary_data[] = $report_data['invoice_number'];
$summary_data[]['invoice_number'] = $report_data['invoice_number'];
}
$summary_data[] = $report_data['comment'];
echo get_detailed_data_row($summary_data, $this);
echo json_encode($summary_data);
}
function get_summary_data($start_date, $end_date=null, $sale_type=0)
@@ -110,12 +117,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['sale_date'],
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
$tabular_data[] = array($row['sale_date'],
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
to_currency($row['profit']));
}
@@ -141,12 +148,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['category'],
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
$tabular_data[] = array($row['category'],
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
to_currency($row['profit']));
}
@@ -172,12 +179,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['customer'],
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
$tabular_data[] = array($row['customer'],
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
to_currency($row['profit']));
}
@@ -203,12 +210,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['supplier'],
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
$tabular_data[] = array($row['supplier'],
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
to_currency($row['profit']));
}
@@ -234,12 +241,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array(character_limiter($row['name'], 40),
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
$tabular_data[] = array(character_limiter($row['name'], 40),
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
to_currency($row['profit']));
}
@@ -265,12 +272,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['employee'],
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
$tabular_data[] = array($row['employee'],
to_quantity_decimals($row['quantity_purchased']),
to_currency($row['subtotal']),
to_currency($row['total']),
to_currency($row['tax']),
to_currency($row['cost']),
to_currency($row['profit']));
}
@@ -325,7 +332,7 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['discount_percent'],
$tabular_data[] = array($row['discount_percent'],
$row['count']);
}
@@ -351,8 +358,8 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['payment_type'],
$row['count'],
$tabular_data[] = array($row['payment_type'],
$row['count'],
to_currency($row['payment_amount']));
}
@@ -786,7 +793,6 @@ class Reports extends Secure_area
"headers" => $model->getDataColumns(),
"summary_data" => $summary_data,
"details_data" => $details_data,
"header_width" => intval(100 / count($headers['summary'])),
"overall_summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date,'customer_id' =>$customer_id, 'sale_type'=>$sale_type)),
"export_excel" => $export_excel
);
@@ -837,7 +843,6 @@ class Reports extends Secure_area
"headers" => $model->getDataColumns(),
"summary_data" => $summary_data,
"details_data" => $details_data,
"header_width" => intval(100 / count($headers)),
"overall_summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date,'employee_id' =>$employee_id, 'sale_type'=>$sale_type)),
"export_excel" => $export_excel
);
@@ -887,7 +892,6 @@ class Reports extends Secure_area
"headers" => $headers,
"summary_data" => $summary_data,
"details_data" => $details_data,
"header_width" => intval(100 / count($headers['summary'])),
"overall_summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date,'discount' =>$discount, 'sale_type'=>$sale_type)),
"export_excel" => $export_excel
);
@@ -910,7 +914,23 @@ class Reports extends Secure_area
foreach($report_data['summary'] as $key=>$row)
{
$summary_data[] = array('POS '.$row['sale_id'], $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['employee_name'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']);
$summary_data[] = array(
'id' => $row['sale_id'],
'sale_date' => $row['sale_date'],
'quantity' => to_quantity_decimals($row['items_purchased']),
'employee' => $row['employee_name'],
'customer' => $row['customer_name'],
'subtotal' => to_currency($row['subtotal']),
'total' => to_currency($row['total']),
'tax' => to_currency($row['tax']),
'cost' => to_currency($row['cost']),
'profit' => to_currency($row['profit']),
'payment_type' => $row['payment_type'],
'comment' => $row['comment'],
'edit' => anchor("sales/edit/".$row['sale_id'], '<span class="glyphicon glyphicon-edit"></span>',
array('class' => "modal-dlg modal-btn-delete modal-btn-submit print_hide", 'title' => $this->lang->line('sales_update'))
)
);
foreach($report_data['details'][$key] as $drow)
{
@@ -930,7 +950,6 @@ class Reports extends Secure_area
"editable" => "sales",
"summary_data" => $summary_data,
"details_data" => $details_data,
"header_width" => intval(100 / count($headers['summary'])),
"overall_summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type, 'location_id'=>$location_id)),
"export_excel" => $export_excel
);
@@ -953,30 +972,22 @@ class Reports extends Secure_area
foreach($report_data['summary'] as $key=>$row)
{
if($this->config->item('invoice_enable') == TRUE)
$summary_data[] = array(
'id' => $row['receiving_id'],
'receiving_date' => $row['receiving_date'],
'quantity' => to_quantity_decimals($row['items_purchased']),
'employee' => $row['employee_name'], $row['supplier_name'],
'total' => to_currency($row['total']),
'payment_type' => $row['payment_type'],
'invoice_number' => $row['invoice_number'],
'comment' => $row['comment'],
'edit' => anchor("receivings/edit/" . $row['receiving_id'], '<span class="glyphicon glyphicon-edit"></span>',
array('class' => "modal-dlg modal-btn-submit print_hide", 'title' => $this->lang->line('receivings_update'))
)
);
if($this->config->item('invoice_enable'))
{
$summary_data[] = array(
'RECV '.$row['receiving_id'],
$row['receiving_date'],
to_quantity_decimals($row['items_purchased']),
$row['employee_name'], $row['supplier_name'],
to_currency($row['total']),
$row['payment_type'],
$row['invoice_number'],
$row['comment']
);
}
else
{
$summary_data[] = array(
'RECV '.$row['receiving_id'],
$row['receiving_date'],
to_quantity_decimals($row['items_purchased']),
$row['employee_name'], $row['supplier_name'],
to_currency($row['total']),
$row['payment_type'],
$row['comment']
);
unset($summary_data['invoice_number']);
}
foreach($report_data['details'][$key] as $drow)
@@ -994,11 +1005,9 @@ class Reports extends Secure_area
"title" => $this->lang->line('reports_detailed_receivings_report'),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"header_width" => intval(100 / count($headers['summary'])),
"editable" => "receivings",
"summary_data" => $summary_data,
"details_data" => $details_data,
"header_width" => intval(100 / count($headers['summary'])),
"overall_summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'receiving_type'=>$receiving_type, 'location_id'=>$location_id)),
"export_excel" => $export_excel
);

View File

@@ -111,6 +111,16 @@ function get_sales_manage_payments_summary($payments, $sales, $controller)
return $table;
}
function transform_headers_readonly($array)
{
$result = array();
foreach($array as $key => $value)
{
$result[] = array('field' => $key, 'title' => $value);
}
return json_encode($result);
}
function transform_headers($array)
{
return json_encode(array_map(function($v) {
@@ -155,21 +165,6 @@ function get_person_data_row($person, $controller) {
));
}
function get_detailed_data_row($row, $controller)
{
$table_data_row='<tr>';
$table_data_row.='<td><a href="#" class="expand">+</a></td>';
foreach($row as $cell)
{
$table_data_row.='<td>';
$table_data_row.=$cell;
$table_data_row.='</td>';
}
$table_data_row.='</tr>';
return $table_data_row;
}
function get_suppliers_manage_table_headers()
{
$CI =& get_instance();

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Zwischentotal";
$lang["reports_total_inventory_value"] = "Total Inventarwert";
$lang["reports_zero_and_less"] = "Null und weniger";
$lang["reports_more_than_zero"] = "Mehr als Null";
$lang["reports_no_reports_to_display"] = "Keine Artikel zum Anzeigen";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Sub Total";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";
$lang["reports_no_reports_to_display"] = "No Items to display";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Subtotal";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";
$lang["reports_no_reports_to_display"] = "No hay artículos que mostrar";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Sous-Total";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";
$lang["reports_no_reports_to_display"] = "Aucun Items à afficher";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Iznos međuzbroja";
$lang["reports_total_inventory_value"] = "Ukupan iznos inventure";
$lang["reports_zero_and_less"] = "Nula i manje";
$lang["reports_more_than_zero"] = "Više od nule";
$lang["reports_no_reports_to_display"] = "Nema artikla za prikazati";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Sub Total";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Nulla és kevesebb";
$lang["reports_more_than_zero"] = "Több mint nulla";
$lang["reports_no_reports_to_display"] = "Nincsenek megjeleníthető termékek";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Sub Total";
$lang["reports_total_inventory_value"] = "Total Nilai Persediaan";
$lang["reports_zero_and_less"] = "Stok habis dan minus";
$lang["reports_more_than_zero"] = "Stok belum habis";
$lang["reports_no_reports_to_display"] = "Tidak ada item untuk ditampilkan";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Subtotaal";
$lang["reports_total_inventory_value"] = "Totale waarde stock";
$lang["reports_zero_and_less"] = "Nul en minder";
$lang["reports_more_than_zero"] = "Meer dan nul";
$lang["reports_no_reports_to_display"] = "Er werden geen producten gevonden";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Sub Total";
$lang["reports_total_inventory_value"] = "Valor Total Inventário";
$lang["reports_zero_and_less"] = "Zero e menor";
$lang["reports_more_than_zero"] = "Maior do que zero";
$lang["reports_no_reports_to_display"] = "Sem itens para mostrar";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "промежуточный итог";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";
$lang["reports_no_reports_to_display"] = "Нет товаров для отображения";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "ยอดรวมหักภาษี ";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";
$lang["reports_no_reports_to_display"] = "ไม่มีสินค้าแสดง";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Ara Toplam";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";
$lang["reports_no_reports_to_display"] = "Gösterecek Ürün Yok";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "小計";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";
$lang["reports_no_reports_to_display"] = "沒有產品可以顯示";

View File

@@ -247,11 +247,9 @@ class Item extends CI_Model
*/
public function delete($item_id)
{
$this->db->where('item_id', $item_id);
// set to 0 quantities
$this->Item_quantity->reset_quantity($item_id);
$this->db->where('item_id', $item_id);
return $this->db->update('items', array('deleted'=>1));
}

View File

@@ -9,18 +9,32 @@ class Detailed_receivings extends Report
public function getDataColumns()
{
if(get_instance()->config->item('invoice_enable') == TRUE)
$columns = array(
'summary' => array(
'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'),
'invoice_number' => $this->lang->line('recvs_invoice_number'),
'comments' => $this->lang->line('reports_comments'),
'edit' => ''),
'details' => array(
$this->lang->line('reports_item_number'),
$this->lang->line('reports_name'),
$this->lang->line('reports_category'),
$this->lang->line('reports_quantity'),
$this->lang->line('reports_total'),
$this->lang->line('reports_discount'))
);
if (get_instance()->config->item('invoice_enable') == TRUE)
{
return array('summary' => array($this->lang->line('reports_receiving_id'), $this->lang->line('reports_date'), $this->lang->line('reports_quantity'), $this->lang->line('reports_received_by'), $this->lang->line('reports_supplied_by'), $this->lang->line('reports_total'), $this->lang->line('reports_payment_type'), $this->lang->line('recvs_invoice_number'), $this->lang->line('reports_comments')),
'details' => array($this->lang->line('reports_item_number'), $this->lang->line('reports_name'), $this->lang->line('reports_category'), $this->lang->line('reports_quantity'), $this->lang->line('reports_total'), $this->lang->line('reports_discount'))
);
}
else
{
return array('summary' => array($this->lang->line('reports_receiving_id'), $this->lang->line('reports_date'), $this->lang->line('reports_quantity'), $this->lang->line('reports_received_by'), $this->lang->line('reports_supplied_by'), $this->lang->line('reports_total'), $this->lang->line('reports_payment_type'), $this->lang->line('reports_comments')),
'details' => array($this->lang->line('reports_item_number'), $this->lang->line('reports_name'), $this->lang->line('reports_category'), $this->lang->line('reports_quantity'), $this->lang->line('reports_total'), $this->lang->line('reports_discount'))
);
unset($columns['summary']['invoice_number']);
}
return $columns;
}
public function getDataByReceivingId($receiving_id)

View File

@@ -9,8 +9,33 @@ class Detailed_sales extends Report
public function getDataColumns()
{
return array('summary' => array($this->lang->line('reports_sale_id'), $this->lang->line('reports_date'), $this->lang->line('reports_quantity'), $this->lang->line('reports_sold_by'), $this->lang->line('reports_sold_to'), $this->lang->line('reports_subtotal'), $this->lang->line('reports_total'), $this->lang->line('reports_tax'), $this->lang->line('reports_cost'), $this->lang->line('reports_profit'), $this->lang->line('reports_payment_type'), $this->lang->line('reports_comments')),
'details' => array($this->lang->line('reports_name'), $this->lang->line('reports_category'), $this->lang->line('reports_serial_number'), $this->lang->line('reports_description'), $this->lang->line('reports_quantity'), $this->lang->line('reports_subtotal'), $this->lang->line('reports_total'), $this->lang->line('reports_tax'), $this->lang->line('reports_cost'), $this->lang->line('reports_profit'), $this->lang->line('reports_discount'))
return array(
'summary' => array(
'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'),
'total' => $this->lang->line('reports_total'),
'tax' => $this->lang->line('reports_tax'),
'cost' => $this->lang->line('reports_cost'),
'profit' => $this->lang->line('reports_profit'),
'payment_type' => $this->lang->line('reports_payment_type'),
'comment' => $this->lang->line('reports_comments'),
'edit' => ''),
'details' => array(
$this->lang->line('reports_name'),
$this->lang->line('reports_category'),
$this->lang->line('reports_serial_number'),
$this->lang->line('reports_description'),
$this->lang->line('reports_quantity'),
$this->lang->line('reports_subtotal'),
$this->lang->line('reports_total'),
$this->lang->line('reports_tax'),
$this->lang->line('reports_cost'),
$this->lang->line('reports_profit'),
$this->lang->line('reports_discount'))
);
}

View File

@@ -64,7 +64,7 @@
<link rel="stylesheet" type="text/css" href="dist/opensourcepos.min.css?rel=52c16a3504"/>
<!-- end mincss template tags -->
<!-- start minjs template tags -->
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=12e7a818b3" language="javascript"></script>
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=26f578fa6d" language="javascript"></script>
<!-- end minjs template tags -->
<?php endif; ?>

View File

@@ -115,11 +115,8 @@ $(document).ready(function()
success:function(response)
{
dialog_support.hide();
post_form_submit(response);
},
error: function(jqXHR, textStatus, errorThrown) {
post_form_submit({message: errorThrown});
},
table_support.handle_submit('<?php echo site_url('receivings'); ?>', response);
}
dataType:'json'
});
};

View File

@@ -16,39 +16,7 @@
<div id="page_subtitle"><?php echo $subtitle ?></div>
<div id="table_holder">
<table class="tablesorter report" id="sortable_table">
<thead>
<tr>
<?php
foreach ($headers as $header)
{
?>
<th><?php echo $header; ?></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
foreach ($data as $row)
{
?>
<tr>
<?php
foreach ($row as $cell)
{
?>
<td><?php echo $cell; ?></td>
<?php
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
<table id="table"></table>
</div>
<div id="report_summary">
@@ -79,22 +47,28 @@ if($export_excel == 1)
}
else
{
?>
<script type="text/javascript" language="javascript">
$(document).ready(function()
{
<?php $this->load->view('partial/bootstrap_tables_locale'); ?>
$('#table').bootstrapTable({
columns: <?php echo transform_headers_readonly($headers); ?>,
pageSize: <?php echo $this->config->item('lines_per_page'); ?>,
striped: true,
pagination: true,
showColumns: true,
data: <?php echo json_encode($data); ?>,
iconSize: 'sm',
paginationVAlign: 'bottom'
});
});
</script>
<?php
$this->load->view("partial/footer");
?>
<script type="text/javascript" language="javascript">
function init_table_sorting()
{
//Only init if there is more than one row
if($('.tablesorter tbody tr').length > 1)
{
$("#sortable_table").tablesorter();
}
}
$(document).ready(function()
{
init_table_sorting();
});
</script>
<?php
<?php
} // end if not is excel export
?>

View File

@@ -16,79 +16,7 @@
<div id="page_subtitle"><?php echo $subtitle ?></div>
<div id="table_holder">
<table class="tablesorter report" id="sortable_table">
<thead>
<tr>
<th><a href="#" class="expand_all">+</a></th>
<?php
foreach ($headers['summary'] as $header)
{
?>
<th width="<?php echo $header_width; ?>%"><?php echo $header; ?></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
foreach ($summary_data as $key=>$row)
{
?>
<tr>
<td><a href="#" class="expand">+</a></td>
<?php
foreach ($row as $cell)
{
?>
<td><?php echo $cell; ?></td>
<?php
}
?>
</tr>
<tr>
<td colspan="100">
<table class="innertable">
<thead>
<tr>
<?php
foreach ($headers['details'] as $header)
{
?>
<th><?php echo $header; ?></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
foreach ($details_data[$key] as $row2)
{
?>
<tr>
<?php
foreach ($row2 as $cell)
{
?>
<td><?php echo $cell; ?></td>
<?php
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<table id="table"></table>
</div>
<div id="report_summary">
@@ -118,78 +46,45 @@ if($export_excel == 1)
}
else
{
$this->load->view("partial/footer");
?>
?>
<script type="text/javascript" language="javascript">
<?php
if (isset($editable))
{
?>
table_support.handle_submit = function(resource, response)
$(document).ready(function()
{
if(!response.success)
{
set_feedback(response.message, 'alert alert-dismissible alert-danger', true);
}
else
{
var row_id = response.id
$.get('<?php echo site_url("reports/get_detailed_" . $editable . "_row")?>/'+row_id, function(response)
{
//Replace previous row
var row = get_table_row(row_id).parent().parent();
var sign = row.find("a.expand").text();
row.replaceWith(response);
row = get_table_row(row_id).parent().parent();
update_sortable_table();
highligh(row);
row.find("a.expand").click(expand_handler).text(sign);
dialog_support.init(row.find("a.modal"));
});
set_feedback(response.message, 'alert alert-dismissible alert-success', false);
}
}
<?php
}
?>
function expand_handler(event)
{
$(event.target).parent().parent().next().find('.innertable').toggle();
var detail_data = <?php echo json_encode($details_data); ?>;
if ($(event.target).text() == '+')
{
$(event.target).text('-');
}
else
{
$(event.target).text('+');
}
return false;
};
$('#table').bootstrapTable({
columns: <?php echo transform_headers_readonly($headers['summary']); ?>,
pageSize: <?php echo $this->config->item('lines_per_page'); ?>,
striped: true,
pagination: true,
showColumns: true,
uniqueId: 'id',
data: <?php echo json_encode($summary_data); ?>,
iconSize: 'sm',
paginationVAlign: 'bottom',
detailView: true,
onExpandRow: function (index, row, $detail) {
$detail.html('<table></table>').find("table").bootstrapTable({
columns: <?php echo transform_headers_readonly($headers['details']); ?>,
data: detail_data[index]
});
}
});
<?php
if (isset($editable))
{
?>
table_support.submit_handler('<?php echo site_url("reports/get_detailed_" . $editable . "_row")?>');
dialog_support.init("a.modal-dlg");
<?php
}
?>
$(document).ready(function()
{
$(".tablesorter a.expand_all").click(function(event)
{
var $inner_elements = $(".tablesorter .innertable");
if ($inner_elements.is(":visible"))
{
$inner_elements.hide();
$("a.expand, a.expand_all").text('+');
}
else
{
$inner_elements.show();
$("a.expand, a.expand_all").text('-');
}
return false;
});
$(".tablesorter a.expand").click(expand_handler);
});
</script>
<?php
<?php $this->load->view("partial/footer"); ?>
<?php
} // end if not is excel export
?>

70
dist/opensourcepos.js vendored
View File

@@ -49471,7 +49471,7 @@ $.tablesorter.addWidget({
pageSize: options.pageSize,
striped: true,
pagination: true,
search: true,
search: options.resource || false,
showColumns: true,
clickToSelect: true,
toolbar: '#toolbar',
@@ -49500,46 +49500,54 @@ $.tablesorter.addWidget({
table().refresh();
}
var handle_submit = function (resource, response) {
var id = response.id;
var submit_handler = function(url) {
return function (resource, response) {
var id = response.id;
if (!response.success) {
set_feedback(response.message, 'alert alert-dismissible alert-danger', true);
} else {
var message = response.message;
var selector = rows_selector(response.id);
if ($(selector.join(",")).length > 0) {
$.each(selector, function(index, element) {
var id = $(element).data('uniqueid');
$.get({
url: resource + '/get_row/' + id,
success: function (response) {
table().updateByUniqueId({id: id, row: response});
dialog_support.init("a.modal-dlg");
enable_actions();
highlight_row(id);
},
dataType: 'json'
});
});
if (!response.success) {
set_feedback(response.message, 'alert alert-dismissible alert-danger', true);
} else {
// call hightlight function once after refresh
options.load_callback = function() {
enable_actions();
highlight_row(id);
};
refresh();
var message = response.message;
var selector = rows_selector(response.id);
if ($(selector.join(",")).length > 0) {
$.each(selector, function (index, element) {
var id = $(element).data('uniqueid');
$.get({
url: url + id || resource + '/get_row/' + id,
success: function (response) {
table().updateByUniqueId({id: id, row: response});
// TODO make selector more specific?
dialog_support.init("a.modal-dlg");
enable_actions();
highlight_row(id);
},
dataType: 'json'
});
});
} else {
// call hightlight function once after refresh
options.load_callback = function () {
enable_actions();
highlight_row(id);
};
refresh();
}
set_feedback(message, 'alert alert-dismissible alert-success', false);
}
set_feedback(message, 'alert alert-dismissible alert-success', false);
}
};
};
var handle_submit = submit_handler();
$.extend(table_support, {
submit_handler: function(url) {
handle_submit = submit_handler(url);
},
handle_submit: handle_submit,
init: init,
do_delete: do_delete,
refresh : refresh,
selected_ids : selected_ids
selected_ids : selected_ids,
});
})(window.table_support = window.table_support || {}, jQuery);;(function($) {

View File

File diff suppressed because one or more lines are too long

View File

@@ -192,7 +192,7 @@
pageSize: options.pageSize,
striped: true,
pagination: true,
search: true,
search: options.resource || false,
showColumns: true,
clickToSelect: true,
toolbar: '#toolbar',
@@ -221,46 +221,54 @@
table().refresh();
}
var handle_submit = function (resource, response) {
var id = response.id;
var submit_handler = function(url) {
return function (resource, response) {
var id = response.id;
if (!response.success) {
set_feedback(response.message, 'alert alert-dismissible alert-danger', true);
} else {
var message = response.message;
var selector = rows_selector(response.id);
if ($(selector.join(",")).length > 0) {
$.each(selector, function(index, element) {
var id = $(element).data('uniqueid');
$.get({
url: resource + '/get_row/' + id,
success: function (response) {
table().updateByUniqueId({id: id, row: response});
dialog_support.init("a.modal-dlg");
enable_actions();
highlight_row(id);
},
dataType: 'json'
});
});
if (!response.success) {
set_feedback(response.message, 'alert alert-dismissible alert-danger', true);
} else {
// call hightlight function once after refresh
options.load_callback = function() {
enable_actions();
highlight_row(id);
};
refresh();
var message = response.message;
var selector = rows_selector(response.id);
if ($(selector.join(",")).length > 0) {
$.each(selector, function (index, element) {
var id = $(element).data('uniqueid');
$.get({
url: url + id || resource + '/get_row/' + id,
success: function (response) {
table().updateByUniqueId({id: id, row: response});
// TODO make selector more specific?
dialog_support.init("a.modal-dlg");
enable_actions();
highlight_row(id);
},
dataType: 'json'
});
});
} else {
// call hightlight function once after refresh
options.load_callback = function () {
enable_actions();
highlight_row(id);
};
refresh();
}
set_feedback(message, 'alert alert-dismissible alert-success', false);
}
set_feedback(message, 'alert alert-dismissible alert-success', false);
}
};
};
var handle_submit = submit_handler();
$.extend(table_support, {
submit_handler: function(url) {
handle_submit = submit_handler(url);
},
handle_submit: handle_submit,
init: init,
do_delete: do_delete,
refresh : refresh,
selected_ids : selected_ids
selected_ids : selected_ids,
});
})(window.table_support = window.table_support || {}, jQuery);

View File

@@ -65,7 +65,7 @@
<!-- end mincss template tags -->
<link rel="stylesheet" type="text/css" href="templates/spacelab/css/style.css"/>
<!-- start minjs template tags -->
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=12e7a818b3" language="javascript"></script>
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=26f578fa6d" language="javascript"></script>
<!-- end minjs template tags -->
<?php endif; ?>

View File

@@ -93,3 +93,4 @@ reports_sub_total_value,Sub Total,Zwischentotal,Subtotaal,Subtotal,Sub Total,Sou
reports_total_inventory_value,Total Inventory Value,Total Inventarwert,Totale waarde stock,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Nilai Persediaan,Valor Total Inventário,Ukupan iznos inventure
reports_zero_and_less,Nulla és kevesebb,Null und weniger,Nul en minder,Zero and less,Zero and less,Zero and less,Zero and less,Zero and less,Zero and less,Zero and less,Stok habis dan minus,Zero e menor,Nula i manje
reports_more_than_zero,Több mint nulla,Mehr als Null,Meer dan nul,More than zero,More than zero,More than zero,More than zero,More than zero,More than zero,More than zero,Stok belum habis,Maior do que zero,Više od nule
reports_no_reports_to_display,Nincsenek megjeleníthető termékek,Keine Artikel zum Anzeigen,Er werden geen producten gevonden,No hay artículos que mostrar,No Items to display,Aucun Items à afficher,沒有產品可以顯示,Нет товаров для отображения,ไม่มีสินค้าแสดง,Gösterecek Ürün Yok,Tidak ada item untuk ditampilkan,Sem itens para mostrar,Nema artikla za prikazati
1 label hu-HU de-CH nl-BE es en fr zh ru th tr id pt-BR hr-HR
93 reports_total_inventory_value Total Inventory Value Total Inventarwert Totale waarde stock Total Inventory Value Total Inventory Value Total Inventory Value Total Inventory Value Total Inventory Value Total Inventory Value Total Inventory Value Total Nilai Persediaan Valor Total Inventário Ukupan iznos inventure
94 reports_zero_and_less Nulla és kevesebb Null und weniger Nul en minder Zero and less Zero and less Zero and less Zero and less Zero and less Zero and less Zero and less Stok habis dan minus Zero e menor Nula i manje
95 reports_more_than_zero Több mint nulla Mehr als Null Meer dan nul More than zero More than zero More than zero More than zero More than zero More than zero More than zero Stok belum habis Maior do que zero Više od nule
96 reports_no_reports_to_display Nincsenek megjeleníthető termékek Keine Artikel zum Anzeigen Er werden geen producten gevonden No hay artículos que mostrar No Items to display Aucun Items à afficher 沒有產品可以顯示 Нет товаров для отображения ไม่มีสินค้าแสดง Gösterecek Ürün Yok Tidak ada item untuk ditampilkan Sem itens para mostrar Nema artikla za prikazati