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,4 +1,3 @@
<div class="div_product_sale">
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
@@ -101,7 +100,6 @@
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
@@ -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>