diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 8136a5cc..629b2542 100755 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -23,15 +23,6 @@ //= require bootstrap-notify/bootstrap-notify.js //= require node-waves/waves.js //= require sweetalert/sweetalert.min.js -//=require jquery-datatable/jquery.dataTables.js -//=require jquery-datatable/skin/bootstrap/js/dataTables.bootstrap.js -//=require jquery-datatable/extensions/export/dataTables.buttons.min.js -//=require jquery-datatable/extensions/export/buttons.flash.min.js -//=require jquery-datatable/extensions/export/jszip.min.js -//=require jquery-datatable/extensions/export/pdfmake.min.js -//=require jquery-datatable/extensions/export/vfs_fonts.js -//=require jquery-datatable/extensions/export/buttons.html5.min.js -//=require jquery-datatable/extensions/export/buttons.print.min.js //= require autosize/autosize.js //= require jquery-countto/jquery.countTo.js //= require raphael/raphael.min @@ -60,7 +51,7 @@ $(document).ready(function() { $('.datepicker').bootstrapMaterialDatePicker({ format: 'DD-MM-YYYY', - clearButton: false, + clearButton: true, weekStart: 1, time: false }); @@ -351,21 +342,7 @@ $(document).ready(function(){ } }); }); - $(function () { - $('.js-basic-example').DataTable({ - responsive: true, -bLengthChange: false - }); - //Exportable table - $('.js-exportable').DataTable({ - dom: 'Bfrtip', - responsive: true, - buttons: [ - 'copy', 'csv', 'excel', 'pdf', 'print' - ] - }); -}); }); diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index ff1757aa..b7bcb027 100755 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -5,7 +5,6 @@ @import "animate-css/animate"; @import "sweetalert/sweetalert.css"; @import "multi-select/css/multi-select.css"; -@import "jquery-datatable/skin/bootstrap/css/dataTables.bootstrap.css"; @import "bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker"; @import "morrisjs/morris"; @import "fileinput.min"; diff --git a/app/controllers/transactions/bookings_controller.rb b/app/controllers/transactions/bookings_controller.rb index dfce77e2..b826cd52 100644 --- a/app/controllers/transactions/bookings_controller.rb +++ b/app/controllers/transactions/bookings_controller.rb @@ -4,7 +4,22 @@ class Transactions::BookingsController < ApplicationController def index - @bookings = Booking.all.order("booking_id desc") + filter = params[:filter] + from = params[:from] + to = params[:to] + + if filter.nil? && from.nil? && to.nil? + @bookings = Booking.all.order("sale_id desc") + @bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(2) + else + sale = Sale.search(filter,from,to) + if sale.count > 0 + @bookings = sale + @bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(2) + else + @bookings = 0 + end + end respond_to do |format| format.html # index.html.erb diff --git a/app/views/reports/shiftsale/index.html.erb b/app/views/reports/shiftsale/index.html.erb index 54b63caa..d8d814b8 100755 --- a/app/views/reports/shiftsale/index.html.erb +++ b/app/views/reports/shiftsale/index.html.erb @@ -145,6 +145,7 @@ // OK button is clicked $('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){ + console.log(date); $('#from').val(date.format("DD-MM-YYYY")) search_by_date(); }); diff --git a/app/views/transactions/bookings/index.html.erb b/app/views/transactions/bookings/index.html.erb index f0e6aea2..997d18b5 100755 --- a/app/views/transactions/bookings/index.html.erb +++ b/app/views/transactions/bookings/index.html.erb @@ -10,10 +10,40 @@
- +
+ + + + + + +
+ <%= form_tag transactions_orders_path, :method => :get do %> +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+
+
+ <% end %> +
+
- +
@@ -48,6 +78,10 @@ <% end %>
<%= t("views.right_panel.detail.booking_id") %>
+
+ <% if @bookings != 0 %> + <%= paginate @bookings %> + <% end %>
diff --git a/app/views/transactions/credit_notes/index.html.erb b/app/views/transactions/credit_notes/index.html.erb index 9f708d8e..ac706d90 100755 --- a/app/views/transactions/credit_notes/index.html.erb +++ b/app/views/transactions/credit_notes/index.html.erb @@ -100,7 +100,9 @@
- + <% if @sales != 0 %> + <%= paginate @sales %> + <% end %>
diff --git a/app/views/transactions/orders/index.html.erb b/app/views/transactions/orders/index.html.erb index 6f146034..d78b9fbf 100755 --- a/app/views/transactions/orders/index.html.erb +++ b/app/views/transactions/orders/index.html.erb @@ -73,7 +73,7 @@
- <%if !@order.nil?%> + <%if !@orders.nil?%> <%= paginate @orders %> <%end%>