From 09193a532a259cc1bc13bd8790339ca355237ff3 Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 25 Jul 2017 16:30:52 +0630 Subject: [PATCH 1/7] fix sale edit cntr --- app/controllers/origami/sale_edit_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/origami/sale_edit_controller.rb b/app/controllers/origami/sale_edit_controller.rb index 3d5b9722..209ec4c0 100644 --- a/app/controllers/origami/sale_edit_controller.rb +++ b/app/controllers/origami/sale_edit_controller.rb @@ -88,8 +88,8 @@ class Origami::SaleEditController < BaseOrigamiController # remove all void items def cancel_all_void sale_id = params[:sale_id] - saleobj = Sale.find(sale_id) - saleobj.sale_items.each do |item| + saleObj = Sale.find(sale_id) + saleObj.sale_items.each do |item| if item.qty.to_i < 0 item.destroy else From 89c8b9a9ccb9a991ae9672ab9f53ca5203162eb3 Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 25 Jul 2017 18:08:04 +0630 Subject: [PATCH 2/7] fix for re-calc tax for gram sale --- app/models/sale.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index fc2a761b..0fcb7923 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -249,7 +249,7 @@ class Sale < ApplicationRecord if item.remark != 'void' #compute each item and added to total subtotal_price = subtotal_price + item.price - total_taxable = total_taxable + item.taxable_price + total_taxable = total_taxable + item.price end end From e693b60945d7e30fd2777bca05e079402544bba7 Mon Sep 17 00:00:00 2001 From: Yan Date: Wed, 26 Jul 2017 16:00:15 +0630 Subject: [PATCH 3/7] bind member for already register member --- app/controllers/crm/customers_controller.rb | 11 +++++++++-- app/models/customer.rb | 2 +- db/seeds.rb | 20 -------------------- lib/tasks/menu_import.rake | 20 ++++++++++++++++++++ lib/tasks/menu_osaka.rake | 20 ++++++++++++++++++++ 5 files changed, 50 insertions(+), 23 deletions(-) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 4b045221..c0123945 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -128,8 +128,15 @@ class Crm::CustomersController < BaseCrmController end # format.json { render :index, status: :created, location: @crm_customers } else - customer = Customer.find(@crm_customers.customer_id) - status = customer.update_attributes(membership_type:member_group_id ) + customer = Customer.find(@crm_customers.customer_id) + + # Check membership id and bind to user + if response["membership_id"] != nil + status = customer.update_attributes(membership_id: response["membership_id"],membership_type:member_group_id ) + else + status = customer.update_attributes(membership_type:member_group_id) + end + if params[:sale_id] format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created.' + response["message"]} else diff --git a/app/models/customer.rb b/app/models/customer.rb index ef777c2d..06f7f1d1 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -10,7 +10,7 @@ class Customer < ApplicationRecord validates :contact_no, uniqueness: true validates :email, uniqueness: true validates :card_no, uniqueness: true - # validates :paypar_account_no + validates :paypar_account_no, uniqueness: true paginates_per 50 diff --git a/db/seeds.rb b/db/seeds.rb index 317194c1..879ef921 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -163,26 +163,6 @@ close_cashier_printer=PrintSetting.create({name: "Close Cashier", unique_code: " crm_order_printer=PrintSetting.create({name: "CRM Order", unique_code: "CrmOrderPdf", printer_name: "Cashier", precision: "0", delimiter: "0", heading_space: "5"}) queue_no_printer=PrintSetting.create({name: "Queue No", unique_code: "QueueNoPdf", printer_name: "Cashier", precision: "0", delimiter: "0", heading_space: "5"}) -member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}) - -member_actions= MembershipAction.create([{membership_type:"get_account_balance",gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - {membership_type:"redeem",gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - {membership_type:"create_membership_customer",gateway_url:"/api/generic_customer/create_membership_customer",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - {membership_type:"update_membership_customer",gateway_url:"/api/generic_customer/update_membership_customer",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - {membership_type:"get_all_member_group",gateway_url:"/api/member_group/get_all_member_group",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - {membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - {membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - {membership_type:"get_member_transactions",gateway_url:"/api/generic_customer/get_membership_transactions",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - {membership_type:"member_discount",gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:6},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - {membership_type:"get_member_campaign",gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:6},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - ]) - -payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"VISA",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"JCB",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"Master",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"Redeem",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}) - cashier_terminal = CashierTerminal.create({name:"Terminal 1"}) cashier_terminal2 = CashierTerminal.create({name:"Terminal 2"}) cashier_terminal3 = CashierTerminal.create({name:"Terminal 3"}) diff --git a/lib/tasks/menu_import.rake b/lib/tasks/menu_import.rake index e0e0be3a..61234dd9 100644 --- a/lib/tasks/menu_import.rake +++ b/lib/tasks/menu_import.rake @@ -636,6 +636,26 @@ zone3 = Zone.create({id:3, name: "H3", is_active:true, created_by: "SYSTEM DEFAU table = Table.create({name:"77", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) table = Table.create({name:"78", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) +member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}) + +member_actions= MembershipAction.create([{membership_type:"get_account_balance",gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"redeem",gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"create_membership_customer",gateway_url:"/api/generic_customer/create_membership_customer",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"update_membership_customer",gateway_url:"/api/generic_customer/update_membership_customer",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"get_all_member_group",gateway_url:"/api/member_group/get_all_member_group",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"get_member_transactions",gateway_url:"/api/generic_customer/get_membership_transactions",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"member_discount",gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:6},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"get_member_campaign",gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:6},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, +]) + +payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://192.168.1.47:3006"}) +payment_methods = PaymentMethodSetting.create({payment_method:"VISA",gateway_url: "http://192.168.1.47:3006"}) +payment_methods = PaymentMethodSetting.create({payment_method:"JCB",gateway_url: "http://192.168.1.47:3006"}) +payment_methods = PaymentMethodSetting.create({payment_method:"Master",gateway_url: "http://192.168.1.47:3006"}) +payment_methods = PaymentMethodSetting.create({payment_method:"Redeem",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}) + #Default Order Queue stations order_queue_station1 = OrderQueueStation.create({station_name: "K1", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['01001','01002','01003','01004']), print_copy:true, cut_per_item: false, use_alternate_name: false, created_by: "SYSTEM DEFAULT"}) order_queue_station2 = OrderQueueStation.create({station_name: "K2", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['02005','02006','02007','02008']), print_copy:true, cut_per_item: true, use_alternate_name: true, created_by: "SYSTEM DEFAULT"}) diff --git a/lib/tasks/menu_osaka.rake b/lib/tasks/menu_osaka.rake index 9241166b..313c8974 100644 --- a/lib/tasks/menu_osaka.rake +++ b/lib/tasks/menu_osaka.rake @@ -896,6 +896,26 @@ zone3 = Zone.create({id:3, name: "H3", is_active:true, created_by: "SYSTEM DEFAU table = Table.create({zone: zone3, name:"34", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) table = Table.create({zone: zone3, name:"35", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) +member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"am-15QFGS9xGBxDrV6bV"}) + +member_actions= MembershipAction.create([{membership_type:"get_account_balance",gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, + {membership_type:"redeem",gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, + {membership_type:"create_membership_customer",gateway_url:"/api/generic_customer/create_membership_customer",merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, + {membership_type:"update_membership_customer",gateway_url:"/api/generic_customer/update_membership_customer",merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, + {membership_type:"get_all_member_group",gateway_url:"/api/member_group/get_all_member_group",merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, + {membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1},merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, + {membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data",merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, + {membership_type:"get_member_transactions",gateway_url:"/api/generic_customer/get_membership_transactions",merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, + {membership_type:"member_discount",gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:6},merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, + {membership_type:"get_member_campaign",gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:6},merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, +]) + +payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://192.168.1.47:3006"}) +payment_methods = PaymentMethodSetting.create({payment_method:"VISA",gateway_url: "http://192.168.1.47:3006"}) +payment_methods = PaymentMethodSetting.create({payment_method:"JCB",gateway_url: "http://192.168.1.47:3006"}) +payment_methods = PaymentMethodSetting.create({payment_method:"Master",gateway_url: "http://192.168.1.47:3006"}) +payment_methods = PaymentMethodSetting.create({payment_method:"Redeem",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"am-15QFGS9xGBxDrV6bV"}) + #Default Order Queue stations order_queue_station1 = OrderQueueStation.create({station_name: "K1", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['I0001','I0002','I0003','I0004']), print_copy:false, cut_per_item: false, use_alternate_name: false, created_by: "SYSTEM DEFAULT"}) order_queue_station2 = OrderQueueStation.create({station_name: "K2", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['I0005','I0006','I0007','I0008']), print_copy:false, cut_per_item: false, use_alternate_name: false, created_by: "SYSTEM DEFAULT"}) From f7588bd8d99050c966a45b49878389aec1c4ac68 Mon Sep 17 00:00:00 2001 From: Yan Date: Wed, 26 Jul 2017 16:42:51 +0630 Subject: [PATCH 4/7] update member for already register member --- app/controllers/crm/customers_controller.rb | 13 ++++++++++++- lib/tasks/menu_import.rake | 12 ++++++------ lib/tasks/menu_osaka.rake | 12 ++++++------ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index c0123945..c819af7b 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -224,7 +224,12 @@ end else customer = Customer.find(@crm_customer.customer_id) - status = customer.update_attributes(membership_type:member_group_id ) + # Check membership id and bind to user + if response["membership_id"] != nil + status = customer.update_attributes(membership_id: response["membership_id"],membership_type:member_group_id ) + else + status = customer.update_attributes(membership_type:member_group_id) + end format.html { redirect_to crm_customers_path, notice: response["error"] } end @@ -262,6 +267,12 @@ end format.html { redirect_to crm_customers_path, notice: 'Customer was successfully updated.' } format.json { render :show, status: :ok, location: @crm_customer } else + # Check membership id and bind to user + if response["membership_id"] != nil + status = customer.update_attributes(membership_id: response["membership_id"],membership_type:member_group_id ) + else + status = customer.update_attributes(membership_type:member_group_id) + end format.html { redirect_to crm_customers_path, notice: response["message"] } end diff --git a/lib/tasks/menu_import.rake b/lib/tasks/menu_import.rake index 61234dd9..cdf175bf 100644 --- a/lib/tasks/menu_import.rake +++ b/lib/tasks/menu_import.rake @@ -636,7 +636,7 @@ zone3 = Zone.create({id:3, name: "H3", is_active:true, created_by: "SYSTEM DEFAU table = Table.create({name:"77", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) table = Table.create({name:"78", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) -member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}) +member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://membership.paypar.ws",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}) member_actions= MembershipAction.create([{membership_type:"get_account_balance",gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, {membership_type:"redeem",gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, @@ -650,11 +650,11 @@ member_actions= MembershipAction.create([{membership_type:"get_account_balance", {membership_type:"get_member_campaign",gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:6},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, ]) -payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"VISA",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"JCB",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"Master",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"Redeem",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}) +payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://membership.paypar.ws"}) +payment_methods = PaymentMethodSetting.create({payment_method:"VISA",gateway_url: "http://membership.paypar.ws"}) +payment_methods = PaymentMethodSetting.create({payment_method:"JCB",gateway_url: "http://membership.paypar.ws"}) +payment_methods = PaymentMethodSetting.create({payment_method:"Master",gateway_url: "http://membership.paypar.ws"}) +payment_methods = PaymentMethodSetting.create({payment_method:"Redeem",gateway_url: "http://membership.paypar.ws",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}) #Default Order Queue stations order_queue_station1 = OrderQueueStation.create({station_name: "K1", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['01001','01002','01003','01004']), print_copy:true, cut_per_item: false, use_alternate_name: false, created_by: "SYSTEM DEFAULT"}) diff --git a/lib/tasks/menu_osaka.rake b/lib/tasks/menu_osaka.rake index 313c8974..941494aa 100644 --- a/lib/tasks/menu_osaka.rake +++ b/lib/tasks/menu_osaka.rake @@ -896,7 +896,7 @@ zone3 = Zone.create({id:3, name: "H3", is_active:true, created_by: "SYSTEM DEFAU table = Table.create({zone: zone3, name:"34", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) table = Table.create({zone: zone3, name:"35", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) -member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"am-15QFGS9xGBxDrV6bV"}) +member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http://staging.membership.paypar.ws",merchant_account_id:"am-15QFGS9xGBxDrV6bV"}) member_actions= MembershipAction.create([{membership_type:"get_account_balance",gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1},merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, {membership_type:"redeem",gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1},merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, @@ -910,11 +910,11 @@ member_actions= MembershipAction.create([{membership_type:"get_account_balance", {membership_type:"get_member_campaign",gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:6},merchant_account_id:"am-15QFGS9xGBxDrV6bV",auth_token:"code2lab"}, ]) -payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"VISA",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"JCB",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"Master",gateway_url: "http://192.168.1.47:3006"}) -payment_methods = PaymentMethodSetting.create({payment_method:"Redeem",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"am-15QFGS9xGBxDrV6bV"}) +payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://staging.membership.paypar.ws"}) +payment_methods = PaymentMethodSetting.create({payment_method:"VISA",gateway_url: "http://staging.membership.paypar.ws"}) +payment_methods = PaymentMethodSetting.create({payment_method:"JCB",gateway_url: "http://staging.membership.paypar.ws"}) +payment_methods = PaymentMethodSetting.create({payment_method:"Master",gateway_url: "http://staging.membership.paypar.ws"}) +payment_methods = PaymentMethodSetting.create({payment_method:"Redeem",gateway_url: "http://staging.membership.paypar.ws",merchant_account_id:"am-15QFGS9xGBxDrV6bV"}) #Default Order Queue stations order_queue_station1 = OrderQueueStation.create({station_name: "K1", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['I0001','I0002','I0003','I0004']), print_copy:false, cut_per_item: false, use_alternate_name: false, created_by: "SYSTEM DEFAULT"}) From 7bfe8b1578faac6f994213771bc2e81e8a2998a9 Mon Sep 17 00:00:00 2001 From: Yan Date: Wed, 26 Jul 2017 18:02:30 +0630 Subject: [PATCH 5/7] dump.rdb --- dump.rdb | Bin 487 -> 573 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dump.rdb b/dump.rdb index 0e8d606fd2b675a0c3e88d8fa1ab9153d5ebc576..059a26dd90f8185e1b640d7ce37ffdc7b689e486 100644 GIT binary patch delta 319 zcmaFPyq9HyfkaeoMdUAz(&E$<-Q3jNLlbTbG5llr&BZt|Rg=+d;!0^IBZG-66(+8c zU@|hB*e~Pv=XuYnx>!aA1{TrE#5^kt6C(qw6eF{g)Wp;@vlMef7M7&c#1cV6Qv*W- zGYd0gBRz9N17l+|*22=v)DqUT#GK+(mdw1g{KF3G9kxvtV^j>02dgzTFgDOLH!?Ff zGtp5h$V^cJo2{c%l9;Yw%3NGgl&WCNQd*RlSE67ipPZkUTv}9=nwMOuWMyQkqf}U$ zTAEs{WEHKHlA4xS$}qWyQQc-@LN*_Y6Hm%a zTqhZ1XmNmnfxEaQvBWAZF*7GMHmjf>96+Z|5ykBEF4&x From ad2dfa2ee04b2c91fdc39ad2af3c9761d34cd1e7 Mon Sep 17 00:00:00 2001 From: Yan Date: Wed, 26 Jul 2017 18:39:46 +0630 Subject: [PATCH 6/7] crm updated --- app/controllers/crm/customers_controller.rb | 3 --- app/views/crm/customers/_new_form.html.erb | 5 ++-- app/views/origami/customers/index.html.erb | 14 +++++++----- db/seeds.rb | 3 ++- dump.rdb | Bin 573 -> 574 bytes lib/tasks/menu_osaka.rake | 24 ++++++++++---------- 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index c819af7b..b2c715ad 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -215,14 +215,11 @@ end end if response["status"] == true - customer = Customer.find(@crm_customer.customer_id) status = customer.update_attributes(membership_id: response["customer_datas"]["id"],membership_type:member_group_id ) format.html { redirect_to crm_customers_path, notice: 'Customer was successfully updated'} - else - customer = Customer.find(@crm_customer.customer_id) # Check membership id and bind to user if response["membership_id"] != nil diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb index 3c09d20f..b99c25a3 100644 --- a/app/views/crm/customers/_new_form.html.erb +++ b/app/views/crm/customers/_new_form.html.erb @@ -128,10 +128,9 @@