check route in product sale

This commit is contained in:
phyusin
2018-02-26 11:33:51 +06:30
parent 5523ff6fc1
commit 0f36e44d1c
2 changed files with 94 additions and 106 deletions

View File

@@ -2,10 +2,7 @@ class Reports::ProductSaleController < BaseReportController
authorize_resource :class => false
def index
@order_by = 'desc'
if !params[:order_by].nil?
@order_by = params[:order_by]
end
@sale_data = Sale.get_menu_item_query(@order_by)

View File

@@ -1,5 +1,4 @@
<div class="div_product_sale">
<div class="page-header">
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.sale_item_report") %></li>
@@ -7,8 +6,8 @@
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div>
<div class="row">
</div>
<div class="row">
<div class="col-md-12">
<div class="text-right">
<a href="javascript:export_to('<%=reports_product_sale_index_path%>.xls')" class = "btn btn-info wave-effects "><%= t("views.btn.exp_to_excel") %></a>
@@ -100,7 +99,6 @@
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
@@ -110,13 +108,6 @@
$('#order_by').on('change', function(){
var order_by = $("#order_by").val();
$('.div_product_sale').html("");
$.ajax({
type: 'GET',
url: '?order_by='+order_by,
success: function(data) {
$('.div_product_sale').html(data);
}
});
window.location.href = "?order_by=" + order_by;
});
</script>