From c6b72a112b73616bc323391a8dd7d3ec047d88cf Mon Sep 17 00:00:00 2001 From: Moe Su Date: Mon, 12 Jun 2017 13:31:01 +0630 Subject: [PATCH 1/6] For Pull --- dump.rdb | Bin 20156 -> 20365 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dump.rdb b/dump.rdb index ebdb6db6aa4a16a1abe03b56aaa0c4d4053ff704..0e6392847a8e41d0312e82639916e8eec64d12a8 100644 GIT binary patch delta 394 zcmWm7y=qiJ6ae74yF?dO1-H>6cvp!a$SiYa&Y3f_5O4!_VlNhE=FSX)#6n{uglJ_I zFx)gE`Dw%;Tnoic8w;Pqi%(!BSOm=reBamoYUi+etuB7Lv3l?C=-Jbp!**z!fQYJc_-j>(yC;31c;QQB5*bYY9`+Nr-z1T_SQ{7r_Ja2;Q5`=!R{Lz9K5{y E4{QT>lmGw# delta 159 zcmV;Q0AT-(p8>p`0gx~ep&C6|`UrJ%Wn?XFWo^RnW066d5;-fi51C3;}49wE`an17c=3F_Ta+C6m1Y3zIA@FhXFU7cwwrWj8oAF*GzaWnwTj zF*r71VKrkpGa!@~V{&C-bY)~;VRRxoF*G?hF*i0hGdC_aKq~+>AZq|_V71^2vkL=y NOb9(%2Jyx?=AoT9F%|#- From a2111f16355607559c3de5ce07e0c555e0227378 Mon Sep 17 00:00:00 2001 From: Moe Su Date: Mon, 12 Jun 2017 13:58:16 +0630 Subject: [PATCH 2/6] For Pull --- app/models/order.rb | 2 -- dump.rdb | Bin 20365 -> 20467 bytes 2 files changed, 2 deletions(-) diff --git a/app/models/order.rb b/app/models/order.rb index a76159be..702855cc 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -243,7 +243,6 @@ class Order < ApplicationRecord .joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id") .joins("left join orders on orders.order_id = booking_orders.order_id") .joins("left join sales on sales.sale_id = bookings.sale_id") - .where("sales.sale_status='completed'") .group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status") @@ -272,7 +271,6 @@ class Order < ApplicationRecord .joins("left join orders on orders.order_id = booking_orders.order_id") .joins("left join sale_orders on sale_orders.order_id = orders.order_id") .joins("left join sales on sales.sale_id = sale_orders.sale_id") - .where("sales.sale_status<>'complete' and booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true) .group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.customer_id") diff --git a/dump.rdb b/dump.rdb index 0e6392847a8e41d0312e82639916e8eec64d12a8..9a81a61e209e6152e39a6f20ab56fb2fd13d5afc 100644 GIT binary patch delta 324 zcmV-K0lWT;_R`UrJ%Wn?XFWo^PRYLP*l5t&B7AHW6x01yQL00aO4 zL8p^}E)$bQ15T4q0V5?5H!(G4HaIjeEn;LeWi2#jIW-^&4l*+>GBIUiG-PFCVq`fm zlTa}wlf3~8lPoPTPhg-IWH>oCIAUfwH!)%|VrDZpGiEU~Wiw(oAe0zma%Ew3Wn^Dr zbRs%2G&wgiH8C|dH!d(VAP4|4AZq|_V71^29|kuuF@6530pX~vlX3wjM;+2NDGU0Ad3G03ZS% zL8p_EDjow2bY+v#L}Zgk0wt4LMJ1EG0SlAJJTOjRpci9hHDNJkH!v_VVrDR6WjA3r zHa0Y5Gch2P9Ak22VRU6=Utx42Ix#dkH!(LhH#IOWGdMFfHaQ?`0B&Hl;0qrHH!w1N z{;C1tsFSk-DFk5m;Wd-q0y8`XGBh)N{;ol-0I1`oTOVRHF*P Date: Mon, 12 Jun 2017 14:11:13 +0630 Subject: [PATCH 3/6] updated for food and beverage bugs --- app/assets/javascripts/origami.js | 34 ++++++++++-------------- app/models/sale_item.rb | 17 ++++++------ app/views/origami/payments/show.html.erb | 1 - config/routes.rb | 2 +- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index 14f9fbe9..d3ac9e76 100644 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -64,12 +64,6 @@ $(document).ready(function(){ url: "/origami/" + unique_id, data: { 'booking_id' : unique_id }, success:function(result){ -// ======= -// type: "GET", -// url: "origami/" + unique_id, -// data: { 'id' : unique_id }, -// success:function(result){ -// >>>>>>> 5ee3ae257a59269b651dcc5c0232b95d7f41fb77 for (i = 0; i < result.length; i++) { var data = JSON.stringify(result[i]); var parse_data = JSON.parse(data); @@ -191,20 +185,20 @@ $(document).ready(function(){ }); function show_customer_details(customer_id){ - $('.customer_detail').removeClass('hide'); - //Start Ajax - $.ajax({ - type: "GET", - url: "origami/"+customer_id+"/get_customer/", - data: {}, - dataType: "json", - success: function(data) { - $("#customer_name").text(data.name); - $("#customer_name").text(data.name); - } - }); - //End Ajax -} + $('.customer_detail').removeClass('hide'); + //Start Ajax + $.ajax({ + type: "GET", + url: "origami/"+customer_id+"/get_customer/", + data: {}, + dataType: "json", + success: function(data) { + $("#customer_name").text(data.name); + $("#customer_name").text(data.name); + } + }); + //End Ajax + } /* For Receipt - Calculate discount or tax */ $('.cashier_number').on('click', function(event){ diff --git a/app/models/sale_item.rb b/app/models/sale_item.rb index 0aed9a23..25b37178 100644 --- a/app/models/sale_item.rb +++ b/app/models/sale_item.rb @@ -36,24 +36,25 @@ class SaleItem < ApplicationRecord sale_items.each do |si| food_price = self.get_food_price(si.sale_item_id) - beverage_price = self.get_beverage_price(si.sale_item_id) -puts food_price - # food_prices = food_prices + food_price.price - # beverage_prices = beverage_prices + beverage_price.price + beverage_price = self.get_beverage_price(si.sale_item_id) + food_prices = food_prices + food_price + beverage_prices = beverage_prices + beverage_price end return food_prices, beverage_prices end def self.get_food_price(sale_item_id) - food_price=SaleItem.select("sale_items.price") + food=SaleItem.select("sale_items.price") .joins("left join menu_items on menu_items.item_code = sale_items.product_code") - .where("sale_items.sale_item_id=? and menu_items.account_id=0", sale_item_id) + .where("sale_items.sale_item_id=? and menu_items.account_id=1", sale_item_id.to_s) + food_price = food[0].price rescue 0 end def self.get_beverage_price(sale_item_id) - beverage_price=SaleItem.select("sale_items.price") + beverage=SaleItem.select("sale_items.price") .joins("left join menu_items on menu_items.item_code = sale_items.product_code") - .where("sale_items.sale_item_id=? and menu_items.account_id=1", sale_item_id) + .where("sale_items.sale_item_id=? and menu_items.account_id=2", sale_item_id.to_s) + beverage_price = beverage[0].price rescue 0 end private diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 198b9518..f52c99a1 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -216,7 +216,6 @@ $( document ).ready(function() { }); $('#pay').click(function() { - if($('#balance').text() > 0){ alert(" Insufficient Amount!") }else{ diff --git a/config/routes.rb b/config/routes.rb index 0666e0c4..ddb6e3ff 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -72,7 +72,7 @@ Rails.application.routes.draw do #--------- Cashier ------------# namespace :origami do root "home#index" - get "/:booking_id" => "home#show" do #origami/:booking_id will show + get "/:booking_id" => "home#index" do #origami/:booking_id will show # resources :discounts, only: [:index,:new, :create ] #add discount type resources :customers #add customer type end From dd5de68bc0769804de7fd9f4a19762a6b30cb453 Mon Sep 17 00:00:00 2001 From: Moe Su Date: Mon, 12 Jun 2017 14:16:31 +0630 Subject: [PATCH 4/6] Seed --- db/seeds.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index fe7bdcc7..5cd38d12 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -51,6 +51,10 @@ menu_item_type = Lookup.create([{lookup_type:'menu_item_type', name: 'SIMPLE', v {lookup_type:'menu_item_type', name: 'Set Menu', value: 'setMenu'}, {lookup_type:'menu_item_type', name: 'DIY', value: 'diy'}]) +member_group_type = Lookup.create([{lookup_type:'member_group_type', name: 'Platinum', value: '1'}, + {lookup_type:'member_group_type', name: 'Silver', value: '2'} + ]) + #menu_item_attribute:[size|] menu_item_attribute_type = Lookup.create([{lookup_type:'menu_item_attribute_type', name: 'Size', value: 'size'}]) # {lookup_type:'menu_item_attribute_type', name: 'Spicy', value: 'spicy'}, @@ -141,7 +145,7 @@ order_station2=PrintSetting.create({name: "Order Summary", unique_code: "OrderSu request_bill_printer=PrintSetting.create({name: "Receipt Bill", unique_code: "ReceiptBillPdf", printer_name: "EPSON-TM-T82-S-A"}) crm_order_printer=PrintSetting.create({name: "CRM Order", unique_code: "CrmOrderPdf", printer_name: "EPSON-TM-T82-S-A"}) -member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "192.168.1."}) +member_setting = MembershipSetting.create({membership_type:"paypar_url",gateway_url: "http//192.168.1.47:3006"}) member_actions= MembershipAction.create([{membership_type:"get_account_balance",gateway_url:"/api/membership_campaigns/get_correspond_account_data",additional_parameter:{campaign_type_id:1}}, {membership_type:"redeem",gateway_url:"/api/membership_campaigns/redeem",additional_parameter:{campaign_type_id:1}}, @@ -151,6 +155,7 @@ member_actions= MembershipAction.create([{membership_type:"get_account_balance", {membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1}}, {membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data"} ]) +payment_methods = PaymentMethodSetting.create({membership_type:"REDEEMREBATE",gateway_url: "http//192.168.1.47:3006"}) # shop = Shop.create( # {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon", From b0eb92b04323ad016aad7a8dd978e6b72f89b070 Mon Sep 17 00:00:00 2001 From: Moe Su Date: Mon, 12 Jun 2017 14:19:04 +0630 Subject: [PATCH 5/6] Seed --- db/seeds.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index 5cd38d12..ae2d617d 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -155,7 +155,7 @@ member_actions= MembershipAction.create([{membership_type:"get_account_balance", {membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1}}, {membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data"} ]) -payment_methods = PaymentMethodSetting.create({membership_type:"REDEEMREBATE",gateway_url: "http//192.168.1.47:3006"}) +payment_methods = PaymentMethodSetting.create({payment_method:"REDEEMREBATE",gateway_url: "http//192.168.1.47:3006"}) # shop = Shop.create( # {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon", From c7ff5140d4929a8674e7b00baa4d59bf60a58db2 Mon Sep 17 00:00:00 2001 From: Phyo Date: Mon, 12 Jun 2017 14:22:45 +0630 Subject: [PATCH 6/6] Payment route change --- app/views/origami/mpu/index.html.erb | 2 +- app/views/origami/payments/show.html.erb | 2 +- config/routes.rb | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/origami/mpu/index.html.erb b/app/views/origami/mpu/index.html.erb index f082dc1a..7b483a75 100644 --- a/app/views/origami/mpu/index.html.erb +++ b/app/views/origami/mpu/index.html.erb @@ -13,7 +13,7 @@ Amount : var sale_id = "<%= @sale_id %>"; $.ajax({type: "POST", - url: "<%= origami_create_mpu_payment_path %>", + url: "<%= origami_payment_mpu_path %>", data: "amount="+ amount + "&sale_id="+ sale_id, success:function(result){ if(result){ diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index e8d35206..7eb890f4 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -229,7 +229,7 @@ $( document ).ready(function() { var card = $('#card').text(); var sale_id = $('#sale_id').text(); $.ajax({type: "POST", - url: "<%= origami_payment_process_path %>", + url: "<%= origami_payment_cash_path %>", data: "cash="+ cash + "&sale_id=" + sale_id, success:function(result){ alert("Thank you") diff --git a/config/routes.rb b/config/routes.rb index ddb6e3ff..6337f4ee 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -82,17 +82,17 @@ Rails.application.routes.draw do get "/:id/discount" => "discounts#index" post "/:id/discount" => "discounts#create" - get "/:id/request_bills" => "request_bills#print" + get "/:id/request_bills" => "request_bills#print" #--------- Payment ------------# get 'sale/:sale_id/payment' => 'payments#show' - post 'payment_process' => 'payments#create' + post 'payment/cash' => 'payments#create' post 'paypar_payment_process' => 'paypar_payments#create' get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index" get 'sale/:sale_id/payment/others_payment' => "others_payments#index" # get 'sale/:sale_id/payment/others_payment/:payment_method' => "redeem_payments#index" get 'sale/:sale_id/payment/others_payment/MPU' => "mpu#index" - post 'create_mpu_payment' => "mpu#create" + post 'payment/mpu' => "mpu#create" get 'sale/:sale_id/payment/others_payment/REDEEMREBATE' => "redeem_payments#index" #---------Add Customer --------------# @@ -167,7 +167,7 @@ Rails.application.routes.draw do resources :tax_profiles #lookups resources :lookups - #orders + #orders resources :orders #cashier_terminals resources :cashier_terminals