From 2d55ea0dab7556f28f81b5a3df8d96bb6dc4296a Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 7 Jul 2017 09:56:18 +0630 Subject: [PATCH 01/71] update add order --- .../javascripts/origami/addorders.coffee | 3 + app/assets/stylesheets/origami.scss | 1 + app/assets/stylesheets/origami/addorders.scss | 3 + .../origami/addorders_controller.rb | 21 ++++ app/helpers/origami/addorders_helper.rb | 2 + app/views/origami/addorders/index.html.erb | 108 ++++++++++++++++++ app/views/origami/addorders/show.html.erb | 30 +++++ app/views/origami/home/show.html.erb | 8 +- config/routes.rb | 2 + .../origami/addorders_controller_spec.rb | 5 + spec/helpers/origami/addorders_helper_spec.rb | 15 +++ 11 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/origami/addorders.coffee create mode 100644 app/assets/stylesheets/origami/addorders.scss create mode 100644 app/controllers/origami/addorders_controller.rb create mode 100644 app/helpers/origami/addorders_helper.rb create mode 100644 app/views/origami/addorders/index.html.erb create mode 100644 app/views/origami/addorders/show.html.erb create mode 100644 spec/controllers/origami/addorders_controller_spec.rb create mode 100644 spec/helpers/origami/addorders_helper_spec.rb diff --git a/app/assets/javascripts/origami/addorders.coffee b/app/assets/javascripts/origami/addorders.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/origami/addorders.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 7935b50e..1f195ba5 100644 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -211,3 +211,4 @@ tr.discount-item-row:hover { margin-left:-40px !important; margin-top:-40px !important; } + diff --git a/app/assets/stylesheets/origami/addorders.scss b/app/assets/stylesheets/origami/addorders.scss new file mode 100644 index 00000000..f45d06f3 --- /dev/null +++ b/app/assets/stylesheets/origami/addorders.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the origami/addorders controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/origami/addorders_controller.rb b/app/controllers/origami/addorders_controller.rb new file mode 100644 index 00000000..68a15c71 --- /dev/null +++ b/app/controllers/origami/addorders_controller.rb @@ -0,0 +1,21 @@ +class Origami::AddordersController < BaseOrigamiController + before_action :set_dining, only: [:show] + + def index + @tables = Table.all.active.order('zone_id asc').group("zone_id") + @rooms = Room.all.active.order('zone_id asc').group("zone_id") + @all_table = Table.all.active.order('status desc') + @all_room = Room.all.active.order('status desc') + end + + def show + @menu = MenuCategory.all + end + + private + + def set_dining + @dining = DiningFacility.find(params[:id]) + end + +end diff --git a/app/helpers/origami/addorders_helper.rb b/app/helpers/origami/addorders_helper.rb new file mode 100644 index 00000000..c90e5344 --- /dev/null +++ b/app/helpers/origami/addorders_helper.rb @@ -0,0 +1,2 @@ +module Origami::AddordersHelper +end diff --git a/app/views/origami/addorders/index.html.erb b/app/views/origami/addorders/index.html.erb new file mode 100644 index 00000000..50e52d3e --- /dev/null +++ b/app/views/origami/addorders/index.html.erb @@ -0,0 +1,108 @@ +
+
+ +
+ +
+ <% @tables.each do |zone| %> +

Zone : <%=zone.zone.name%>

+
+ + <% @all_table.each do |table| %> + <% if zone.zone_id == table.zone_id %> +
" data-id = "<%= table.id %>"> +
+ +

<%= table.name %>

+

Seat : <%= table.seater %>

+
+
+ <% end %> <% end %> +
+ <% end %> +
+ +
+ <% @rooms.each do |zone| %> +

Zone : <%=zone.zone.name%>

+
+ + <% @all_room.each do |room| %> + <% if zone.zone_id == room.zone_id %> +
" data-id = "<%= room.id %>"> +
+ +

<%= room.name %>

+

Seat : <%= room.seater %>

