From 9d76e1313a0805aaebf8649332258f8a0dfc0a1f Mon Sep 17 00:00:00 2001 From: Zin Lin Phyo Date: Mon, 26 Jun 2017 18:13:43 +0630 Subject: [PATCH] overall void update --- .idea/.generators | 8 + .idea/.rakeTasks | 7 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/sxrestaurant.iml | 236 ++++++ .idea/vcs.xml | 6 + .idea/workspace.xml | 817 +++++++++++++++++++++ app/controllers/origami/void_controller.rb | 28 + config/routes.rb | 2 +- dump.rdb | Bin 18262 -> 18261 bytes 10 files changed, 1115 insertions(+), 1 deletion(-) create mode 100644 .idea/.generators create mode 100644 .idea/.rakeTasks create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/sxrestaurant.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 app/controllers/origami/void_controller.rb diff --git a/.idea/.generators b/.idea/.generators new file mode 100644 index 00000000..16189766 --- /dev/null +++ b/.idea/.generators @@ -0,0 +1,8 @@ + + diff --git a/.idea/.rakeTasks b/.idea/.rakeTasks new file mode 100644 index 00000000..3577d8ad --- /dev/null +++ b/.idea/.rakeTasks @@ -0,0 +1,7 @@ + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..157739d4 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..21ecc838 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/sxrestaurant.iml b/.idea/sxrestaurant.iml new file mode 100644 index 00000000..586fd380 --- /dev/null +++ b/.idea/sxrestaurant.iml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..4d3242d5 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,817 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + origami + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + project + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1498458293643 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/controllers/origami/void_controller.rb b/app/controllers/origami/void_controller.rb new file mode 100644 index 00000000..bea37a21 --- /dev/null +++ b/app/controllers/origami/void_controller.rb @@ -0,0 +1,28 @@ +class Origami::VoidController < BaseOrigamiController + + def overall_void + + sale_id = params[:sale_id] + if Sale.exists?(sale_id) + sale = Sale.find_by_sale_id(sale_id) + sale.payment_status = 'void' + sale.sale_status = 'void' + sale.save + + table_avaliable = true + table = sale.bookings[0].dining_facility + table.bookings.each do |booking| + if booking.sale.sale_status == 'new' + table_avaliable = false + end + end + + if table_avaliable == true + table.status = 'available' + table.save + end + + end + end + +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3bb93268..73b361ce 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -128,7 +128,7 @@ Rails.application.routes.draw do #resources :customers get '/:sale_id/customers', to: "customers#add_customer" get '/:customer_id/get_customer' => 'home#get_customer',:as => "show_customer_details" - post '/:sale_id/update_sale' , to: "customers#update_sale_by_customer"#update customer id in sale table + post '/:sale_id/update_sale' , to: "customers#update_sale_by_customer" # update customer id in sale table end #--------- Waiter/Ordering Station ------------# diff --git a/dump.rdb b/dump.rdb index 041df177e5969bb1b252b44f32d8d3f28339ced3..acef6aa79d6c19cf0bb0d215a80225ad58500e81 100644 GIT binary patch delta 79 zcmV-V0I>hojsew<0gx~l!SYa9`UrJ%Wn?XFWo^Qs@f-mD0Q(gIlOPHgkzXDI&n7jI lfG`pfF*G?iG&eUgG&e3aIXE>qII+WvMhKKTSDj!bdc?;x9Bu#r delta 80 zcmV-W0I&bmjsez=0gx~lXYf#2`UrJ%Wn?XFWo^O`u^RyX0Q(gIlOGBfkzXDItLZC| mfG`shF*G?iG&eRjG%_wRGBYqYH#xDwi$(|>It&-MQ&#t<=^H`-