diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index 1409c829..5e866699 100755 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -33,9 +33,25 @@ $(document).on('turbolinks:load', function() { $(".tables").on("click", function(){ - var table_id = $(this).val(); - $('#table_id').val(table_id); - oqs_id = $("#oqs_id").val(); + active = $(this).hasClass('selected-table'); + if (active) { + $(this).removeClass('bg-blue'); + $(this).addClass('green'); + $(this).removeClass('selected-table'); + }else{ + $(this).removeClass('green'); + $(this).addClass('bg-blue'); + $(this).addClass('selected-table'); + } + var list = document.getElementsByClassName('selected-table'); + var i; + var table_id =[]; + for (i = 0; i < list.length; i++) { + table_id.push(list[i].value); + } + $('#table_id').val(table_id); + + oqs_id = $("#oqs_id").val(); if (table_id){ var table = table_id }else{ diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js index 043fbb03..ca1bd0b9 100644 --- a/app/assets/javascripts/custom.js +++ b/app/assets/javascripts/custom.js @@ -13,6 +13,16 @@ $(document).ready(function() { touchScrollStep : 50 }); + $('#table-slimscroll').slimScroll({ + height: height, + size: '5px', + color: 'rgba(0,0,0,0.5)', + alwaysVisible: false, + borderRadius: '0', + railBorderRadius: '0', + touchScrollStep : 50 + }); + $('#order-detail-slimscroll').slimScroll({ height: height-$('#order-detail-slimscroll').attr('data-height'), size: '5px', diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index ca021430..715a9fe1 100755 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -361,6 +361,7 @@ function resCardSaleTrans(card_sale_trans_id,cmd_type,payment_type, bnk_bill_amo function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amount,sale_id,receipt_no,com_port,cashier_type) { $("#loading_wrapper").hide(); var jobj = $.parseJSON(resMsg); + $("#reference_no").val(jobj.REFNUM); if(jobj.STATUS == "Approved"){ $.ajax({type: "POST", url: "/origami/payment/"+payment_type, diff --git a/app/assets/stylesheets/OQS.scss b/app/assets/stylesheets/OQS.scss index 88b00402..6a97bdcb 100755 --- a/app/assets/stylesheets/OQS.scss +++ b/app/assets/stylesheets/OQS.scss @@ -87,7 +87,7 @@ select.form-control { } .green{ - background-color: #009900; + background-color: #009900 !important; } .left{ margin-left:1px; @@ -104,4 +104,20 @@ select.form-control { i.logout_icon{ position: relative; top: 5px; +} + +.table-block{ + padding: 24px 8px 0 0; +} + +.label-align{ + padding-left: 10px; +} + +.table-float{ + float: left; +} + +.table-width{ + width: 100%; } \ No newline at end of file diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 3082687b..1d0ad8e4 100755 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -39,7 +39,7 @@ class Crm::CustomersController < BaseCrmController @membership_types = Lookup.collection_of("member_group_type") - @taxes = TaxProfile.all.order("order_by asc") + @taxes = TaxProfile.where(:group_type => 'cashier') @filter = filter diff --git a/app/controllers/oqs/backhome_controller.rb b/app/controllers/oqs/backhome_controller.rb index 4ac5f0a2..f809ef9f 100755 --- a/app/controllers/oqs/backhome_controller.rb +++ b/app/controllers/oqs/backhome_controller.rb @@ -89,6 +89,7 @@ class Oqs::HomeController < BaseOqsController # Query for OQS with delivery status def queue_items_query(status) + byebug AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type as type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at") .joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id diff --git a/app/controllers/oqs/home_controller.rb b/app/controllers/oqs/home_controller.rb index 23d6341e..48e686b6 100755 --- a/app/controllers/oqs/home_controller.rb +++ b/app/controllers/oqs/home_controller.rb @@ -5,7 +5,8 @@ class Oqs::HomeController < BaseOqsController # @queue_items_details = queue_items_query(false) # Query for OQS with delivery status true - @tables = DiningFacility.all.active.order('status desc') + # @tables = DiningFacility.all.active.order('status desc') + @tables = DiningFacility.where(:type => 'Table').order('status desc') @rooms = Room.all.active.order('status desc') @filter = params[:filter] @@ -161,9 +162,9 @@ class Oqs::HomeController < BaseOqsController oqs = "and assigned_order_items.order_queue_station_id = '#{oqs_id}' " end - if table_id.to_i>0 - table = "and df.id = '#{table_id}' " - + if !table_id.empty? + tableId = table_id.to_a.map{|h| h}.join(",") + table = "and df.id IN (#{tableId})" else table = '' end diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index 537703a1..ec559870 100755 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -86,7 +86,7 @@ class Origami::CustomersController < BaseOrigamiController @crm_customer = Customer.new @count_customer = Customer.count_customer - @taxes = TaxProfile.all.order("order_by asc") + @taxes = TaxProfile.where(:group_type => 'cashier') # if flash["errors"] # @crm_customer.valid? # end diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index cf3e480f..95a6a277 100755 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -197,7 +197,6 @@ class ReceiptBillPdf < Prawn::Document move_down line_move sub_total = 0.0 total_qty = 0.0 - sale_items.each do |item| # check for item not to show if item.price != 0 @@ -247,7 +246,6 @@ class ReceiptBillPdf < Prawn::Document bounding_box([self.item_width + self.price_width + 8,y_position], :width =>self.total_width, :height => self.item_height) do text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right end - end def all_total(sale_data,precision,delimiter) diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index ee73d560..fe7f4b4e 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -1,9 +1,10 @@
<%= @filter %>
+