+
+
+ <% end %> <% end %> +
+ <% end %> +
+ +
+
+ +
+ +
+
+ + diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb new file mode 100644 index 00000000..1a2e7b8b --- /dev/null +++ b/app/views/origami/addorders/show.html.erb @@ -0,0 +1,30 @@ +
+
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+ + diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 8b613409..cb18971c 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -302,7 +302,7 @@ <% if @status_order == 'order' && @status_sale != 'sale' %> - + @@ -312,7 +312,7 @@ <% else %> - + @@ -555,4 +555,8 @@ function show_customer_details(customer_id){ } }); + + $('#add_order').on('click',function(){ + window.location.href = '/origami/addorders'; + }); diff --git a/config/routes.rb b/config/routes.rb index 2b7db5eb..b04bed33 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -156,6 +156,8 @@ Rails.application.routes.draw do 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 + + resources :addorders end #--------- Waiter/Ordering Station ------------# diff --git a/spec/controllers/origami/addorders_controller_spec.rb b/spec/controllers/origami/addorders_controller_spec.rb new file mode 100644 index 00000000..9e0643ad --- /dev/null +++ b/spec/controllers/origami/addorders_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Origami::AddordersController, type: :controller do + +end diff --git a/spec/helpers/origami/addorders_helper_spec.rb b/spec/helpers/origami/addorders_helper_spec.rb new file mode 100644 index 00000000..f9ea7bcf --- /dev/null +++ b/spec/helpers/origami/addorders_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the Origami::AddordersHelper. For example: +# +# describe Origami::AddordersHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe Origami::AddordersHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end From d99ed58d28b7f7f1a527e7ea2a7cb9c94f4627da Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Sun, 9 Jul 2017 21:00:33 +0630 Subject: [PATCH 02/71] update view --- app/views/origami/addorders/show.html.erb | 16 ++++++++++++++-- app/views/origami/home/show.html.erb | 4 +++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb index 1a2e7b8b..98055c46 100644 --- a/app/views/origami/addorders/show.html.erb +++ b/app/views/origami/addorders/show.html.erb @@ -4,7 +4,7 @@ -
- -
- +
+
+
ORDER DETAILS | Table 21
+ +
+
+ + +
+ + + + + + + + + + + + + + + + + +
#ItemsPrice
1aaaaa x2name
+
+ +
+
+ + From 83b8d726324be48f32807b36cf9d4371038ff7f1 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 26 Jul 2017 15:04:35 +0630 Subject: [PATCH 04/71] update add order --- .../api/restaurant/menu_categories.rb | 37 ---- .../api/restaurant/menu_controller.rb | 2 +- .../origami/addorders_controller.rb | 1 + app/views/origami/addorders/show.html.erb | 163 ++++++++++++------ app/views/origami/home/show.html.erb | 2 +- config/routes.rb | 2 +- 6 files changed, 111 insertions(+), 96 deletions(-) delete mode 100644 app/controllers/api/restaurant/menu_categories.rb diff --git a/app/controllers/api/restaurant/menu_categories.rb b/app/controllers/api/restaurant/menu_categories.rb deleted file mode 100644 index fe7983ea..00000000 --- a/app/controllers/api/restaurant/menu_categories.rb +++ /dev/null @@ -1,37 +0,0 @@ -class Api::Restaurant::MenuController < Api::ApiController - - #Description - # Pull the default menu details and also other available (active) menus - # Input Params - order_id - def index - @menus = Menu.all - @current_menu = Menu.current_menu - - end - - #Description - # This API show current order details - # Input Params - menu_id - def show - @menu = menu_detail(params[:id]) - end - - - private - def menu_detail (menu_id) - if (menu_id) - #Pull this menu - menu = Menu.find_by_id(menu_id) - return menu - else - Menu.current_menu - end - - end - - def menu_params() - params.permit(:id) - end - - -end diff --git a/app/controllers/api/restaurant/menu_controller.rb b/app/controllers/api/restaurant/menu_controller.rb index fe7983ea..169cc1fd 100644 --- a/app/controllers/api/restaurant/menu_controller.rb +++ b/app/controllers/api/restaurant/menu_controller.rb @@ -1,5 +1,5 @@ class Api::Restaurant::MenuController < Api::ApiController - + skip_before_action :authenticate #Description # Pull the default menu details and also other available (active) menus # Input Params - order_id diff --git a/app/controllers/origami/addorders_controller.rb b/app/controllers/origami/addorders_controller.rb index 68a15c71..e65b24b7 100644 --- a/app/controllers/origami/addorders_controller.rb +++ b/app/controllers/origami/addorders_controller.rb @@ -10,6 +10,7 @@ class Origami::AddordersController < BaseOrigamiController def show @menu = MenuCategory.all + @table_id = params[:id] end private diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb index c4f51c1e..049ba371 100644 --- a/app/views/origami/addorders/show.html.erb +++ b/app/views/origami/addorders/show.html.erb @@ -1,65 +1,42 @@
-
-
+
+
-
+
-
ORDER DETAILS | Table 21
+
ORDER DETAILS | Table <%=@table_id%>
- - -
+
@@ -90,21 +67,95 @@ - + + diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 92b37cf9..8281a16e 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -579,6 +579,6 @@ function show_customer_details(customer_id){ $('#add_order').on('click',function(){ var dining_id = "<%= @dining.id %>" - window.location.href = '/origami/addorders/'+dining_id; + window.location.href = '/origami/addorders/'+ dining_id; }); diff --git a/config/routes.rb b/config/routes.rb index e4723a22..310ae0f0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -30,7 +30,7 @@ Rails.application.routes.draw do namespace :restaurant do get 'zones' => "zones#index" resources :menu, only:[:index, :show] - resources :menu_categories, only: [:index] + resources :menu_categories, only: [:index, :show] resources :menu_items, only: [:index, :show] resources :menu_item_attributes, only: [:index] resources :menu_item_options, only: [:index] From 50a878349d19b512de9dc5efd53997d4f99ca659 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 26 Jul 2017 15:08:44 +0630 Subject: [PATCH 05/71] update add order --- app/assets/images/logo.png | Bin 0 -> 9424 bytes .../restaurant/menu_categories_controller.rb | 39 ++++++++++++++++ .../menu_categories/show.json.jbuilder | 43 ++++++++++++++++++ app/views/origami/addorders/show.html.erb | 4 +- public/image/logo.png | Bin 0 -> 9424 bytes 5 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 app/assets/images/logo.png create mode 100644 app/controllers/api/restaurant/menu_categories_controller.rb create mode 100644 app/views/api/restaurant/menu_categories/show.json.jbuilder create mode 100644 public/image/logo.png diff --git a/app/assets/images/logo.png b/app/assets/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..578d16f7b25ca4b60a4db70950c07c23d96c3ce3 GIT binary patch literal 9424 zcmV;>Brn^EP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb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DC14IA06|H-TX@Y50(ilnNpN{KxQT2-p4E#$bUD= ze=qi3d%NU_Yvp1W()3;qTXj1nLoXFMi<7dlVmRB3W%hBI*1cBqR+ znN?d&%Cf#KLn$XoTmQ4bf8>d)$9(_)zEAvAQTo7s&v!{leT(#4E|%8ZdO6YWNEhIH za{dz1|L~6OxL1PZ87Gy%CAx27ekK*n&Ay301^2kUexCyrB#v0l5xqk?Qs0zfWu?!Y zUU@j+59D&3JgI?(SoHMHfz&NB19+8OdD|pc_!rwoX+?VRu-BzCd~%*MtobJ04+yyD zfn6*a^y|`WUoGe9d|%AVJK4eej=T3*OT2`Tq8lO#Sajebg%3KUBb?^Q^z$<%do@I^E|SEt592pDvXwza{VQ6|(JD z1;ovX(yM;B$O^w&{=OUcZI{3oHCK5n<>0NzKbgT zqhdQ?=g1Wrk^p!M?i=!bJahYfa#9O@N~2EtA`NmOJwoA6{KX}AG|G9pAK(6w{~G|X W;#|`CF$kdm0000 1 then + + json.item_instances item.menu_item_instances do |is| + json.item_instance_item_code = is.item_instance_code + json.item_instance_name = is.item_instance_name + json.price = is.price + json.is_available = is.is_available + json.is_on_promotion = is.is_on_promotion + json.promotion_price = is.promotion_price + json.item_attributes = is.item_attributes + end + + end + #Child Menu items + if (item.children) then + json.set_items item.children.each do |item| + json.partial! 'api/restaurant/menu/menu_item', item: item + end + + end + end +end diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb index 049ba371..952836d1 100644 --- a/app/views/origami/addorders/show.html.erb +++ b/app/views/origami/addorders/show.html.erb @@ -81,6 +81,7 @@ $(function(){ }); //End Booking Click function show_details(url_item){ + alert(url_item) //Start Ajax $.ajax({ type: "GET", @@ -109,9 +110,8 @@ function show_details(url_item){ +''; - + $(".menu_items_list").append(row); } - $(".menu_items_list").html(row); } }); //end Ajax diff --git a/public/image/logo.png b/public/image/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..578d16f7b25ca4b60a4db70950c07c23d96c3ce3 GIT binary patch liter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;ovX(yM;B$O^w&{=OUcZI{3oHCK5n<>0NzKbgT zqhdQ?=g1Wrk^p!M?i=!bJahYfa#9O@N~2EtA`NmOJwoA6{KX}AG|G9pAK(6w{~G|X W;#|`CF$kdm0000 Date: Wed, 26 Jul 2017 18:26:55 +0630 Subject: [PATCH 06/71] update add order view --- app/views/origami/addorders/show.html.erb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb index 952836d1..8fdf0c32 100644 --- a/app/views/origami/addorders/show.html.erb +++ b/app/views/origami/addorders/show.html.erb @@ -81,7 +81,9 @@ $(function(){ }); //End Booking Click function show_details(url_item){ - alert(url_item) + var menu_list = $('.menu_items_list'); + // menu_list.empty(); + // var row = ''; //Start Ajax $.ajax({ type: "GET", @@ -89,29 +91,32 @@ function show_details(url_item){ data: {}, dataType: "json", success: function(data) { - + menu_items = data.menu_items; for(var field in menu_items) { if (menu_items[field].item_instances){ - var price = parseFloat(menu_items[field].item_instances[0].price).toFixed(2); + console.log(menu_items[field].item_instances.price); + var price = parseFloat(menu_items[field].item_instances[0]).toFixed(2); }else{ var price = parseFloat(menu_items[field].price).toFixed(2); } - row = '
' +'
' +''+ menu_items[field].name +'' +'
' + +'
' +'<%= image_tag "logo.png" ,width: '75', height: '75', :style => '' %>' +'
' + +''; - $(".menu_items_list").append(row); + $('.menu_items_list').append(row); } + } }); //end Ajax From be0af338a891d907955d3ff072a7c22955b55178 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 27 Jul 2017 15:13:13 +0630 Subject: [PATCH 07/71] update add oresr --- app/views/origami/addorders/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb index 8fdf0c32..07103225 100644 --- a/app/views/origami/addorders/show.html.erb +++ b/app/views/origami/addorders/show.html.erb @@ -112,7 +112,7 @@ function show_details(url_item){ +'
' +''; $('.menu_items_list').append(row); } From 9b678b8523576cb9c7c9708c56cf6a5bbcec9124 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 27 Jul 2017 16:40:35 +0630 Subject: [PATCH 08/71] update add order menu category api --- .../menu_categories/show.json.jbuilder | 24 ++++++++--------- app/views/origami/addorders/show.html.erb | 27 ++++++++----------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/app/views/api/restaurant/menu_categories/show.json.jbuilder b/app/views/api/restaurant/menu_categories/show.json.jbuilder index c175be67..d7a6d581 100644 --- a/app/views/api/restaurant/menu_categories/show.json.jbuilder +++ b/app/views/api/restaurant/menu_categories/show.json.jbuilder @@ -13,22 +13,22 @@ if @menu.menu_items if item.menu_item_instances.count == 1 then item_instance = item.menu_item_instances[0] - json.price = item_instance.price - json.is_available = item_instance.is_available - json.is_on_promotion = item_instance.is_on_promotion - json.promotion_price = item_instance.promotion_price - json.item_attributes = item_instance.item_attributes + json.price item_instance.price + json.is_available item_instance.is_available + json.is_on_promotion item_instance.is_on_promotion + json.promotion_price item_instance.promotion_price + json.item_attributes item_instance.item_attributes elsif item.menu_item_instances.count > 1 then json.item_instances item.menu_item_instances do |is| - json.item_instance_item_code = is.item_instance_code - json.item_instance_name = is.item_instance_name - json.price = is.price - json.is_available = is.is_available - json.is_on_promotion = is.is_on_promotion - json.promotion_price = is.promotion_price - json.item_attributes = is.item_attributes + json.item_instance_item_code is.item_instance_code + json.item_instance_name is.item_instance_name + json.price is.price + json.is_available is.is_available + json.is_on_promotion is.is_on_promotion + json.promotion_price is.promotion_price + json.item_attributes is.item_attributes end end diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb index 07103225..3dff858e 100644 --- a/app/views/origami/addorders/show.html.erb +++ b/app/views/origami/addorders/show.html.erb @@ -15,18 +15,7 @@
@@ -96,14 +85,14 @@ function show_details(url_item){ for(var field in menu_items) { if (menu_items[field].item_instances){ - console.log(menu_items[field].item_instances.price); - var price = parseFloat(menu_items[field].item_instances[0]).toFixed(2); + console.log(menu_items[field].item_instances[0]); + var price = parseFloat(menu_items[field].item_instances[0].price).toFixed(2); }else{ var price = parseFloat(menu_items[field].price).toFixed(2); } row = '
' - +'
' + +'
' +''+ menu_items[field].name +'' +'
' @@ -112,7 +101,7 @@ function show_details(url_item){ +'
' +''; $('.menu_items_list').append(row); } @@ -127,6 +116,12 @@ function show_details(url_item){ + From 13359cecba5c8706a6b444369ef1bd85708beefe Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 9 Aug 2017 13:57:52 +0630 Subject: [PATCH 14/71] update void for bitp --- app/controllers/origami/void_controller.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/origami/void_controller.rb b/app/controllers/origami/void_controller.rb index 73f89d13..1cf1ec65 100644 --- a/app/controllers/origami/void_controller.rb +++ b/app/controllers/origami/void_controller.rb @@ -6,18 +6,19 @@ class Origami::VoidController < BaseOrigamiController if Sale.exists?(sale_id) sale = Sale.find_by_sale_id(sale_id) - sale.payment_status = 'void' - sale.sale_status = 'void' - sale.save - + # update count for shift sale - if(sale.sale_status == "void") + if(sale.sale_status == "completed") if sale.shift_sale_id != nil shift = ShiftSale.find(sale.shift_sale_id) shift.calculate(sale_id, "void") end end + sale.payment_status = 'void' + sale.sale_status = 'void' + sale.save + bookings = sale.bookings bookings.each do |booking| orders = booking.orders From 0fc2fb1d9829fe5a7d7300baf218426ccac7db43 Mon Sep 17 00:00:00 2001 From: Yan Date: Wed, 9 Aug 2017 15:32:33 +0630 Subject: [PATCH 15/71] calc tax by user taxes --- app/models/sale.rb | 120 ++++++++++++++++++++++----------------------- db/seeds.rb | 5 +- 2 files changed, 62 insertions(+), 63 deletions(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index 9fe8ad8f..672df8d1 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -273,28 +273,33 @@ class Sale < ApplicationRecord total_tax_amount = 0 #tax_profile - list by order_by tax_profiles = TaxProfile.all.order("order_by asc") + customer = Customer.find(sale.customer_id) # #Creat new tax records tax_profiles.each do |tax| - sale_tax = SaleTax.new(:sale => sale) - sale_tax.tax_name = tax.name - sale_tax.tax_rate = tax.rate + customer.tax_profiles.each do |cus_tax| + if cus_tax == tax.id + sale_tax = SaleTax.new(:sale => sale) + sale_tax.tax_name = tax.name + sale_tax.tax_rate = tax.rate - # substract , to give after discount - total_tax = total_taxable - total_discount - #include or execulive - if tax.inclusive - sale_tax.tax_payable_amount = total_tax / 21 - else - sale_tax.tax_payable_amount = total_tax * tax.rate / 100 + # substract , to give after discount + total_tax = total_taxable - total_discount + #include or execulive + if tax.inclusive + sale_tax.tax_payable_amount = total_tax / 21 + else + sale_tax.tax_payable_amount = total_tax * tax.rate / 100 + end + #new taxable amount is standard rule for step by step + # total_taxable = total_taxable + sale_tax.tax_payable_amount + + sale_tax.inclusive = tax.inclusive + sale_tax.save + + total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount + end end - #new taxable amount is standard rule for step by step - # total_taxable = total_taxable + sale_tax.tax_payable_amount - - sale_tax.inclusive = tax.inclusive - sale_tax.save - - total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount end sale.total_tax = total_tax_amount @@ -312,32 +317,35 @@ class Sale < ApplicationRecord #tax_profile - list by order_by tax_profiles = TaxProfile.all.order("order_by asc") - # #Creat new tax records + customer = Customer.find(self.customer_id) + # #Create new tax records tax_profiles.each do |tax| - sale_tax = SaleTax.new(:sale => self) - sale_tax.tax_name = tax.name - sale_tax.tax_rate = tax.rate + customer.tax_profiles.each do |cus_tax| + if cus_tax == tax.id + sale_tax = SaleTax.new(:sale => self) + sale_tax.tax_name = tax.name + sale_tax.tax_rate = tax.rate - # substract , to give after discount - total_tax = total_taxable - self.total_discount - #include or execulive - if tax.inclusive - sale_tax.tax_payable_amount = total_tax / 21 - else - sale_tax.tax_payable_amount = total_tax * tax.rate / 100 + # substract , to give after discount + total_tax = total_taxable - self.total_discount + #include or execulive + if tax.inclusive + sale_tax.tax_payable_amount = total_tax / 21 + else + sale_tax.tax_payable_amount = total_tax * tax.rate / 100 + end + + #new taxable amount is standard rule for step by step + # total_taxable = total_taxable + sale_tax.tax_payable_amount + + sale_tax.inclusive = tax.inclusive + sale_tax.save + + total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount + end end - - #new taxable amount is standard rule for step by step - # total_taxable = total_taxable + sale_tax.tax_payable_amount - - sale_tax.inclusive = tax.inclusive - sale_tax.save - - total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount end - self.total_tax = total_tax_amount - end def product_get_unit_price(item_code) @@ -382,7 +390,6 @@ class Sale < ApplicationRecord end def self.search(filter,from,to) - if filter.blank? keyword = '' else @@ -399,7 +406,6 @@ class Sale < ApplicationRecord end def self.search_credit_sales(customer,filter,from,to) - if filter.blank? keyword = '' else @@ -518,31 +524,25 @@ class Sale < ApplicationRecord end def self.get_by_range_by_saleitems(from,to,status,report_type) + query = Sale.select(" + mi.item_code as code,(SUM(i.qty) * i.unit_price) as grand_total, + SUM(i.qty) as total_item," + + " i.unit_price as unit_price, + mi.name as product_name, + mc.name as menu_category_name, + mc.id as menu_category_id ") + .group('mi.id') + .order("mi.menu_category_id") - query = Sale.select(" - mi.item_code as code,(SUM(i.qty) * i.unit_price) as grand_total, - SUM(i.qty) as total_item," + - " i.unit_price as unit_price, - mi.name as product_name, - mc.name as menu_category_name, - mc.id as menu_category_id ") - .group('mi.id') - .order("mi.menu_category_id") - - query = query.joins("JOIN sale_items i ON i.sale_id = sales.sale_id - JOIN menu_items mi ON i.product_code = mi.item_code" + - " JOIN menu_categories mc ON mc.id = mi.menu_category_id - JOIN employees ea ON ea.id = sales.cashier_id") - - - query = query.where("(receipt_date between ? and ? and sale_status=?) AND i.unit_price <> 0",from,to,status) - - + query = query.joins("JOIN sale_items i ON i.sale_id = sales.sale_id + JOIN menu_items mi ON i.product_code = mi.item_code" + + " JOIN menu_categories mc ON mc.id = mi.menu_category_id + JOIN employees ea ON ea.id = sales.cashier_id") + query = query.where("(receipt_date between ? and ? and sale_status=?) AND i.unit_price <> 0",from,to,status) end - def self.get_by_shiftsales(from,to,shift) if !shift.blank? ShiftSale.where("id =?",shift.id) diff --git a/db/seeds.rb b/db/seeds.rb index 1b63bcb0..1b024797 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -99,9 +99,8 @@ customer_type = Lookup.create([{lookup_type:'customer_type', name: 'Dinein', val {lookup_type:'customer_type', name: 'Delivery', value: 'Delivery'}]) #WALK CUSTOMER - Default CUSTOMER (take key 1) -customer = Customer.create({name:"WALK-IN", email: "cus1@customer.com", contact_no:"000000000",card_no:"000"}) -customer2 = Customer.create({name:"TAKEAWAY", email: "cus2@customer.com", contact_no:"111111111",card_no:"111"}) - +customer = Customer.create({name:"WALK-IN", email: "cus1@customer.com", contact_no:"000000000",card_no:"000", customer_type:"Dinein", tax_profiles:"[2,1]"}) +customer2 = Customer.create({name:"TAKEAWAY", email: "cus2@customer.com", contact_no:"111111111",card_no:"111", customer_type:"Takeaway", tax_profiles:"[1]"}) #Default ZOne # zone = Zone.create({id:1, name: "Normal Zone", is_active:true, created_by: "SYSTEM DEFAULT"}) From 2794103e52b45986b5706010751e3f229a270b67 Mon Sep 17 00:00:00 2001 From: Yan Date: Wed, 9 Aug 2017 17:54:22 +0630 Subject: [PATCH 16/71] update customer tax calc --- .../origami/customers_controller.rb | 4 +- app/models/sale.rb | 7 ++- app/views/crm/customers/_new_form.html.erb | 23 ++++---- app/views/origami/customers/index.html.erb | 57 +++++++++++++------ 4 files changed, 57 insertions(+), 34 deletions(-) diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index 026e59e3..ec826416 100644 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -37,14 +37,14 @@ class Origami::CustomersController < BaseOrigamiController @crm_customers = Customer.order("customer_id").page(params[:page]) #@products = Product.order("name").page(params[:page]).per(5) else - @crm_customers = Customer.search(filter) - + @crm_customers = Customer.search(filter) end #@crm_customers = Customer.all @crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(50) @crm_customer = Customer.new @count_customer = Customer.count_customer + @taxes = TaxProfile.all.order("order_by asc") # if flash["errors"] # @crm_customer.valid? # end diff --git a/app/models/sale.rb b/app/models/sale.rb index 712584a5..b252fdf1 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -277,8 +277,8 @@ class Sale < ApplicationRecord # #Creat new tax records tax_profiles.each do |tax| - customer.tax_profiles.each do |cus_tax| - if cus_tax == tax.id + customer.tax_profiles.each do |cus_tax| + if cus_tax.to_i == tax.id sale_tax = SaleTax.new(:sale => sale) sale_tax.tax_name = tax.name sale_tax.tax_rate = tax.rate @@ -318,10 +318,11 @@ class Sale < ApplicationRecord tax_profiles = TaxProfile.all.order("order_by asc") customer = Customer.find(self.customer_id) + # #Create new tax records tax_profiles.each do |tax| customer.tax_profiles.each do |cus_tax| - if cus_tax == tax.id + if cus_tax.to_i == tax.id sale_tax = SaleTax.new(:sale => self) sale_tax.tax_name = tax.name sale_tax.tax_rate = tax.rate diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb index 5f1d1b46..35c3a46d 100644 --- a/app/views/crm/customers/_new_form.html.erb +++ b/app/views/crm/customers/_new_form.html.erb @@ -82,17 +82,7 @@
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%> -
- -
"> - <%= f.input :card_no, :class => "form-control col-md-6 card_no"%> - <% flash.each do |name, msg| %> - <% str="[\"#{msg['card_no']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end %> -
+
@@ -103,10 +93,21 @@ <%end %>
+
<%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %>
+
"> + <%= f.input :card_no, :class => "form-control col-md-6 card_no"%> + <% flash.each do |name, msg| %> + <% str="[\"#{msg['card_no']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end %> +
+
diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index 3c22c2e4..c41e3cd6 100644 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -81,23 +81,7 @@ <%= f.error_notification %> - <%= f.hidden_field :id, :class => "form-control col-md-6 " %> -
"> - <%= f.input :card_no, :class => "form-control col-md-6 card_no"%> - <% flash.each do |name, msg| %> - <% str="[\"#{msg['name']}\"]" - str.gsub!('["', '') - str.gsub!('"]', '') %> - <%= str %> - <% end -%> -
-
- -
- -
-
-
+ <%= f.hidden_field :id, :class => "form-control col-md-6 " %>

@@ -176,6 +160,37 @@ <%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
+
+ + +
+ +
+ <%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %> +
+ +
"> + <%= f.input :card_no, :class => "form-control col-md-6 card_no"%> + <% flash.each do |name, msg| %> + <% str="[\"#{msg['name']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end -%> +
+
+ +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Cashier Cashier Terminal Opening Date Opening float Received Amount Cast In Cast Out Total Receipt Dining Count Takeaway Count Total Void
<%= @shift.employee.name%><%=@shift.cashier_terminal.name%><%= @shift.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') %> + <%=@shift.opening_balance %><%=@shift.closing_balance %><%=@shift.cash_in %><%=@shift.cash_out %><%= @shift.total_receipt %><%= @shift.dining_count %><%= @shift.takeaway_count %>(<%= @shift.total_void.round(2) %>)
+ + <% @total_amount_by_account.each do |amount| %> + + + + + + <%end%> + + + + + + + <% @total_discount_by_account.each do |amount| %> + + + + + + <%end%> + + + + + + + <% @sale_taxes.each do |tax| %> + + + + + + <%end%> + + + + + + + + + + + + + + + +
Total <%= amount.account_name %> Amount<%= amount.total_price.round(2) %>
Net Sales<%=@shift.nett_sales %>
Total <%= amount.account_name %> Discount<%= amount.total_price.round(2) %>
Overall Discount Amount<%= @shift.total_discounts %>
<%= tax.tax_name %> <%= tax.st_amount.round(2) %>
Total Tax <%=@shift.total_taxes %>
Rounding Adj <%= @shift.total_rounding.round(2) %>
Grand Total <%= @shift.grand_total.round(2) %>
+
+ + + + + + + + + + + + <% @total_amount = 0 + @other_payment.each do |other| %> + + + + + + + + + + <% @total_amount = @total_amount+other.mpu_amount %> + + + + + + <% @total_amount = @total_amount+other.visa_amount %> + + + + + + <% @total_amount = @total_amount+other.master_amount %> + + + + + + <% @total_amount = @total_amount+other.jcb_amount %> + + + + + + <% @total_amount = @total_amount+other.paypar_amount %> + + <%end%> + + + + + + + + + + + + +
Cash Payment <%=@shift.cash_sales %>
Credit Payment <%=@shift.credit_sales %>
Other Payment Detail
MPU Payment <%=other.mpu_amount.round(2) %>
VISA Payment <%=other.visa_amount.round(2) %>
JCB Payment <%=other.master_amount.round(2) %>
Master Payment <%=other.jcb_amount.round(2) %>
Reedem Payment <%=other.paypar_amount.round(2) %>
Total Other Payment <%=@shift.other_sales %>
Total Payment <%= @total_amount+@shift.cash_sales+@shift.credit_sales %>
+
+
+ +
+


+ + +
+
+ + \ No newline at end of file diff --git a/db/migrate/20170530072247_create_shops.rb b/db/migrate/20170530072247_create_shops.rb index 72d8b882..27b2305e 100644 --- a/db/migrate/20170530072247_create_shops.rb +++ b/db/migrate/20170530072247_create_shops.rb @@ -19,6 +19,7 @@ class CreateShops < ActiveRecord::Migration[5.1] t.string :owner_token t.string :id_prefix, :null => false, :limit => 3 t.boolean :is_rounding_adj, :default => false + t.boolean :quick_sale_summary, :default => false t.timestamps end diff --git a/db/seeds.rb b/db/seeds.rb index 1b63bcb0..328c9e54 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -99,8 +99,8 @@ customer_type = Lookup.create([{lookup_type:'customer_type', name: 'Dinein', val {lookup_type:'customer_type', name: 'Delivery', value: 'Delivery'}]) #WALK CUSTOMER - Default CUSTOMER (take key 1) -customer = Customer.create({name:"WALK-IN", email: "cus1@customer.com", contact_no:"000000000",card_no:"000"}) -customer2 = Customer.create({name:"TAKEAWAY", email: "cus2@customer.com", contact_no:"111111111",card_no:"111"}) +customer = Customer.create({name:"WALK-IN", email: "cus1@customer.com", contact_no:"000000000",card_no:"000",customer_type:"Dinein"}) +customer2 = Customer.create({name:"TAKEAWAY", email: "cus2@customer.com", contact_no:"111111111",card_no:"111",customer_type:"Takeaway"}) #Default ZOne @@ -149,7 +149,7 @@ menu_item_attribute_size_medium = MenuItemAttribute.create({attribute_type:"size menu_item_attribute_size_large = MenuItemAttribute.create({attribute_type:"size", name: "Large", value: "large"}) shop = Shop.create({id:1, name: "OSAKA OHSHO(Tamwe)", address:'No. 256, Kyaikkasan Road, Tamwe Township, Yangon', township:"Tamwe",state:"Yangon",city:"Yangon", country:"Myanmar", phone_no:"Tel: 09-258676611",reservation_no:"111",license:"123", -activated_at:"2017-06-26 08:36:24",license_data:"test",base_currency:"111",id_prefix:"111",is_rounding_adj:"0"}) +activated_at:"2017-06-26 08:36:24",license_data:"test",base_currency:"111",id_prefix:"111",is_rounding_adj:"0",quick_sale_summary:"0"}) #Default Order Queue stations # order_queue_station1 = OrderQueueStation.create({station_name: "Queue Station 1", is_active: true,printer_name: "kitchen_printer", 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: "Queue Station 2", is_active: true,printer_name: "drink_printer", processing_items: JSON.generate(['02005','02006','02007','02008']), print_copy:true, cut_per_item: true, use_alternate_name: true, created_by: "SYSTEM DEFAULT"}) From 321c65d70baf65ed674d288248cb9b9d6e74c28c Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 10 Aug 2017 13:37:31 +0630 Subject: [PATCH 18/71] update view --- app/views/origami/home/index.html.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb index 35aa4230..cdb76bd0 100644 --- a/app/views/origami/home/index.html.erb +++ b/app/views/origami/home/index.html.erb @@ -108,8 +108,11 @@ - + <%if current_login_employee.role == "cashier" %> + + <%end%> + <%if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %> + +
+
+ <% + end + end + end + %> + + +
+
+ + <% end %> + +
+ + + +
+
+
+
ORDER DETAILS - Table
+
+
+
+ + + + + + + + + + + + + + + + + +
Order ByOrder At + Customer +
Table/Room
+
+
+ + + + + + + + + + +
ItemsQTY
+
+ +
+
+
+ + +
+ + + Back + + +
+ + diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 71077ec4..ed27aa13 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -1,29 +1,25 @@
-
@@ -193,4 +144,82 @@
+ diff --git a/config/routes.rb b/config/routes.rb index 0753b64b..599ec8c8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -198,6 +198,8 @@ Rails.application.routes.draw do # Pass assigned_order_item_id get 'print/print/:id', to: "print#print" get 'print/print_order_summary/:id', to: "print#print_order_summary" + + get "/get_items/:id" =>"home#get_items_by_oqs", :as => "get_order_items_by_oqs" #dashboard # end From a368c4b0b690063452a16604a7bdbc78cab04a05 Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 10 Aug 2017 18:25:10 +0630 Subject: [PATCH 29/71] date convert oqs --- app/views/oqs/home/index.html.erb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 857d9cb7..02e5837f 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -77,13 +77,11 @@ - -
- - - -
- + +
+ +
+ @@ -175,7 +173,7 @@ function show_details(url){ options = data.options; } - var date = data[field]["created_at"]; + var date = new Date(data[field]["created_at"] + " UTC"); row ='
' +'
' @@ -194,7 +192,7 @@ function show_details(url){ +'

' +'Order at' - +''+ date +' - ' + +''+ date.toLocalString() +' - ' +''+ data[field]["item_order_by"] +' ' +' ' From d32fbf18e097d57875f586df57d7f95d175fd4ef Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 10 Aug 2017 18:45:59 +0630 Subject: [PATCH 30/71] update oqs --- app/views/oqs/home/index.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 02e5837f..ad683d40 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -173,7 +173,8 @@ function show_details(url){ options = data.options; } - var date = new Date(data[field]["created_at"] + " UTC"); + var date = new Date(data[field]["created_at"]); + var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes(); row ='

' +'
' @@ -192,7 +193,7 @@ function show_details(url){ +'

' +'Order at' - +''+ date.toLocalString() +' - ' + +''+ show_date +' - ' +''+ data[field]["item_order_by"] +' ' +' ' From 5ffb715bd1c9ede50ad2acb81c4a972112cf53c2 Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 10 Aug 2017 18:47:29 +0630 Subject: [PATCH 31/71] add menu_item_set --- db/migrate/20170810121704_menu_item_set.rb | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 db/migrate/20170810121704_menu_item_set.rb diff --git a/db/migrate/20170810121704_menu_item_set.rb b/db/migrate/20170810121704_menu_item_set.rb new file mode 100644 index 00000000..5ab5a546 --- /dev/null +++ b/db/migrate/20170810121704_menu_item_set.rb @@ -0,0 +1,4 @@ +class MenuItemSet < ActiveRecord::Migration[5.1] + def change + end +end From 9eaf04778c0a305f2ba194c52fd1b0b7f3ce1ce4 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 11 Aug 2017 10:25:09 +0630 Subject: [PATCH 32/71] update oqs --- app/assets/javascripts/OQS.js | 86 +++++++++++++++++++++++++++++-- app/views/oqs/home/index.html.erb | 78 ---------------------------- 2 files changed, 82 insertions(+), 82 deletions(-) diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index d77a3a6a..54e73fe1 100644 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -24,6 +24,81 @@ $(document).ready(function(){ // window.location.reload(1); // }, 10000); + $(".oqs_click").on("click", function(){ + + var oqs_id = $(this).find(".oqs-id").text(); + var url = 'oqs/get_items/'+oqs_id; + show_details(url); + + }); //End Click + + function show_details(url){ + var oqs_append = $('.oqs_append'); + oqs_append.empty(); + + //Start Ajax + $.ajax({ + type: "GET", + url: url, + data: {}, + dataType: "json", + success: function(data) { + for(var field in data) { + var price = parseFloat(data[field].price).toFixed(2); + + if (data[field]["options"] == "[]") { + var options = ""; + }else{ + var options = data.options; + } + + var date = data[field]["created_at"]; + + row ='

' + +'
' + +'

' + +''+data[field]["zone"]+'- ' + +''+ data[field]["zone"] +'' + +''+ data[field]["order_id"] +'- ' + +'

' + + +'

' + +''+ data[field]["item_name"] +'- ' + +''+ data[field]["qty"] +'- ' + +'

' + + +'

'+ options +'

' + + +'

' + +'Order at' + +''+ date +' - ' + + +''+ data[field]["item_order_by"] +' ' + +' ' + +'

' + + +' ' + +' ' + +'
' + + +'' + + +'
'; + + + + $('.oqs_append').append(row); + } + + } + }); + //end Ajax + + } + $(document).on('click', '.queue_station', function(event){ var orderZone=$(this).children().children().children('.order-zone').text().trim(); // var orderItem=$(this).children().children().children('.order-item').text(); @@ -41,7 +116,6 @@ $(document).ready(function(){ $('#order-from').text(orderZone); // clear order items $("#oqs-order-details-table").children("tbody").empty(); - // Call get_order_items() for Order Items by dining $.ajax({ type: 'GET', @@ -76,7 +150,7 @@ $(document).ready(function(){ // complete for queue item - $(document).on('click', '.order-complete', function(event){ + $(document).on('click', '.order-complete', function(event){ //e.preventDefault(); var _self = $(this); // To know in ajax return var assigned_item_id=$(this).attr('id').substr(15); @@ -118,10 +192,13 @@ $(document).ready(function(){ }); // Print Order Item - $('#print_order_item').on('click',function(){ + $(document).on('click', '#print_order_item', function(event){ var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text(); var options = $('.selected-item').children('.card-block').find('.item-options').text(); var params = { 'options':options }; + console.log(assigned_item_id); + console.log(options); + console.log(params); $.ajax({ type: 'GET', url: '/oqs/print/print/'+assigned_item_id, @@ -130,7 +207,8 @@ $(document).ready(function(){ }); // Print Order Summary - $('#print_order_summary').on('click',function(){ + // $('#print_order_summary').on('click',function(){ + $(document).on('click', '#print_order_summary', function(event){ var table_name=$('.selected-item').children().children().children('.order-zone').text().trim(); var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text(); var params = { 'table_name':table_name }; diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 857d9cb7..5642e4f7 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -144,82 +144,4 @@
- From 2000eb2d6c054a47db5acb57e2d49de557285134 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 11 Aug 2017 11:27:53 +0630 Subject: [PATCH 33/71] add pivot table for menu --- db/migrate/20170810121704_menu_item_set.rb | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 db/migrate/20170810121704_menu_item_set.rb diff --git a/db/migrate/20170810121704_menu_item_set.rb b/db/migrate/20170810121704_menu_item_set.rb deleted file mode 100644 index 5ab5a546..00000000 --- a/db/migrate/20170810121704_menu_item_set.rb +++ /dev/null @@ -1,4 +0,0 @@ -class MenuItemSet < ActiveRecord::Migration[5.1] - def change - end -end From b0f2bbe899efef62a875ee77d63c07389be7f6f0 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 11 Aug 2017 11:28:13 +0630 Subject: [PATCH 34/71] add pivot table for menu --- db/migrate/20170810121704_create_item_sets.rb | 9 +++++++++ .../20170811121704_create_menu_instance_item_sets.rb | 8 ++++++++ db/migrate/20170811121704_create_menu_item_sets.rb | 8 ++++++++ 3 files changed, 25 insertions(+) create mode 100644 db/migrate/20170810121704_create_item_sets.rb create mode 100644 db/migrate/20170811121704_create_menu_instance_item_sets.rb create mode 100644 db/migrate/20170811121704_create_menu_item_sets.rb diff --git a/db/migrate/20170810121704_create_item_sets.rb b/db/migrate/20170810121704_create_item_sets.rb new file mode 100644 index 00000000..da7fc570 --- /dev/null +++ b/db/migrate/20170810121704_create_item_sets.rb @@ -0,0 +1,9 @@ +class CreateItemSets < ActiveRecord::Migration[5.1] + def change + create_table :item_sets do |t| + t.string :name, :null => false + t.integer :min_selectable_qty + t.integer :max_selectable_qty + t.timestamps + end +end diff --git a/db/migrate/20170811121704_create_menu_instance_item_sets.rb b/db/migrate/20170811121704_create_menu_instance_item_sets.rb new file mode 100644 index 00000000..1712065b --- /dev/null +++ b/db/migrate/20170811121704_create_menu_instance_item_sets.rb @@ -0,0 +1,8 @@ +class CreateMenuInstanceItemSets < ActiveRecord::Migration[5.1] + def change + create_table :menu_instance_item_sets do |t| + t.references :item_set_id, foreign_key: true + t.references :menu_item_instance_id, foreign_key: true + t.timestamps + end +end diff --git a/db/migrate/20170811121704_create_menu_item_sets.rb b/db/migrate/20170811121704_create_menu_item_sets.rb new file mode 100644 index 00000000..1cacad00 --- /dev/null +++ b/db/migrate/20170811121704_create_menu_item_sets.rb @@ -0,0 +1,8 @@ +class CreateMenuItemSets < ActiveRecord::Migration[5.1] + def change + create_table :menu_item_sets do |t| + t.references :item_set_id, foreign_key: true + t.references :menu_item_id, foreign_key: true + t.timestamps + end +end From 0e93eb37651c9d5741db1274a968ec98605c7df5 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 11 Aug 2017 12:13:30 +0630 Subject: [PATCH 35/71] fix for customer tax ui and calc tax after bind customer --- app/controllers/origami/customers_controller.rb | 2 ++ app/models/sale.rb | 14 ++++++++++---- app/views/crm/customers/index.html.erb | 6 ++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index ec826416..9c054378 100644 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -89,6 +89,8 @@ class Origami::CustomersController < BaseOrigamiController if status == true render json: JSON.generate({:status => true}) + # Re-calc All Amount in Sale + sale.compute_by_sale_items(sale.sale_id, sale.sale_items, sale.total_discount) else render json: JSON.generate({:status => false, :error_message => "Record not found"}) end diff --git a/app/models/sale.rb b/app/models/sale.rb index 9f4ae9f7..7a4a7a62 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -274,11 +274,14 @@ class Sale < ApplicationRecord #tax_profile - list by order_by tax_profiles = TaxProfile.all.order("order_by asc") customer = Customer.find(sale.customer_id) - +puts customer.tax_profiles # #Creat new tax records tax_profiles.each do |tax| - customer.tax_profiles.each do |cus_tax| - if cus_tax.to_i == tax.id + customer.tax_profiles.each do |cus_tax| +puts tax +puts cus_tax + if cus_tax.to_i == tax.id +puts "WALSS" sale_tax = SaleTax.new(:sale => sale) sale_tax.tax_name = tax.name sale_tax.tax_rate = tax.rate @@ -319,11 +322,14 @@ class Sale < ApplicationRecord tax_profiles = TaxProfile.all.order("order_by asc") customer = Customer.find(self.customer_id) - +puts customer.tax_profiles # #Create new tax records tax_profiles.each do |tax| customer.tax_profiles.each do |cus_tax| +puts tax +puts cus_tax if cus_tax.to_i == tax.id +puts "WALSS" sale_tax = SaleTax.new(:sale => self) sale_tax.tax_name = tax.name sale_tax.tax_rate = tax.rate diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index 34aaf51e..14e38822 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -124,18 +124,20 @@ $(document).on('click',".customer_tr",function(){ var url = "customers/" + customer_id + "/edit"; } + $("#customer_tax_profiles").children().removeAttr("selected").css({'color':'#000','background':'none'});; + $.ajax({ type: "GET", url: url, data: {}, dataType: "json", - success: function(data) { + success: function(data) { // Selected for Taxes var taxes = JSON.stringify(data.tax_profiles); var parse_taxes = JSON.parse(taxes); console.log(parse_taxes); $.each(parse_taxes, function(i, value){ - $("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected"); + $("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'}); }); $('#customer_id').val(data.id); From ed793bd48cd0a8b698843fd916ffecf6fb626cca Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 11 Aug 2017 12:15:47 +0630 Subject: [PATCH 36/71] remove puts in sale --- app/models/sale.rb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index 7a4a7a62..a73667ba 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -274,14 +274,10 @@ class Sale < ApplicationRecord #tax_profile - list by order_by tax_profiles = TaxProfile.all.order("order_by asc") customer = Customer.find(sale.customer_id) -puts customer.tax_profiles # #Creat new tax records tax_profiles.each do |tax| - customer.tax_profiles.each do |cus_tax| -puts tax -puts cus_tax - if cus_tax.to_i == tax.id -puts "WALSS" + customer.tax_profiles.each do |cus_tax| + if cus_tax.to_i == tax.id sale_tax = SaleTax.new(:sale => sale) sale_tax.tax_name = tax.name sale_tax.tax_rate = tax.rate @@ -322,14 +318,10 @@ puts "WALSS" tax_profiles = TaxProfile.all.order("order_by asc") customer = Customer.find(self.customer_id) -puts customer.tax_profiles # #Create new tax records tax_profiles.each do |tax| - customer.tax_profiles.each do |cus_tax| -puts tax -puts cus_tax - if cus_tax.to_i == tax.id -puts "WALSS" + customer.tax_profiles.each do |cus_tax| + if cus_tax.to_i == tax.id sale_tax = SaleTax.new(:sale => self) sale_tax.tax_name = tax.name sale_tax.tax_rate = tax.rate From 2c7a641d47422d0426dfea8a3f179dbfc4ddce4b Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 11 Aug 2017 13:21:40 +0630 Subject: [PATCH 37/71] update oqs --- app/assets/javascripts/OQS.js | 8 +++++--- app/controllers/oqs/backhome_controller.rb | 2 +- app/controllers/oqs/home_controller.rb | 10 +++++++--- app/views/oqs/home/index.html.erb | 3 +-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index cad815bf..19d0429e 100644 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -46,7 +46,8 @@ $(document).ready(function(){ url: url, data: {}, dataType: "json", - success: function(data) { + success: function(data) { + for(var field in data) { var price = parseFloat(data[field].price).toFixed(2); @@ -62,7 +63,7 @@ $(document).ready(function(){ row ='
' +'
' +'

' - +''+data[field]["type"]+'- ' + +''+data[field]["table_type"]+'- ' +''+ data[field]["zone"] +'' +''+ data[field]["order_id"] +'- ' +'

' @@ -200,7 +201,8 @@ $(document).ready(function(){ $(document).on('click', '#print_order_item', function(event){ var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text(); var options = $('.selected-item').children('.card-block').find('.item-options').text(); - var params = { 'options':options }; + var params = { 'options':options }; + $.ajax({ type: 'GET', url: '/oqs/print/print/'+assigned_item_id, diff --git a/app/controllers/oqs/backhome_controller.rb b/app/controllers/oqs/backhome_controller.rb index b09e4a2d..4ac5f0a2 100644 --- a/app/controllers/oqs/backhome_controller.rb +++ b/app/controllers/oqs/backhome_controller.rb @@ -89,7 +89,7 @@ class Oqs::HomeController < BaseOqsController # Query for OQS with delivery status def queue_items_query(status) - AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at") + AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type as type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at") .joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id left join orders as od ON od.order_id = assigned_order_items.order_id diff --git a/app/controllers/oqs/home_controller.rb b/app/controllers/oqs/home_controller.rb index d25ab0ac..dfe648d0 100644 --- a/app/controllers/oqs/home_controller.rb +++ b/app/controllers/oqs/home_controller.rb @@ -95,7 +95,6 @@ class Oqs::HomeController < BaseOqsController end - # Query for OQS with delivery status def queue_items_query(status,oqs_id=nil) if oqs_id == nil @@ -103,7 +102,13 @@ class Oqs::HomeController < BaseOqsController else oqs = "and assigned_order_items.order_queue_station_id = '#{oqs_id}' " end - AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type as type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at") + AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, + oqs.id as station_id, oqs.station_name, + oqs.is_active, oqpz.zone_id, + df.name as zone, df.type as table_type, + odt.order_id, odt.item_code, odt.item_name, + odt.price, odt.qty, odt.item_order_by, odt.options, + cus.name as customer_name, odt.created_at") .joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id left join orders as od ON od.order_id = assigned_order_items.order_id @@ -114,7 +119,6 @@ class Oqs::HomeController < BaseOqsController left join dining_facilities as df on df.id = bk.dining_facility_id") .where("assigned_order_items.delivery_status = #{status} AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' #{oqs}") .group("assigned_order_items.assigned_order_item_id") - .order("assigned_order_items.created_at") end diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index c6c35e1c..3ab1cf24 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -17,12 +17,11 @@ > <%= qsi.station_name %> - <%= qsi.assigned_order_items.count(:delivery_status) %> + <%= qsi.assigned_order_items.where("delivery_status=0").count %> <% if qsi.auto_print %> (ap) <% end %> - <%= qsi.assigned_order_items.where("delivery_status=0").count %> <% end %> From b7c49f5f60702e5c03fbee5a310dd6bdb7fde9c1 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 11 Aug 2017 13:34:58 +0630 Subject: [PATCH 38/71] remove item set migrateion --- db/migrate/20170810121704_create_item_sets.rb | 9 --------- .../20170811121704_create_menu_instance_item_sets.rb | 8 -------- db/migrate/20170811121704_create_menu_item_sets.rb | 8 -------- 3 files changed, 25 deletions(-) delete mode 100644 db/migrate/20170810121704_create_item_sets.rb delete mode 100644 db/migrate/20170811121704_create_menu_instance_item_sets.rb delete mode 100644 db/migrate/20170811121704_create_menu_item_sets.rb diff --git a/db/migrate/20170810121704_create_item_sets.rb b/db/migrate/20170810121704_create_item_sets.rb deleted file mode 100644 index da7fc570..00000000 --- a/db/migrate/20170810121704_create_item_sets.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateItemSets < ActiveRecord::Migration[5.1] - def change - create_table :item_sets do |t| - t.string :name, :null => false - t.integer :min_selectable_qty - t.integer :max_selectable_qty - t.timestamps - end -end diff --git a/db/migrate/20170811121704_create_menu_instance_item_sets.rb b/db/migrate/20170811121704_create_menu_instance_item_sets.rb deleted file mode 100644 index 1712065b..00000000 --- a/db/migrate/20170811121704_create_menu_instance_item_sets.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateMenuInstanceItemSets < ActiveRecord::Migration[5.1] - def change - create_table :menu_instance_item_sets do |t| - t.references :item_set_id, foreign_key: true - t.references :menu_item_instance_id, foreign_key: true - t.timestamps - end -end diff --git a/db/migrate/20170811121704_create_menu_item_sets.rb b/db/migrate/20170811121704_create_menu_item_sets.rb deleted file mode 100644 index 1cacad00..00000000 --- a/db/migrate/20170811121704_create_menu_item_sets.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateMenuItemSets < ActiveRecord::Migration[5.1] - def change - create_table :menu_item_sets do |t| - t.references :item_set_id, foreign_key: true - t.references :menu_item_id, foreign_key: true - t.timestamps - end -end From b7cde3125f7c74d5c777238e8954e9e6fa7bb6f3 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 11 Aug 2017 13:44:25 +0630 Subject: [PATCH 39/71] add item set and relation --- app/models/item_set.rb | 2 ++ app/models/menu_instance_item_set.rb | 2 ++ app/models/menu_item_set.rb | 2 ++ db/migrate/20170811070634_create_item_sets.rb | 11 +++++++++++ db/migrate/20170811071108_create_menu_item_sets.rb | 10 ++++++++++ .../20170811071327_create_menu_instance_item_sets.rb | 10 ++++++++++ spec/models/item_set_spec.rb | 5 +++++ spec/models/menu_instance_item_set_spec.rb | 5 +++++ spec/models/menu_item_set_spec.rb | 5 +++++ 9 files changed, 52 insertions(+) create mode 100644 app/models/item_set.rb create mode 100644 app/models/menu_instance_item_set.rb create mode 100644 app/models/menu_item_set.rb create mode 100644 db/migrate/20170811070634_create_item_sets.rb create mode 100644 db/migrate/20170811071108_create_menu_item_sets.rb create mode 100644 db/migrate/20170811071327_create_menu_instance_item_sets.rb create mode 100644 spec/models/item_set_spec.rb create mode 100644 spec/models/menu_instance_item_set_spec.rb create mode 100644 spec/models/menu_item_set_spec.rb diff --git a/app/models/item_set.rb b/app/models/item_set.rb new file mode 100644 index 00000000..83c32c82 --- /dev/null +++ b/app/models/item_set.rb @@ -0,0 +1,2 @@ +class ItemSet < ApplicationRecord +end diff --git a/app/models/menu_instance_item_set.rb b/app/models/menu_instance_item_set.rb new file mode 100644 index 00000000..6674c0c2 --- /dev/null +++ b/app/models/menu_instance_item_set.rb @@ -0,0 +1,2 @@ +class MenuInstanceItemSet < ApplicationRecord +end diff --git a/app/models/menu_item_set.rb b/app/models/menu_item_set.rb new file mode 100644 index 00000000..407924bd --- /dev/null +++ b/app/models/menu_item_set.rb @@ -0,0 +1,2 @@ +class MenuItemSet < ApplicationRecord +end diff --git a/db/migrate/20170811070634_create_item_sets.rb b/db/migrate/20170811070634_create_item_sets.rb new file mode 100644 index 00000000..d666222c --- /dev/null +++ b/db/migrate/20170811070634_create_item_sets.rb @@ -0,0 +1,11 @@ +class CreateItemSets < ActiveRecord::Migration[5.1] + def change + create_table :item_sets do |t| + t.string :name + t.integer :min_selectable_qty + t.integer :max_selectable_qty + + t.timestamps + end + end +end diff --git a/db/migrate/20170811071108_create_menu_item_sets.rb b/db/migrate/20170811071108_create_menu_item_sets.rb new file mode 100644 index 00000000..f423ea7b --- /dev/null +++ b/db/migrate/20170811071108_create_menu_item_sets.rb @@ -0,0 +1,10 @@ +class CreateMenuItemSets < ActiveRecord::Migration[5.1] + def change + create_table :menu_item_sets do |t| + t.references :item_set_id, foreign_key: true + t.references :menu_item_id, foreign_key: true + + t.timestamps + end + end +end diff --git a/db/migrate/20170811071327_create_menu_instance_item_sets.rb b/db/migrate/20170811071327_create_menu_instance_item_sets.rb new file mode 100644 index 00000000..b25ba8b6 --- /dev/null +++ b/db/migrate/20170811071327_create_menu_instance_item_sets.rb @@ -0,0 +1,10 @@ +class CreateMenuInstanceItemSets < ActiveRecord::Migration[5.1] + def change + create_table :menu_instance_item_sets do |t| + t.references :item_set_id, foreign_key: true + t.references :menu_item_instance_id, foreign_key: true + + t.timestamps + end + end +end diff --git a/spec/models/item_set_spec.rb b/spec/models/item_set_spec.rb new file mode 100644 index 00000000..70c14cff --- /dev/null +++ b/spec/models/item_set_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe ItemSet, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/menu_instance_item_set_spec.rb b/spec/models/menu_instance_item_set_spec.rb new file mode 100644 index 00000000..5711f7e7 --- /dev/null +++ b/spec/models/menu_instance_item_set_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe MenuInstanceItemSet, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/menu_item_set_spec.rb b/spec/models/menu_item_set_spec.rb new file mode 100644 index 00000000..f3c82b26 --- /dev/null +++ b/spec/models/menu_item_set_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe MenuItemSet, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end From 12d3e70b197efb866296bd041a4a264fc26db7ed Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 11 Aug 2017 14:23:33 +0630 Subject: [PATCH 40/71] update model for menu --- app/models/item_set.rb | 5 +++++ app/models/menu_instance_item_set.rb | 2 ++ app/models/menu_item.rb | 3 +++ app/models/menu_item_set.rb | 2 ++ 4 files changed, 12 insertions(+) diff --git a/app/models/item_set.rb b/app/models/item_set.rb index 83c32c82..379347a3 100644 --- a/app/models/item_set.rb +++ b/app/models/item_set.rb @@ -1,2 +1,7 @@ class ItemSet < ApplicationRecord + has_many :menu_item_sets + has_many :menu_items, through: :menu_item_sets + + has_many :menu_instance_item_sets + has_many :menu_item_instances, through: :menu_item_sets end diff --git a/app/models/menu_instance_item_set.rb b/app/models/menu_instance_item_set.rb index 6674c0c2..bc1d7aaf 100644 --- a/app/models/menu_instance_item_set.rb +++ b/app/models/menu_instance_item_set.rb @@ -1,2 +1,4 @@ class MenuInstanceItemSet < ApplicationRecord + belongs_to :item_set + belongs_to :menu_item_instance end diff --git a/app/models/menu_item.rb b/app/models/menu_item.rb index 1f1afbe4..0db0cda4 100644 --- a/app/models/menu_item.rb +++ b/app/models/menu_item.rb @@ -8,6 +8,9 @@ class MenuItem < ApplicationRecord has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id" belongs_to :account + has_many :menu_item_sets + has_many :item_sets, through: :menu_item_sets + validates_presence_of :name, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item default_scope { order('item_code asc') } diff --git a/app/models/menu_item_set.rb b/app/models/menu_item_set.rb index 407924bd..a39b8522 100644 --- a/app/models/menu_item_set.rb +++ b/app/models/menu_item_set.rb @@ -1,2 +1,4 @@ class MenuItemSet < ApplicationRecord + belongs_to :item_set + belongs_to :menu_item end From be71d187b0f1f83536051c972c6b985cc493aa1b Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 11 Aug 2017 15:00:24 +0630 Subject: [PATCH 41/71] update menu --- app/models/menu_category.rb | 8 ++++---- app/models/menu_item.rb | 11 +++++------ app/models/menu_item_instance.rb | 10 +++++----- app/views/settings/menu_categories/show.html.erb | 2 +- db/migrate/20170811071108_create_menu_item_sets.rb | 4 ++-- .../20170811071327_create_menu_instance_item_sets.rb | 4 ++-- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/app/models/menu_category.rb b/app/models/menu_category.rb index 71ad42c8..29484bcc 100644 --- a/app/models/menu_category.rb +++ b/app/models/menu_category.rb @@ -1,5 +1,5 @@ class MenuCategory < ApplicationRecord - before_create :generate_menu_category_code + # before_create :generate_menu_category_code belongs_to :menu has_many :children, :class_name => "MenuCategory", foreign_key: "menu_category_id" @@ -37,7 +37,7 @@ class MenuCategory < ApplicationRecord private - def generate_menu_category_code - self.code = SeedGenerator.generate_code(self.class.name, "C") - end + # def generate_menu_category_code + # self.code = SeedGenerator.generate_code(self.class.name, "C") + # end end diff --git a/app/models/menu_item.rb b/app/models/menu_item.rb index 0db0cda4..4a661c14 100644 --- a/app/models/menu_item.rb +++ b/app/models/menu_item.rb @@ -1,6 +1,5 @@ class MenuItem < ApplicationRecord - - before_create :generate_menu_item_code + # before_create :generate_menu_item_code belongs_to :menu_category, :optional => true has_many :menu_item_instances @@ -73,10 +72,10 @@ class MenuItem < ApplicationRecord end - private + # private - def generate_menu_item_code - self.item_code = SeedGenerator.generate_code(self.class.name, "I") - end + # def generate_menu_item_code + # self.item_code = SeedGenerator.generate_code(self.class.name, "I") + # end end diff --git a/app/models/menu_item_instance.rb b/app/models/menu_item_instance.rb index f39c29a2..579b7a5a 100644 --- a/app/models/menu_item_instance.rb +++ b/app/models/menu_item_instance.rb @@ -1,6 +1,6 @@ class MenuItemInstance < ApplicationRecord belongs_to :menu_item - before_create :generate_menu_item_instance_code + # before_create :generate_menu_item_instance_code def self.findParentCategory(item) if item.menu_category_id @@ -11,9 +11,9 @@ class MenuItemInstance < ApplicationRecord end end - private + # private - def generate_menu_item_instance_code - self.item_instance_code = SeedGenerator.generate_code(self.class.name, "II") - end + # def generate_menu_item_instance_code + # self.item_instance_code = SeedGenerator.generate_code(self.class.name, "II") + # end end diff --git a/app/views/settings/menu_categories/show.html.erb b/app/views/settings/menu_categories/show.html.erb index 25c3c9ba..7e1f44af 100644 --- a/app/views/settings/menu_categories/show.html.erb +++ b/app/views/settings/menu_categories/show.html.erb @@ -1,6 +1,6 @@ - <%= render 'form', settings_set_menu_item: @settings_menu_item %> + <%= render 'form', settings_set_menu_item: @settings_menu_item, item_attributes: @item_attributes, item_options: @item_options, item_sets: @item_sets %>
diff --git a/app/views/settings/simple_menu_items/_form.html.erb b/app/views/settings/simple_menu_items/_form.html.erb index 2edc1e50..721c7230 100644 --- a/app/views/settings/simple_menu_items/_form.html.erb +++ b/app/views/settings/simple_menu_items/_form.html.erb @@ -1,35 +1,52 @@ <%= simple_form_for([:settings,@category, @settings_menu_item]) do |f| %> <%= f.error_notification %> -
+ +
- +
+ +
+
+
+ + <%= f.file_field :image_path, :class => "img-thumbnail" %>
- <%= f.file_field :image_path, :class => "img-thumbnail" %>
-
-
-
- <%= f.input :item_code %> - <%= f.input :name %> - <%= f.input :alt_name %> - <%= f.input :type %> - <%= f.input :account_id, :label => "Account type", :collection => Account.collection %> - <%= f.input :menu_item_id, :label => "Parent Menu Item", :collection => MenuItem.collection %> - <%= f.input :min_qty %> - <%= f.input :min_selectable_item %> - <%= f.input :max_selectable_item %> +
+
+ <%= f.input :item_sets, :collection => @item_sets, :input_html => { :multiple => true }, :class => "form-control item_sets" %> +
-
-
- <%= f.button :submit %> +
+ <%= f.button :submit %> +
<% end %> diff --git a/app/views/settings/simple_menu_items/edit.html.erb b/app/views/settings/simple_menu_items/edit.html.erb index 07849c07..84c60e04 100644 --- a/app/views/settings/simple_menu_items/edit.html.erb +++ b/app/views/settings/simple_menu_items/edit.html.erb @@ -1,7 +1,3 @@ - -
- <%= render 'form', settings_simple_menu_item: @settings_menu_item %> + + <%= render 'form', settings_simple_menu_item: @settings_menu_item, item_sets: @item_sets %>
+ + diff --git a/app/views/settings/simple_menu_items/new.html.erb b/app/views/settings/simple_menu_items/new.html.erb index 9e18525b..158e7d52 100644 --- a/app/views/settings/simple_menu_items/new.html.erb +++ b/app/views/settings/simple_menu_items/new.html.erb @@ -10,5 +10,9 @@
  • New
  • - <%= render 'form', settings_simple_menu_item: @settings_menu_item %> +
    +
    + <%= render 'form', settings_simple_menu_item: @settings_menu_item, item_attributes: @item_attributes, item_options: @item_options, item_sets: @item_sets %> +
    +
    diff --git a/db/migrate/20170331024749_create_menu_items.rb b/db/migrate/20170331024749_create_menu_items.rb index ce6d1486..75897d52 100644 --- a/db/migrate/20170331024749_create_menu_items.rb +++ b/db/migrate/20170331024749_create_menu_items.rb @@ -1,4 +1,3 @@ - class CreateMenuItems < ActiveRecord::Migration[5.1] def change create_table :menu_items do |t| @@ -10,12 +9,16 @@ class CreateMenuItems < ActiveRecord::Migration[5.1] t.string :information t.string :type, :null => false, :default => "SimpleMenuItem" t.references :menu_category, foreign_key: true - t.references :menu_item, foreign_key: true + t.json :item_attributes + t.json :item_options + # t.references :menu_item, foreign_key: true t.references :account, foreign_key: true t.integer :min_qty, :null => false, :default => 1 t.boolean :taxable, :null => false, :default => true - t.integer :min_selectable_item, :null => false, :default => 1 - t.integer :max_selectable_item, :null => false, :default => 1 + t.boolean :is_sub_item, :null => false, :default => false + t.boolean :is_available, :null => false, :default => true + # t.integer :min_selectable_item, :null => false, :default => 1 + # t.integer :max_selectable_item, :null => false, :default => 1 t.string :created_by t.timestamps diff --git a/db/migrate/20170628103624_create_print_settings.rb b/db/migrate/20170628103624_create_print_settings.rb index aca49a0d..28c0ae57 100644 --- a/db/migrate/20170628103624_create_print_settings.rb +++ b/db/migrate/20170628103624_create_print_settings.rb @@ -3,11 +3,7 @@ class CreatePrintSettings < ActiveRecord::Migration[5.1] create_table :print_settings do |t| t.string :name, :null => false t.string :unique_code, :null => false - t.string :template - t.string :db_name - t.string :db_type - t.string :db_username - t.string :db_password + t.string :template t.string :printer_name, :null => false t.string :api_settings t.decimal :page_width, :null => false, :default => 200 diff --git a/db/migrate/20170814041543_remove_d_bcols_from_print_settings.rb b/db/migrate/20170814041543_remove_d_bcols_from_print_settings.rb deleted file mode 100644 index 48a7de5d..00000000 --- a/db/migrate/20170814041543_remove_d_bcols_from_print_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class RemoveDBcolsFromPrintSettings < ActiveRecord::Migration[5.1] - def change - remove_column :print_settings, :db_name, :string - remove_column :print_settings, :db_type, :string - remove_column :print_settings, :db_username, :string - remove_column :print_settings, :db_password, :string - end -end diff --git a/public/image/menu_images/if_Dish_food_Dome_dish_kitchen_restaurant_1886917.png b/public/image/menu_images/if_Dish_food_Dome_dish_kitchen_restaurant_1886917.png new file mode 100644 index 0000000000000000000000000000000000000000..0c364b22b1963415a7b33961eed94b45ebbdc97d GIT binary patch literal 6195 zcmV-37|iF1P)5n?m~f-uAMv-+O1fAn=(fYB=n8| zI|;lKjMw*^`OdBtD^_r&ud$e*N_U`8{OHQoF_$>3KN=w(r|P22jnOE)imx7gQIPV_kfti5h+O*HI2Uop?oM01qjxa3KR z|0l`g6i5mM@+Cm}LHw8I9ir4G61}N5;CiunYjZf?YpVqM1OeKvX!9JfBD0mCiG@C; zfcmV0t^fhj(!m|9)h~$9wy&=KnH3wGq7E;$?5Ju2th%ywGAOnPg6jx08~{?KSbYRI z{6|CfD#pXwQmdCeb;FKcF12E)IsyoUR?lnwB#FKqq%KO_;qJn#ZURWkes*L@gA`87Cg}b`fRsOf6qdV}KC@^uDvXK}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vTTiqWT{K5{?0zIBW+J*Pw_r>0AafkJoB<+^0)=E8^lR21E-W6_4I_JktVc>tV$B4)tySnv&suPT;0RBbWA znh_1!2p@{%J;_Uj2tV$t!TH4&K2U-YAc3|k+N^*#b}xvQ=Q{$Vo)dI!UL9p{Eaj$F z(FnjX9q*s!lm|Ke!kmr(0^B=lNW)hP`PAzPC7*V$y?VnuVZ8=Q`3ogLGFN{F(2cdfp9!&Jq(6^f=7g#cX#0sss! zb9`eyL+64-jN-*+zhjb7><$+F|KO01*gC? zsusZ~P;~@I#Sbrkt9;2v8njmfRqq@jsThX!DZ`5DhtzvWI73*&5)A`sP8Vk9D;U4 z0PXNw#M_9iZC`l0d3Uj|shsHZ1jvLyXwAPoI#yF`3Wz2MV*-K3F-xN;Gy>d6 zqI|^c1(Y{V0FFSZ2x|@z)IL(YPeA*GWfugy2x_MVdTsHO*Z!m0CUJ%0{{hwQkqJSM RX(|8!002ovPDHLkV1j2Bx55Ab literal 0 HcmV?d00001 From 88eb1d6c64e18828fff6aefc5293989e8f9a5e77 Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 17 Aug 2017 10:43:45 +0630 Subject: [PATCH 62/71] update seed --- db/seeds.rb | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/db/seeds.rb b/db/seeds.rb index 8bc16f74..5ab0d36d 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -175,4 +175,75 @@ queue_no_printer=PrintSetting.create({name: "Queue No", unique_code: "QueueNoPdf cashier_terminal = CashierTerminal.create({name:"Terminal 1"}) cashier_terminal2 = CashierTerminal.create({name:"Terminal 2"}) cashier_terminal3 = CashierTerminal.create({name:"Terminal 3"}) + +zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"}) + table = Table.create({name:"61", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"62", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"53", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"54", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"24", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"25", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"26", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"34", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"35", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"45", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"46", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"47", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"48", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + +zone2 = Zone.create({id:2, name: "H2", is_active:true, created_by: "SYSTEM DEFAULT"}) + table = Table.create({name:"51", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"52", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"11", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"12", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"21", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"22", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"23", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"31", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"32", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"33", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"41", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"42", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"43", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"44", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) +zone3 = Zone.create({id:3, name: "H3", is_active:true, created_by: "SYSTEM DEFAULT"}) + table = Table.create({name:"71", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"72", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"73", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"74", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"75", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({name:"76", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + 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://staging.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"}, + {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://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"}) +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"}) +zone_order_queue_station = OrderQueueStation.create({station_name: "K3", is_active: true, printer_name: "Cashier", processing_items: JSON.generate(['01001','01002','01003','01004','02005','02006','02007','02008']), print_copy: true, cut_per_item: true, use_alternate_name: false, created_by: "SYSTEM DEFAULT"}) + +# QueueStationZone +zone_queue_station1 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station1, zone: zone}) +zone_queue_station2 = OrderQueueProcessByZone.create({order_queue_station: order_queue_station2, zone: zone2}) +zone_queue_station3 = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone3}) + puts " Finished System Default Set Up Data " From 7f2bfa2348e60757af7e92d20d78042a4369dfed Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 17 Aug 2017 13:51:01 +0630 Subject: [PATCH 63/71] update add order and calculate subtotal --- .../restaurant/menu_categories_controller.rb | 2 - .../restaurant/menu/_menu_item.json.jbuilder | 4 +- .../menu_categories/show.json.jbuilder | 10 +-- app/views/origami/addorders/show.html.erb | 84 +++++++++++++------ 4 files changed, 64 insertions(+), 36 deletions(-) diff --git a/app/controllers/api/restaurant/menu_categories_controller.rb b/app/controllers/api/restaurant/menu_categories_controller.rb index 5ab10ff5..f1f3e6d0 100644 --- a/app/controllers/api/restaurant/menu_categories_controller.rb +++ b/app/controllers/api/restaurant/menu_categories_controller.rb @@ -13,9 +13,7 @@ class Api::Restaurant::MenuCategoriesController < Api::ApiController # This API show current order details # Input Params - menu_id def show - puts "SSSSSSSSSSSSS" @menu = menu_detail(params[:id]) - puts @menu.to_json end diff --git a/app/views/api/restaurant/menu/_menu_item.json.jbuilder b/app/views/api/restaurant/menu/_menu_item.json.jbuilder index c93c3b12..d86624b5 100644 --- a/app/views/api/restaurant/menu/_menu_item.json.jbuilder +++ b/app/views/api/restaurant/menu/_menu_item.json.jbuilder @@ -32,8 +32,8 @@ elsif item.menu_item_instances.count > 1 then end #Child Menu items -if (item.children) then - json.set_items item.children.each do |item| +if (item.menu_item_sets) then + json.set_items item.menu_item_sets.each do |item| json.partial! 'api/restaurant/menu/menu_item', item: item end diff --git a/app/views/api/restaurant/menu_categories/show.json.jbuilder b/app/views/api/restaurant/menu_categories/show.json.jbuilder index d7a6d581..f48f6c77 100644 --- a/app/views/api/restaurant/menu_categories/show.json.jbuilder +++ b/app/views/api/restaurant/menu_categories/show.json.jbuilder @@ -6,8 +6,8 @@ if @menu.menu_items json.alt_name item.alt_name json.type item.type json.min_qty item.min_qty - json.min_selectable_item item.min_selectable_item - json.max_selectable_item item.max_selectable_item + # json.min_selectable_item item.min_selectable_item + # json.max_selectable_item item.max_selectable_item #Item instance if item.menu_item_instances.count == 1 then @@ -33,11 +33,11 @@ if @menu.menu_items end #Child Menu items - if (item.children) then - json.set_items item.children.each do |item| + if (item.menu_item_sets) then + json.set_items item.menu_item_sets.each do |item| json.partial! 'api/restaurant/menu/menu_item', item: item end - end + end end end diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb index c7aa4455..638da002 100644 --- a/app/views/origami/addorders/show.html.erb +++ b/app/views/origami/addorders/show.html.erb @@ -23,7 +23,7 @@
    -
    +
    @@ -42,7 +42,7 @@
    - +
    Sub Total:222220.00
    @@ -53,14 +53,16 @@ $(function(){ + //click menu sidebar menu category $(".menu_category").on("click", function(){ var menu_id = $(this).find(".menu-id").text(); var url = $(this).attr('data-ref'); show_menu_item_list(url); - }); //End menu category Click - + }); + //End menu category Click + + //show menu item list when click menu category function show_menu_item_list(url_item){ - var menu_list = $('.menu_items_list'); menu_list.empty(); @@ -74,7 +76,7 @@ $(function(){ var menu_items_list = $('.menu_items_list'); menu_items_list.empty(); menu_items = data.menu_items; - + console.log(data); for(var field in menu_items) { if (menu_items[field].item_instances){ var price = parseFloat(menu_items[field].item_instances[1].price).toFixed(2); @@ -130,47 +132,75 @@ $(function(){ } //end show detail function + // click plus icon for add $(document).on('click', '.add_icon', function(event){ var item_data = $(this); - show_item_detail(item_data); + show_item_detail(item_data); + calculate_sub_total(); }); //End Add Icon Click function show_item_detail(data){ + qty = 1; + append = 0; + price = data.attr('data-price'); + instance_code = data.attr('data-instance'); - price = data.attr('data-price'); - - if (data.attr('data-qty') === undefined){ - qty = 1; - }else{ - qty = data.attr('data-qty'); - } - - if (data.attr('data-instance') == "undefined"){ + if (instance_code == "undefined"){ instance = ''; }else{ - instance = data.attr('data-instance'); + instance = "("+data.attr('data-instance')+")"; } + var rowCount = $('.summary-items tbody tr').length+1; + var item_row = $('.summary-items tbody tr'); + + $(item_row).each(function(i){ + if ($(item_row[i]).attr('data-code') == data.attr('data-item-code')) { + qty = parseInt($(item_row[i]).children('#item_qty').text()) +1; + $(item_row[i]).children('#item_qty').text(qty); + $(item_row[i]).children('#item_price').text(price*qty); + append = 1; + }else{ + qty = 1; + } + }); - - var rowCount = $('.summary-items tbody'); - console.log(rowCount); - for(var field in rowCount) { - // console.log(rowCount[field].attr('data-code')); - } - - row ='' + if (append===0) { + row ="" +''+rowCount+'' - +'' + data.attr('data-name')+ ' ' + instance + '' + +'' + data.attr('data-name')+ ' ' + instance + '' +'' + qty + '' +'' + parseFloat(price).toFixed(2) +'' +''; - $(".summary-items tbody").append(row); + $(".summary-items tbody").append(row); + } } + function calculate_sub_total(){ + var total_price = 0; + var taxable_amount = 0; + var item_row = $('.summary-items tbody tr'); + + $(item_row).each(function(i){ + // var taxable = $(item_row[i]).attr('data-taxable'); + var unit_price = parseFloat($(item_row[i]).attr('data-price')); + var qty = parseFloat($(item_row[i]).children('#item_qty').text()); + // if(taxable == 'true'){ + // taxable_amount += qty*unit_price; + // } + total_price += qty*unit_price; + }); + var fixed_total_price = parseFloat(total_price).toFixed(2); + var fixed_taxable_amount = parseFloat(taxable_amount).toFixed(2); + $('#sub_total').empty(); + $('#sub_total').append(fixed_total_price); + // $('#sub_total').attr('taxable_amount',fixed_taxable_amount); + // $('#show_sub').text(fixed_total_price); +} + }); From 29b3f945737f81045514552dcaa01b0c9f6e7904 Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 17 Aug 2017 18:55:13 +0630 Subject: [PATCH 64/71] add menu api --- .../api/restaurant/item_sets_controller.rb | 9 +++ .../api/restaurant/menu_controller.rb | 3 +- .../menu_item_attributes_controller.rb | 4 -- .../concerns/token_verification.rb | 3 +- .../settings/item_sets_controller.rb | 2 +- .../settings/menu_categories_controller.rb | 2 +- .../settings/set_menu_items_controller.rb | 2 +- .../settings/simple_menu_items_controller.rb | 2 +- app/models/employee.rb | 1 - .../restaurant/item_sets/index.json.jbuilder | 6 ++ .../api/restaurant/menu/_menu.json.jbuilder | 5 +- .../restaurant/menu/_menu_item.json.jbuilder | 60 ++++++++++-------- .../api/restaurant/menu/index.json.jbuilder | 12 ++-- app/views/layouts/_header.html.erb | 2 +- app/views/settings/item_sets/_form.html.erb | 1 + app/views/settings/item_sets/index.html.erb | 2 + app/views/settings/item_sets/show.html.erb | 4 ++ .../settings/menu_categories/_form.html.erb | 4 +- .../settings/menu_categories/index.html.erb | 2 + .../settings/menu_categories/show.html.erb | 2 + .../settings/set_menu_items/show.html.erb | 57 ----------------- .../settings/simple_menu_items/show.html.erb | 62 +------------------ config/routes.rb | 1 + .../20170327152733_create_menu_categories.rb | 2 +- db/migrate/20170811071000_create_item_sets.rb | 1 + .../20170816042256_settings_products.rb | 1 - 26 files changed, 84 insertions(+), 168 deletions(-) create mode 100644 app/controllers/api/restaurant/item_sets_controller.rb create mode 100644 app/views/api/restaurant/item_sets/index.json.jbuilder diff --git a/app/controllers/api/restaurant/item_sets_controller.rb b/app/controllers/api/restaurant/item_sets_controller.rb new file mode 100644 index 00000000..a7ad9efc --- /dev/null +++ b/app/controllers/api/restaurant/item_sets_controller.rb @@ -0,0 +1,9 @@ +class Api::Restaurant::ItemSetsController < Api::ApiController + + #Description + # Pull the default menu details and also other available (active) menus + # Input Params - order_id + def index + @item_sets = ItemSet.all + end +end diff --git a/app/controllers/api/restaurant/menu_controller.rb b/app/controllers/api/restaurant/menu_controller.rb index fe7983ea..f6f2902b 100644 --- a/app/controllers/api/restaurant/menu_controller.rb +++ b/app/controllers/api/restaurant/menu_controller.rb @@ -5,8 +5,7 @@ class Api::Restaurant::MenuController < Api::ApiController # Input Params - order_id def index @menus = Menu.all - @current_menu = Menu.current_menu - + # @current_menu = Menu.current_menu end #Description diff --git a/app/controllers/api/restaurant/menu_item_attributes_controller.rb b/app/controllers/api/restaurant/menu_item_attributes_controller.rb index f2aead8f..1b6a48d4 100644 --- a/app/controllers/api/restaurant/menu_item_attributes_controller.rb +++ b/app/controllers/api/restaurant/menu_item_attributes_controller.rb @@ -6,8 +6,4 @@ class Api::Restaurant::MenuItemAttributesController < Api::ApiController def index @menu_attributes = MenuItemAttribute.all end - - - - end diff --git a/app/controllers/concerns/token_verification.rb b/app/controllers/concerns/token_verification.rb index 0cc6c263..66658b6a 100644 --- a/app/controllers/concerns/token_verification.rb +++ b/app/controllers/concerns/token_verification.rb @@ -14,10 +14,9 @@ module TokenVerification end def authenticate_token - authenticate_with_http_token do |token, options| + authenticate_with_http_token do |token, options| #@current_user = User.find_by(api_key: token) Rails.logger.debug "token - " + token.to_s - @user = Employee.authenticate_by_token(token) if @user return true diff --git a/app/controllers/settings/item_sets_controller.rb b/app/controllers/settings/item_sets_controller.rb index 5564ed98..cbd74edb 100644 --- a/app/controllers/settings/item_sets_controller.rb +++ b/app/controllers/settings/item_sets_controller.rb @@ -69,6 +69,6 @@ class Settings::ItemSetsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def settings_item_set_params - params.require(:item_set).permit(:name, :min_selectable_qty, :max_selectable_qty) + params.require(:item_set).permit(:name, :alt_name, :min_selectable_qty, :max_selectable_qty) end end diff --git a/app/controllers/settings/menu_categories_controller.rb b/app/controllers/settings/menu_categories_controller.rb index 8ca9cfb4..a15cca20 100644 --- a/app/controllers/settings/menu_categories_controller.rb +++ b/app/controllers/settings/menu_categories_controller.rb @@ -89,6 +89,6 @@ class Settings::MenuCategoriesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def settings_menu_category_params - params.require(:menu_category).permit(:code, :menu_id, :name, :alt_name, :order_by, :menu_category_id) + params.require(:menu_category).permit(:code, :menu_id, :name, :alt_name, :order_by, :menu_category_id, :is_available) end end diff --git a/app/controllers/settings/set_menu_items_controller.rb b/app/controllers/settings/set_menu_items_controller.rb index 64b9c945..60fa3b7d 100644 --- a/app/controllers/settings/set_menu_items_controller.rb +++ b/app/controllers/settings/set_menu_items_controller.rb @@ -12,7 +12,7 @@ class Settings::SetMenuItemsController < ApplicationController # GET /settings/menu_items/1 # GET /settings/menu_items/1.json def show - @sub_menu = MenuItem.where("menu_item_id=?",params[:id]).page(params[:page]).per(10) + # @sub_menu = MenuItem.where("menu_item_id=?",params[:id]).page(params[:page]).per(10) @menu_item_instance = MenuItemInstance.where("menu_item_id=?",params[:id]).page(params[:page]).per(10) end diff --git a/app/controllers/settings/simple_menu_items_controller.rb b/app/controllers/settings/simple_menu_items_controller.rb index 9d3ac5ed..60949618 100644 --- a/app/controllers/settings/simple_menu_items_controller.rb +++ b/app/controllers/settings/simple_menu_items_controller.rb @@ -12,7 +12,7 @@ class Settings::SimpleMenuItemsController < ApplicationController # GET /settings/menu_items/1 # GET /settings/menu_items/1.json def show - @sub_menu = MenuItem.where("menu_item_id=?",params[:id]).page(params[:page]).per(10) + # @sub_menu = MenuItem.where("menu_item_id=?",params[:id]).page(params[:page]).per(10) @menu_item_instance = MenuItemInstance.where("menu_item_id=?",params[:id]).page(params[:page]).per(10) end diff --git a/app/models/employee.rb b/app/models/employee.rb index 7693c448..85aeaec1 100644 --- a/app/models/employee.rb +++ b/app/models/employee.rb @@ -35,7 +35,6 @@ class Employee < ApplicationRecord end def self.authenticate_by_token(session_token) - if (session_token) user = Employee.find_by_token_session(session_token) if user && user.session_expiry.utc > DateTime.now.utc diff --git a/app/views/api/restaurant/item_sets/index.json.jbuilder b/app/views/api/restaurant/item_sets/index.json.jbuilder new file mode 100644 index 00000000..eb39022d --- /dev/null +++ b/app/views/api/restaurant/item_sets/index.json.jbuilder @@ -0,0 +1,6 @@ +json.array! @item_sets do |set| + json.name set.name + json.alt_name set.alt_name + json.min_selectable_qty set.min_selectable_qty + json.max_selectable_qty set.max_selectable_qty +end diff --git a/app/views/api/restaurant/menu/_menu.json.jbuilder b/app/views/api/restaurant/menu/_menu.json.jbuilder index 43721ff0..cfa950d7 100644 --- a/app/views/api/restaurant/menu/_menu.json.jbuilder +++ b/app/views/api/restaurant/menu/_menu.json.jbuilder @@ -5,13 +5,14 @@ json.valid_time_from menu.valid_time_from.strftime("%H:%M") json.valid_time_to menu.valid_time_to.strftime("%H:%M") if (menu.menu_categories) - json.menu_categories menu.menu_categories do |category| + json.categories menu.menu_categories do |category| json.id category.id json.name category.name json.alt_name category.alt_name + json.is_available category.is_available if category.menu_items - json.menu_items category.menu_items do |item| + json.items category.menu_items do |item| json.partial! 'api/restaurant/menu/menu_item', item: item end end diff --git a/app/views/api/restaurant/menu/_menu_item.json.jbuilder b/app/views/api/restaurant/menu/_menu_item.json.jbuilder index c93c3b12..f0b790b7 100644 --- a/app/views/api/restaurant/menu/_menu_item.json.jbuilder +++ b/app/views/api/restaurant/menu/_menu_item.json.jbuilder @@ -1,40 +1,46 @@ #Menu Item Information -json.item_code item.item_code -json.name item.name -json.alt_name item.alt_name -json.type item.type -json.min_qty item.min_qty -json.min_selectable_item item.min_selectable_item -json.max_selectable_item item.max_selectable_item +json.id item.id +json.item_code item.item_code +json.name item.name +json.alt_name item.alt_name +json.image item.image_path.url +json.description item.description +json.Information item.information +json.type item.type +json.account_id item.account_id +json.min_qty item.min_qty +json.is_available item.is_available +json.is_sub_item item.is_sub_item +json.attributes item.item_attributes +json.options item.item_options +# json.min_selectable_item item.min_selectable_item +# json.max_selectable_item item.max_selectable_item #Item instance -if item.menu_item_instances.count == 1 then +# if item.menu_item_instances.count == 1 then +# item_instance = item.menu_item_instances[0] +# json.price = item_instance.price +# json.is_available = item_instance.is_available +# json.is_on_promotion = item_instance.is_on_promotion +# json.promotion_price = item_instance.promotion_price +# json.item_attributes = item_instance.item_attributes - item_instance = item.menu_item_instances[0] - json.price = item_instance.price - json.is_available = item_instance.is_available - json.is_on_promotion = item_instance.is_on_promotion - json.promotion_price = item_instance.promotion_price - json.item_attributes = item_instance.item_attributes - -elsif item.menu_item_instances.count > 1 then - - json.item_instances item.menu_item_instances do |is| - json.item_instance_item_code = is.item_instance_code - json.item_instance_name = is.item_instance_name +# elsif item.menu_item_instances.count > 1 then + json.instances item.menu_item_instances do |is| + json.code = is.item_instance_code + json.name = is.item_instance_name json.price = is.price json.is_available = is.is_available json.is_on_promotion = is.is_on_promotion json.promotion_price = is.promotion_price json.item_attributes = is.item_attributes - end + # end end #Child Menu items -if (item.children) then - json.set_items item.children.each do |item| - json.partial! 'api/restaurant/menu/menu_item', item: item - end - -end +# if (item.children) then +# json.set_items item.children.each do |item| +# json.partial! 'api/restaurant/menu/menu_item', item: item +# end +# end diff --git a/app/views/api/restaurant/menu/index.json.jbuilder b/app/views/api/restaurant/menu/index.json.jbuilder index b4241854..55e876f6 100644 --- a/app/views/api/restaurant/menu/index.json.jbuilder +++ b/app/views/api/restaurant/menu/index.json.jbuilder @@ -4,9 +4,11 @@ json.array! @menus do |menu| json.valid_days menu.valid_days json.valid_time_from menu.valid_time_from.strftime("%H:%M") json.valid_time_to menu.valid_time_to.strftime("%H:%M") - if (@current_menu) - json.current_menu do - json.partial! 'api/restaurant/menu/menu', menu: @current_menu - end - end + + json.partial! 'api/restaurant/menu/menu', menu: menu + # if (@current_menu) + # json.current_menu do + # json.partial! 'api/restaurant/menu/menu', menu: @current_menu + # end + # end end diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index d7ccedaf..0daa8f5f 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -31,7 +31,7 @@
  • <%= link_to "Accounts", settings_accounts_path, :tabindex =>"-1" %>

  • -
  • <%= link_to "Promotion", settings_promotions_path, :tabindex =>"-1" %>
  • ] +
  • <%= link_to "Promotion", settings_promotions_path, :tabindex =>"-1" %>
  • <%= link_to "Products", settings_products_path, :tabindex =>"-1" %>
  • diff --git a/app/views/settings/item_sets/_form.html.erb b/app/views/settings/item_sets/_form.html.erb index 28441ea5..8eb23795 100644 --- a/app/views/settings/item_sets/_form.html.erb +++ b/app/views/settings/item_sets/_form.html.erb @@ -3,6 +3,7 @@
    <%= f.input :name %> + <%= f.input :alt_name %> <%= f.input :min_selectable_qty,input_html: {value: f.object.min_selectable_qty || '0'} %> <%= f.input :max_selectable_qty,input_html: {value: f.object.max_selectable_qty || '0'} %>
    diff --git a/app/views/settings/item_sets/index.html.erb b/app/views/settings/item_sets/index.html.erb index 80db10b9..b530a018 100644 --- a/app/views/settings/item_sets/index.html.erb +++ b/app/views/settings/item_sets/index.html.erb @@ -14,6 +14,7 @@ Name + Alt Name Min selectable qty Max selectable qty Action @@ -24,6 +25,7 @@ <% @settings_item_sets.each do |item| %> <%= item.name %> + <%= item.alt_name %> <%= item.min_selectable_qty %> <%= item.max_selectable_qty %> <%= link_to 'Show', settings_item_set_path(item),:class=>'btn btn-sm btn-success' %> diff --git a/app/views/settings/item_sets/show.html.erb b/app/views/settings/item_sets/show.html.erb index f863b5fc..21e5f132 100644 --- a/app/views/settings/item_sets/show.html.erb +++ b/app/views/settings/item_sets/show.html.erb @@ -17,6 +17,10 @@ Name: <%= @settings_item_set.name %> + + Alt Name: + <%= @settings_item_set.alt_name %> + Min selectable qty: <%= @settings_item_set.min_selectable_qty %> diff --git a/app/views/settings/menu_categories/_form.html.erb b/app/views/settings/menu_categories/_form.html.erb index 6a48555d..b611b397 100644 --- a/app/views/settings/menu_categories/_form.html.erb +++ b/app/views/settings/menu_categories/_form.html.erb @@ -2,13 +2,13 @@ <%= f.error_notification %>
    - <%= f.input :menu_id, as: :hidden %> + <%= f.input :menu_id, as: :hidden %> <%= f.input :code, label: "Category Code" %> <%= f.input :name %> <%= f.input :alt_name %> + <%= f.input :is_available %> <%= f.input :order_by %> <%= f.association :parent %> -
    diff --git a/app/views/settings/menu_categories/index.html.erb b/app/views/settings/menu_categories/index.html.erb index 8ac80a16..9345469c 100644 --- a/app/views/settings/menu_categories/index.html.erb +++ b/app/views/settings/menu_categories/index.html.erb @@ -17,6 +17,7 @@ Menu Name Alt name + Is Available Order by Parent @@ -31,6 +32,7 @@ <%= link_to settings_menu_category.name, settings_menu_category_path(settings_menu_category) %> <%= settings_menu_category.alt_name rescue ''%> + <%= settings_menu_category.is_available rescue false%> <%= settings_menu_category.order_by rescue ''%> <%= settings_menu_category.parent.name rescue ''%> <%= link_to 'Edit', edit_settings_menu_category_path(settings_menu_category) %> | <%= link_to 'Destroy', settings_menu_category_path(settings_menu_category), method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/settings/menu_categories/show.html.erb b/app/views/settings/menu_categories/show.html.erb index 7e1f44af..737709cd 100644 --- a/app/views/settings/menu_categories/show.html.erb +++ b/app/views/settings/menu_categories/show.html.erb @@ -16,6 +16,7 @@ Menu Name Alt name + Is Available Order by Created At Action @@ -27,6 +28,7 @@ <%= @settings_menu_category.menu.name %> <%= @settings_menu_category.name rescue "-" %> <%= @settings_menu_category.alt_name %> + <%= settings_menu_category.is_available rescue false%> <%= @settings_menu_category.order_by %> <%= @settings_menu_category.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %> <%= link_to 'Edit', edit_settings_menu_menu_category_path(@settings_menu_category, @settings_menu_category) %> diff --git a/app/views/settings/set_menu_items/show.html.erb b/app/views/settings/set_menu_items/show.html.erb index a5762fc3..6cec8cab 100644 --- a/app/views/settings/set_menu_items/show.html.erb +++ b/app/views/settings/set_menu_items/show.html.erb @@ -21,10 +21,7 @@ Type Account Type Menu category - Menu item Min qty - Min selectable item - Max selectable item Created At Action @@ -38,10 +35,7 @@ <%= @settings_menu_item.type %> <%= @settings_menu_item.account.title %> <%= @settings_menu_item.menu_category_id %> - <%= @settings_menu_item.menu_item_id %> <%= @settings_menu_item.min_qty %> - <%= @settings_menu_item.min_selectable_item %> - <%= @settings_menu_item.max_selectable_item %> <%= @settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %> <%= link_to 'Edit', edit_settings_menu_category_set_menu_item_path(@category, @settings_menu_item) %> @@ -51,58 +45,7 @@
    -<% if @sub_menu.count > 0 %> -
    -
    -
    -

    Sub Menu Items

    - - - - - - - - - - - - - - - - - <% @sub_menu.each do |settings_menu_item| %> - - - - - - - - - - - <% if settings_menu_item.type == "SimpleMenuItem" %> - - - - <% else %> - - - - <% end %> - - <% end %> - -
    Item codeNameAlt nameTypeParent ItemCreated byCreated at
    <%= settings_menu_item.item_code %><%= settings_menu_item.name %><%= settings_menu_item.alt_name %><%= settings_menu_item.type %><%= settings_menu_item.parent.name rescue "-" %><%= settings_menu_item.created_by %><%= settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %><%= link_to 'Show', settings_menu_category_simple_menu_item_path(@category, settings_menu_item ) %><%= link_to 'Edit', edit_settings_menu_category_simple_menu_item_path(@category, settings_menu_item) %><%= link_to 'Destroy', settings_menu_category_simple_menu_item_path(@category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } %><%= link_to 'Show', settings_menu_category_set_menu_item_path(@category, settings_menu_item ) %><%= link_to 'Edit', edit_settings_menu_category_set_menu_item_path(@category, settings_menu_item) %><%= link_to 'Destroy', settings_menu_category_set_menu_item_path(@category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } %>
    -
    -
    - <%= paginate @sub_menu, param_name: :page, :outer_window => 3 %> - -<% end %> -

    Menu Item Instances diff --git a/app/views/settings/simple_menu_items/show.html.erb b/app/views/settings/simple_menu_items/show.html.erb index 9bfae1b0..d9961c92 100644 --- a/app/views/settings/simple_menu_items/show.html.erb +++ b/app/views/settings/simple_menu_items/show.html.erb @@ -23,10 +23,10 @@ Type Accout Menu category - Menu item + Min qty - Min selectable item - Max selectable item + Created At Action @@ -40,10 +40,7 @@ <%= @settings_menu_item.type %> <%= @settings_menu_item.account.title %> <%= @settings_menu_item.menu_category_id %> - <%= @settings_menu_item.menu_item_id %> <%= @settings_menu_item.min_qty %> - <%= @settings_menu_item.min_selectable_item %> - <%= @settings_menu_item.max_selectable_item %> <%= @settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %> @@ -54,60 +51,7 @@

    -<% if @sub_menu.count > 0 %> -
    -
    -
    -

    Sub Menu Items

    - - - - - - - - - - - - - - - - - <% @sub_menu.each do |settings_menu_item| %> - - - - - - - - - - - - <% if settings_menu_item.type == "SimpleMenuItem" %> - - - - <% else %> - - - - <% end %> - - <% end %> - -
    Item codeNameAlt nameTypeParent ItemCreated byCreated at
    <%= settings_menu_item.item_code %><%= settings_menu_item.name %><%= settings_menu_item.alt_name %><%= settings_menu_item.type %><%= settings_menu_item.parent.name rescue "-" %><%= settings_menu_item.created_by %><%= settings_menu_item.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %><%= link_to 'Show', settings_menu_category_simple_menu_item_path(@category, settings_menu_item ) %><%= link_to 'Edit', edit_settings_menu_category_simple_menu_item_path(@category, settings_menu_item) %><%= link_to 'Destroy', settings_menu_category_simple_menu_item_path(@category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } %><%= link_to 'Show', settings_menu_category_set_menu_item_path(@category, settings_menu_item ) %><%= link_to 'Edit', edit_settings_menu_category_set_menu_item_path(@category, settings_menu_item) %><%= link_to 'Destroy', settings_menu_category_set_menu_item_path(@category, settings_menu_item ), method: :delete, data: { confirm: 'Are you sure?' } %>
    -
    -
    - <%= paginate @sub_menu, param_name: :page, :outer_window => 3 %> - -<% end %> - -

    Menu Item Instances diff --git a/config/routes.rb b/config/routes.rb index 631f1316..619295eb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -35,6 +35,7 @@ Rails.application.routes.draw do resources :menu_item_attributes, only: [:index] resources :menu_item_options, only: [:index] resources :menu_sold_out, only: [:index] + get "item_sets" => "item_sets#index" end #User request move table or bills diff --git a/db/migrate/20170327152733_create_menu_categories.rb b/db/migrate/20170327152733_create_menu_categories.rb index 59e3a8c9..3b978654 100644 --- a/db/migrate/20170327152733_create_menu_categories.rb +++ b/db/migrate/20170327152733_create_menu_categories.rb @@ -8,7 +8,7 @@ class CreateMenuCategories < ActiveRecord::Migration[5.1] t.integer :order_by t.string :created_by, :null => false t.references :menu_category, :null => true - + t.boolean :is_available, :null => false, :default => true t.timestamps end end diff --git a/db/migrate/20170811071000_create_item_sets.rb b/db/migrate/20170811071000_create_item_sets.rb index d666222c..07b42355 100644 --- a/db/migrate/20170811071000_create_item_sets.rb +++ b/db/migrate/20170811071000_create_item_sets.rb @@ -2,6 +2,7 @@ class CreateItemSets < ActiveRecord::Migration[5.1] def change create_table :item_sets do |t| t.string :name + t.string :alt_name t.integer :min_selectable_qty t.integer :max_selectable_qty diff --git a/db/migrate/20170816042256_settings_products.rb b/db/migrate/20170816042256_settings_products.rb index 69c790fc..73535db3 100644 --- a/db/migrate/20170816042256_settings_products.rb +++ b/db/migrate/20170816042256_settings_products.rb @@ -2,7 +2,6 @@ class SettingsProducts < ActiveRecord::Migration[5.1] def change create_table :products do |t| t.string :item_code, :limit => 16 - t.string :name, :null => false t.string :alt_name t.integer :unit_price From e448265a48291b4e7b5fb1325134b472e6853f66 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 17 Aug 2017 18:55:29 +0630 Subject: [PATCH 65/71] update add oreder --- app/views/origami/addorders/show.html.erb | 57 ++++++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb index 638da002..1c400d0d 100644 --- a/app/views/origami/addorders/show.html.erb +++ b/app/views/origami/addorders/show.html.erb @@ -23,7 +23,7 @@

    -
    +
    @@ -49,6 +49,51 @@ + + + From 3b8a5183577c63dde12587548761782ac22e9e78 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 18 Aug 2017 19:09:09 +0630 Subject: [PATCH 68/71] update addorder --- .../restaurant/menu/_menu_item.json.jbuilder | 14 +- .../menu_categories/show.json.jbuilder | 61 ++++---- app/views/origami/addorders/show.html.erb | 141 ++++++++++++------ 3 files changed, 132 insertions(+), 84 deletions(-) diff --git a/app/views/api/restaurant/menu/_menu_item.json.jbuilder b/app/views/api/restaurant/menu/_menu_item.json.jbuilder index ffad3dc2..6446169f 100644 --- a/app/views/api/restaurant/menu/_menu_item.json.jbuilder +++ b/app/views/api/restaurant/menu/_menu_item.json.jbuilder @@ -28,13 +28,13 @@ json.options item.item_options # elsif item.menu_item_instances.count > 1 then json.instances item.menu_item_instances do |is| - json.code = is.item_instance_code - json.name = is.item_instance_name - json.price = is.price - json.is_available = is.is_available - json.is_on_promotion = is.is_on_promotion - json.promotion_price = is.promotion_price - json.item_attributes = is.item_attributes + json.code is.item_instance_code + json.name is.item_instance_name + json.price is.price + json.is_available is.is_available + json.is_on_promotion is.is_on_promotion + json.promotion_price is.promotion_price + json.item_attributes is.item_attributes # end end diff --git a/app/views/api/restaurant/menu_categories/show.json.jbuilder b/app/views/api/restaurant/menu_categories/show.json.jbuilder index f48f6c77..ad05acbf 100644 --- a/app/views/api/restaurant/menu_categories/show.json.jbuilder +++ b/app/views/api/restaurant/menu_categories/show.json.jbuilder @@ -1,43 +1,48 @@ if @menu.menu_items json.menu_items @menu.menu_items do |item| #Menu Item Information - json.item_code item.item_code - json.name item.name - json.alt_name item.alt_name - json.type item.type - json.min_qty item.min_qty + # json.item_code item.item_code + # json.name item.name + # json.alt_name item.alt_name + # json.type item.type + # json.min_qty item.min_qty # json.min_selectable_item item.min_selectable_item # json.max_selectable_item item.max_selectable_item #Item instance - if item.menu_item_instances.count == 1 then + # if item.menu_item_instances.count == 1 then - item_instance = item.menu_item_instances[0] - json.price item_instance.price - json.is_available item_instance.is_available - json.is_on_promotion item_instance.is_on_promotion - json.promotion_price item_instance.promotion_price - json.item_attributes item_instance.item_attributes + # item_instance = item.menu_item_instances[0] + # json.price item_instance.price + # json.is_available item_instance.is_available + # json.is_on_promotion item_instance.is_on_promotion + # json.promotion_price item_instance.promotion_price + # json.item_attributes item_instance.item_attributes - elsif item.menu_item_instances.count > 1 then + # elsif item.menu_item_instances.count > 1 then - json.item_instances item.menu_item_instances do |is| - json.item_instance_item_code is.item_instance_code - json.item_instance_name is.item_instance_name - json.price is.price - json.is_available is.is_available - json.is_on_promotion is.is_on_promotion - json.promotion_price is.promotion_price - json.item_attributes is.item_attributes - end + # json.item_instances item.menu_item_instances do |is| + # json.item_instance_item_code is.item_instance_code + # json.item_instance_name is.item_instance_name + # json.price is.price + # json.is_available is.is_available + # json.is_on_promotion is.is_on_promotion + # json.promotion_price is.promotion_price + # json.item_attributes is.item_attributes + # end - end + # end #Child Menu items - if (item.menu_item_sets) then - json.set_items item.menu_item_sets.each do |item| - json.partial! 'api/restaurant/menu/menu_item', item: item - end + # if (item.menu_item_sets) then + # json.set_items item.menu_item_sets.each do |item| + # json.partial! 'api/restaurant/menu/menu_item', item: item + # end - end + #end + # if category.menu_items + # json.items category.menu_items do |item| + json.partial! 'api/restaurant/menu/menu_item', item: item + # end + # end end end diff --git a/app/views/origami/addorders/show.html.erb b/app/views/origami/addorders/show.html.erb index f30d8b84..0e8a8163 100644 --- a/app/views/origami/addorders/show.html.erb +++ b/app/views/origami/addorders/show.html.erb @@ -49,9 +49,51 @@ + + + + + -
    - - - - - - - - - - - - - - -
    Item NameQuantity
    - - - -
    - -
    + + + + + + + + + + + + + + + +
    Item NameQuantity
    + + + +
    +
    diff --git a/app/views/settings/menu_item_instances/show.html.erb b/app/views/settings/menu_item_instances/show.html.erb index 40383b51..2fb1ca39 100644 --- a/app/views/settings/menu_item_instances/show.html.erb +++ b/app/views/settings/menu_item_instances/show.html.erb @@ -24,8 +24,8 @@ On Promotion Promotion Price Available - Created At - + Is Default + Created At @@ -38,6 +38,7 @@ <%= @settings_menu_item_instances.is_on_promotion %> <%= @settings_menu_item_instances.promotion_price %> <%= @settings_menu_item_instances.is_available %> + <%= @settings_menu_item_instances.is_default %> <%= @settings_menu_item_instances.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %> <% if params[:simple_menu_item_id] %> <%= link_to 'Edit', edit_settings_simple_menu_item_menu_item_instance_path(@item,@settings_menu_item_instances) %> diff --git a/db/migrate/20170402084230_create_menu_item_instances.rb b/db/migrate/20170402084230_create_menu_item_instances.rb index c79cb322..8e95f8f5 100644 --- a/db/migrate/20170402084230_create_menu_item_instances.rb +++ b/db/migrate/20170402084230_create_menu_item_instances.rb @@ -9,6 +9,7 @@ class CreateMenuItemInstances < ActiveRecord::Migration[5.1] t.boolean :is_on_promotion, :null => false, :default => false t.decimal :promotion_price, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.boolean :is_available, :null => false, :default => true + t.boolean :is_default, :null => false, :default => true t.timestamps end end diff --git a/db/seeds.rb b/db/seeds.rb index 2a9e422a..bf458f2a 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -125,6 +125,7 @@ product = Account.create({title: "Product", account_type: "2"}) #Default Menu Options menu_options = MenuItemOption.create([{option_type: "Spicy", name: "Less Spicy", value: "less_spicy"},{option_type: "Spicy", name: "Spicy", value: "spicy"},{option_type: "Spicy", name: "Super Spicy", value: "super_spicy"}]) menu_options = MenuItemOption.create([{option_type: "Oil", name: "Less Oil", value: "less_oil"},{name: "No MSG", value: "no_msg"},{option_type: "Sweet", name: "Less Sweet", value: "less_sweet"}]) +menu_pkg_options = MenuItemOption.create([{option_type: "Package", name: "Bottle", value: "Bottle"},{option_type: "Package", name: "Can", value: "can"}]) # #Default Menu Category menu_category1 = MenuCategory.create({menu: menu, code:"C001", name: "Soup Base", alt_name: "Soup_base", order_by: 1, is_available: 1, created_by: "SYSTEM DEFAULT"}) diff --git a/public/image/menu_images/icons8-Food-100.png b/public/image/menu_images/icons8-Food-100.png new file mode 100644 index 0000000000000000000000000000000000000000..a77e616915a0092eebe86fb03492d432df762dd9 GIT binary patch literal 5031 zcmV;Y6IkqtP)=6J8S`pvvI{d)Rc zqnXhtMORTsdVT-;JNo;&zb3eo3Tg&OLG|WNXK)9Q0$T*GfNWX6<9QJBLV@+$TX!fb z2+*cdy!wx?)wg*oWS{HbH#F4+D4wSTwVBpMDB1!lUVZro^%rDy*aGs(#-<9Yl0B5t zd6_m|P~|k#H@sHAGt)k8-O#idz;`n(FO=)mfT#bVvA#vD&lZp^8=AHe;P124fr6+e z5XTI=mFd*MEgPEF65!Wa9z<^-jt9m5*aEV3L(@$F6|56e@0*U`O6W=IaZrEPGjqi^X5S>>7?;9DP{g=@xLRkMV9B#*G-AeDDlVaeAL6VKA_t#6t?+m!+6o`%MC zb*_MHUEj131h24+<)4~_mET&8V8B)W`xs*WvR=N}jr~7(%WSZrvEJ7}{_Ulv1xf%% zjS5ybJY&{%ZvQE?A2_Z5?gR*r#k zTZ3r%@ow7%B3&(8H|%Huh)#cZKQb40e|8=ifs8FuP#ge?6#}I|DJH5?L{y5QI7K+F z=>tFV+OHA4J*fYz0V`zMjUCPM+LcHJJcZ0$d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PF3e2(52tDdG4ST1u_4t zbzuLyrNN#)oNV4_X3Lt|%bN|RJ+~4{ne_<=w~podd(Znv(f`pUy_sBCi^V`ZUL92D z-aCTci`NpvcR2y?OQ`dJOkVRyuIJZx{rzVyVju~Kmy_nc8vq~%Fmt<(U_Jdl%m8L$ zhxuUrnG7b+Wpd(i6sd%bi5+y9Jg3&ezS!=(0gfQ+uoV*1(-D?J>nU0&aS Date: Mon, 21 Aug 2017 10:09:23 +0630 Subject: [PATCH 70/71] Coupon / Voucher data change --- app/controllers/origami/voucher_controller.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/origami/voucher_controller.rb b/app/controllers/origami/voucher_controller.rb index 7eda6084..e65abc85 100644 --- a/app/controllers/origami/voucher_controller.rb +++ b/app/controllers/origami/voucher_controller.rb @@ -22,7 +22,7 @@ class Origami::VoucherController < BaseOrigamiController def create cash = params[:amount] sale_id = params[:sale_id] - sale_id = params[:refnumber] + voucher_no = params[:refnumber] if(Sale.exists?(sale_id)) customer_data= Customer.find_by_customer_id(sale_data.customer_id) if customer_data @@ -37,11 +37,12 @@ class Origami::VoucherController < BaseOrigamiController auth_token = member_actions.auth_token.to_s # membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid,auth_token) # if membership_data["status"]==true + # app_token: token,membership_id:membership_id, + # campaign_type_id:campaign_type_id,merchant_uid:merchant_uid, + # auth_token:auth_token begin response = HTTParty.get(url, - :body => { app_token: token,membership_id:membership_id, - campaign_type_id:campaign_type_id,merchant_uid:merchant_uid, - auth_token:auth_token + :body => { voucher_no: voucher_no,membership_id:membership_id }.to_json, :headers => { 'Content-Type' => 'application/json', From 150c843fe0bedf38a0e30a0c2ded1ebfe27e71d6 Mon Sep 17 00:00:00 2001 From: yamin Date: Mon, 21 Aug 2017 10:14:16 +0630 Subject: [PATCH 71/71] Update --- app/views/settings/products/_form.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/settings/products/_form.html.erb b/app/views/settings/products/_form.html.erb index 37a049c6..a6711a82 100644 --- a/app/views/settings/products/_form.html.erb +++ b/app/views/settings/products/_form.html.erb @@ -7,6 +7,7 @@ <%= f.input :alt_name %> <%= f.input :unit_price %> <%= f.input :image_path %> + <%= f.input :description %> <%= f.input :information %>