diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index c3dba58b..e84aef30 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -10,9 +10,13 @@ class HomeController < ApplicationController @login_form.emp_id = params[:login_form][:emp_id] @login_form.password = params[:login_form][:password] @employee = Employee.login(@login_form.emp_id, @login_form.password) - if @employee + puts @employee.role + if @employee.role == "administrator" session[:session_token] = @employee.token_session redirect_to dashboard_path + elsif @employee.role == "cashier" + session[:session_token] = @employee.token_session + redirect_to origami_root_path else render :index end diff --git a/app/controllers/origami/jcb_controller.rb b/app/controllers/origami/jcb_controller.rb index 9be83462..b13790c3 100644 --- a/app/controllers/origami/jcb_controller.rb +++ b/app/controllers/origami/jcb_controller.rb @@ -10,7 +10,7 @@ class Origami::JcbController < BaseOrigamiController if(Sale.exists?(sale_id)) saleObj = Sale.find(sale_id) sale_payment = SalePayment.new - @status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu") + @status, @sale = sale_payment.process_payment(saleObj, @user, cash, "jcb") end end diff --git a/app/controllers/origami/master_controller.rb b/app/controllers/origami/master_controller.rb index 92ab7ebb..714d4b6a 100644 --- a/app/controllers/origami/master_controller.rb +++ b/app/controllers/origami/master_controller.rb @@ -10,7 +10,7 @@ class Origami::MasterController < BaseOrigamiController if(Sale.exists?(sale_id)) saleObj = Sale.find(sale_id) sale_payment = SalePayment.new - @status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu") + @status, @sale = sale_payment.process_payment(saleObj, @user, cash, "master") end end diff --git a/app/controllers/origami/visa_controller.rb b/app/controllers/origami/visa_controller.rb index 043bd43c..05f475a9 100644 --- a/app/controllers/origami/visa_controller.rb +++ b/app/controllers/origami/visa_controller.rb @@ -10,7 +10,7 @@ class Origami::VisaController < BaseOrigamiController if(Sale.exists?(sale_id)) saleObj = Sale.find(sale_id) sale_payment = SalePayment.new - @status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu") + @status, @sale = sale_payment.process_payment(saleObj, @user, cash, "visa") end end diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index f3819466..bff00d82 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -138,6 +138,8 @@ $(function() { $(document).on('click',".customer_tr",function(){ // if(this.checked){ + $(this).closest('tr').find('.checkbox_check').prop( "checked", true ); + //$( "#checkbox_check" ).prop( "checked", true ); var sale_id = $("#sale_id").val() || 0; var customer_id = $(this).attr('data-ref'); diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index 1c6bebaa..b58ca35a 100644 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -136,7 +136,7 @@ $(document).on('click',".customer_tr",function(){ // if(this.checked){ - + $(this).closest('tr').find('.checkbox_check').prop( "checked", true ); var sale_id = $("#sale_id").val() || 0; var customer_id = $(this).attr('data-ref'); diff --git a/app/views/origami/jcb/index.html.erb b/app/views/origami/jcb/index.html.erb index 723b387d..a1a5a2cd 100644 --- a/app/views/origami/jcb/index.html.erb +++ b/app/views/origami/jcb/index.html.erb @@ -67,7 +67,7 @@
10000
-
Pay
+
Pay
@@ -80,12 +80,54 @@ diff --git a/app/views/origami/redeem_payments/index.html.erb b/app/views/origami/redeem_payments/index.html.erb index be686c51..4d0ab223 100644 --- a/app/views/origami/redeem_payments/index.html.erb +++ b/app/views/origami/redeem_payments/index.html.erb @@ -76,7 +76,45 @@