diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index c5e8c56b..f9550317 100755 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -196,7 +196,7 @@ $(document).on('turbolinks:load', function() { $(document).on('click', '.access_modal', function(event){ type = $(this).data("type"); - $(".ok").attr("data-action",type) + $(".ok").attr("data-action",type); $('#AccessCodeModal').modal('show'); }); diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 325cb241..c246a9e4 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -129,7 +129,7 @@ class HomeController < ApplicationController if !@total_payment_methods.nil? @total_payment_methods.each do |payment| - if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" || payment.payment_method == "unionpay" || payment.payment_method == "alipay" || payment.payment_method == "paymal" || payment.payment_method == "dinga" || payment.payment_method == "JunctionPay" + if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" || payment.payment_method == "unionpay" || payment.payment_method == "alipay" pay = Sale.payment_sale('card', today, current_user,@from,@to,@from_time,@to_time) @sale_data.push({'card' => pay.payment_amount}) else diff --git a/app/controllers/origami/dashboard_controller.rb b/app/controllers/origami/dashboard_controller.rb index ab7bde82..4b530322 100644 --- a/app/controllers/origami/dashboard_controller.rb +++ b/app/controllers/origami/dashboard_controller.rb @@ -18,16 +18,16 @@ class Origami::DashboardController < BaseOrigamiController # .sum('(CASE WHEN sp.payment_method="cash" THEN (sp.payment_amount - sales.amount_changed) ELSE sp.payment_amount END)') # @inventories = StockJournal.inventory_balances(today).sum(:balance) - @total_sale = Sale.total_sale(today,current_user) - @total_count = Sale.total_count(today,current_user) - @total_card = Sale.total_card_sale(today,current_user) - @total_credit = Sale.credit_payment(today,current_user) + # @total_sale = Sale.total_sale(today,current_user) + # @total_count = Sale.total_count(today,current_user) + # @total_card = Sale.total_card_sale(today,current_user) + # @total_credit = Sale.credit_payment(today,current_user) @sale_data = Array.new @total_payment_methods = Sale.total_payment_methods(today,current_user) if !@total_payment_methods.nil? @total_payment_methods.each do |payment| - if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" + if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" || payment.payment_method == "unionpay" || payment.payment_method == "alipay" pay = Sale.payment_sale('card', today, current_user) @sale_data.push({'card' => pay.payment_amount}) else diff --git a/app/views/origami/cash_ins/new.html.erb b/app/views/origami/cash_ins/new.html.erb index 0b27a62f..1297249b 100755 --- a/app/views/origami/cash_ins/new.html.erb +++ b/app/views/origami/cash_ins/new.html.erb @@ -61,7 +61,7 @@ var payment_method = ""; $('.payment-type').on('click',function(){ - $('.payment-type').css("background-color","#7a62d3") + $('.payment-type').css("background-color","#7a62d3"); $(this).css("background-color","green"); var type = $(this).attr('data-id') if(type == 'cash'){ diff --git a/app/views/origami/pending_order/completed_sale.html.erb b/app/views/origami/pending_order/completed_sale.html.erb index 1b7194f5..46dc035d 100644 --- a/app/views/origami/pending_order/completed_sale.html.erb +++ b/app/views/origami/pending_order/completed_sale.html.erb @@ -324,13 +324,12 @@ $(document).ready(function(){ swal("Opps","You are not authorized for void","warning") } }); +}); - $(document).on('click', '.access_modal', function(event){ - type = $(this).data("type"); - $(".ok").attr("data-action",type) - $('#AccessCodeModal').modal('show'); - }); - +$(document).on('click', '.access_modal', function(event){ + type = $(this).data("type"); + $(".ok").attr("data-action",type); + $('#AccessCodeModal').modal('show'); }); function check_emp_access_code(access_code,type) { diff --git a/app/views/origami/sales/show.html.erb b/app/views/origami/sales/show.html.erb index 9ca1cd72..b373fd45 100755 --- a/app/views/origami/sales/show.html.erb +++ b/app/views/origami/sales/show.html.erb @@ -410,7 +410,7 @@ $('#back').on('click',function(){ $(document).on('click', '.access_modal', function(event){ type = $(this).data("type"); - $(".ok").attr("data-action",type) + $(".ok").attr("data-action",type); $('#AccessCodeModal').modal('show'); }); $('#void').on('click', function () {