From 3cb58782934f4638b3a4b7894c30c492feca67a1 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 14 Jun 2017 10:18:48 +0630 Subject: [PATCH 1/7] update sale --- app/views/transactions/sales/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/transactions/sales/show.html.erb b/app/views/transactions/sales/show.html.erb index 484de762..b149ebe7 100644 --- a/app/views/transactions/sales/show.html.erb +++ b/app/views/transactions/sales/show.html.erb @@ -23,7 +23,7 @@ Receipt Date Receipt no Cashier - OSales status + Sales status Receipt generated at From 998b23aae543bbc811b43cb9acc97af3cd556823 Mon Sep 17 00:00:00 2001 From: Nweni Date: Wed, 14 Jun 2017 10:27:15 +0630 Subject: [PATCH 2/7] update key --- app/views/origami/jcb/index.html.erb | 42 +++++++++++++++++++ app/views/origami/master/index.html.erb | 39 +++++++++++++++++ app/views/origami/mpu/index.html.erb | 39 +++++++++++++++++ .../origami/redeem_payments/index.html.erb | 38 +++++++++++++++++ app/views/origami/visa/index.html.erb | 39 +++++++++++++++++ 5 files changed, 197 insertions(+) diff --git a/app/views/origami/jcb/index.html.erb b/app/views/origami/jcb/index.html.erb index 723b387d..ea6ea5cc 100644 --- a/app/views/origami/jcb/index.html.erb +++ b/app/views/origami/jcb/index.html.erb @@ -80,6 +80,48 @@ From c155c86970d0279c79322b1f3802791c966ff026 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 14 Jun 2017 10:43:27 +0630 Subject: [PATCH 5/7] update checkbox in customer view --- app/views/crm/customers/index.html.erb | 2 ++ app/views/origami/customers/index.html.erb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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'); From 9d1aff2fa2e0ab43adf0f1b7a0a470792a0f4a73 Mon Sep 17 00:00:00 2001 From: Nweni Date: Wed, 14 Jun 2017 10:49:00 +0630 Subject: [PATCH 6/7] other payment updated --- app/views/origami/jcb/index.html.erb | 2 +- app/views/origami/master/index.html.erb | 2 +- app/views/origami/mpu/index.html.erb | 2 +- app/views/origami/visa/index.html.erb | 2 +- config/routes.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/origami/jcb/index.html.erb b/app/views/origami/jcb/index.html.erb index 924eeb0e..a1a5a2cd 100644 --- a/app/views/origami/jcb/index.html.erb +++ b/app/views/origami/jcb/index.html.erb @@ -123,7 +123,7 @@ $(document).on('click', '.cashier_number', function(event){ $('#jcb_pay').on('click',function(){ - var amount = $('#amount').val(); + var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; $.ajax({type: "POST", diff --git a/app/views/origami/master/index.html.erb b/app/views/origami/master/index.html.erb index a2e31257..da481022 100644 --- a/app/views/origami/master/index.html.erb +++ b/app/views/origami/master/index.html.erb @@ -120,7 +120,7 @@ $(document).on('click', '.cashier_number', function(event){ } }); $('#master_pay').on('click',function(){ - var amount = $('#amount').val(); + var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; $.ajax({type: "POST", diff --git a/app/views/origami/mpu/index.html.erb b/app/views/origami/mpu/index.html.erb index d6ebd1a4..10caf0b3 100644 --- a/app/views/origami/mpu/index.html.erb +++ b/app/views/origami/mpu/index.html.erb @@ -120,7 +120,7 @@ $(document).on('click', '.cashier_number', function(event){ } }); $('#mpu_pay').on('click',function(){ - var amount = $('#amount').val(); + var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; $.ajax({type: "POST", diff --git a/app/views/origami/visa/index.html.erb b/app/views/origami/visa/index.html.erb index 37f48772..72cd94aa 100644 --- a/app/views/origami/visa/index.html.erb +++ b/app/views/origami/visa/index.html.erb @@ -120,7 +120,7 @@ $(document).on('click', '.cashier_number', function(event){ } }); $('#visa_pay').on('click',function(){ - var amount = $('#amount').val(); + var amount = $('#amount').text(); var sale_id = "<%= @sale_id %>"; $.ajax({type: "POST", diff --git a/config/routes.rb b/config/routes.rb index a0da05ae..ee9b44a0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -91,7 +91,7 @@ Rails.application.routes.draw do post 'payment/mpu' => "mpu#create" post 'payment/jcb' => "jcb#create" post 'payment/master' => "master#create" - post 'payment/visa' => "master#visa" + post 'payment/visa' => "visa#create" post 'payment/paypar' => 'paypar_payments#create' get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index" From 7b2d2731c1c9edf76c54afc63d5f327e85f9b364 Mon Sep 17 00:00:00 2001 From: Nweni Date: Wed, 14 Jun 2017 11:05:15 +0630 Subject: [PATCH 7/7] auth --- app/controllers/home_controller.rb | 6 +++++- db/seeds.rb | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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/db/seeds.rb b/db/seeds.rb index a7fdc416..e834c9f6 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -136,8 +136,8 @@ zone_queue_station = OrderQueueProcessByZone.create({order_queue_station: zone_o #Create Adminstrator employee -admin_employee = Employee.create({name: "Administrator", role: "Administrator", password: "99999", emp_id:"999", created_by: "SYSTEM DEFAULT"}) -admin_employee = Employee.create({name: "Waiter", role: "Waiter", password: "11111", emp_id:"111", created_by: "SYSTEM DEFAULT"}) +admin_employee = Employee.create({name: "Administrator", role: "administrator", password: "99999", emp_id:"999", created_by: "SYSTEM DEFAULT"}) +admin_employee = Employee.create({name: "Waiter", role: "waiter", password: "11111", emp_id:"111", created_by: "SYSTEM DEFAULT"}) order_station1=PrintSetting.create({name: "OrderItemPdf", unique_code: "OrderItemPdf", printer_name: "EPSON-TM-T82-S-A"}) order_station2=PrintSetting.create({name: "Order Summary", unique_code: "OrderSummaryPdf", printer_name: "EPSON-TM-T82-S-A"}) request_bill_printer=PrintSetting.create({name: "Receipt Bill", unique_code: "ReceiptBillPdf", printer_name: "EPSON-TM-T82-S-A"})