diff --git a/Gemfile b/Gemfile index 5344bdc5..fa2990ad 100644 --- a/Gemfile +++ b/Gemfile @@ -72,6 +72,10 @@ gem 'filterrific' gem 'cancancan', '~> 1.10' +#pageless no need for current +# gem 'will_paginate' +# gem 'pageless-rails', github: 'rorlab/pageless-rails' + # Use Capistrano for deployment # gem 'capistrano-rails', group: :development diff --git a/app/assets/images/ajax-loader.gif b/app/assets/images/ajax-loader.gif new file mode 100644 index 00000000..4155add2 Binary files /dev/null and b/app/assets/images/ajax-loader.gif differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 63c871d9..9adb6b75 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -30,134 +30,3 @@ function export_to(path) var form_params = $("#frm_report").serialize(); window.location = path+"?"+ form_params; } - -/* -* ToDo Move to here from pages -* -* - - - -$(function(){ - $('#custom_excel').hide(); - - $('#custom_excel').click(function(){ - var url = $('#custom_excel').attr('data-url'); - $('#frm_report').attr('action',url) - $('#frm_report').submit(); - // window.location = url; - }); - - var item = $('#item').val(); - var payment_type = $('#payment_type'); - - if(item == 'order'){ - $('#cashier').hide(); - $('#waiter').show(); - if(payment_type){ - $('#payment_type').hide(); - } - } - else if(item == 'sale'){ - $('#waiter').hide(); - $('#cashier').show(); - } - else{ - $('#waiter').hide(); - $('#cashier').show(); - $("#item").val('sale'); - } -}); - -//Reset the form to pervious values -$("#branch").val(<%=params[:branch]%>); -$("#waiter").val("<%=params[:waiter]%>"); -$("#cashier").val(<%=params[:cashier]%>); -$("#product").val(<%=params[:product]%>); -$("#singer").val(<%=params[:singer]%>); -$("#item").val('<%=params[:item]%>'); -$("#guest_role").val('<%=params[:guest_role]%>'); - - -$("#from").val("<%=params[:from]%>"); -$("#to").val("<%=params[:to]%>"); -$("#sel_period").val(<%=params[:period]%>); -$("#sel_sale_type").val(<%=params[:sale_type]%>); - -<% if params[:period_type] == 1 || params[:period_type] == "1" %> - $("#rd_period_type_1").attr("checked","checked"); -<% else %> - $("#rd_period_type_0").attr("checked","checked"); -<% end %> -$(".btn-group button").removeClass("active"); -<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %> -$("#btn_report_type_<%= report_type %>").addClass("active"); - -$('#item').change(function(){ - var item = $('#item').val(); - var payment_type = $('#payment_type'); - - if(item == 'sale'){ - $('#waiter').hide(); - $('#cashier').show(); - if(payment_type){ - $('#payment_type').show(); - } - } - else{ - $('#cashier').hide(); - $('#waiter').show(); - if(payment_type){ - $('#payment_type').hide(); - } - } -}); - -$(function(){ - var check_arr = []; - var search = '<%= params[:period_type] %>'; - if(search){ - if(parseInt(search) == 0){ - search_by_period(); - } - else{ - search_by_date(); - } - }else{ - search_by_period(); - } - $('#sel_period').change(function(){ - search_by_period(); - }); - function search_by_period(){ - var period = $('#sel_period').val(); - var period_type = 0; - var from = ""; - var to = ""; - } - - $('#from').change(function(){ - search_by_date(); - }); - - $('#to').change(function(){ - search_by_date(); - }); - function search_by_date(){ - var from = $('#from').val(); - var to = $('#to').val(); - var period = 0; - var period_type = 1; - if(to != '' && from != ''){ - shift_name = from + ',' + to; - check_arr.push(to); - // console.log(check_arr.length) - if(check_arr.length == 1){ - } - if(check_arr.length == 3){ - check_arr = []; - } - } - } -}); -*/ diff --git a/app/assets/stylesheets/CRM.scss b/app/assets/stylesheets/CRM.scss index cf6782dd..82b84afd 100644 --- a/app/assets/stylesheets/CRM.scss +++ b/app/assets/stylesheets/CRM.scss @@ -52,4 +52,33 @@ @include media-breakpoint-only(xl) { column-count: 5; } +} + +#sxModal { + display: none; + overflow: auto; + width: 100%; + height: 100%; + background-color: #000; + background-color: rgba(0,0,0,0.4); + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1100; +} + +#sxModal-Content { + position: relative; + left: 42%; + top: 30%; + background-color: #32ad1a; + color: #fff; + text-align: center; + width: 200px; + height: 200px; + padding-top: 5%; + border-radius: 100px; + z-index: 1101; } \ No newline at end of file diff --git a/app/assets/stylesheets/OQS.scss b/app/assets/stylesheets/OQS.scss index 57c5a36d..74a8032f 100644 --- a/app/assets/stylesheets/OQS.scss +++ b/app/assets/stylesheets/OQS.scss @@ -24,4 +24,4 @@ width: 49%; font-size: 18px; margin: 0px 0px 5px 0px; -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 1f195ba5..10e2b319 100644 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -10,7 +10,8 @@ // padding-top: 4.5rem; // } .card-columns { - font-size: 18px !important;} + font-size: 18px !important; +} .others-payment{ line-height:100px; @@ -53,7 +54,8 @@ .payment{ height:70px;line-height:70px; - align:center;color:white; + align:center; + color:white; font-size:16px; margin-top:5px; } @@ -161,15 +163,15 @@ } .green{ - background-color: #009900 + background-color: #009900; } .orange{ - background-color: #FF8C00 + background-color: #FF8C00; } .blue{ - background-color: blue + background-color: blue; } /* End Colors */ @@ -212,3 +214,57 @@ tr.discount-item-row:hover { margin-top:-40px !important; } +#sxModal { + display: none; + overflow: auto; + width: 100%; + height: 100%; + background-color: #000; + background-color: rgba(0,0,0,0.4); + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1100; +} + +#sxModal-Content { + position: relative; + left: 42%; + top: 30%; + background-color: #d9534f; + color: #fff; + text-align: center; + width: 200px; + height: 200px; + padding-top: 5%; + border-radius: 100px; + z-index: 1101; +} + +/*Loading gif for payment*/ + +#loading_wrapper{ + + position: fixed; + background-color: #C8C8C8 ; + height: 100%; + width: 100%; + left: 0; + opacity: 0.6; + top: 0; + z-index: 9999999; +} +#loading{ + position: relative; + height: 100%; + width: 100%; + background-image: url('../../../image/loading-ajax.gif'); + background-position: center center; + background-repeat: no-repeat; + opacity: 1; + filter: alpha(opacity=100); /* ie */ + -moz-opacity: 1; /* mozilla */ + +} diff --git a/app/controllers/base_report_controller.rb b/app/controllers/base_report_controller.rb index 12eeccd2..af9ec4fc 100644 --- a/app/controllers/base_report_controller.rb +++ b/app/controllers/base_report_controller.rb @@ -34,12 +34,10 @@ class BaseReportController < ActionController::Base to = params[:to] day_ref = Time.now.utc.getlocal - if params[:report_type] == "daily_sale" || params[:report_type] == "sale_item" + if from.present? && to.present? - if from != "" && to != "" - - f_date = DateTime.parse(params[:from]) - t_date = DateTime.parse(params[:to]) + f_date = DateTime.parse(from) + t_date = DateTime.parse(to) f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec) t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec) from = f_time.beginning_of_day.utc.getlocal @@ -83,59 +81,6 @@ class BaseReportController < ActionController::Base to = (day_ref - 1.year).end_of_year.utc end end - else # end daily sale report - if period_type.to_i == 1 - - if params[:from] != "" && params[:to] !="" - - f_date = DateTime.parse(params[:from]) - t_date = DateTime.parse(params[:to]) - f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec) - t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec) - from = f_time.beginning_of_day.utc.getlocal - to = t_time.end_of_day.utc.getlocal - else - from = day_ref.beginning_of_day.utc - to = day_ref.end_of_day.utc - end - else - case period.to_i - when PERIOD["today"] - - from = day_ref.beginning_of_day.utc - to = day_ref.end_of_day.utc - - when PERIOD["yesterday"] - from = (day_ref - 1.day).beginning_of_day.utc - to = (day_ref - 1.day).end_of_day.utc - - when PERIOD["this_week"] - from = Time.now.beginning_of_week.utc - to = Time.now.utc - when PERIOD["last_week"] - from = (day_ref - 7.day).beginning_of_week.utc - to = (day_ref - 7.day).end_of_week.utc - when PERIOD["last_7"] - from = (day_ref - 7.day).utc - to = Time.now.utc - when PERIOD["this_month"] - from = Time.now.beginning_of_month.utc - to = Time.now.utc - when PERIOD["last_month"] - from = (day_ref - 1.month).beginning_of_month.utc - to = (day_ref - 1.month).end_of_month.utc - when PERIOD["last_30"] - from = (day_ref - 30.day).utc - to = Time.now.utc - when PERIOD["this_year"] - from = Time.now.beginning_of_year.utc - to = Time.now.utc - when PERIOD["last_year"] - from = (day_ref - 1.year).beginning_of_year.utc - to = (day_ref - 1.year).end_of_year.utc - end - end - end return from, to diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 7b846db0..4b045221 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -6,7 +6,6 @@ class Crm::CustomersController < BaseCrmController # GET /crm/customers.json def index filter = params[:filter] - if filter.nil? @crm_customers = Customer.all else @@ -49,21 +48,7 @@ class Crm::CustomersController < BaseCrmController #get customer amount @customer = Customer.find(params[:id]) @response = Customer.get_membership_transactions(@customer) - # get member information - total = Customer.get_member_account(@customer) - - - @balance = 0.00 - @accountable_type = '' - if total["status"]==true - total["data"].each do |res| - if res["accountable_type"] == "RebateAccount" || res["accountable_type"] == "RebatebonusAccount" - @balance += res["balance"] - # @accountable_type = res["accountable_type"] - @accountable_type = "Rebate Balance" - end - end - end + # @response = "" #end customer amount @@ -95,10 +80,10 @@ class Crm::CustomersController < BaseCrmController address = customer_params[:address] nrc = customer_params[:nrc_no] card_no = customer_params[:card_no] + paypar_account_no = customer_params[:paypar_account_no] member_group_id = params[:member_group_id] if member_group_id.present? - puts "aaaaaaaaa" membership = MembershipSetting.find_by_membership_type("paypar_url") memberaction = MembershipAction.find_by_membership_type("create_membership_customer") merchant_uid = memberaction.merchant_account_id.to_s @@ -109,6 +94,7 @@ class Crm::CustomersController < BaseCrmController response = HTTParty.post(url, :body => {name: name,phone: phone,email: email, dob: dob,address: address,nrc:nrc,card_no:card_no, + paypar_account_no: paypar_account_no, member_group_id: member_group_id, merchant_uid:merchant_uid,auth_token:auth_token}.to_json, :headers => { @@ -119,18 +105,18 @@ class Crm::CustomersController < BaseCrmController ) rescue HTTParty::Error - response = {status: false, message: "Can't open membership server "} + response = {"status" => false, "message" => "Can't open membership server "} rescue Net::OpenTimeout - - response = { status: false , message: "Can't open membership server "} + response = {"status" => false, "message" => "Can't open membership server "} rescue OpenURI::HTTPError - response = { status: false, message: "Can't open membership server "} + response = {"status" => false, "message" => "Can't open membership server "} rescue SocketError - response = { status: false, message: "Can't open membership server "} - end + response = {"status" => false, "message" => "Can't open membership server "} + end + if response["status"] == true customer = Customer.find(@crm_customers.customer_id) status = customer.update_attributes(membership_id: response["customer_datas"]["id"],membership_type:member_group_id ) @@ -145,9 +131,9 @@ class Crm::CustomersController < BaseCrmController customer = Customer.find(@crm_customers.customer_id) status = customer.update_attributes(membership_type:member_group_id ) if params[:sale_id] - format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created.' + response[:message]} + format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created.' + response["message"]} else - format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created.' + response[:message] } + format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created.' + response["message"] } end end else @@ -186,6 +172,7 @@ end address = customer_params[:address] nrc = customer_params[:nrc_no] card_no = customer_params[:card_no] + paypar_account_no = customer_params[:paypar_account_no] id = @crm_customer.membership_id member_group_id = params[:member_group_id] @@ -201,6 +188,7 @@ end response = HTTParty.post(url, :body => { name: name,phone: phone,email: email, dob: dob,address: address,nrc:nrc, + paypar_account_no: paypar_account_no, card_no:card_no,member_group_id: member_group_id, merchant_uid:merchant_uid,auth_token:auth_token}.to_json, :headers => { @@ -245,6 +233,7 @@ end response = HTTParty.post(url, :body => {name: name,phone: phone,email: email, dob: dob,address: address,nrc:nrc,card_no:card_no, + paypar_account_no: paypar_account_no, id: id,member_group_id:member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json, :headers => { 'Content-Type' => 'application/json', @@ -301,6 +290,6 @@ end def customer_params params.require(:customer).permit(:name, :company, :contact_no, :email, - :date_of_birth,:salutation,:gender,:nrc_no,:address,:card_no) + :date_of_birth,:salutation,:gender,:nrc_no,:address,:card_no, :paypar_account_no) end end diff --git a/app/controllers/crm/dining_queues_controller.rb b/app/controllers/crm/dining_queues_controller.rb index 9c5f8b73..22351395 100644 --- a/app/controllers/crm/dining_queues_controller.rb +++ b/app/controllers/crm/dining_queues_controller.rb @@ -86,7 +86,7 @@ class Crm::DiningQueuesController < BaseCrmController table_id = params[:table_id] status = queue.update_attributes(dining_facility_id: table_id,status:"Assign") - status = DiningFacility.find(table_id).update_attributes(status: "occupied") + # status = DiningFacility.find(table_id).update_attributes(status: "occupied") if status == true diff --git a/app/controllers/crm/home_controller.rb b/app/controllers/crm/home_controller.rb index 6866ddf1..012f2bc6 100644 --- a/app/controllers/crm/home_controller.rb +++ b/app/controllers/crm/home_controller.rb @@ -1,13 +1,13 @@ class Crm::HomeController < BaseCrmController def index - # @booking = Booking.all - # @customer = Customer.all - # from = Time.now.beginning_of_day.utc - # to = Time.now.end_of_day.utc - # @queue = DiningQueue.where('created_at BETWEEN ? AND ?', from, to).order('queue_no ASC') - redirect_to crm_customers_path - # .where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to) + @booking = Booking.all + @customer = Customer.all + from = Time.now.beginning_of_day.utc + to = Time.now.end_of_day.utc + @queue = DiningQueue.where('created_at BETWEEN ? AND ?', from, to).order('queue_no ASC') + redirect_to crm_customers_path + # .where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to) end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index d6960bc3..ead69f39 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -21,7 +21,8 @@ class HomeController < ApplicationController session[:session_token] = @employee.token_session route_by_role(@employee) else - render :show, flash[:notice] => "Invalid PIN for Employee. Please try again!" + flash[:notice] ="Invalid PIN for Employee. Please try again!" + render :show end end @@ -41,9 +42,12 @@ class HomeController < ApplicationController elsif @employee.role == "manager" session[:session_token] = @employee.token_session redirect_to dashboard_path - elsif @employee.role == "accountant" + elsif @employee.role == "supervisour" session[:session_token] = @employee.token_session - redirect_to dashboard_path + redirect_to origami_root_path + elsif @employee.role == "account" + session[:session_token] = @employee.token_session + redirect_to reports_dailysale_index_path else render :index end @@ -65,6 +69,8 @@ class HomeController < ApplicationController end def destroy + # clear in employee session + Employee.logout(session[:session_token]) session[:session_token] = nil redirect_to root_path end @@ -93,12 +99,15 @@ class HomeController < ApplicationController redirect_to new_origami_shift_path end elsif employee.role == "manager" - redirect_to oqs_root_path + redirect_to dashboard_path elsif employee.role == "waiter" redirect_to oqs_root_path elsif employee.role == "crm" redirect_to crm_root_path - + elsif @employee.role == "supervisour" + redirect_to origami_root_path + elsif @employee.role == "account" + redirect_to reports_dailysale_index_path end end end diff --git a/app/controllers/oqs/home_controller.rb b/app/controllers/oqs/home_controller.rb index 226b3a83..d8731ecb 100644 --- a/app/controllers/oqs/home_controller.rb +++ b/app/controllers/oqs/home_controller.rb @@ -26,6 +26,7 @@ class Oqs::HomeController < BaseOqsController @queue_stations_items.push({:zone_id => zone_id , :station_name => que.station_name, :is_active => que.is_active , :is_ap => que.auto_print, :item_count => i }) end + # @queue_items_details = @queue_items_details.paginate(:per_page => 10, :page => params[:page]) @queue_stations_items end @@ -99,6 +100,7 @@ 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") .group("assigned_order_items.assigned_order_item_id") + .order("assigned_order_items.created_at") end # Completed Order @@ -112,8 +114,10 @@ class Oqs::HomeController < BaseOqsController left join booking_orders as bo on bo.order_id = assigned_order_items.order_id left join bookings as bk on bk.booking_id = bo.booking_id left join dining_facilities as df on df.id = bk.dining_facility_id") - .where("assigned_order_items.delivery_status = true AND odt.price <> 0") + .where("assigned_order_items.delivery_status = true AND odt.price <> 0 AND assigned_order_items.created_at between '#{Time.now.beginning_of_day.utc}' and '#{Time.now.end_of_day.utc}'") .group("assigned_order_items.order_id") + .limit(20) + .order("assigned_order_items.created_at") # completed_order = AssignedOrderItem.group(:order_id).where('delivery_status=true'); diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index 203e5600..26e3c74b 100644 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -50,12 +50,22 @@ class Origami::CustomersController < BaseOrigamiController def update_sale_by_customer id = params[:sale_id][0,3] + customer_id = params[:customer_id] + + # Check and find with card no + if(!customer_id.include? "CUS") + customer = Customer.find_by_paypar_account_no(customer_id) + if(customer != nil) + customer_id = customer.customer_id + end + end + if(id == "SAL") sale = Sale.find(params[:sale_id]) - status = sale.update_attributes(customer_id: params[:customer_id]) + status = sale.update_attributes(customer_id: customer_id) sale.sale_orders.each do |sale_order| order = Order.find(sale_order.order_id) - status = order.update_attributes(customer_id: params[:customer_id]) + status = order.update_attributes(customer_id: customer_id) end else @booking = BookingOrder.find_by_order_id(params[:sale_id]) @@ -63,7 +73,7 @@ class Origami::CustomersController < BaseOrigamiController @orders.each do |bo| order = Order.find(bo.order_id) - status = order.update_attributes(customer_id: params[:customer_id]) + status = order.update_attributes(customer_id: customer_id) end end diff --git a/app/controllers/origami/discounts_controller.rb b/app/controllers/origami/discounts_controller.rb index 16590320..e6ddf11f 100644 --- a/app/controllers/origami/discounts_controller.rb +++ b/app/controllers/origami/discounts_controller.rb @@ -7,7 +7,7 @@ class Origami::DiscountsController < BaseOrigamiController if Sale.exists?(sale_id) @sale_data = Sale.find(sale_id) end - + @member_discount = MembershipSetting.find_by_discount(1) @accounts = Account.all end @@ -42,6 +42,7 @@ class Origami::DiscountsController < BaseOrigamiController sale_item.unit_price = di["price"] sale_item.taxable_price = di["price"] sale_item.is_taxable = 0 + sale_item.account_id = origin_sale_item.account_id sale_item.price = di["price"] sale_item.save @@ -49,11 +50,14 @@ class Origami::DiscountsController < BaseOrigamiController end # Re-calc All Amount in Sale - sale.compute_by_sale_items(sale_id, sale.sale_items, overall_discount.to_f) + sale.compute_by_sale_items(sale_id, sale.sale_items, overall_discount.to_f) + result = {:status=> "Success", :table_id => table_id, :table_type => table_type } + else + result = {:status=> "Please, Check Again!", :table_id => table_id, :table_type => table_type } end - dining = {:table_id => table_id, :table_type => table_type } - render :json => dining.to_json + + render :json => result.to_json end # Remove selected discount Items @@ -78,11 +82,12 @@ class Origami::DiscountsController < BaseOrigamiController # sale.save # Re-calc All Amount in Sale sale.compute_by_sale_items(sale_id, sale.sale_items, sale.total_discount) - end + result = {:status=> "Success", :table_id => table_id, :table_type => table_type } + else + result = {:status=> "Please, Check Again!", :table_id => table_id, :table_type => table_type } + end - dining = {:table_id => table_id, :table_type => table_type } - - render :json => dining.to_json + render :json => result.to_json end # Remove all discount Items @@ -92,13 +97,14 @@ class Origami::DiscountsController < BaseOrigamiController if Sale.exists?(sale_id) sale = Sale.find(sale_id) table_id = sale.bookings[0].dining_facility_id - table_type = DiningFacility.find(table_id).type - + table_type = DiningFacility.find(table_id).type + + discount_items = [] #destroy all discount sale item - sale.sale_items.each do |si| - if si.remark == "Discount" && si.price < 0 - sale.total_amount = (sale.total_amount + si.price.abs) - si.destroy + sale.sale_items.each do |si| + if si.remark == "Discount" && si.price < 0 + sale.total_amount = (sale.total_amount + si.price.abs) + discount_items.push(si) end end @@ -106,13 +112,99 @@ class Origami::DiscountsController < BaseOrigamiController # sale.grand_total = (sale.total_amount - sale.total_discount) + sale.total_tax; # sale.save + #destroy in sale.sale_items + sale.sale_items.destroy(discount_items) + # Re-calc All Amount in Sale sale.compute_by_sale_items(sale_id, sale.sale_items, 0) + result = {:status=> "Success", :table_id => table_id, :table_type => table_type } + else + result = {:status=> "Please, Check Again!", :table_id => table_id, :table_type => table_type } + end + + render :json => result.to_json + end + + # Member Discount + def member_discount + sale_id = params[:sale_id] + # account_types = JSON.parse(params[:account_types]) + account_types = Account.where("discount=?",true) + sub_total = params[:sub_total] + sale = Sale.find(sale_id) + price = SaleItem.calculate_price_by_accounts(sale.sale_items) + + arr = Array.new; + + account_types.each do |at| + price.each do |pc| + if pc[:name] == at.title && pc[:price]>0 + str={type:pc[:name],amount:pc[:price]} + arr.push(str) + end + end end - dining = {:table_id => table_id, :table_type => table_type } + generic_customer_id = sale.customer.membership_id - render :json => dining.to_json + receipt_no = sale.receipt_no + membership = MembershipSetting.find_by_membership_type("paypar_url") + memberaction = MembershipAction.find_by_membership_type("member_discount") + merchant_uid = memberaction.merchant_account_id.to_s + campaign_type_id = memberaction.additional_parameter["campaign_type_id"] + auth_token = memberaction.auth_token.to_s + url = membership.gateway_url.to_s + memberaction.gateway_url.to_s + + # Control for Paypar Cloud + begin + response = HTTParty.post(url, + :body => { account_no: nil, + generic_customer_id:generic_customer_id , + campaign_type_id: campaign_type_id, + receipt_no: receipt_no, + merchant_uid:merchant_uid, + campaign_method:arr.to_json, + total_sale_transaction_amount: sale.grand_total, + auth_token:auth_token}.to_json, + :headers => { + 'Content-Type' => 'application/json', + 'Accept' => 'application/json' + }, :timeout => 10) + rescue HTTParty::Error + response = {:status=> false, :message => "Can't open membership server " } + + rescue Net::OpenTimeout + response = {:status=> false, :message => "Can't open membership server " } + rescue OpenURI::HTTPError + response = {:status=> false, :message => "Can't open membership server " } + + rescue SocketError + response = {:status=> false, :message => "Can't open membership server " } + end + + table_id = sale.bookings[0].dining_facility_id + table_type = DiningFacility.find(table_id).type + + # Re-calc All Amount in Sale + if response["status"] == true + discount_amount = response["discount_earned"] + if response["discount_bonus_earned"] + discount_amount = discount_amount + response["discount_bonus_earned"] + end + sale.compute_by_sale_items(sale_id, sale.sale_items, discount_amount, 'member_discount') + result = {:status=> "Success",:title=>"Member Discount", :table_id => table_id,:table_type => table_type } + end + + if response["status"] == "500" + result = {:status=> response["error"],:title=>"Alert", :table_id => table_id,:table_type => table_type } + end + if !response.nil? + if response[:status] == false + result = {:status=> response[:message],:title=>"Alert", :table_id => table_id,:table_type => table_type } + end + end + + render :json => result.to_json end #discount for selected order diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 32f4ab12..7ee03e47 100644 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -4,7 +4,7 @@ class Origami::HomeController < BaseOrigamiController def index @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') - @complete = Sale.all + @complete = Sale.where("sale_status != 'new'") @orders = Order.all.order('date desc') # @shift = ShiftSale.current_open_shift(current_user.id) end @@ -13,7 +13,7 @@ class Origami::HomeController < BaseOrigamiController def show @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') - @complete = Sale.all + @complete = Sale.where("sale_status != 'new'") @orders = Order.all.order('date desc') @status_order = "" @status_sale = "" diff --git a/app/controllers/origami/movetable_controller.rb b/app/controllers/origami/movetable_controller.rb index 50f2c774..6062216f 100644 --- a/app/controllers/origami/movetable_controller.rb +++ b/app/controllers/origami/movetable_controller.rb @@ -44,12 +44,14 @@ class Origami::MovetableController < BaseOrigamiController change_to = params[:change_to] #new change_from = params[:change_from] #original bookings = Booking.where('dining_facility_id=?',change_from) + booking_array = Array.new bookings.each do | booking | - if booking.sale_id.nil? || booking.sale.sale_status != 'completed' || booking.booking_status != 'moved' + if booking.sale_id.nil? && booking.booking_status != 'moved' booking_array.push(booking) end end + @get_type = Booking.update_dining_facility(booking_array,change_to,change_from) end end diff --git a/app/controllers/origami/orders_controller.rb b/app/controllers/origami/orders_controller.rb index ef213ddd..f3cddd74 100644 --- a/app/controllers/origami/orders_controller.rb +++ b/app/controllers/origami/orders_controller.rb @@ -3,7 +3,7 @@ class Origami::OrdersController < BaseOrigamiController def show @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') - @complete = Sale.all + @complete = Sale.where("sale_status != 'new'") @orders = Order.all.order('status desc') @order = Order.find(params[:order_id]) sale_order = SaleOrder.find_by_order_id(@order.order_id) diff --git a/app/controllers/origami/other_charges_controller.rb b/app/controllers/origami/other_charges_controller.rb index bb0d9e42..b0e6472c 100644 --- a/app/controllers/origami/other_charges_controller.rb +++ b/app/controllers/origami/other_charges_controller.rb @@ -37,6 +37,7 @@ class Origami::OtherChargesController < BaseOrigamiController sale_item.unit_price = di["price"] sale_item.taxable_price = 0 sale_item.is_taxable = 0 + sale_item.account_id = 0 sale_item.price = di["price"] sale_item.save diff --git a/app/controllers/origami/others_payments_controller.rb b/app/controllers/origami/others_payments_controller.rb index c050c3f3..2a24e2ac 100644 --- a/app/controllers/origami/others_payments_controller.rb +++ b/app/controllers/origami/others_payments_controller.rb @@ -6,6 +6,8 @@ class Origami::OthersPaymentsController < BaseOrigamiController @sale_id = params[:sale_id] @payment_method_setting = PaymentMethodSetting.all + @rebate = MembershipSetting.find_by_rebate(1) + # @sale_id = params[:sale_id] # sale_data = Sale.find_by_sale_id(@sale_id) diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index c956f7f9..24d63b71 100644 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -18,7 +18,8 @@ class Origami::PaymentsController < BaseOrigamiController # customer= Customer.where('customer_id=' +.customer_id) customer= Customer.find(sale_data.customer_id) # get member information - if customer.membership_id != nil + rebate = MembershipSetting.find_by_rebate(1) + if customer.membership_id != nil && rebate member_info = Customer.get_member_account(customer) end # get printer info @@ -55,7 +56,8 @@ class Origami::PaymentsController < BaseOrigamiController #shop detail shop_details = Shop.find(1) # get member information - if customer.membership_id != nil + rebate = MembershipSetting.find_by_rebate(1) + if customer.membership_id != nil && rebate member_info = Customer.get_member_account(customer) rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no) end @@ -67,10 +69,8 @@ class Origami::PaymentsController < BaseOrigamiController discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items) printer = Printer::ReceiptPrinter.new(print_settings) - printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid") - - - end + printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid") + end end def show @@ -87,12 +87,13 @@ class Origami::PaymentsController < BaseOrigamiController @sale_data = Sale.find_by_sale_id(sale_id) @balance = 0.00 @accountable_type = '' + @table_no = '' #get customer amount @customer = Customer.find(@sale_data.customer_id) - + rebate = MembershipSetting.find_by_rebate(1) # get member information - if @customer.membership_id != nil + if @customer.membership_id != nil && rebate response = Customer.get_member_account(@customer) if response["status"]==true response["data"].each do |res| @@ -107,6 +108,12 @@ class Origami::PaymentsController < BaseOrigamiController #end customer amount + @sale_data.bookings.each do |sbk| + df = DiningFacility.find(sbk.dining_facility_id) + @table_no = df.type + ' ' + df.name + break + end + @sale_data.sale_payments.each do |spay| if spay.payment_method == "cash" @cash = spay.payment_amount @@ -140,7 +147,8 @@ class Origami::PaymentsController < BaseOrigamiController #shop detail shop_details = Shop.find(1) # get member information - if customer.membership_id != nil + rebate = MembershipSetting.find_by_rebate(1) + if customer.membership_id != nil && rebate member_info = Customer.get_member_account(customer) rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no) end diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb index cfea9d37..687c872f 100644 --- a/app/controllers/origami/request_bills_controller.rb +++ b/app/controllers/origami/request_bills_controller.rb @@ -5,19 +5,24 @@ class Origami::RequestBillsController < BaseOrigamiController @sale = Sale.new sale_order=SaleOrder.new - order_id = params[:id] # order_id - bk_order = BookingOrder.find_by_order_id(order_id) - check_booking = Booking.find_by_booking_id(bk_order.booking_id) - if check_booking.sale_id.nil? - # Create Sale if it doesn't exist - # puts "current_login_employee" - # puts current_login_employee.name - @status, @sale_id = @sale.generate_invoice_from_booking(check_booking.id,current_login_employee, cashier = nil) - @sale_data = Sale.find_by_sale_id(@sale_id) - @sale_items = SaleItem.where("sale_id=?",@sale_id) + if ShiftSale.current_open_shift(current_user.id) + order_id = params[:id] # order_id + bk_order = BookingOrder.find_by_order_id(order_id) + check_booking = Booking.find_by_booking_id(bk_order.booking_id) + if check_booking.sale_id.nil? + # Create Sale if it doesn't exist + # puts "current_login_employee" + # puts current_login_employee.name + @status, @sale_id = @sale.generate_invoice_from_booking(check_booking.id,current_login_employee, cashier = nil) + @sale_data = Sale.find_by_sale_id(@sale_id) + @sale_items = SaleItem.where("sale_id=?",@sale_id) + else + @sale_data = Sale.find_by_sale_id(check_booking.sale_id) + @sale_items = SaleItem.where("sale_id=?",@sale_data.sale_id) + end else - @sale_data = Sale.find_by_sale_id(check_booking.sale_id) - @sale_items = SaleItem.where("sale_id=?",@sale_data.sale_id) + @status = false + @error_message = "No Current Open Shift for This Employee" end # Not Use for these printed bill cannot give customer diff --git a/app/controllers/origami/rooms_controller.rb b/app/controllers/origami/rooms_controller.rb index e5728f99..823136b9 100644 --- a/app/controllers/origami/rooms_controller.rb +++ b/app/controllers/origami/rooms_controller.rb @@ -3,7 +3,7 @@ class Origami::RoomsController < BaseOrigamiController def show @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') - @complete = Sale.all + @complete = Sale.where("sale_status != 'new'") @orders = Order.all.order('date desc') @room = DiningFacility.find(params[:room_id]) @sale_array = Array.new @@ -31,9 +31,6 @@ class Origami::RoomsController < BaseOrigamiController end end end - puts "hhhhhhhhhh" - puts @status - puts @obj.to_json end diff --git a/app/controllers/origami/sale_edit_controller.rb b/app/controllers/origami/sale_edit_controller.rb index 3d632403..209ec4c0 100644 --- a/app/controllers/origami/sale_edit_controller.rb +++ b/app/controllers/origami/sale_edit_controller.rb @@ -21,6 +21,10 @@ class Origami::SaleEditController < BaseOrigamiController @newsaleitem.is_taxable = 1 @newsaleitem.product_name = saleitemObj.product_name + " - void" @newsaleitem.save + + # re-calc tax + saleObj = Sale.find(saleitemObj.sale_id) + saleObj.compute_without_void end # def item_edit @@ -56,6 +60,10 @@ class Origami::SaleEditController < BaseOrigamiController # saleitemObj.remark = 'edit' saleitemObj.product_name = saleitemObj.product_name + " - updated" saleitemObj.save + + # re-calc tax + saleObj = Sale.find(saleitemObj.sale_id) + saleObj.compute_without_void end @@ -71,13 +79,17 @@ class Origami::SaleEditController < BaseOrigamiController end end saleitemObj.destroy + + # re-calc tax + saleObj = Sale.find(saleitemObj.sale_id) + saleObj.compute_without_void end # remove all void items def cancel_all_void sale_id = params[:sale_id] - saleobj = Sale.find(sale_id) - saleobj.sale_items.each do |item| + saleObj = Sale.find(sale_id) + saleObj.sale_items.each do |item| if item.qty.to_i < 0 item.destroy else @@ -85,6 +97,9 @@ class Origami::SaleEditController < BaseOrigamiController end item.save end + + # re-calc tax + saleObj.compute_without_void end def apply_void diff --git a/app/controllers/origami/sales_controller.rb b/app/controllers/origami/sales_controller.rb index c397da0f..3a9586fb 100644 --- a/app/controllers/origami/sales_controller.rb +++ b/app/controllers/origami/sales_controller.rb @@ -3,7 +3,7 @@ class Origami::SalesController < BaseOrigamiController def show @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') - @complete = Sale.all + @complete = Sale.where("sale_status != 'new'") @orders = Order.all.order('date desc') @sale = Sale.find(params[:sale_id]) end diff --git a/app/controllers/origami/shifts_controller.rb b/app/controllers/origami/shifts_controller.rb index e527da46..e03dd0fc 100644 --- a/app/controllers/origami/shifts_controller.rb +++ b/app/controllers/origami/shifts_controller.rb @@ -4,8 +4,6 @@ class Origami::ShiftsController < BaseOrigamiController end def show - puts ">>>>>" - puts current_user.id @shift = ShiftSale.current_open_shift(current_user.id) end @@ -32,18 +30,29 @@ class Origami::ShiftsController < BaseOrigamiController unique_code = "CloseCashierPdf" shop_details = Shop.find(1) + #get tax + shift_obj = ShiftSale.where('id =?',@shift.id) + @sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='') + # get printer info print_settings=PrintSetting.find_by_unique_code(unique_code) printer = Printer::CashierStationPrinter.new(print_settings) - printer.print_close_cashier(print_settings,@shift,shop_details) + printer.print_close_cashier(print_settings,@shift,shop_details,@sale_taxes) + end - + Employee.logout(session[:session_token]) + session[:session_token] = nil end def edit end + def sale_summary + @shift = ShiftSale.current_open_shift(current_user.id) + + end + end diff --git a/app/controllers/origami/void_controller.rb b/app/controllers/origami/void_controller.rb index 687d9fa5..73f89d13 100644 --- a/app/controllers/origami/void_controller.rb +++ b/app/controllers/origami/void_controller.rb @@ -3,12 +3,21 @@ class Origami::VoidController < BaseOrigamiController def overall_void sale_id = params[:sale_id] + if Sale.exists?(sale_id) sale = Sale.find_by_sale_id(sale_id) sale.payment_status = 'void' sale.sale_status = 'void' sale.save + # update count for shift sale + if(sale.sale_status == "void") + if sale.shift_sale_id != nil + shift = ShiftSale.find(sale.shift_sale_id) + shift.calculate(sale_id, "void") + end + end + bookings = sale.bookings bookings.each do |booking| orders = booking.orders diff --git a/app/controllers/reports/bksaleitem_controller.rb b/app/controllers/reports/bksaleitem_controller.rb new file mode 100644 index 00000000..0f91681d --- /dev/null +++ b/app/controllers/reports/bksaleitem_controller.rb @@ -0,0 +1,19 @@ +class Reports::SaleitemController < BaseReportController + authorize_resource :class => false + def index + + from, to, report_type = get_date_range_from_params + + @sale_data = Sale.get_by_range_by_saleitems(from,to,Sale::SALE_STATUS_COMPLETED,report_type) + + respond_to do |format| + format.html + format.xls + end + end + + def show + + end + +end diff --git a/app/controllers/reports/dailysale_controller.rb b/app/controllers/reports/dailysale_controller.rb index 27e812ab..fc1f150f 100644 --- a/app/controllers/reports/dailysale_controller.rb +++ b/app/controllers/reports/dailysale_controller.rb @@ -2,9 +2,12 @@ class Reports::DailysaleController < BaseReportController authorize_resource :class => false def index - from, to ,report_type = get_date_range_from_params + from, to = get_date_range_from_params @sale_data = Sale.daily_sales_list(from,to) @tax = SaleTax.get_tax(from,to) + @from = from + @to = to + respond_to do |format| format.html format.xls diff --git a/app/controllers/reports/receipt_no_controller.rb b/app/controllers/reports/receipt_no_controller.rb index e4157c4e..3ca19e9d 100644 --- a/app/controllers/reports/receipt_no_controller.rb +++ b/app/controllers/reports/receipt_no_controller.rb @@ -1,13 +1,37 @@ class Reports::ReceiptNoController < BaseReportController authorize_resource :class => false def index - from, to = get_date_range_from_params - puts "from..." - puts from - puts "to..." - puts to - @sale_data = Sale.get_receipt_no_list(from,to) - @sale_data = Kaminari.paginate_array(@sale_data).page(params[:page]).per(50) + @payments = [["All Payment",''], ["Cash Payment","cash"], ["Credit Payment","creditnote"], ["FOC Payment","foc"], ["Other Payment","card"]] + + from, to = get_date_range_from_params + + @shift_sale_range = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED) + + @shift = '' + if params[:shift_name].to_i != 0 + shift_sale = ShiftSale.find(params[:shift_name]) + if to.blank? + @shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',shift_sale.shift_started_at) + else + + @shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',shift_sale.shift_started_at, shift_sale.shift_closed_at) + end + end + payment_type = params[:payment_type] + @sale_data = Sale.get_shift_sales_by_receipt_no(@shift_sale_range,@shift,from,to,payment_type) + @sale_taxes = Sale.get_separate_tax(@shift_sale_range,@shift,from,to,payment_type) + + @from = from + @to = to + + if @shift.present? + @shift.each do |sh| + @shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p") + @shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p") + @shift_data = sh + end + end + respond_to do |format| format.html format.xls @@ -15,6 +39,25 @@ authorize_resource :class => false end def show - + from, to = get_date_range_from_params + + @sale_data = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED) + + date_arr = Array.new + @sale_data.each do |sale| + local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p") + local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p") + opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc + closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc + shift_id = sale.id.nil? ? '-' : sale.id + str = {:shift_id => shift_id, :local_opening_date => local_opening_date, :local_closing_date => local_closing_date, :opening_date => opening_date, :closing_date => closing_date} + date_arr.push(str) + end + + out = {:status => 'ok', :message => date_arr} + + respond_to do |format| + format.json { render json: out } + end end end \ No newline at end of file diff --git a/app/controllers/reports/saleitem_controller.rb b/app/controllers/reports/saleitem_controller.rb index 0f91681d..00be65e6 100644 --- a/app/controllers/reports/saleitem_controller.rb +++ b/app/controllers/reports/saleitem_controller.rb @@ -2,9 +2,43 @@ class Reports::SaleitemController < BaseReportController authorize_resource :class => false def index - from, to, report_type = get_date_range_from_params + from, to = get_date_range_from_params + shift_sale_range = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED) - @sale_data = Sale.get_by_range_by_saleitems(from,to,Sale::SALE_STATUS_COMPLETED,report_type) + shift = '' + if params[:shift_name].to_i != 0 + shift_sale = ShiftSale.find(params[:shift_name]) + if to.blank? + shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',shift_sale.shift_started_at) + else + + shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',shift_sale.shift_started_at, shift_sale.shift_closed_at) + end + end + @sale_data, @discount_data , @cash_data , @card_data , @credit_data , @foc_data , @grand_total , @change_amount = Sale.get_by_shift_items(shift_sale_range,shift, from, to, Sale::SALE_STATUS_COMPLETED) + + @account_cate_count = Hash.new {|hash, key| hash[key] = 0} + + + @sale_data.each {|acc_cate| @account_cate_count[acc_cate.account_id] += 1} + + @menu_cate_count = Hash.new {|hash, key| hash[key] = 0} + @sale_data.each {|cate| @menu_cate_count[cate.menu_category_id] += 1} + + + @totalByAccount = Hash.new {|hash, key| hash[key] = 0} + @sale_data.each {|acc| @totalByAccount[acc.account_id] += acc.grand_total} + + @from = from + @to = to + + if shift.present? + shift.each do |sh| + @shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p") + @shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p") + @shift_data = sh + end + end respond_to do |format| format.html @@ -13,7 +47,26 @@ class Reports::SaleitemController < BaseReportController end def show - - end + from, to, report_type = get_date_range_from_params + @sale_data = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED) + + date_arr = Array.new + @sale_data.each do |sale| + local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p") + local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p") + opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc + closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc + shift_id = sale.id.nil? ? '-' : sale.id + str = {:shift_id => shift_id, :local_opening_date => local_opening_date, :local_closing_date => local_closing_date, :opening_date => opening_date, :closing_date => closing_date} + date_arr.push(str) + end + + out = {:status => 'ok', :message => date_arr} + + respond_to do |format| + format.json { render json: out } + end + end + end diff --git a/app/controllers/reports/shiftsale_controller.rb b/app/controllers/reports/shiftsale_controller.rb index 87fae97d..5bc2020c 100644 --- a/app/controllers/reports/shiftsale_controller.rb +++ b/app/controllers/reports/shiftsale_controller.rb @@ -3,16 +3,48 @@ class Reports::ShiftsaleController < BaseReportController def index - from, to, report_type = get_date_range_from_params - @sale_data = Sale.get_by_shiftsales(from,to) - respond_to do |format| + from, to = get_date_range_from_params + @shift = '' + if params[:shift_name].to_i != 0 + @shift = ShiftSale.find(params[:shift_name]) + end + @sale_data = Sale.get_by_shiftsales(from,to,@shift) + @from = from + @to = to + if @shift.present? + + @shift_from = @shift.shift_started_at.nil? ? '-' : @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p") + @shift_to = @shift.shift_closed_at.nil? ? '-' : @shift.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p") + @shift_data = @shift + end + + respond_to do |format| format.html format.xls end end def show - + from, to = get_date_range_from_params + + @sale_data = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED) + + date_arr = Array.new + @sale_data.each do |sale| + local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p") + local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p") + opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc + closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc + shift_id = sale.id.nil? ? '-' : sale.id + str = {:shift_id => shift_id, :local_opening_date => local_opening_date, :local_closing_date => local_closing_date, :opening_date => opening_date, :closing_date => closing_date} + date_arr.push(str) + end + + out = {:status => 'ok', :message => date_arr} + + respond_to do |format| + format.json { render json: out } + end end end diff --git a/app/controllers/settings/membership_settings_controller.rb b/app/controllers/settings/membership_settings_controller.rb index 36bb0092..d4da84cd 100644 --- a/app/controllers/settings/membership_settings_controller.rb +++ b/app/controllers/settings/membership_settings_controller.rb @@ -70,6 +70,6 @@ class Settings::MembershipSettingsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def settings_membership_setting_params - params.require(:membership_setting).permit(:membership_type, :is_active, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_by) + params.require(:membership_setting).permit(:membership_type, :is_active,:discount,:rebate,:bonus,:point, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id, :created_by) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 96956958..ae3934e4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,11 +1,25 @@ module ApplicationHelper - def flash_class(level) - case level - when :notice then "alert alert-info fade-in" - when :success then "alert alert-success fade-in" - when :error then "alert alert-error fade-in" - when :alert then "alert alert-error fade-in" - end -end + def flash_class(level) + case level + when :notice then "alert alert-info fade-in" + when :success then "alert alert-success fade-in" + when :error then "alert alert-error fade-in" + when :alert then "alert alert-error fade-in" + end + end + + # For Pageless + # def pageless(total_pages, url=nil, container=nil) + # opts = { + # :totalPages => total_pages, + # :url => url, + # :loaderMsg => 'Loading more pages...', + # :loaderImage => image_path('load.gif') + # } + + # container && opts[:container] ||= container + + # javascript_tag("$('#{container}').pageless(#{opts.to_json});") + # end end diff --git a/app/models/ability.rb b/app/models/ability.rb index 3e5fc8b6..368aa424 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -75,8 +75,8 @@ class Ability can :read, Sale can :update, Sale - can :add_customer, Customer - can :update_sale_by_customer, Customer + can :add_customer, Customer + can :update_sale_by_customer, Customer can :index, :other_charge can :create, :other_charge @@ -84,6 +84,7 @@ class Ability can :create, :discount can :remove_discount_items, :discount can :remove_all_discount, :discount + can :member_discount, :discount can :first_bill, :payment can :show, :payment @@ -100,8 +101,10 @@ class Ability can :show, :payment can :create, :payment can :reprint, :payment + + can :manage, DiningQueue - elsif user.role == "accountant" + elsif user.role == "account" can :index, :dailysale can :index, :saleitem @@ -110,11 +113,19 @@ class Ability elsif user.role == "supervisour" - can :index, :dailysale - can :index, :saleitem - can :index, :receipt_no - can :index, :shiftsale + can :edit, :sale_edit + can :item_void, :sale_edit + can :item_edit, :sale_edit + can :item_void_cancel, :sale_edit + can :cancel_all_void, :sale_edit + can :apply_void, :sale_edit + can :overall_void, :void + can :first_bill, :payment + can :create, :payment + can :show, :payment + can :reprint, :payment + can :rounding_adj, :payment end end diff --git a/app/models/booking.rb b/app/models/booking.rb index cc4ae389..e3d94a37 100644 --- a/app/models/booking.rb +++ b/app/models/booking.rb @@ -1,4 +1,3 @@ - class Booking < ApplicationRecord self.primary_key = "booking_id" @@ -14,6 +13,7 @@ class Booking < ApplicationRecord def self.update_dining_facility(booking_arr, newd, old) table = DiningFacility.find(newd) exist = table.get_booking + if exist # order exists booking_arr.each do |booking| diff --git a/app/models/customer.rb b/app/models/customer.rb index 2f09ff12..ef777c2d 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -10,6 +10,7 @@ class Customer < ApplicationRecord validates :contact_no, uniqueness: true validates :email, uniqueness: true validates :card_no, uniqueness: true + # validates :paypar_account_no paginates_per 50 @@ -66,6 +67,9 @@ class Customer < ApplicationRecord }, :timeout => 10 ) + rescue HTTParty::Error + response = {status: false, message: "Can't open membership server " } + rescue Net::OpenTimeout response = { status: false , message: "Server Time out"} @@ -193,7 +197,7 @@ class Customer < ApplicationRecord def self.search(search) if search # find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"]) - where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ?", "%#{search}%", "%#{search}%", "%#{search}%",) + where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ? OR paypar_account_no ='#{search}'", "%#{search}%", "%#{search}%", "%#{search}%",) else find(:all) end diff --git a/app/models/employee.rb b/app/models/employee.rb index 2d70768d..7693c448 100644 --- a/app/models/employee.rb +++ b/app/models/employee.rb @@ -54,6 +54,7 @@ class Employee < ApplicationRecord def self.logout(session_token) if (session_token) user = Employee.find_by_token_session(session_token) + if user user.token_session = nil user.session_expiry = nil diff --git a/app/models/menu_category.rb b/app/models/menu_category.rb index e660b4b5..71ad42c8 100644 --- a/app/models/menu_category.rb +++ b/app/models/menu_category.rb @@ -1,10 +1,12 @@ -class MenuCategory < ApplicationRecord +class MenuCategory < ApplicationRecord + before_create :generate_menu_category_code + belongs_to :menu has_many :children, :class_name => "MenuCategory", foreign_key: "menu_category_id" belongs_to :parent, :class_name => "MenuCategory", foreign_key: "menu_category_id", optional: true has_many :menu_items - validates_presence_of :name, :menu, :code, :order_by + validates_presence_of :name, :menu, :order_by default_scope { order('order_by asc') } @@ -12,7 +14,7 @@ class MenuCategory < ApplicationRecord # find the sub menu item of current item sub_menu_cat = MenuCategory.where("menu_category_id=?",menu_category.id) if sub_menu_cat.length != 0 - sub_menu_cat.each do |sub| + sub_menu_cat.each do |sub| if destroyCategory(sub) end end @@ -20,17 +22,22 @@ class MenuCategory < ApplicationRecord items = MenuItem.where("menu_category_id=?",menu_category.id) items.each do |item| abc = MenuItem.deleteRecursive(item) - end + end menu_category.destroy return true else items = MenuItem.where("menu_category_id=?",menu_category.id) items.each do |item| abc = MenuItem.deleteRecursive(item) - end + end menu_category.destroy return false end end + private + + 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 50b70e66..1f1afbe4 100644 --- a/app/models/menu_item.rb +++ b/app/models/menu_item.rb @@ -1,17 +1,19 @@ class MenuItem < ApplicationRecord + before_create :generate_menu_item_code + belongs_to :menu_category, :optional => true has_many :menu_item_instances belongs_to :parent, :class_name => "MenuItem", foreign_key: "menu_item_id", :optional => true has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id" belongs_to :account - validates_presence_of :item_code, :name, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item + validates_presence_of :name, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item default_scope { order('item_code asc') } scope :simple_menu_item, -> { where(type: 'SimpleMenuItem') } - scope :set_menu_item, -> { where(type: 'SetMenuItem') } + scope :set_menu_item, -> { where(type: 'SetMenuItem') } def self.collection MenuItem.select("id, name").map { |e| [e.name, e.id] } @@ -46,7 +48,7 @@ class MenuItem < ApplicationRecord # find the sub menu item of current item sub_menu_items = MenuItem.where("menu_item_id=?",menu_item.id) if sub_menu_items.length != 0 - sub_menu_items.each do |subitem| + sub_menu_items.each do |subitem| if deleteRecursive(subitem) end end @@ -54,17 +56,24 @@ class MenuItem < ApplicationRecord instances = MenuItemInstance.where("menu_item_id=?",menu_item.id) instances.each do |instance| instance.destroy - end + end menu_item.destroy return true else instances = MenuItemInstance.where("menu_item_id=?",menu_item.id) instances.each do |instance| instance.destroy - end + end menu_item.destroy return false end - end + end + + private + + 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 09225a23..f39c29a2 100644 --- a/app/models/menu_item_instance.rb +++ b/app/models/menu_item_instance.rb @@ -1,6 +1,7 @@ class MenuItemInstance < ApplicationRecord belongs_to :menu_item - + before_create :generate_menu_item_instance_code + def self.findParentCategory(item) if item.menu_category_id return item.menu_category_id @@ -9,4 +10,10 @@ class MenuItemInstance < ApplicationRecord findParentCategory(parentitem) end end + + private + + def generate_menu_item_instance_code + self.item_instance_code = SeedGenerator.generate_code(self.class.name, "II") + end end diff --git a/app/models/printer/cashier_station_printer.rb b/app/models/printer/cashier_station_printer.rb index 564b4909..55bf8c39 100644 --- a/app/models/printer/cashier_station_printer.rb +++ b/app/models/printer/cashier_station_printer.rb @@ -22,13 +22,17 @@ class Printer::CashierStationPrinter < Printer::PrinterWorker # end #Bill Receipt Print - def print_close_cashier(printer_settings,shift_sale,shop_details) + def print_close_cashier(printer_settings,shift_sale,shop_details,sale_taxes) #Use CUPS service #Generate PDF #Print - pdf = CloseCashierPdf.new(printer_settings,shift_sale,shop_details) - pdf.render_file "tmp/print_close_cashier.pdf" - self.print("tmp/print_close_cashier.pdf") + cashier = shift_sale.employee.name + shift_name = shift_sale.shift_started_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") + "_" + shift_sale.shift_closed_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") + + pdf = CloseCashierPdf.new(printer_settings,shift_sale,shop_details,sale_taxes) + filename = "tmp/close_cashier_#{cashier}_#{shift_name}.pdf" + pdf.render_file filename + self.print(filename) end diff --git a/app/models/printer/order_queue_printer.rb b/app/models/printer/order_queue_printer.rb index 6c8ba7e2..f66f1bc9 100644 --- a/app/models/printer/order_queue_printer.rb +++ b/app/models/printer/order_queue_printer.rb @@ -6,7 +6,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker #Print order_item = print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code) - filename = "tmp/order_item_#{order_item[0].item_name}" + ".pdf" + filename = "tmp/order_item.pdf" # check for item not to show if order_item[0].price != 0 @@ -35,7 +35,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker # For Print Per Item if oqs.cut_per_item order.each do|odi| - filename = "tmp/order_item_#{odi.item_name}" + ".pdf" + filename = "tmp/order_item.pdf" # For Item Options options = odi.options == "[]"? "" : odi.options @@ -54,7 +54,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker end # For Print Order Summary else - filename = "tmp/order_summary_#{ order_id }" + ".pdf" + filename = "tmp/order_summary.pdf" pdf = OrderSummaryPdf.new(print_settings,order, print_status, order_items, oqs.use_alternate_name) pdf.render_file filename if oqs.print_copy @@ -75,7 +75,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker # For Print Per Item if oqs.cut_per_item order.each do|odi| - filename = "tmp/order_item_#{odi.item_name}" + ".pdf" + filename = "tmp/order_item.pdf" # For Item Options options = odi.options == "[]"? "" : odi.options @@ -97,7 +97,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker end # For Print Order Summary else - filename = "tmp/booking_summary_#{ booking_id }" + ".pdf" + filename = "tmp/booking_summary.pdf" pdf = OrderSummaryPdf.new(print_settings,order, print_status,oqs.use_alternate_name) pdf.render_file filename if oqs.print_copy diff --git a/app/models/printer/receipt_printer.rb b/app/models/printer/receipt_printer.rb index 652339b9..4bd25201 100644 --- a/app/models/printer/receipt_printer.rb +++ b/app/models/printer/receipt_printer.rb @@ -75,8 +75,14 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker # print as print copies in printer setting count = printer_settings.print_copies begin - pdf.render_file "tmp/receipt_bill.pdf" - self.print("tmp/receipt_bill.pdf") + if count == 1 + pdf.render_file "tmp/receipt_bill_#{sale_data.receipt_no}.pdf" + self.print("tmp/receipt_bill_#{sale_data.receipt_no}.pdf") + else + pdf.render_file "tmp/receipt_bill_#{sale_data.receipt_no}_#{count}.pdf" + self.print("tmp/receipt_bill_#{sale_data.receipt_no}_#{count}.pdf") + end + count -= 1 end until count == 0 end diff --git a/app/models/sale.rb b/app/models/sale.rb index 0e767ea0..197c7106 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -42,8 +42,8 @@ class Sale < ApplicationRecord booking.sale_id = sale_id end - order = booking.booking_orders.take.order - link_order_sale(order.id) + order = booking.booking_orders.take.order + link_order_sale(order.id) return status, sale_id end @@ -208,7 +208,7 @@ class Sale < ApplicationRecord end #compute - invoice total - def compute_by_sale_items(sale_id, sale_itemss, total_discount) + def compute_by_sale_items(sale_id, sale_itemss, total_discount,discount_type=nil) sale = Sale.find(sale_id) sales_items = sale_itemss @@ -227,6 +227,9 @@ class Sale < ApplicationRecord sale.total_amount = subtotal_price sale.total_discount = total_discount sale.grand_total = (sale.total_amount - sale.total_discount) + sale.total_tax + if discount_type == "member_discount" + sale.discount_type = discount_type + end #compute rounding adjustment # adjust_rounding @@ -246,7 +249,7 @@ class Sale < ApplicationRecord if item.remark != 'void' #compute each item and added to total subtotal_price = subtotal_price + item.price - total_taxable = total_taxable + item.taxable_price + total_taxable = total_taxable + item.price end end @@ -320,7 +323,8 @@ class Sale < ApplicationRecord sale_tax.tax_rate = tax.rate #include or execulive # sale_tax.tax_payable_amount = total_taxable * tax.rate - sale_tax.tax_payable_amount = total_taxable * tax.rate / 100 + total_tax = total_taxable - self.total_discount + sale_tax.tax_payable_amount = total_tax * tax.rate / 100 #new taxable amount is standard rule for step by step # total_taxable = total_taxable + sale_tax.tax_payable_amount @@ -427,7 +431,7 @@ class Sale < ApplicationRecord SUM(case when (sale_payments.payment_method='jcb') then sale_payments.payment_amount else 0 end) as jcb_amount, SUM(case when (sale_payments.payment_method='paypar') then sale_payments.payment_amount else 0 end) as paypar_amount, SUM(case when (sale_payments.payment_method='cash') then sale_payments.payment_amount else 0 end) as cash_amount, - SUM(case when (sale_payments.payment_method='credit') then sale_payments.payment_amount else 0 end) as credit_amount, + SUM(case when (sale_payments.payment_method='creditnote') then sale_payments.payment_amount else 0 end) as credit_amount, SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount") .joins("join (select * from sale_payments group by sale_payments.sale_id, sale_payments.payment_method) sale_payments on sale_payments.sale_id = sales.sale_id") .where("sale_status = ? AND sales.receipt_date between ? and ? AND total_amount != 0", 'completed', from, to) @@ -445,6 +449,7 @@ class Sale < ApplicationRecord total_sale = Sale.select("IFNULL(SUM(case when (sale_status='completed') then grand_total else 0 end),0) as grand_total, IFNULL(SUM(case when (sale_status='completed') then old_grand_total else 0 end),0) as old_grand_total, IFNULL(SUM(case when (sale_status='completed') then total_discount else 0 end),0) as total_discount, + IFNULL(SUM(case when (sale_status='completed') then amount_changed else 0 end),0) as total_change_amount, IFNULL(SUM(case when (sale_status='void') then grand_total else 0 end),0) as void_amount, IFNULL(SUM(case when (sale_status='completed') then rounding_adjustment else 0 end),0) as rounding_adj") .where("(sale_status = ? OR sale_status = ?) AND receipt_date between ? and ? AND total_amount != 0", 'completed', 'void', from_date, to_date) @@ -454,6 +459,7 @@ class Sale < ApplicationRecord old_grand_total = sale.old_grand_total total_discount = sale.total_discount void_amount = sale.void_amount + total_change_amount = sale.total_change_amount total = {:sale_date => pay.sale_date, :mpu_amount => pay.mpu_amount, :master_amount => pay.master_amount, @@ -464,6 +470,7 @@ class Sale < ApplicationRecord :credit_amount => pay.credit_amount, :foc_amount => pay.foc_amount, :total_discount => total_discount, + :total_change_amount => total_change_amount, :grand_total => grand_total, :old_grand_total => old_grand_total, :void_amount => void_amount, @@ -493,89 +500,218 @@ def self.get_by_range_by_saleitems(from,to,status,report_type) JOIN employees ea ON ea.id = sales.cashier_id") - query = query.where("receipt_date between ? and ? and sale_status=?",from,to,status) + query = query.where("(receipt_date between ? and ? and sale_status=?) AND i.unit_price <> 0",from,to,status) - case report_type.to_i - when REPORT_TYPE["daily"] - return query - when REPORT_TYPE["monthly"] - - return query.group("MONTH(date)") - when REPORT_TYPE["yearly"] - return query.group("YEAR(date)") - end end -def self.get_by_shiftsales(from,to) - return ShiftSale.where("(shift_started_at between ? and ? OR shift_closed_at between ? and ? )", from, to, from, to) +def self.get_by_shiftsales(from,to,shift) + if !shift.blank? + ShiftSale.where("id =?",shift.id) + else + ShiftSale.where("(shift_started_at between ? and ? OR shift_closed_at between ? and ? )", from, to, from, to) + end end -# def self.get_by_shiftsales(employee,from,to) -# shift_sales = ShiftSale.select('shift_sales.id, cs.name as cashier_station_name, shift_sales.shift_started_at as opening_date, shift_sales.shift_closeed_at as closing_date') -# .joins(" INNER JOIN cashier_terminals cs ON cs.id = shift_sales.cashier_terminal_id") -# .where("shift_sales.employee_id = ? and (shift_sales.shift_started_at between ? and ? OR shift_sales.shift_closeed_at between ? and ? )", employee, from, to, from, to) -# .order("shift_sales.id DESC") +def self.get_by_shift_sale(from,to,status) + query = ShiftSale.select("shift_sales.id ,shift_started_at AS opening_date, + shift_closed_at As closing_date," + + " grand_total AS grand_total, cash_sales AS cash," + + "total_taxes AS total_tax,total_discounts As total_discount") + .order("shift_sales.id DESC") + return query = query.where("shift_sales.shift_started_at >= ?" + " AND shift_sales.shift_closed_at <= ?", from,to) +end -# sale_arr = Array.new -# shift_sales.each do |shift| -# all_total= Sale.select("grand_total,sr.payment_method, sr.payment_amount, rounding_adjustment") -# .joins("join employees e on sales.cashier_id = e.id join shift_sales sh on sh.id = sales.shift_sale_id") -# .joins("INNER JOIN (select * from sale_payments group by sale_payments.sale_id, sale_payments.payment_method) sr ON sr.sale_id = sales.sale_id") -# .where("sales.shift_sale_id =? and sales.sale_status = 'completed' and sales.total_amount != 0",shift.id) - -# void = Sale.select("SUM(sales.grand_total) AS grand_total") -# .joins("join shift_sales sh on sh.id = sales.shift_sale_id") -# .where('sales.sales_status = "void" and sales.total_amount != 0 and sales.shift_sale_id = ?', shift.id) -# .sum(:grand_total) -# cash = all_total.select('sr.payment_type') -# .where('sr.payment_type = "cash"') -# .sum(:amount) +def self.get_item_query() + query = Sale.select("acc.title as account_name,mi.account_id, mi.item_code as item_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 ") + + 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 shift_sales sh ON sh.`id` = sales.shift_sale_id JOIN menu_categories mc ON mc.id = mi.menu_category_id ") + # "JOIN employee_accesses ea ON ea.`employee_id` = sales.cashier_id ") -# credit = all_total.where('sr.payment_type = "credit"') -# .sum(:amount) - -# accept_credit = all_total.select('ci.amout') -# .joins("INNER JOIN credit_items ci ON ci.sale_id = sales.id") -# .where('sr.payment_type = "credit"') -# .sum(:amout) - + query = query.joins(" JOIN accounts acc ON acc.id = mi.account_id") + query = query.group('i.product_code ').order("mi.account_id, mi.menu_category_id") + end + + + def self.get_by_shift_items(shift_sale_range, shift, from, to, status) + + # date_type_selection = get_sql_function_for_report_type(report_type) + + query = self.get_item_query() + discount_query = 0 + total_card_amount = 0 + total_cash_amount = 0 + total_credit_amount = 0 + total_foc_amount = 0 + total_grand_total = 0 - -# foc = all_total.where('sales.payment_type = "foc" and sales.sales_status = "completed"') -# .sum(:grand_total) - -# card = all_total.select('payment_type') -# .where('sr.payment_type = "card"') -# .sum(:amount).to_f - -# rounding_adj = all_total.sum(:rounding_adjustment) + if shift.present? + query = query.where("sales.shift_sale_id IN (?) and sale_status='completed'",shift.to_a) + discount_query = Sale.where("sales.shift_sale_id in (?) and sale_status= 'completed' ", shift.to_a).sum(:total_discount) + change_amount = Sale.where("sales.shift_sale_id in (?) and sale_status= 'completed' ", shift.to_a).sum(:amount_changed) + sale_cash = Sale.select("SUM(case when (sale_payments.payment_method ='mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar') then (sale_payments.payment_amount) else 0 end) as card_amount, + SUM(case when (sale_payments.payment_method='cash') then (sale_payments.payment_amount) else 0 end) as cash_amount, + SUM(case when (sale_payments.payment_method='creditnote') then (sale_payments.payment_amount) else 0 end) as credit_amount, + SUM(case when (sale_payments.payment_method='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount") + .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") + .where("sales.shift_sale_id in (?) and sale_status = 'completed' and sale_payments.payment_amount != 0 ", shift.to_a) + sale_cash.each do |s_c| + total_cash_amount += s_c.cash_amount.to_f + total_card_amount += s_c.card_amount.to_f + total_credit_amount += s_c.credit_amount.to_f + total_foc_amount += s_c.foc_amount.to_f + end + total_grand_total = total_cash_amount.to_f + total_card_amount.to_f + total_credit_amount.to_f + + ### => get all sales range in shift_sales + elsif shift_sale_range.present? + query = query.where("sales.shift_sale_id IN (?) and sale_status='completed'",shift_sale_range.to_a) + discount_query = Sale.where("sales.shift_sale_id IN (?) and sale_status ='completed'", shift_sale_range.to_a).sum(:total_discount) + change_amount = Sale.where("sales.shift_sale_id IN (?) and sale_status ='completed'", shift_sale_range.to_a).sum(:amount_changed) + sale_cash = Sale.select("SUM(case when (sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar') then (sale_payments.payment_amount) else 0 end) as card_amount, + SUM(case when (sale_payments.payment_method='cash') then (sale_payments.payment_amount) else 0 end) as cash_amount, + SUM(case when (sale_payments.payment_method='creditnote') then (sale_payments.payment_amount) else 0 end) as credit_amount, + SUM(case when (sale_payments.payment_method='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount") + .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") + .where("sales.shift_sale_id in (?) and sale_status = 'completed' and sale_payments.payment_amount != 0 ", shift_sale_range.to_a) + sale_cash.each do |s_c| + total_cash_amount += s_c.cash_amount.to_f + total_card_amount += s_c.card_amount.to_f + total_credit_amount += s_c.credit_amount.to_f + total_foc_amount += s_c.foc_amount.to_f + end + total_grand_total = total_cash_amount.to_f + total_card_amount.to_f + total_credit_amount.to_f + + else + query = query.where("sales.receipt_date between ? and ? and sale_status='completed'",from,to) + discount_query = Sale.where("sales.receipt_date between ? and ? and sale_status ='completed'", from,to).sum(:total_discount) + change_amount = Sale.where("sales.receipt_date between ? and ? and sale_status ='completed'", from,to).sum(:amount_changed) + sale_cash = Sale.select("SUM(case when (sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar') then (sale_payments.payment_amount) else 0 end) as card_amount, + SUM(case when (sale_payments.payment_method='cash') then (sale_payments.payment_amount) else 0 end) as cash_amount, + SUM(case when (sale_payments.payment_method='creditnote') then (sale_payments.payment_amount) else 0 end) as credit_amount, + SUM(case when (sale_payments.payment_method='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount") + .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") + .where("sales.receipt_date between ? and ? and sale_status = 'completed' and sale_payments.payment_amount != 0 ", from,to) + sale_cash.each do |s_c| + total_cash_amount += s_c.cash_amount.to_f + total_card_amount += s_c.card_amount.to_f + total_credit_amount += s_c.credit_amount.to_f + total_foc_amount += s_c.foc_amount.to_f + end + total_grand_total = total_cash_amount.to_f + total_card_amount.to_f + total_credit_amount.to_f + + end -# discount = all_total.sum(:discount_amount) -# void = void.nil? ? 0 : void -# cash = cash.nil? ? 0 : cash -# credit = credit.nil? ? 0 : credit -# foc = foc.nil? ? 0 : foc -# card = card.nil? ? 0 : card -# accept_credit = accept_credit.nil? ? 0 : accept_credit -# # all_payments = void.to_d + cash.to_d + credit.to_d + foc.to_d + card.to_d + accept_credit.to_d -# all_payments = cash.to_d + credit.to_d + foc.to_d + card.to_d + accept_credit.to_d -# payments = { void_amount: void, cash_amount: cash, credit_amount: credit,accept_credit_amount: accept_credit, foc_amount: foc, card_amount: card, grand_total: all_payments , cashier_station_name: shift.cashier_station_name, opening_date: shift.opening_date, closing_date: shift.closing_date, rounding_adj: rounding_adj } + return query, discount_query , total_cash_amount , total_card_amount , total_credit_amount , total_foc_amount , total_grand_total , change_amount +end -# sale_arr.push(payments) -# end +def self.get_shift_sales_by_receipt_no(shift_sale_range,shift,from,to,payment_type) + ## => left join -> show all sales although no orders + if payment_type.blank? + payment_type = '' + else + if payment_type == 'card' + payment_type = " and sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar'" + else + payment_type = " and sale_payments.payment_method = '#{payment_type}'" + end + end + + query = Sale.all + if shift.present? -# return sale_arr -# end + query = query.where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed' and sale_payments.payment_amount != 0", shift.to_a) + .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") + .group("sales.sale_id") + + elsif shift_sale_range.present? + + query = query.where("sale_status='completed' #{payment_type} and sale_payments.payment_amount != 0 and sales.shift_sale_id in (?)",shift_sale_range.to_a) + .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") + .group("sales.sale_id") + + else + + query = query.where("sale_status='completed' and sales.receipt_date between ? and ? #{payment_type} and sale_payments.payment_amount != 0",from,to) + .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") + .group("sales.sale_id") + end + +end + +def self.get_separate_tax(shift_sale_range=nil,shift,from,to,payment_type) + + if payment_type.blank? + payment_type = '' + else + if payment_type == 'card' + payment_type = " and sale_payments.payment_method = 'mpu' or sale_payments.payment_method = 'visa' or sale_payments.payment_method = 'master' or sale_payments.payment_method = 'jcb' or sale_payments.payment_method = 'paypar'" + else + payment_type = " and sale_payments.payment_method = '#{payment_type}'" + end + end + + if shift.present? + query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name") + .joins("LEFT JOIN sales ON sales.sale_id = sale_taxes.sale_id") + .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") + .where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed' and sale_payments.payment_amount != 0", shift.to_a) + .group("sale_taxes.tax_name") + .order("sale_taxes.sale_tax_id asc") + elsif shift_sale_range.present? + query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name") + .joins("LEFT JOIN sales ON sales.sale_id = sale_taxes.sale_id") + .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") + .where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed' and sale_payments.payment_amount != 0", shift_sale_range.to_a) + .group("sale_taxes.tax_name") + .order("sale_taxes.sale_tax_id asc") + else + query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name") + .joins("LEFT JOIN sales ON sales.sale_id = sale_taxes.sale_id") + .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") + .where("sales.receipt_date between ? and ? #{payment_type} and sale_status= 'completed' and sale_payments.payment_amount != 0", from,to) + .group("sale_taxes.tax_name") + .order("sale_taxes.sale_tax_id asc") + end + + # query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name") + # .joins("INNER JOIN sales ON sales.sale_id = sale_taxes.sale_id") + # .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") + # .group("sale_taxes.tax_name") + # .order("sale_taxes.sale_tax_id asc") + + # if shift.present? + # query = query.where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed'", shift.to_a) + # else + # query = query.where("sales.receipt_date between ? and ? #{payment_type} and sale_status= 'completed' ",from,to) + # end +end + +# def self.get_separate_tax(from,to,payment_method=nil) + +# query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name") +# .joins("INNER JOIN sales ON sales.sale_id = sale_taxes.sale_id") +# .group("sale_taxes.tax_name") + +# return query = query.where("sale_status=? and receipt_date between ? and ?","completed",from,to) +# end + +def grand_total_after_rounding + return self.old_grand_total.to_f + self.rounding_adjustment.to_f +end def get_cash_amount cash = 0.0 self.sale_payments.each do |pay| if pay.payment_method == 'cash' - cash = pay.payment_amount + cash = pay.payment_amount-self.amount_changed end end return cash @@ -604,7 +740,7 @@ end def get_commerical_tax tax = 0.0 self.sale_taxes.each do |taxobj| - if taxobj.tax_name == "Commerical Tax" + if taxobj.tax_name == "Commercial Tax" tax += taxobj.tax_payable_amount end end @@ -616,8 +752,4 @@ end def generate_custom_id self.sale_id = SeedGenerator.generate_id(self.class.name, "SAL") end - - def self.get_receipt_no_list(from,to) - sale = Sale.where("sale_status=? and receipt_date between ? and ?","completed",from,to) - end end diff --git a/app/models/sale_item.rb b/app/models/sale_item.rb index 3cc0eb43..af2230de 100644 --- a/app/models/sale_item.rb +++ b/app/models/sale_item.rb @@ -57,7 +57,7 @@ class SaleItem < ApplicationRecord # Check for actual sale items sale_items.where("is_taxable = false AND remark = 'Discount'").find_each do |si| if si.account_id == a.id - discount_account[:price] = (discount_account[:price] + si.price) * -1 + discount_account[:price] = (discount_account[:price].abs + si.price.abs) * -1 end end discount_accounts.push(discount_account) @@ -66,26 +66,32 @@ class SaleItem < ApplicationRecord return discount_accounts end - # Calculate rebate_by_account + # Calculate rebate_by_account def self.calculate_rebate_by_account(sale_items) rebateacc = Account.where("rebate=?",true) - puts "Account that can rebate" - rebateacc.each do |i| - puts i.title - end - prices=0 - sale_items.each do |si| - price = self.get_rebate_price(si.sale_item_id,rebateacc) + price = 0 + rebate_arr = [] + rebateacc.each do |a| + account_price = {:type => a.title, :amount => 0} - prices = prices + price + # Check for actual sale items + sale_items.each do |si| + if si.account_id == a.id + account_price[:amount] = account_price[:amount] + si.price + price = price + si.price + end + + end + rebate_arr.push(account_price) end - return prices + + return price,rebate_arr end # get food price or beverage price for item def self.get_rebate_price(sale_item_id,rebateacc) - price=0 - + price = 0 + type = '' item=SaleItem.select("sale_items.price , menu_items.account_id") .joins("left join menu_items on menu_items.item_code = sale_items.product_code") .where("sale_items.sale_item_id=?", sale_item_id.to_s) @@ -93,12 +99,14 @@ class SaleItem < ApplicationRecord rebateacc.each do |i| if item[0].account_id == i.id price = item[0].price + type = i.title end end - return price + return price,type end + # def self.get_overall_discount(sale_id) # price = 0.0 # item=SaleItem.where("product_code=?", sale_id) diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index b3455e27..74764785 100644 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -77,7 +77,10 @@ class SalePayment < ApplicationRecord # Control for Paypar Cloud 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}.to_json, + :body => { app_token: token,membership_id:membership_id, + campaign_type_id:campaign_type_id,merchant_uid:merchant_uid, + auth_token:auth_token + }.to_json, :headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json' @@ -115,7 +118,14 @@ class SalePayment < ApplicationRecord # Control for Paypar Cloud begin response = HTTParty.post(url, - :body => { generic_customer_id:membership_id,total_amount: redeem_prices,total_sale_transaction_amount: sale_data.grand_total,redeem_amount:received_amount,receipt_no:sale_data.receipt_no,campaign_type_id:campaign_type_id,account_no:"",merchant_uid:merchant_uid,auth_token:auth_token}.to_json, + :body => { generic_customer_id:membership_id, + total_amount: redeem_prices, + total_sale_transaction_amount: sale_data.grand_total, + redeem_amount:received_amount, + receipt_no:sale_data.receipt_no, + campaign_type_id:campaign_type_id, + account_no:"",merchant_uid:merchant_uid, + auth_token:auth_token}.to_json, :headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json' @@ -261,26 +271,31 @@ class SalePayment < ApplicationRecord end self.sale.sale_status = "completed" - response = rebat(sObj) + if MembershipSetting.find_by_rebate(1) + response = rebat(sObj) - if response["status"] == true - self.sale.rebate_status = 'true' - end - if response["status"] == false - self.sale.rebate_status = 'false' - end + if !response.nil? + if response["status"] == true + self.sale.rebate_status = 'true' + end + if response["status"] == false + self.sale.rebate_status = 'false' + end - if response[:status] == false - self.sale.rebate_status = 'false' - end - if response[:status] == "no_member" - self.sale.rebate_status = nil + if response[:status] == false + self.sale.rebate_status = 'false' + end + if response[:status] == "no_member" + self.sale.rebate_status = nil + end + end + puts "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr" + puts response.to_json end self.sale.save! table_update_status(sObj) - if paid_amount != "0.0" update_shift end @@ -288,6 +303,7 @@ class SalePayment < ApplicationRecord end + # update for cashier shift def update_shift shift = ShiftSale.current_open_shift(self.sale.cashier_id) if !shift.nil? @@ -305,10 +321,14 @@ class SalePayment < ApplicationRecord bookings = table.bookings bookings.each do |tablebooking| if tablebooking.booking_status != 'moved' - if tablebooking.sale.sale_status != 'completed' && tablebooking.sale.sale_status != 'void' + if tablebooking.sale_id + if tablebooking.sale.sale_status != 'completed' && tablebooking.sale.sale_status != 'void' + status = false + end + else status = false - end - end + end + end end if status table.status = "available" @@ -318,13 +338,14 @@ class SalePayment < ApplicationRecord end def rebat(sObj) - rebate_prices = SaleItem.calculate_rebate_by_account(sObj.sale_items) - + rebate_prices,campaign_method = SaleItem.calculate_rebate_by_account(sObj.sale_items) generic_customer_id = sObj.customer.membership_id if generic_customer_id.present? - paypar = sObj.sale_payments + + paypar = sObj.sale_payments payparcost = 0 - credit = 0 + credit = 0 + paypar.each do |pp| if pp.payment_method == "paypar" payparcost = payparcost + pp.payment_amount @@ -333,46 +354,113 @@ class SalePayment < ApplicationRecord end end # overall_dis = SaleItem.get_overall_discount(sObj.id) - overall_dis = sObj.total_discount - - total_amount = rebate_prices - payparcost - overall_dis - if credit == 1 - total_amount = 0 - end - if total_amount >= 0 - receipt_no = sObj.receipt_no - membership = MembershipSetting.find_by_membership_type("paypar_url") - memberaction = MembershipAction.find_by_membership_type("rebate") - merchant_uid = memberaction.merchant_account_id.to_s - campaign_type_id = memberaction.additional_parameter["campaign_type_id"] - auth_token = memberaction.auth_token.to_s - url = membership.gateway_url.to_s + memberaction.gateway_url.to_s + overall_dis = sObj.total_discount + + membership = MembershipSetting.find_by_membership_type("paypar_url") + memberaction = MembershipAction.find_by_membership_type("get_member_campaign") + merchant_uid = memberaction.merchant_account_id.to_s + campaign_type_id = memberaction.additional_parameter["campaign_type_id"] + auth_token = memberaction.auth_token.to_s + url = membership.gateway_url.to_s + memberaction.gateway_url.to_s # Control for Paypar Cloud begin - response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id ,total_sale_transaction_amount: sObj.grand_total,merchant_uid:merchant_uid,total_amount: total_amount,campaign_type_id: campaign_type_id, - receipt_no: receipt_no,auth_token:auth_token}.to_json, - :headers => { - 'Content-Type' => 'application/json', - 'Accept' => 'application/json' - }, :timeout => 10) + response = HTTParty.get(url, + :body => { + member_group_id:sObj.customer.membership_type, + merchant_uid:merchant_uid, + campaign_type_id: campaign_type_id, + auth_token:auth_token + }.to_json, + :headers => { + 'Content-Type' => 'application/json', + 'Accept' => 'application/json' + }, :timeout => 10) rescue Net::OpenTimeout response = { "status": false , "message": "Connect To" } - - rescue OpenURI::HTTPError response = { "status": false, "message": "Can't connect server"} rescue SocketError response = { "status": false, "message": "Can't connect server"} + end + + redeem_amount = payparcost + overall_dis + + total_percentage = 0 + + type_arr = [] + response["membership_campaign_data"].each do |a| + data = {:type => a["rules_type"], :percentage => a["change_unit"].to_i * a["base_unit"].to_i} + total_percentage = total_percentage + a["change_unit"].to_i * a["base_unit"].to_i + + type_arr.push(data) + end + + rebate_arr =[] + campaign_method.each do |a| + data = {:type => a[:type], :amount => a[:amount]} + puts data + type_arr.each do |si| + if si[:type] == a[:type] + puts "steeeeeeeeeeeee" + amount = (redeem_amount / total_percentage)*si[:percentage] + actual = a[:amount] - amount + data[:amount] = actual + end + + end + rebate_arr.push(data) + + end + puts "ssssssssss" + puts rebate_arr.to_json + total_amount = rebate_prices - payparcost - overall_dis + + if credit == 1 + total_amount = 0 + end + if total_amount >= 0 + receipt_no = sObj.receipt_no + membership = MembershipSetting.find_by_membership_type("paypar_url") + memberaction = MembershipAction.find_by_membership_type("rebate") + merchant_uid = memberaction.merchant_account_id.to_s + campaign_type_id = memberaction.additional_parameter["campaign_type_id"] + auth_token = memberaction.auth_token.to_s + url = membership.gateway_url.to_s + memberaction.gateway_url.to_s + + # Control for Paypar Cloud + begin + response = HTTParty.post(url, + :body => { + generic_customer_id:generic_customer_id , + total_sale_transaction_amount: sObj.grand_total, + merchant_uid:merchant_uid, + total_amount: total_amount, + campaign_type_id: campaign_type_id, + receipt_no: receipt_no, + campaign_method: rebate_arr.to_json, + auth_token:auth_token + }.to_json, + :headers => { + 'Content-Type' => 'application/json', + 'Accept' => 'application/json' + }, :timeout => 10) + rescue Net::OpenTimeout + response = { "status": false , "message": "Connect To" } + rescue OpenURI::HTTPError + response = { "status": false, "message": "Can't connect server"} + rescue SocketError + response = { "status": false, "message": "Can't connect server"} end return response + puts "latest respppppp" puts response.to_json - end + end else response = { "status": "no_member", "message": "Not membership"} - + end end diff --git a/app/models/seed_generator.rb b/app/models/seed_generator.rb index fe896a4d..335ab131 100644 --- a/app/models/seed_generator.rb +++ b/app/models/seed_generator.rb @@ -1,5 +1,5 @@ class SeedGenerator < ApplicationRecord - + # Generate ID for Tables def self.generate_id(model, prefix) seed = SeedGenerator.find_by_model(model) new_receipt_no = 0 @@ -23,6 +23,7 @@ class SeedGenerator < ApplicationRecord end + # Generate Receipt No def self.new_receipt_no seed = SeedGenerator.find_by_model("sale") new_receipt_no = 0 @@ -41,4 +42,33 @@ class SeedGenerator < ApplicationRecord return seed.current end + + # Generate for 4 digit Code + def self.generate_code(model, prefix) + seed = SeedGenerator.find_by_model(model) + new_code = 0 + + if (seed.nil?) + seed = SeedGenerator.new() + seed.model = model + new_code = seed.next + seed.save + else + current_no = seed.next + seed.next = seed.next + seed.increase_by + seed.current = current_no + seed.save + end + + + if prefix.length == 1 + padding_len = 5 - prefix.length + count = 4-prefix.length + else prefix.length == 2 + padding_len = 6 - prefix.length + count = 5-prefix.length + end + next_code = prefix + seed.current.to_s.to_s.rjust((count)+1,'0') + return next_code + end end diff --git a/app/models/shift_sale.rb b/app/models/shift_sale.rb index b9c5aa28..b7ce7299 100644 --- a/app/models/shift_sale.rb +++ b/app/models/shift_sale.rb @@ -18,15 +18,16 @@ class ShiftSale < ApplicationRecord def self.current_shift today_date = DateTime.now.strftime("%Y-%m-%d") - shift = ShiftSale.where("DATE(shift_started_at)=? and shift_started_at is not null and shift_closed_at is null",today_date).take + shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null").take return shift end def self.current_open_shift(current_user) #if current_user #find open shift where is open today and is not closed and login by current cashier + #DATE(shift_started_at)=? and today_date = DateTime.now.strftime("%Y-%m-%d") - shift = ShiftSale.where("DATE(shift_started_at)=? and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}",today_date).take + shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}").take return shift #end end @@ -52,10 +53,34 @@ class ShiftSale < ApplicationRecord self.cash_sales = self.cash_sales.to_f + cash.to_f self.credit_sales = self.credit_sales.to_i + credit.to_f self.other_sales = self.other_sales.to_i + other_sales.to_f - self.nett_sales = self.grand_total.to_i - self.commercial_taxes + self.nett_sales = self.nett_sales + saleobj.total_amount.to_f #self.grand_total.to_i - self.commercial_taxes self.commercial_taxes = self.commercial_taxes.to_i + tax.to_f + self.total_rounding = self.total_rounding + saleobj.rounding_adjustment + self.total_receipt = self.total_receipt + 1 self.save + end + # Calculate by type and update + def calculate(sale, type) + saleobj = Sale.find_by_sale_id(sale) + cash = saleobj.get_cash_amount + credit = saleobj.get_credit_amount + other_sales = saleobj.get_other_amount + tax = saleobj.get_commerical_tax + if type == "void" + self.total_revenue = self.total_revenue.to_f - saleobj.total_amount.to_f + self.total_discounts = self.total_discounts - saleobj.total_discount + self.total_taxes = self.total_taxes - saleobj.total_tax + self.grand_total = self.grand_total - saleobj.grand_total + self.cash_sales = self.cash_sales.to_f - cash.to_f + self.credit_sales = self.credit_sales.to_i - credit.to_f + self.other_sales = self.other_sales.to_i - other_sales.to_f + self.nett_sales = self.nett_sales - saleobj.total_amount.to_f #self.grand_total.to_i - self.commercial_taxes + self.commercial_taxes = self.commercial_taxes.to_i - tax.to_f + self.total_rounding = self.total_rounding - saleobj.rounding_adjustment + self.total_void = self.total_void + saleobj.grand_total + self.save + end end def get_closing_balance(shift) diff --git a/app/pdf/close_cashier_pdf.rb b/app/pdf/close_cashier_pdf.rb index fc04b6cc..893746b2 100644 --- a/app/pdf/close_cashier_pdf.rb +++ b/app/pdf/close_cashier_pdf.rb @@ -1,6 +1,6 @@ class CloseCashierPdf < Prawn::Document attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width,:text_width - def initialize(printer_settings, shift_sale,shop_details) + def initialize(printer_settings, shift_sale,shop_details,sale_taxes) self.page_width = 210 self.page_height = 7000 self.margin = 5 @@ -32,7 +32,7 @@ class CloseCashierPdf < Prawn::Document stroke_horizontal_rule - shift_detail(shift_sale) + shift_detail(shift_sale,sale_taxes) @@ -51,7 +51,7 @@ class CloseCashierPdf < Prawn::Document stroke_horizontal_rule end - def shift_detail(shift_sale) + def shift_detail(shift_sale,sale_taxes) move_down 7 y_position = cursor bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do @@ -68,6 +68,22 @@ class CloseCashierPdf < Prawn::Document bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do text "#{ shift_sale.cashier_terminal.name}" , :size => self.item_font_size,:align => :left end + + y_position = cursor + bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do + text "Opening Date : ", :size => self.item_font_size,:align => :left + end + bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do + text "#{ shift_sale.shift_started_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left + end + + y_position = cursor + bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do + text "Closing Date : ", :size => self.item_font_size,:align => :left + end + bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do + text "#{ shift_sale.shift_closed_at.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left + end y_position = cursor bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do @@ -88,6 +104,12 @@ class CloseCashierPdf < Prawn::Document move_down 10 + y_position = cursor + bounding_box([0,y_position], :width =>self.page_width - 10, :height => 20) do + text "Shift Sale Summary", :size => self.header_font_size, :align => :center + end + move_down 10 + y_position = cursor bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do text "Received Amount :", :size => self.item_font_size, :align => :right @@ -96,6 +118,23 @@ class CloseCashierPdf < Prawn::Document text "#{shift_sale.closing_balance}", :size => self.item_font_size, :align => :right end + y_position = cursor + bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do + text "Cash In:", :size => self.item_font_size, :align => :right + end + bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do + text "#{shift_sale.cash_in}", :size => self.item_font_size, :align => :right + end + + + y_position = cursor + bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do + text "Cash Out:", :size => self.item_font_size, :align => :right + end + bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do + text "#{shift_sale.cash_out}", :size => self.item_font_size, :align => :right + end + y_position = cursor bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do text "Net Sales:", :size => self.item_font_size, :align => :right @@ -151,15 +190,17 @@ class CloseCashierPdf < Prawn::Document bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do text "#{shift_sale.total_discounts}", :size => self.item_font_size, :align => :right end - - y_position = cursor - bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do - text "Commercial Tax :", :size => self.item_font_size, :align => :right + + sale_taxes.each do |tax| + + y_position = cursor + bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do + text "#{tax.tax_name} :", :size => self.item_font_size, :align => :right + end + bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do + text "#{tax.st_amount.round(2)}", :size => self.item_font_size, :align => :right + end end - bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do - text "#{shift_sale.commercial_taxes}", :size => self.item_font_size, :align => :right - end - y_position = cursor bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do text "Grand Total :", :size => self.item_font_size, :align => :right @@ -168,6 +209,22 @@ class CloseCashierPdf < Prawn::Document text "#{shift_sale.grand_total}", :size => self.item_font_size, :align => :right end + y_position = cursor + bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do + text "Total Receipts :", :size => self.item_font_size, :align => :right + end + bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do + text "#{shift_sale.total_receipt}", :size => self.item_font_size, :align => :right + end + + y_position = cursor + bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do + text "Total Void:", :size => self.item_font_size, :align => :right + end + bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do + text "(#{shift_sale.total_void})", :size => self.item_font_size, :align => :right + end + move_down 5 stroke_horizontal_rule move_down 5 diff --git a/app/pdf/order_item_pdf.rb b/app/pdf/order_item_pdf.rb index 546e8f82..20a4537c 100644 --- a/app/pdf/order_item_pdf.rb +++ b/app/pdf/order_item_pdf.rb @@ -6,7 +6,7 @@ class OrderItemPdf < Prawn::Document self.page_height = 1450 self.margin = 0 self.price_width = 40 # No Need for item - self.qty_width = 35 + self.qty_width = 40 self.total_width = 40 # No Need for item self.item_width = self.page_width - (self.qty_width - self.margin) self.item_height = 15 diff --git a/app/pdf/order_summary_pdf.rb b/app/pdf/order_summary_pdf.rb index 6d530058..244fbdfa 100644 --- a/app/pdf/order_summary_pdf.rb +++ b/app/pdf/order_summary_pdf.rb @@ -6,7 +6,7 @@ class OrderSummaryPdf < Prawn::Document self.page_height = 1450 self.margin = 0 self.price_width = 40 # No Need for item - self.qty_width = 35 + self.qty_width = 40 self.total_width = 40 # No Need for item self.item_width = self.page_width - (self.qty_width - self.margin) self.item_height = 15 @@ -68,7 +68,7 @@ class OrderSummaryPdf < Prawn::Document text "Item", :size => self.item_font_size,:align => :left end - bounding_box([self.item_width-2,y_position], :width => self.qty_width, :height => self.item_height) do + bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do text "Qty", :size => self.item_font_size,:align => :left end diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index bd65ed20..28ce5745 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -1,6 +1,6 @@ class ReceiptBillPdf < Prawn::Document include ActionView::Helpers::NumberHelper - attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width + attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status) self.page_width = 210 self.page_height = 7000 @@ -12,6 +12,9 @@ class ReceiptBillPdf < Prawn::Document self.item_height = 15 self.item_description_width = (self.page_width-20) / 2 self.label_width = 100 + + self.description_width = 150 + self.price_num_width = 50 # @item_width = self.page_width.to_i / 2 # @qty_width = @item_width.to_i / 3 # @double = @qty_width * 1.3 @@ -73,10 +76,10 @@ class ReceiptBillPdf < Prawn::Document move_down 7 # move_down 2 y_position = cursor - bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do + bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do text "Receipt No: #{sale_data.receipt_no}", :size => self.item_font_size,:align => :left end - bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do + bounding_box([self.description_width,y_position], :width => self.price_num_width, :height => self.item_height) do text "#{ sale_data.bookings[0].dining_facility.type } - #{ sale_data.bookings[0].dining_facility.name }" , :size => self.item_font_size,:align => :right end move_down 5 @@ -140,10 +143,13 @@ class ReceiptBillPdf < Prawn::Document y_position = cursor pad_top(15) { - text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :size => self.item_font_size, :overflow => :shrink_to_fix - text_box "#{number_with_precision(price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[self.item_width,y_position], :width => self.price_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix - text_box "#{number_with_precision(qty, :precision => precision.to_i)}", :at =>[item_name_width,y_position], :width => self.qty_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix - text_box "#{number_with_precision(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[(item_name_width+4),y_position], :width =>self.total_width+3, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix + bounding_box([0,y_position], :width =>self.item_width) do + text "#{product_name}", :size => self.item_font_size,:align => :left + end + # text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :size => self.item_font_size + text_box "#{number_with_precision(price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[self.item_width,y_position], :width => self.price_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix + text_box "#{number_with_precision(qty, :precision => precision.to_i)}", :at =>[item_name_width,y_position], :width => self.qty_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix + text_box "#{number_with_precision(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[(item_name_width+4),y_position], :width =>self.total_width+3, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix } move_down 5 end @@ -165,9 +171,14 @@ class ReceiptBillPdf < Prawn::Document def all_total(sale_data,precision,delimiter) item_name_width = self.item_width y_position = cursor + if sale_data.discount_type == 'member_discount' + dis_type = "Member Discount:" + else + dis_type = "Overall Discount:" + end bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do - text "Overall Discount", :size => self.item_font_size,:align => :left + text "#{ dis_type }", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do text "( #{number_with_precision(sale_data.total_discount, :precision => precision.to_i, :delimiter => delimiter)} )" , :size => self.item_font_size,:align => :right @@ -317,16 +328,16 @@ class ReceiptBillPdf < Prawn::Document text "#{number_with_precision(redeem, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right end - # old = balance + redeem + old = balance + redeem - # move_down 5 - # y_position = cursor - # bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do - # text "Old Balance", :size => self.item_font_size,:align => :left - # end - # bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - # text "#{number_with_precision(old, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right - # end + move_down 5 + y_position = cursor + bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + text "Old Balance", :size => self.item_font_size,:align => :left + end + bounding_box([self.item_description_width,y_position], :width =>self.label_width) do + text "#{number_with_precision(old, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right + end end end @@ -386,10 +397,10 @@ class ReceiptBillPdf < Prawn::Document y_position = cursor item_price_by_accounts.each do |ipa| y_position = cursor - bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + bounding_box([0,y_position], :width =>self.label_width) do text "#{ ipa[:name] }", :size => self.item_font_size,:align => :left end - bounding_box([self.item_description_width,y_position], :width =>self.label_width) do + bounding_box([self.label_width,y_position], :width =>self.item_description_width) do text "#{number_with_precision(ipa[:price], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right end end diff --git a/app/views/crm/customers/_crm_customer.json.jbuilder b/app/views/crm/customers/_crm_customer.json.jbuilder index 1b1b237e..c0d66225 100644 --- a/app/views/crm/customers/_crm_customer.json.jbuilder +++ b/app/views/crm/customers/_crm_customer.json.jbuilder @@ -1,2 +1,2 @@ -json.extract! crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, :created_at, :updated_at,:salutation, :gender,:nrc_no,:address,:card_no +json.extract! crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, :created_at, :updated_at,:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no json.url crm_customer_url(crm_customer, format: :json) diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb index 66a16b2b..3c09d20f 100644 --- a/app/views/crm/customers/_new_form.html.erb +++ b/app/views/crm/customers/_new_form.html.erb @@ -1,7 +1,5 @@
- <%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %> - <%= f.hidden_field :id, :class => "form-control col-md-6 " %> @@ -15,6 +13,14 @@ <% end -%>
+
+ +
+ +
+
+
+

@@ -46,11 +52,11 @@
- <%= f.input :nrc_no, :class => "form-control nrc_no" %> + <%= f.input :nrc_no,:label => "NRC No", :class => "form-control nrc_no" %>
- <%= f.input :company, :class => "form-control col-md-6 company",:required => true%> + <%= f.input :company, :class => "form-control col-md-6 company"%> <% flash.each do |name, msg| %> <% str="[\"#{msg['company']}\"]" @@ -107,11 +113,44 @@
-
<%= f.button :submit, "Submit",:class => 'btn btn-primary ', :id => 'submit_customer' %> <%= f.button :submit, "Update",:class => 'btn btn-primary ', :disabled =>'', :id => 'update_customer' %> <%= f.button :button, "Reset",:class => 'btn btn-danger ', :id => 'reset' %>
<%end%> - \ No newline at end of file + + +
+

Card Tap

+
+ + \ No newline at end of file diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index a44aed2f..6f336158 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -22,15 +22,16 @@ - <%= form_tag crm_customers_path, :method => :get do %> -
- - + <%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %> +
+ +
<% end %> + @@ -73,14 +74,13 @@ <%= paginate @crm_customers %>
- <%= render 'card_read_form' %> <%= render 'new_form', crm_customer: @crm_customer %>

- + Back
@@ -97,6 +97,16 @@ $(function() { $('.datepicker').attr('ReadOnly','true'); $('.datepicker').css('cursor','pointer'); + // Read Card Reader + $("#member_acc_no").on('click', function(e){ + var cardNo = ""; + $("#sxModal").show(); + setTimeout(function(){ + getCardNo(); + $("#sxModal").hide(); + $("#filter_form").submit(); + },100); + }); }); $(document).on('click',".customer_tr",function(){ @@ -119,7 +129,7 @@ $(document).on('click',".customer_tr",function(){ url: url, data: {}, dataType: "json", - success: function(data) { + success: function(data) { $('#customer_id').val(data.id); $('#customer_name').val(data.name); $('#customer_company').val(data.company); @@ -128,6 +138,7 @@ $(document).on('click',".customer_tr",function(){ $('#customer_salutation').val(data.salutation); $('#customer_nrc_no').val(data.nrc_no); $('#customer_card_no').val(data.card_no); + $('#paypar_account_no').val(data.paypar_account_no); $('#customer_address').val(data.address); $('#customer_date_of_birth').val(data.date_of_birth); $('#customer_membership_type').val(data.membership_type); diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 21a05d9c..f25aa4c8 100644 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -64,18 +64,11 @@
- - - - - - - - - - + + + @@ -86,9 +79,9 @@ <% @response["data"].each do |transaction| %> - + - + diff --git a/app/views/crm/customers/show.json.jbuilder b/app/views/crm/customers/show.json.jbuilder index 86901801..5fd0410a 100644 --- a/app/views/crm/customers/show.json.jbuilder +++ b/app/views/crm/customers/show.json.jbuilder @@ -1,4 +1,4 @@ json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, - :salutation, :gender,:nrc_no,:address,:card_no + :salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no json.url crm_customer_url(@crm_customer, format: :json) diff --git a/app/views/crm/dining_queues/index.html.erb b/app/views/crm/dining_queues/index.html.erb index 4f39147f..3d186efe 100644 --- a/app/views/crm/dining_queues/index.html.erb +++ b/app/views/crm/dining_queues/index.html.erb @@ -50,6 +50,7 @@
+
+ + + + + + + + diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index fd951d6c..69054218 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -45,6 +45,11 @@
  • <%= link_to "Shift Sale Report", reports_shiftsale_index_path, :tabindex =>"-1" %>
  • + + + diff --git a/app/views/layouts/_header_crm.html.erb b/app/views/layouts/_header_crm.html.erb index e004853e..37bb0deb 100644 --- a/app/views/layouts/_header_crm.html.erb +++ b/app/views/layouts/_header_crm.html.erb @@ -4,7 +4,7 @@ CRM
    - <%= link_to 'Queue', crm_dining_queues_path, :html=>":color:white" %> | Bookings | Online Orders | <%= link_to 'Customer', crm_customers_path, :html=>":color:white" %> + <%= link_to 'Home', dashboard_path, :html=>":color:white" %> | <%= link_to 'Queue', crm_dining_queues_path, :html=>":color:white" %> | Bookings | Online Orders | <%= link_to 'Customer', crm_customers_path, :html=>":color:white" %>
    diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 571de1a2..3e068b12 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -130,7 +130,7 @@ end end %> - +
    @@ -192,6 +192,8 @@ + + diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index a1d359e8..b11488b4 100644 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -12,19 +12,20 @@
    -
    Membership TransactionsCurrent Balance : <%= @balance%>
    DateRedeemRebateBalanceDiscount Amount From Account Status Receipt No
    <%= transaction["date"]%><%= transaction["redeem"]%> <%= transaction["rebate"] %><%= transaction["balance"] %> <%= transaction["account_status"] %> <%= transaction["status"] %> <%= transaction["receipt_no"] %>
    +
    @@ -34,6 +35,7 @@ + @@ -54,7 +56,7 @@ - + <% end %> @@ -89,6 +91,13 @@ <%= str %> <% end -%> +
    + +
    + +
    +
    +

    @@ -121,10 +130,10 @@
    - <%= f.input :nrc_no, :class => "form-control nrc_no" %> + <%= f.input :nrc_no, :label => "NRC No",:class => "form-control nrc_no" %>
    - <%= f.input :company, :class => "form-control col-md-6 company",:required => true%> + <%= f.input :company, :class => "form-control col-md-6 company"%> <% flash.each do |name, msg| %> <% str="[\"#{msg['company']}\"]" @@ -192,6 +201,10 @@
    +
    +

    Card Tap

    +
    + + \ No newline at end of file diff --git a/app/views/origami/request_bills/print.json.jbuilder b/app/views/origami/request_bills/print.json.jbuilder index 08bf292c..332a9cec 100644 --- a/app/views/origami/request_bills/print.json.jbuilder +++ b/app/views/origami/request_bills/print.json.jbuilder @@ -1 +1,7 @@ -json.status true +if @status == true + #show invoice number and stuff + json.status @status +else + json.status @status + json.error_message @error_message +end diff --git a/app/views/origami/room_invoices/index.html.erb b/app/views/origami/room_invoices/index.html.erb index 71b9bee7..3d88622e 100644 --- a/app/views/origami/room_invoices/index.html.erb +++ b/app/views/origami/room_invoices/index.html.erb @@ -40,7 +40,11 @@ - + <%if @sale.discount_type == 'member_discount'%> + + <%else%> + + <%end%> diff --git a/app/views/origami/room_invoices/show.html.erb b/app/views/origami/room_invoices/show.html.erb index b44340d4..86cb1789 100644 --- a/app/views/origami/room_invoices/show.html.erb +++ b/app/views/origami/room_invoices/show.html.erb @@ -106,7 +106,11 @@ - + <%if @sale.discount_type == 'member_discount'%> + + <%else%> + + <%end%> diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index 9b681fe1..d115b765 100644 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -203,7 +203,11 @@ - + <%if @obj != nil && @status_sale == 'sale' && @obj.discount_type == 'member_discount'%> + + <%else%> + + <%end%> <% if @status == "sale" %> @@ -457,8 +461,24 @@ $('#request_bills').click(function() { url: ajax_url, // data: 'order_id='+ order_id, success:function(result){ - - location.reload(); + if(!result.status){ + $.confirm({ + title: 'Infomation!', + content: result.error_message, + buttons: { + confirm: { + text: 'Ok', + btnClass: 'btn-green', + action: function(){ + window.location.href = '/origami'; + } + } + } + }); + } + else { + location.reload(); + } } }); }); diff --git a/app/views/origami/sales/show.html.erb b/app/views/origami/sales/show.html.erb index ad8a73aa..dd58a577 100644 --- a/app/views/origami/sales/show.html.erb +++ b/app/views/origami/sales/show.html.erb @@ -164,7 +164,11 @@ - + <%if @sale.discount_type == 'member_discount'%> + + <%else%> + + <%end%> @@ -222,6 +226,22 @@ $('#pay').on('click',function() { $('#back').on('click',function(){ window.location.href = '/origami/'; }) + +$('#void').on('click',function () { + var sure = confirm("Are you sure want to Void"); + if (sure == true) { + var sale_id = $('#sale_id').val(); + var ajax_url = "/origami/sale/" + sale_id + '/void'; + $.ajax({ + type: 'POST', + url: ajax_url, + success: function () { + window.location.href = '/origami/'; + } + }); + } + }); + $('#re-print').click(function() { var sale_id = $('#sale_id').val(); window.location.href = '/origami/'+ sale_id + "/reprint" diff --git a/app/views/origami/shifts/new.html.erb b/app/views/origami/shifts/new.html.erb index 8d3ca457..a8ded240 100644 --- a/app/views/origami/shifts/new.html.erb +++ b/app/views/origami/shifts/new.html.erb @@ -110,7 +110,7 @@ $(document).on('focusout', '.float-value', function(event){ $('#open_cashier').on('click',function(){ var cashier_terminal = $('#cashier_terminal').val(); - var amount = $('#total').text(); + var amount = $('#total').text()||0; $.ajax({type: "POST", url: "<%= origami_shifts_path %>", data: "opening_balance=" + amount + "&cashier_terminal="+ cashier_terminal, diff --git a/app/views/origami/table_invoices/index.html.erb b/app/views/origami/table_invoices/index.html.erb index 95a6ee33..834d5f36 100644 --- a/app/views/origami/table_invoices/index.html.erb +++ b/app/views/origami/table_invoices/index.html.erb @@ -40,7 +40,11 @@ - + <%if @sale.discount_type == 'member_discount'%> + + <%else%> + + <%end%> diff --git a/app/views/origami/table_invoices/show.html.erb b/app/views/origami/table_invoices/show.html.erb index c49ddfbc..b5769e02 100644 --- a/app/views/origami/table_invoices/show.html.erb +++ b/app/views/origami/table_invoices/show.html.erb @@ -106,7 +106,11 @@ - + <%if @sale.discount_type == 'member_discount'%> + + <%else%> + + <%end%> diff --git a/app/views/reports/_shift_sale_report_filter.html.erb b/app/views/reports/_shift_sale_report_filter.html.erb new file mode 100644 index 00000000..a5513531 --- /dev/null +++ b/app/views/reports/_shift_sale_report_filter.html.erb @@ -0,0 +1,177 @@ +
    +
    + <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> + <% if period_type != false %> +
    +
    + + +
    + +
    + + +
    +
    + + + +
    +
    + + +
    +
    + + +
    +
    + +
    +
    + <% end %> + +
    +
    + <% if defined? promotions %> + <%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]), :class => "form-control" %> + <% end %> + + <% if defined? menu_types %> + <%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %> + <% end %> + + <% if defined? payments %> + <%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %> + <% end %> + + + + <% if defined? cashiers %> + <%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations", :class => "form-control" %> + <% end %> + + <% if defined? singer %> + <%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List", :class => "form-control" %> + <% end %> + + <% if defined? bsm %> + <%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %> + <% end %> + + <% if defined? guest_role %> + <%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List", :class => "form-control" %> + <% end %> + + <% if defined? list_by_payment_type %> + <%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %> + <% end %> + + <% if defined? products %> + <%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %> + <% end %> + + <% if defined? items %> + <%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %> + <% end %> +
    +
    + + + + <% end %> +
    +
    + + + diff --git a/app/views/reports/dailysale/_shift_sale_report_filter.html.erb b/app/views/reports/dailysale/_shift_sale_report_filter.html.erb index 9b89858a..d49d2660 100644 --- a/app/views/reports/dailysale/_shift_sale_report_filter.html.erb +++ b/app/views/reports/dailysale/_shift_sale_report_filter.html.erb @@ -6,6 +6,7 @@
    - +
    diff --git a/app/views/reports/dailysale/index.html.erb b/app/views/reports/dailysale/index.html.erb index 64565fb5..1b94d2c9 100644 --- a/app/views/reports/dailysale/index.html.erb +++ b/app/views/reports/dailysale/index.html.erb @@ -24,20 +24,18 @@
    <% path ="/origami/#{@sale_id}/customers" %> - <%= form_tag path, :method => :get do %> -
    - - + <%= form_tag path, :id => "filter_form", :method => :get do %> +
    + +
    <% end %> +
    Company Contact no Email
    <%= crm_customer.company rescue '-' %> <%= crm_customer.contact_no %> <%= crm_customer.email %>
    Discount:Member Discount:Discount:(<%= @sale.total_discount rescue 0%>)
    <%= sub_total %>
    Discount:Member Discount:Discount:(<%= @sale.total_discount rescue 0%>)
    <%= sub_total %>
    Discount:Member Discount:Discount:(<%=@obj.total_discount rescue 0%>)
    <%= sub_total %>
    Discount:Member Discount:Discount:(<%= @sale.total_discount rescue 0%>)
    Discount:Member Discount:Discount:(<%= @sale.total_discount rescue 0%>)
    <%= sub_total %>
    Discount:Member Discount:Discount:(<%= @sale.total_discount rescue 0%>)
    - <% if params[:from]%> - + - <% end %> - + - + @@ -61,7 +59,8 @@ <% foc = 0 %> <% discount = 0 %> <% total = 0 %> - <% grand_total = 0 %> + <% grand_total = 0 %> + <% old_grand_total = 0 %> <% count = 1 %> <% rounding_adj = 0 %> <% @sale_data.each do |sale| %> <% void += sale[:void_amount] %> @@ -70,12 +69,13 @@ <% visa += sale[:visa_amount] %> <% jcb += sale[:jcb_amount] %> <% paypar += sale[:paypar_amount] %> - <% cash += sale[:cash_amount] %> + <% cash += sale[:cash_amount]-sale[:total_change_amount] %> <% credit += sale[:credit_amount] %> <% foc += sale[:foc_amount] %> <% discount += sale[:total_discount] %> <% total += sale[:old_grand_total].to_f + sale[:rounding_adj].to_f %> <% grand_total += sale[:grand_total].to_f %> + <% old_grand_total += sale[:old_grand_total].to_f %> <% rounding_adj += sale[:rounding_adj].to_f %> @@ -86,31 +86,31 @@ - + - + <% count = count + 1 %> <% end %> - - - - - + + + + + - + <% total_tax = 0 %> @@ -137,54 +137,3 @@ - - - \ No newline at end of file diff --git a/app/views/reports/dailysale/index.xls.erb b/app/views/reports/dailysale/index.xls.erb index 67e76e3c..c1eda6ef 100644 --- a/app/views/reports/dailysale/index.xls.erb +++ b/app/views/reports/dailysale/index.xls.erb @@ -1,12 +1,11 @@ -
    +
    +
    Sale (<%= params[:from] rescue '-' %> - <%= params[:to] rescue '-'%>) From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
    Sr.noSr Date Void Amount Mpu Sales Master Sales Visa Sales Jcb SalesPaypar SalesRedeem Sales Cash Sales Credit Sales FOC Sales
    <%= count %><%= number_with_delimiter(sprintf("%.2f",sale[:visa_amount]), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",sale[:jcb_amount]), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]-sale[:total_change_amount]), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%> (<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>) <%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total]), :delimiter => ',') rescue '-'%>
    Total<%= number_with_delimiter(sprintf("%.2f",mpu_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",master_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",visa_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",jcb_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",paypar_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",mpu), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",master), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",visa), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",jcb), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",paypar), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",cash), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",credit), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",foc), :delimiter => ',') rescue '-'%> (<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>) <%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",grand_total), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",old_grand_total), :delimiter => ',') rescue '-'%>
    - <% if params[:from]%> - + - <% end %> @@ -15,7 +14,7 @@ - + @@ -39,7 +38,8 @@ <% foc = 0 %> <% discount = 0 %> <% total = 0 %> - <% grand_total = 0 %> + <% grand_total = 0 %> + <% old_grand_total = 0 %> <% count = 1 %> <% rounding_adj = 0 %> <% @sale_data.each do |sale| %> <% void += sale[:void_amount] %> @@ -48,12 +48,13 @@ <% visa += sale[:visa_amount] %> <% jcb += sale[:jcb_amount] %> <% paypar += sale[:paypar_amount] %> - <% cash += sale[:cash_amount] %> + <% cash += sale[:cash_amount]-sale[:total_change_amount] %> <% credit += sale[:credit_amount] %> <% foc += sale[:foc_amount] %> <% discount += sale[:total_discount] %> - <% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %> + <% total += sale[:old_grand_total].to_f + sale[:rounding_adj].to_f %> <% grand_total += sale[:grand_total].to_f %> + <% old_grand_total += sale[:old_grand_total].to_f %> <% rounding_adj += sale[:rounding_adj].to_f %> @@ -64,31 +65,31 @@ - + - + - + <% count = count + 1 %> <% end %> - - - - - + + + + + - + <% total_tax = 0 %> @@ -113,4 +114,5 @@ <% end %>
    Sale (<%= params[:from] rescue '-' %> - <%= params[:to] rescue '-'%>) From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
    Sr.no DateMaster Sales Visa Sales Jcb SalesPaypar SalesRedeem Sales Cash Sales Credit Sales FOC Sales
    <%= count %><%= number_with_delimiter(sprintf("%.2f",sale[:visa_amount]), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",sale[:jcb_amount]), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]-sale[:total_change_amount]), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%> (<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)<%= number_with_delimiter(sprintf("%.2f",sale[:grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:old_grand_total]), :delimiter => ',') rescue '-'%>
    Total<%= number_with_delimiter(sprintf("%.2f",mpu_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",master_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",visa_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",jcb_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",paypar_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",mpu), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",master), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",visa), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",jcb), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",paypar), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",cash), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",credit), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",foc), :delimiter => ',') rescue '-'%> (<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>) <%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%> <%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",grand_total), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",old_grand_total), :delimiter => ',') rescue '-'%>
    - \ No newline at end of file + + diff --git a/app/views/reports/receipt_no/_shift_sale_report_filter.html.erb b/app/views/reports/receipt_no/_shift_sale_report_filter.html.erb index 1b4082f5..c6308a66 100644 --- a/app/views/reports/receipt_no/_shift_sale_report_filter.html.erb +++ b/app/views/reports/receipt_no/_shift_sale_report_filter.html.erb @@ -6,6 +6,7 @@
    + <% if defined? payments %>
    - - + + <%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
    -
    + <% end %> +
    -
    +
    -
    +
    + + +
    +
    <% end %> - - -
    -
    - <% if defined? promotions %> - <%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]), :class => "form-control" %> - <% end %> - - <% if defined? menu_types %> - <%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %> - <% end %> - - <% if defined? payments %> - <%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %> - <% end %> - - <% if defined? shift_name %> - - <% end %> - - <% if defined? cashiers %> - <%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations", :class => "form-control" %> - <% end %> - - <% if defined? singer %> - <%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List", :class => "form-control" %> - <% end %> - - <% if defined? bsm %> - <%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %> - <% end %> - - <% if defined? guest_role %> - <%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List", :class => "form-control" %> - <% end %> - - <% if defined? list_by_payment_type %> - <%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %> - <% end %> - - <% if defined? products %> - <%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %> - <% end %> - - <% if defined? items %> - <%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %> - <% end %> -
    -
    - - - <% end %>
    - \ No newline at end of file + diff --git a/app/views/reports/receipt_no/index.html.erb b/app/views/reports/receipt_no/index.html.erb index dc7d05ee..5868d078 100644 --- a/app/views/reports/receipt_no/index.html.erb +++ b/app/views/reports/receipt_no/index.html.erb @@ -1,115 +1,209 @@
    - <%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_receipt_no_index_path} %> + <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_receipt_no_index_path} %>
    -
    +
    -
    +
    - - - - - - - - - - <% TaxProfile.all.each do |r|%> - - <% end %> - - - +
    DateReceipt NoCashier NameGross SalesDiscountTotal Sales<%=r.name%>Nett Sales
    + + + + + + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + + <% end %> - - <% total_sales = 0 %> - <% net_sales = 0 %> - <% @sale_data.each do |sale| %> - <% total_sales = sale.total_amount.to_f - sale.total_discount.to_f%> - <% net_sales = total_sales.to_f + sale.total_tax.to_f%> - - - - - - - - <% sale.sale_taxes.each do |sale|%> - - <% end %> - - - - <% end %> - -
    From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
    Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
    <%= sale.receipt_date.strftime("#{sale.receipt_date.day.ordinalize} %b") rescue '-' %><%=sale.receipt_no.to_s rescue ''%><%=Employee.find(sale.cashier_id).name rescue ''%><%= number_with_delimiter(sprintf("%.2f",sale.total_amount.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale.total_discount.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",total_sales.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale.tax_payable_amount.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",net_sales.to_f), :delimiter => ',') %>
    -
    + + Recipt No + Cashier Name + Total Amount + Discount Amount + <% @sale_taxes.each do |tax| %> + <%= tax.tax_name %> + <% end %> + + Grand Total + Rounding Adj. + Grand Total +
    + Rounding Adj. + + + + + <% grand_total = 0 %> + <% old_grand_total = 0 %> + <% total_tax = 0 %> + <% guest_count = 0 %> + <% total_sum = 0 %> + <% discount_amt = 0 %> + <% other_amt = 0 %> + <% total_nett = 0 %> + <% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %> + <%if @sale_data %> + <% @sale_data.each do |result| %> + + <% grand_total = grand_total.to_f + result.grand_total.to_f %> + <% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %> + <% total_tax += result.total_tax.to_f %> + <% total_sum += result.total_amount.to_f %> + <% discount_amt += result.total_discount.to_f %> + <% rounding_adj += result.rounding_adjustment.to_f %> + + + + <%= result.receipt_no rescue '-' %> + <%= result.cashier_name rescue '-' %> + <%= result.total_amount rescue '-' %> + <%= result.total_discount rescue '-' %> + <% result.sale_taxes.each do |tax| %> + <%= tax.tax_payable_amount rescue '-' %> + <%end%> + + <%= result.old_grand_total %> + <%= result.rounding_adjustment.to_f rescue '-' %> + <%= result.grand_total_after_rounding() rescue '-'%> + + + <% end %> + +   + <%= total_sum rescue '-'%> + <%= discount_amt rescue '-'%> + <% @sale_taxes.each do |tax| %> + <%= tax.st_amount.round(2) %> + <% end %> + <%= old_grand_total.to_f.round(2) rescue '-'%> + <%= rounding_adj rescue '-'%> + <%= old_grand_total.to_f.round + rounding_adj %> + + +   + Total Amount + Discount Amount + <% @sale_taxes.each do |tax| %> + <%= tax.tax_name %> + <% end %> + Grand Total + Rounding Adj. + Grand Total +
    + Rounding Adj. + + + <%end%> + + +
    -<%= paginate @sale_data %> - \ No newline at end of file diff --git a/app/views/reports/receipt_no/index.xls.erb b/app/views/reports/receipt_no/index.xls.erb index 5befb18a..cddb34f9 100644 --- a/app/views/reports/receipt_no/index.xls.erb +++ b/app/views/reports/receipt_no/index.xls.erb @@ -1,43 +1,98 @@ -
    -
    +
    +
    + + + + + + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + + <% end %> -
    From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
    Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
    - - - - - - - - - <% TaxProfile.all.each do |r|%> - - <% end %> - - - + + + + + + <% @sale_taxes.each do |tax| %> + + + <% end %> + + + + + + + + <% grand_total = 0 %> + <% old_grand_total = 0 %> + <% total_tax = 0 %> + <% guest_count = 0 %> + <% total_sum = 0 %> + <% discount_amt = 0 %> + <% other_amt = 0 %> + <% total_nett = 0 %> + <% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %> + <%if @sale_data %> + <% @sale_data.each do |result| %> - - <% total_sales = 0 %> - <% net_sales = 0 %> - <% @sale_data.each do |sale| %> - <% total_sales = sale.total_amount.to_f - sale.total_discount.to_f%> - <% net_sales = total_sales.to_f + sale.total_tax.to_f%> - - - - - - - - <% sale.sale_taxes.each do |sale|%> - - <% end %> - - - - <% end %> - -
    DateReceipt NoCashier NameGross SalesDiscountTotal Sales<%=r.name%>Nett Sales
    Recipt NoCashier NameTotal AmountDiscount Amount <%= tax.tax_name %>Grand TotalRounding Adj.Grand Total +
    + Rounding Adj. +
    <%= sale.receipt_date.strftime("#{sale.receipt_date.day.ordinalize} %b") rescue '-' %><%=sale.receipt_no.to_s rescue ''%><%=Employee.find(sale.cashier_id).name rescue ''%><%= number_with_delimiter(sprintf("%.2f",sale.total_amount.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale.total_discount.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",total_sales.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale.tax_payable_amount.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",net_sales.to_f), :delimiter => ',') %>
    -
    + <% grand_total = grand_total.to_f + result.grand_total.to_f %> + <% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %> + <% total_tax += result.total_tax.to_f %> + <% total_sum += result.total_amount.to_f %> + <% discount_amt += result.total_discount.to_f %> + <% rounding_adj += result.rounding_adjustment.to_f %> + + + + <%= result.receipt_no rescue '-' %> + <%= result.cashier_name rescue '-' %> + <%= result.total_amount rescue '-' %> + <%= result.total_discount rescue '-' %> + <% result.sale_taxes.each do |tax| %> + <%= tax.tax_payable_amount rescue '-' %> + <%end%> + + <%= result.old_grand_total %> + <%= result.rounding_adjustment.to_f rescue '-' %> + <%= result.grand_total_after_rounding() rescue '-'%> + + + <% end %> + +   + <%= total_sum rescue '-'%> + <%= discount_amt rescue '-'%> + <% @sale_taxes.each do |tax| %> + <%= tax.st_amount.round(2) %> + <% end %> + <%= old_grand_total.to_f.round(2) rescue '-'%> + <%= rounding_adj rescue '-'%> + <%= old_grand_total.to_f.round + rounding_adj %> + + +   + Total Amount + Discount Amount + <% @sale_taxes.each do |tax| %> + <%= tax.tax_name %> + <% end %> + Grand Total + Rounding Adj. + Grand Total +
    + Rounding Adj. + + + <%end%> + +
    +
    \ No newline at end of file diff --git a/app/views/reports/saleitem (copy)/_shift_sale_report_filter.html.erb b/app/views/reports/saleitem (copy)/_shift_sale_report_filter.html.erb new file mode 100644 index 00000000..c57c8be9 --- /dev/null +++ b/app/views/reports/saleitem (copy)/_shift_sale_report_filter.html.erb @@ -0,0 +1,194 @@ +
    +
    + <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> + <% if period_type != false %> +
    +
    + + +
    + + +
    + + + +
    +
    + + +
    +
    + +
    +
    + <% end %> + + + +
    +
    + <% if defined? promotions %> + <%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]), :class => "form-control" %> + <% end %> + + <% if defined? menu_types %> + <%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %> + <% end %> + + <% if defined? payments %> + <%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %> + <% end %> + + <% if defined? shift_name %> + + <% end %> + + <% if defined? cashiers %> + <%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations", :class => "form-control" %> + <% end %> + + <% if defined? singer %> + <%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List", :class => "form-control" %> + <% end %> + + <% if defined? bsm %> + <%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %> + <% end %> + + <% if defined? guest_role %> + <%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List", :class => "form-control" %> + <% end %> + + <% if defined? list_by_payment_type %> + <%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %> + <% end %> + + <% if defined? products %> + <%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %> + <% end %> + + <% if defined? items %> + <%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %> + <% end %> +
    +
    + + + + <% end %> +
    +
    + \ No newline at end of file diff --git a/app/views/reports/saleitem (copy)/index.html.erb b/app/views/reports/saleitem (copy)/index.html.erb new file mode 100644 index 00000000..b6482271 --- /dev/null +++ b/app/views/reports/saleitem (copy)/index.html.erb @@ -0,0 +1,141 @@ + + +
    + <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_saleitem_index_path} %> +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + +
    Date
    Menu CategoryCodeProductTotal ItemUnit PriceRevenue
    +
    +
    +
    + + \ No newline at end of file diff --git a/app/views/reports/saleitem (copy)/index.xls.erb b/app/views/reports/saleitem (copy)/index.xls.erb new file mode 100644 index 00000000..3773619b --- /dev/null +++ b/app/views/reports/saleitem (copy)/index.xls.erb @@ -0,0 +1,104 @@ + + + + + + + +
    +<% unless @sale_data.blank? %> + + + + + <% if !params[:from].blank?%> + + + + <% end %> + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + + <% end %> + + + + + + + + + + + + + <% acc_arr = Array.new %> + <% cate_arr = Array.new %> + + <% sub_total = 0.0 %> + <% count = 0%> + <% total_price = 0.0 %> + <% cate_count = 0 %> + <% acc_count = 0%> + <% grand_total = 0%> + <% total_discount = 0.0 %> + + <% @sale_data.order("total_item desc").each do |sale| %> + + + + <% if !cate_arr.include?(sale.menu_category_id) %> + + <% cate_arr.push(sale.menu_category_id) %> + <% else %> + + <% end %> + + <% if @item_table == 'sale' %> + <% if sale.item_remark == 'FOC' %> + + <% elsif sale.item_remark == 'FOC ITEM' %> + + <% elsif sale.item_remark == 'DISCOUNT' %> + + <% else %> + + <% end %> + <% if sale.item_remark == 'DISCOUNT' %> + + + + <% total_price += sale.total_price %> + <% else %> + + + + <% end %> + <% else %> + + + + + <% end %> + + + + + + <% grand_total += sale.grand_total%> + <% end %> + + + + + + +
    From Date : <%= params[:from] %> , To Date : <%= params[:to] %>
    Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
     Menu CategoryCodeProductTotal ItemUnit PriceRevenue
     <%= sale.menu_category_name %> <%= sale.code rescue '-' %><%= '[PROMO] '.to_s + sale.product_name.to_s rescue '-' %><%= '[DIS:QTY] '.to_s + sale.product_name.to_s rescue '-' %><%= '[DIS:TP] '.to_s + sale.product_name.to_s rescue '-' %><%= sale.product_name.to_s rescue '-' %> - - <%= sale.total_price.abs rescue '-' %><%= sale.total_item.abs rescue '-' %><%= sale.unit_price rescue '-' %><%= sale.grand_total.abs rescue '-' %><%= sale.product_name.to_s rescue '-' %><%= sale.total_item.abs rescue '-' %><%= sale.unit_price rescue '-' %><%= sale.grand_total.abs rescue '-' %>
     Grand Total<%= grand_total + total_discount %>
    +<% end %> +
    + + \ No newline at end of file diff --git a/app/views/reports/saleitem/_shift_sale_report_filter.html.erb b/app/views/reports/saleitem/_shift_sale_report_filter.html.erb index c57c8be9..eddebc64 100644 --- a/app/views/reports/saleitem/_shift_sale_report_filter.html.erb +++ b/app/views/reports/saleitem/_shift_sale_report_filter.html.erb @@ -6,6 +6,7 @@
    - + - -
    -
    - <% if defined? promotions %> - <%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]), :class => "form-control" %> - <% end %> - - <% if defined? menu_types %> - <%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %> - <% end %> - - <% if defined? payments %> - <%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %> - <% end %> - - <% if defined? shift_name %> - - <% end %> - - <% if defined? cashiers %> - <%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations", :class => "form-control" %> - <% end %> - - <% if defined? singer %> - <%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List", :class => "form-control" %> - <% end %> - - <% if defined? bsm %> - <%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %> - <% end %> - - <% if defined? guest_role %> - <%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List", :class => "form-control" %> - <% end %> - - <% if defined? list_by_payment_type %> - <%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %> - <% end %> - - <% if defined? products %> - <%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %> - <% end %> - - <% if defined? items %> - <%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %> - <% end %> -
    -
    - - - <% end %>
    @@ -148,20 +86,19 @@ $(function(){ } }); -//Reset the form to pervious values -$("#branch").val(<%=params[:branch]%>); -$("#waiter").val("<%=params[:waiter]%>"); -$("#cashier").val(<%=params[:cashier]%>); -$("#product").val(<%=params[:product]%>); -$("#singer").val(<%=params[:singer]%>); -$("#item").val('<%=params[:item]%>'); -$("#guest_role").val('<%=params[:guest_role]%>'); + <% if params[:shift_name].to_i > 0%> + shift_id = '<%= params[:shift_name] %>' + local_date = '<%= @shift_from %> - <%= @shift_to %> ' + var shift = $('#shift_name'); + str = ''; + shift.append(str); +<% end %> + $("#from").val("<%=params[:from] rescue '-'%>"); + $("#to").val("<%=params[:to] rescue '-'%>"); + $("#sel_period").val(<%=params[:period] rescue '-'%>); + $("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>); -$("#from").val("<%=params[:from]%>"); -$("#to").val("<%=params[:to]%>"); -$("#sel_period").val(<%=params[:period]%>); -$("#sel_sale_type").val(<%=params[:sale_type]%>); <% if params[:period_type] == 1 || params[:period_type] == "1" %> $("#rd_period_type_1").attr("checked","checked"); @@ -191,4 +128,4 @@ $('#item').change(function(){ } } }); - \ No newline at end of file + diff --git a/app/views/reports/saleitem/index.html.erb b/app/views/reports/saleitem/index.html.erb index b6482271..89c1c076 100644 --- a/app/views/reports/saleitem/index.html.erb +++ b/app/views/reports/saleitem/index.html.erb @@ -1,13 +1,15 @@
    - <%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_saleitem_index_path} %> + <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_saleitem_index_path} %> +
    @@ -21,121 +23,255 @@
    -
    - - - - - - - - - - - - - - - - +
    + -
    -
    Date
    Menu CategoryCodeProductTotal ItemUnit PriceRevenue
    -
    -
    + + + + + + + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + + <% end %> + + + + + + + + + + + + <% unless @sale_data.blank? %> + <% acc_arr = Array.new %> + <% cate_arr = Array.new %> + + <% sub_total = 0.0 %> + <% count = 0%> + <% total_price = 0.0 %> + <% cate_count = 0 %> + <% acc_count = 0%> + <% grand_total = 0%> + <% total_qty = 0%> + <% total_amount = 0 %> + <% discount = 0%> + + <% @sale_data.each do |sale| %> + <% total_qty += sale.total_item %> + + <% if !acc_arr.include?(sale.account_id) %> + + + + + + + <% acc_arr.push(sale.account_id) %> + + <% end %> + + + <% if !cate_arr.include?(sale.menu_category_id) %> + + <% cate_arr.push(sale.menu_category_id) %> + <% else %> + + <% end %> + + + + + + + + + + <% @menu_cate_count.each do |key,value| %> + <% if sale.menu_category_id == key %> + + <% count = count + 1 %> + <% sub_total += sale.grand_total %> + <% if count == value %> + + + + + + + <% sub_total = 0.0%> + <% count = 0%> + <% end %> + <% end %> + <% end %> + + + + <% end %> + + + + + + + + + <% end %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
    Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
     Menu CategoryCodeProductTotal ItemUnit PriceRevenue
    <%= sale.account_name %> Total Price By <%= sale.account_name %> + <% @totalByAccount.each do |account, total| %> + <% if sale.account_id == account %> + <%= total %> + <% grand_total += total %> + <% end %> + <% end %> +
     <%= sale.menu_category_name %> <%= sale.item_code rescue '-' %><%= sale.product_name rescue '-' %><%= sale.total_item rescue '-' %><%= sale.unit_price rescue '-' %><%= sale.grand_total rescue '-' %>
     Sub Total<%= sub_total %>
     Total Item<%= total_qty%>Total Amount<%= grand_total%>
     Cash Received<%= @cash_data - @change_amount %>
     Card Sales<%= @card_data %>
     Credit Sales<%= @credit_data %>
     FOC Sales<%= @foc_data %>
     Discount Amount<%= @discount_data %>
     Grand Total<%= @grand_total - @change_amount%>
    +
    + - \ No newline at end of file diff --git a/app/views/reports/saleitem/index.xls.erb b/app/views/reports/saleitem/index.xls.erb index 3773619b..74886913 100644 --- a/app/views/reports/saleitem/index.xls.erb +++ b/app/views/reports/saleitem/index.xls.erb @@ -1,104 +1,148 @@ - - - - - - - -
    -<% unless @sale_data.blank? %> +
    +
    +
    + - - +
    + - <% if !params[:from].blank?%> - - + + + + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + + <% end %> + + + + + + + + + + + + <% unless @sale_data.blank? %> + <% acc_arr = Array.new %> + <% cate_arr = Array.new %> + + <% sub_total = 0.0 %> + <% count = 0%> + <% total_price = 0.0 %> + <% cate_count = 0 %> + <% acc_count = 0%> + <% grand_total = 0%> + <% total_qty = 0%> + <% total_amount = 0 %> + <% discount = 0%> + + <% @sale_data.each do |sale| %> + <% total_qty += sale.total_item %> + + <% if !acc_arr.include?(sale.account_id) %> + + + + + + + <% acc_arr.push(sale.account_id) %> + + <% end %> + + + <% if !cate_arr.include?(sale.menu_category_id) %> + + <% cate_arr.push(sale.menu_category_id) %> + <% else %> + + <% end %> + + + + + + + + + + <% @menu_cate_count.each do |key,value| %> + <% if sale.menu_category_id == key %> + + <% count = count + 1 %> + <% sub_total += sale.grand_total %> + <% if count == value %> + + + + + + + <% sub_total = 0.0%> + <% count = 0%> + <% end %> + <% end %> + <% end %> + + + + <% end %> + + + + + + + + + <% end %> + + + + + - <% end %> - <% if @shift_from %> - <% if @shift_data.employee %> - <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> - <% end %> - - - <% end %> - - - - - - - - - - - - - <% acc_arr = Array.new %> - <% cate_arr = Array.new %> - - <% sub_total = 0.0 %> - <% count = 0%> - <% total_price = 0.0 %> - <% cate_count = 0 %> - <% acc_count = 0%> - <% grand_total = 0%> - <% total_discount = 0.0 %> - - <% @sale_data.order("total_item desc").each do |sale| %> - - - - <% if !cate_arr.include?(sale.menu_category_id) %> - - <% cate_arr.push(sale.menu_category_id) %> - <% else %> - - <% end %> - - <% if @item_table == 'sale' %> - <% if sale.item_remark == 'FOC' %> - - <% elsif sale.item_remark == 'FOC ITEM' %> - - <% elsif sale.item_remark == 'DISCOUNT' %> - - <% else %> - - <% end %> - <% if sale.item_remark == 'DISCOUNT' %> - - - - <% total_price += sale.total_price %> - <% else %> - - - - <% end %> - <% else %> - - - - - <% end %> + + + - - - - - <% grand_total += sale.grand_total%> - <% end %> + + + + + + + + + + + + + + + - + + - +
    From Date : <%= params[:from] %> , To Date : <%= params[:to] %>
    From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
    Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
     Menu CategoryCodeProductTotal ItemUnit PriceRevenue
    <%= sale.account_name %> Total Price By <%= sale.account_name %> + <% @totalByAccount.each do |account, total| %> + <% if sale.account_id == account %> + <%= total %> + <% grand_total += total %> + <% end %> + <% end %> +
     <%= sale.menu_category_name %> <%= sale.item_code rescue '-' %><%= sale.product_name rescue '-' %><%= sale.total_item rescue '-' %><%= sale.unit_price rescue '-' %><%= sale.grand_total rescue '-' %>
     Sub Total<%= sub_total %>
     Total Item<%= total_qty%>Total Amount<%= grand_total%>
     Cash Received<%= @cash_data - @change_amount %>
    Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
     Menu CategoryCodeProductTotal ItemUnit PriceRevenue
     <%= sale.menu_category_name %> <%= sale.code rescue '-' %><%= '[PROMO] '.to_s + sale.product_name.to_s rescue '-' %><%= '[DIS:QTY] '.to_s + sale.product_name.to_s rescue '-' %><%= '[DIS:TP] '.to_s + sale.product_name.to_s rescue '-' %><%= sale.product_name.to_s rescue '-' %> - - <%= sale.total_price.abs rescue '-' %><%= sale.total_item.abs rescue '-' %><%= sale.unit_price rescue '-' %><%= sale.grand_total.abs rescue '-' %><%= sale.product_name.to_s rescue '-' %><%= sale.total_item.abs rescue '-' %><%= sale.unit_price rescue '-' %><%= sale.grand_total.abs rescue '-' %> Card Sales<%= @card_data %>
     Credit Sales<%= @credit_data %>
     FOC Sales<%= @foc_data %>
     Discount Amount<%= @discount_data %>
      Grand Total<%= grand_total + total_discount %><%= @grand_total - @change_amount%>
    -<% end %>
    - - \ No newline at end of file +
    +
    diff --git a/app/views/reports/shiftsale/_shift_sale_report_filter.html.erb b/app/views/reports/shiftsale/_shift_sale_report_filter.html.erb index 34173d99..1ccf99ad 100644 --- a/app/views/reports/shiftsale/_shift_sale_report_filter.html.erb +++ b/app/views/reports/shiftsale/_shift_sale_report_filter.html.erb @@ -18,18 +18,7 @@
    - - +
    @@ -39,6 +28,11 @@
    +
    + + +
    @@ -82,15 +76,13 @@ $(function(){ }); //Reset the form to pervious values -$("#branch").val(<%=params[:branch]%>); -$("#waiter").val("<%=params[:waiter]%>"); -$("#cashier").val(<%=params[:cashier]%>); -$("#product").val(<%=params[:product]%>); -$("#singer").val(<%=params[:singer]%>); -$("#item").val('<%=params[:item]%>'); -$("#guest_role").val('<%=params[:guest_role]%>'); - - +<% if params[:shift_name].to_i > 0%> + shift_id = '<%= params[:shift_name] %>' + local_date = '<%= @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")%> -<%= @shift.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p") %>' + var shift = $('#shift_name'); + str = ''; + shift.append(str); +<% end %> $("#from").val("<%=params[:from]%>"); $("#to").val("<%=params[:to]%>"); $("#sel_period").val(<%=params[:period]%>); diff --git a/app/views/reports/shiftsale/index.html.erb b/app/views/reports/shiftsale/index.html.erb index 714a8328..755511ab 100644 --- a/app/views/reports/shiftsale/index.html.erb +++ b/app/views/reports/shiftsale/index.html.erb @@ -7,7 +7,7 @@
    <%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_shiftsale_index_path} %> + :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_shiftsale_index_path} %>
    @@ -27,12 +27,20 @@
    - <% if params[:from]%> - - - - <% end %> - + + + + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + + <% end %> @@ -82,7 +90,7 @@ <% grand_total = result.grand_total.to_f %> - + <% cash += result.cash_sales.to_f %> <% credit += result.credit_sales.to_f %> @@ -103,12 +111,101 @@ - +
    From Date : <%= params[:from] rescue '-'%> ,To Date : <%= params[:to] rescue '-'%>
    From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> + - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%> + +
    Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
    Cashier Station Cashier Name<%= sprintf "%.2f",grand_tota.to_f.to_d rescue '-'%>
    <%= sprintf("%.2f",card) rescue '-'%> <%= sprintf("%.2f",g_total) rescue '-'%><%= sprintf("%.2f",g_total) rescue '-'%>
    + diff --git a/app/views/reports/shiftsale/index.xls.erb b/app/views/reports/shiftsale/index.xls.erb index c2a8a6d2..951268e9 100644 --- a/app/views/reports/shiftsale/index.xls.erb +++ b/app/views/reports/shiftsale/index.xls.erb @@ -1,11 +1,24 @@ +
    +
    - <% if params[:from]%> - - - + + + + <% if @shift_from %> + + <% if @shift_data.employee %> + <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> + <% end %> + + <% end %> @@ -57,7 +70,7 @@ <% grand_total = result.grand_total.to_f %> - + <% cash += result.cash_sales.to_f %> <% credit += result.credit_sales.to_f %> @@ -78,9 +91,10 @@ - +
    From Date : <%= params[:from] rescue '-'%> ,To Date : <%= params[:to] rescue '-'%>
    From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> + - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%> + +
    Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
    <%= sprintf "%.2f",grand_tota.to_f.to_d rescue '-'%>
    <%= sprintf("%.2f",card) rescue '-'%> <%= sprintf("%.2f",g_total) rescue '-'%><%= sprintf("%.2f",g_total) rescue '-'%>
    -
    \ No newline at end of file +
    + \ No newline at end of file diff --git a/app/views/settings/membership_settings/_form.html.erb b/app/views/settings/membership_settings/_form.html.erb index 85b52488..77a189c4 100644 --- a/app/views/settings/membership_settings/_form.html.erb +++ b/app/views/settings/membership_settings/_form.html.erb @@ -7,7 +7,10 @@ <%= f.input :gateway_communication_type %> <%= f.input :gateway_url %> <%= f.input :auth_token %> - <%= f.input :created_by %> + <%= f.input :discount %> + <%= f.input :rebate %> + <%= f.input :bonus %> + <%= f.input :point %>
    diff --git a/app/views/settings/membership_settings/index.html.erb b/app/views/settings/membership_settings/index.html.erb index 9099e9e4..e382f026 100644 --- a/app/views/settings/membership_settings/index.html.erb +++ b/app/views/settings/membership_settings/index.html.erb @@ -18,7 +18,10 @@ Gateway url Auth token Merchant account - Created by + Discount + Rebate + Bonus + Point @@ -32,7 +35,10 @@ <%= settings_membership_setting.gateway_url %> <%= settings_membership_setting.auth_token %> <%= settings_membership_setting.merchant_account rescue ''%> - <%= settings_membership_setting.created_by %> + <%= settings_membership_setting.discount %> + <%= settings_membership_setting.rebate %> + <%= settings_membership_setting.bonus %> + <%= settings_membership_setting.point %> <%= link_to 'Edit', edit_settings_membership_setting_path(settings_membership_setting) %> <%= link_to 'Destroy', settings_membership_setting_path(settings_membership_setting), method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/settings/order_queue_stations/show.html.erb b/app/views/settings/order_queue_stations/show.html.erb index fbb19182..97c5dd4c 100644 --- a/app/views/settings/order_queue_stations/show.html.erb +++ b/app/views/settings/order_queue_stations/show.html.erb @@ -32,7 +32,7 @@ <%= @settings_order_queue_station.station_name %> <%= @settings_order_queue_station.is_active %> <%= @settings_order_queue_station.auto_print %> - <%= @settings_order_queue_station.processing_items %> + <%= JSON.parse(@settings_order_queue_station.processing_items).count %> <%= @settings_order_queue_station.print_copy %> <%= @settings_order_queue_station.printer_name %> <%= @settings_order_queue_station.font_size %> diff --git a/config/routes.rb b/config/routes.rb index b04bed33..e4723a22 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -104,6 +104,9 @@ Rails.application.routes.draw do get "/:id/remove_all_discount" => "discounts#remove_all_discount" post "/:id/remove_discount_items" => "discounts#remove_discount_items" + # Discount for Member + post "/:id/member_discount" => "discounts#member_discount" + get "/:id/request_bills" => "request_bills#print",:as => "request_bill" get '/:sale_id/reprint' => 'payments#reprint' ,:defaults => { :format => 'json' } @@ -111,6 +114,7 @@ Rails.application.routes.draw do resources :shifts, only: [:index, :new, :create, :edit] post 'close_shift' => 'shifts#update_shift' get 'shift/close' => 'shifts#show' + get 'shift/sale_summary' => 'shifts#sale_summary' #shift - index (open/close shift landing page) #shift - show (sales summary display) #shift - new (open shift) @@ -270,10 +274,12 @@ Rails.application.routes.draw do #--------- Reports Controller Sections ------------# namespace :reports do - resources :receipt_no, :only => [:index, :show] + resources :receipt_no resources :dailysale, :only => [:index, :show] resources :saleitem, :only => [:index, :show] resources :shiftsale, :only => [:index, :show] + + get "receipt_no/get_shift_by_date", to: "receipt_no#get_shift_by_date", as: "get_shift_by_date" # resources :sales, :only => [:index, :show] # resources :orders, :only => [:index, :show] # resources :customers, :only => [:index, :show] diff --git a/db/migrate/20170414071634_create_membership_settings.rb b/db/migrate/20170414071634_create_membership_settings.rb index fca5cce4..51127d92 100644 --- a/db/migrate/20170414071634_create_membership_settings.rb +++ b/db/migrate/20170414071634_create_membership_settings.rb @@ -8,7 +8,10 @@ class CreateMembershipSettings < ActiveRecord::Migration[5.1] t.string :auth_token t.string :merchant_account_id t.string :created_by - + t.boolean :discount, :default => false + t.boolean :rebate, :default => false + t.boolean :bonus, :default => false + t.boolean :point, :default => false t.timestamps end end diff --git a/db/migrate/20170622050926_create_customers.rb b/db/migrate/20170622050926_create_customers.rb index 07ec136f..20ced7b0 100644 --- a/db/migrate/20170622050926_create_customers.rb +++ b/db/migrate/20170622050926_create_customers.rb @@ -12,6 +12,7 @@ class CreateCustomers < ActiveRecord::Migration[5.1] t.string :nrc_no t.string :address t.string :card_no, :unique => true + t.string :paypar_account_no, :unique => true t.string :membership_id t.string :membership_type t.string :membership_authentication_code diff --git a/db/migrate/20170626191519_create_shift_sales.rb b/db/migrate/20170626191519_create_shift_sales.rb index 18323c9d..d16449d7 100644 --- a/db/migrate/20170626191519_create_shift_sales.rb +++ b/db/migrate/20170626191519_create_shift_sales.rb @@ -21,6 +21,9 @@ class CreateShiftSales < ActiveRecord::Migration[5.1] t.integer :dining_count, :default => 0 t.integer :takeaway_count, :default => 0 t.integer :member_count, :default => 0 + t.integer :total_rounding, :default => 0 + t.integer :total_receipt, :default => 0 + t.decimal :total_void, :default => 0 t.timestamps end end diff --git a/db/migrate/20170701101420_create_sales.rb b/db/migrate/20170701101420_create_sales.rb index 6d3f33f9..d0e70287 100644 --- a/db/migrate/20170701101420_create_sales.rb +++ b/db/migrate/20170701101420_create_sales.rb @@ -13,6 +13,7 @@ class CreateSales < ActiveRecord::Migration[5.1] t.string :payment_status, :null => false, :default => "outstanding" t.string :sale_status, :null => false, :default => "new" t.decimal :total_amount, :precision => 10, :scale => 2, :null => false, :default => 0.00 + t.string :discount_type, :default => "overall" t.decimal :total_discount, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :total_tax, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.string :tax_type, :null => false , :dfault => "exclusive_tax" diff --git a/db/seeds.rb b/db/seeds.rb index 3bff75a0..317194c1 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -103,7 +103,7 @@ customer2 = Customer.create({name:"TAKEAWAY", email: "cus2@customer.com", contac # room = Room.create({name:"Table 2", zone: zone2, status:"available", seater: 4 , order_by:1, created_by:"SYSTEM DEFAULT"}) #Tax Profile -tax_profiles = TaxProfile.create({id:1, name: "Commerical Tax", rate:5.0, order_by:1, created_by:"SYSTEM DEFAULT"}) +tax_profiles = TaxProfile.create({id:1, name: "Commercial Tax", rate:5.0, order_by:1, created_by:"SYSTEM DEFAULT"}) #Account for Menu Item Type (eg: Food, Beverage) # food = Account.create({title: "Food", account_type: "0"}) @@ -138,7 +138,7 @@ menu_item_attribute_size_small = MenuItemAttribute.create({attribute_type:"size" menu_item_attribute_size_medium = MenuItemAttribute.create({attribute_type:"size",name: "Medium", value: "medium"}) menu_item_attribute_size_large = MenuItemAttribute.create({attribute_type:"size", name: "Large", value: "large"}) -shop = Shop.create({id:1, name: "Beauty In the Pot", address:'No.42-A, Sayar San Road, Bahan, Yangon', township:"Bahan",state:"Yangon",city:"Yangon", country:"Myanmar", phone_no:"+95(9) 252221188, +95(9) 252221177",reservation_no:"111",license:"123", +shop = Shop.create({id:1, name: "OSAKA OHSHO", 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"}) #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"}) @@ -172,7 +172,9 @@ member_actions= MembershipAction.create([{membership_type:"get_account_balance", {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:"get_member_transactions",gateway_url:"/api/generic_customer/get_membership_transactions",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"member_discount",gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:6},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"get_member_campaign",gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:6},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, ]) payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://192.168.1.47:3006"}) diff --git a/dump.rdb b/dump.rdb index 3ac76616..0e8d606f 100644 Binary files a/dump.rdb and b/dump.rdb differ diff --git a/lib/tasks/clear_data.rake b/lib/tasks/clear_data.rake index d0bf6ceb..affe76ff 100644 --- a/lib/tasks/clear_data.rake +++ b/lib/tasks/clear_data.rake @@ -1,19 +1,19 @@ namespace :clear do - # desc "Clear Data" - # task :data => :environment do - # BookingOrder.delete_all - # Booking.delete_all - # OrderItem.delete_all - # AssignedOrderItem.delete_all - # Order.delete_all - # SaleOrder.delete_all - # SaleItem.delete_all - # Sale.delete_all - # SaleAudit.delete_all - # SalePayment.delete_all - # ShiftSale.delete_all - # PaymentJournal.delete_all - # DiningFacility.update_all(status:'available') - # puts "Clear Data Done." - # end + desc "Clear Data" + task :data => :environment do + BookingOrder.delete_all + Booking.delete_all + OrderItem.delete_all + AssignedOrderItem.delete_all + Order.delete_all + SaleOrder.delete_all + SaleItem.delete_all + Sale.delete_all + SaleAudit.delete_all + SalePayment.delete_all + ShiftSale.delete_all + PaymentJournal.delete_all + DiningFacility.update_all(status:'available') + puts "Clear Data Done." + end end diff --git a/lib/tasks/menu_import.rake b/lib/tasks/menu_import.rake index 2ff305fd..e0e0be3a 100644 --- a/lib/tasks/menu_import.rake +++ b/lib/tasks/menu_import.rake @@ -1,5 +1,5 @@ namespace :menu do - desc "Clear Data" + desc "Menu Bitp" task :bitp => :environment do # Main Menu menu = Menu.create({name: "Main Menu", is_active: true, created_by: "SYSTEM DEFAULT"}) @@ -8,47 +8,47 @@ beverage = Account.create({title: "Beverage", account_type: "1"}) # soup base menu_category1 = MenuCategory.create({menu: menu, code:"C001", name: "Soup Base", alt_name: "Soup_base", order_by: 1,created_by: "SYSTEM DEFAULT"}) # single pot - menu_category1_menu_item0 = SimpleMenuItem.create({item_code:"01001", name: "Single Pot", alt_name: "小辣",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_category1_menu_item01 = SimpleMenuItem.create({item_code:"010010", name: "Beauty Collagen Broth", alt_name: "胶原蛋白养颜美容锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_category1_menu_item02 = SimpleMenuItem.create({item_code:"010011", name: "Spicy Nourishing Broth", alt_name: "滋补养生香辣锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_category1_menu_item03 = SimpleMenuItem.create({item_code:"010012", name: "Herbal Drunken Chicken Broth", alt_name: "养生药膳醉鸡锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_category1_menu_item04 = SimpleMenuItem.create({item_code:"010013", name: "Cooling Coconut Broth", alt_name: "清凉解热雪耳椰子锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_category1_menu_item05 = SimpleMenuItem.create({item_code:"010014", name: "Lonevity Wild Pine Mushroom Broth", alt_name: "长生抗癌松茸菌锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_category1_menu_item06 = SimpleMenuItem.create({item_code:"010015", name: "Vitamin C Tomato Sweet Corn Broth", alt_name: "维他命C番茄玉米锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_category1_menu_item0 = SimpleMenuItem.create({item_code:"01001", name: "Single Pot", alt_name: "Single Pot",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_category1_menu_item01 = SimpleMenuItem.create({item_code:"010010", name: "Beauty Collagen Broth", alt_name: "胶原蛋白养颜美容锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_category1_menu_item02 = SimpleMenuItem.create({item_code:"010011", name: "Spicy Nourishing Broth", alt_name: "滋补养生香辣锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_category1_menu_item03 = SimpleMenuItem.create({item_code:"010012", name: "Herbal Drunken Chicken Broth", alt_name: "养生药膳醉鸡锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_category1_menu_item04 = SimpleMenuItem.create({item_code:"010013", name: "Cooling Coconut Broth", alt_name: "清凉解热雪耳椰子锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_category1_menu_item05 = SimpleMenuItem.create({item_code:"010014", name: "Lonevity Wild Pine Mushroom Broth", alt_name: "长生抗癌松茸菌锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_category1_menu_item06 = SimpleMenuItem.create({item_code:"010015", name: "Vitamin C Tomato Sweet Corn Broth", alt_name: "维他命C番茄玉米锅",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Single Pot",item_instance_code:"II0011", menu_item: menu_category1_menu_item0, price:0.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0051", menu_item: menu_category1_menu_item01, price:15800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Spicy Nourishing Broth",item_instance_code:"II0061", menu_item: menu_category1_menu_item02, price:15800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Herbal Drunken Chicken Broth",item_instance_code:"II0071", menu_item: menu_category1_menu_item03, price:17800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cooling Coconut Broth",item_instance_code:"II0081", menu_item: menu_category1_menu_item04, price:15800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Lonevity Wild Pine Mushroom Broth",item_instance_code:"II0091", menu_item: menu_category1_menu_item05, price:15800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Vitamin C Tomato Sweet Corn Broth",item_instance_code:"II0101", menu_item: menu_category1_menu_item06, price:15800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0051", menu_item: menu_category1_menu_item0, price:15800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Spicy Nourishing Broth",item_instance_code:"II0061", menu_item: menu_category1_menu_item0, price:15800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Herbal Drunken Chicken Broth",item_instance_code:"II0071", menu_item: menu_category1_menu_item0, price:17800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cooling Coconut Broth",item_instance_code:"II0081", menu_item: menu_category1_menu_item0, price:15800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Lonevity Wild Pine Mushroom Broth",item_instance_code:"II0091", menu_item: menu_category1_menu_item0, price:15800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Vitamin C Tomato Sweet Corn Broth",item_instance_code:"II0101", menu_item: menu_category1_menu_item0, price:15800.00, is_on_promotion:false}]) # twin pot - menu_category1_menu_item1 = SimpleMenuItem.create({item_code:"01002", name: "Twin Pot", alt_name: "中辣",menu_category: menu_category1 , min_selectable_item: 2, max_selectable_item:2, account: food }) + menu_category1_menu_item1 = SimpleMenuItem.create({item_code:"01002", name: "Twin Pot", alt_name: "Twin Pot",menu_category: menu_category1 , min_selectable_item: 2, max_selectable_item:2, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Twin Pot",item_instance_code:"II0021", menu_item: menu_category1_menu_item1, price:0.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0052", menu_item: menu_category1_menu_item01, price:9800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Spicy Nourishing Broth",item_instance_code:"II0062", menu_item: menu_category1_menu_item02, price:9800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Herbal Drunken Chicken Broth",item_instance_code:"II0072", menu_item: menu_category1_menu_item03, price:9800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cooling Coconut Broth",item_instance_code:"II0082", menu_item: menu_category1_menu_item04, price:9800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Lonevity Wild Pine Mushroom Broth",item_instance_code:"II0092", menu_item: menu_category1_menu_item05, price:9800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Vitamin C Tomato Sweet Corn Broth",item_instance_code:"II0102", menu_item: menu_category1_menu_item06, price:11800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0052", menu_item: menu_category1_menu_item1, price:9800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Spicy Nourishing Broth",item_instance_code:"II0062", menu_item: menu_category1_menu_item1, price:9800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Herbal Drunken Chicken Broth",item_instance_code:"II0072", menu_item: menu_category1_menu_item1, price:9800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cooling Coconut Broth",item_instance_code:"II0082", menu_item: menu_category1_menu_item1, price:9800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Lonevity Wild Pine Mushroom Broth",item_instance_code:"II0092", menu_item: menu_category1_menu_item1, price:9800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Vitamin C Tomato Sweet Corn Broth",item_instance_code:"II0102", menu_item: menu_category1_menu_item1, price:11800.00, is_on_promotion:false}]) # vip room Individual pot - menu_category1_menu_item2 = SimpleMenuItem.create({item_code:"01003", name: "VIP Room Individual Pot", alt_name: "VIP 小辣",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_category1_menu_item2 = SimpleMenuItem.create({item_code:"01003", name: "VIP Room Individual Pot", alt_name: "VIP",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"VIP Room Individual Pot",item_instance_code:"II0031", menu_item: menu_category1_menu_item2, price:0.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0053", menu_item: menu_category1_menu_item01, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Spicy Nourishing Broth ",item_instance_code:"II0063", menu_item: menu_category1_menu_item02, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Herbal Drunken Chicken Broth",item_instance_code:"II0073", menu_item: menu_category1_menu_item03, price:8000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cooling Coconut Broth",item_instance_code:"II0083", menu_item: menu_category1_menu_item04, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Lonevity Wild Pine Mushroom Broth",item_instance_code:"II0093", menu_item: menu_category1_menu_item05, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Vitamin C Tomato Sweet Corn Broth",item_instance_code:"II0103", menu_item: menu_category1_menu_item06, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0053", menu_item: menu_category1_menu_item2, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Spicy Nourishing Broth ",item_instance_code:"II0063", menu_item: menu_category1_menu_item2, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Herbal Drunken Chicken Broth",item_instance_code:"II0073", menu_item: menu_category1_menu_item2, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cooling Coconut Broth",item_instance_code:"II0083", menu_item: menu_category1_menu_item2, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Lonevity Wild Pine Mushroom Broth",item_instance_code:"II0093", menu_item: menu_category1_menu_item2, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Vitamin C Tomato Sweet Corn Broth",item_instance_code:"II0103", menu_item: menu_category1_menu_item2, price:6000.00, is_on_promotion:false}]) # Quart pot - menu_category1_menu_item3 = SimpleMenuItem.create({item_code:"01004", name: "Quart Pot", alt_name: "大辣",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_category1_menu_item3 = SimpleMenuItem.create({item_code:"01004", name: "Quart Pot", alt_name: "Quart Pot",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Quart Pot",item_instance_code:"II0041", menu_item: menu_category1_menu_item3, price:0.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0054", menu_item: menu_category1_menu_item01, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Spicy Nourishing Broth ",item_instance_code:"II0064", menu_item: menu_category1_menu_item02, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Herbal Drunken Chicken Broth",item_instance_code:"II0074", menu_item: menu_category1_menu_item03, price:8000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cooling Coconut Broth",item_instance_code:"II0084", menu_item: menu_category1_menu_item04, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Lonevity Wild Pine Mushroom Broth",item_instance_code:"II0094", menu_item: menu_category1_menu_item05, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Vitamin C Tomato Sweet Corn Broth",item_instance_code:"II0104", menu_item: menu_category1_menu_item06, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0054", menu_item: menu_category1_menu_item3, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Spicy Nourishing Broth ",item_instance_code:"II0064", menu_item: menu_category1_menu_item3, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Herbal Drunken Chicken Broth",item_instance_code:"II0074", menu_item: menu_category1_menu_item3, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cooling Coconut Broth",item_instance_code:"II0084", menu_item: menu_category1_menu_item3, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Lonevity Wild Pine Mushroom Broth",item_instance_code:"II0094", menu_item: menu_category1_menu_item3, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Vitamin C Tomato Sweet Corn Broth",item_instance_code:"II0104", menu_item: menu_category1_menu_item3, price:6000.00, is_on_promotion:false}]) # Assorted Platter diff --git a/lib/tasks/menu_osaka.rake b/lib/tasks/menu_osaka.rake new file mode 100644 index 00000000..9241166b --- /dev/null +++ b/lib/tasks/menu_osaka.rake @@ -0,0 +1,909 @@ +namespace :menu do + desc "Menu Osaka" + task :osaka => :environment do + MenuItemInstance.delete_all + MenuItem.delete_all + MenuCategory.delete_all + Menu.delete_all + Account.delete_all +# Main Menu +menu = Menu.create({name: "Main Menu", is_active: true, created_by: "SYSTEM DEFAULT"}) +food = Account.create({title: "Food", account_type: "0"}) +beverage = Account.create({title: "Beverage", account_type: "1"}) +# Gyoza +menu_category1 = MenuCategory.create({menu: menu, name: "Gyoza", alt_name: "Gyoza", order_by: 1,created_by: "SYSTEM DEFAULT"}) + #Gyoza 6Pcs + menu_category1_menu_item5 = SimpleMenuItem.create({name: "Gyoza 6Pcs", alt_name: "Gyoza 6Pcs",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Pork", menu_item: menu_category1_menu_item5, price:2500.0, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Chicken", menu_item: menu_category1_menu_item5, price:2500.0, is_on_promotion:false}]) + #Gyoza 12 Pcs + menu_category1_menu_item6 = SimpleMenuItem.create({name: "Gyoza 12 Pcs", alt_name: "Gyoza 12 Pcs",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Pork", menu_item: menu_category1_menu_item6, price:5000.0, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Chicken", menu_item: menu_category1_menu_item6, price:5000.0, is_on_promotion:false}]) + # Cheese Gyoza 6pcs + menu_category1_menu_item2 = SimpleMenuItem.create({name: "Cheese Gyoza 6pcs", alt_name: "Cheese Gyoza 6pcs",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item2, price:5000.0, is_on_promotion:false}]) + # Spicy Mayonnaise Gyoza 6pcs + menu_category1_menu_item4 = SimpleMenuItem.create({name: "Spicy Mayonnaise Gyoza 6pcs", alt_name: "Spicy Mayonnaise Gyoza 6pcs",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item4, price:4000.0, is_on_promotion:false}]) + #Garlic Gyoza 6pcs + menu_category1_menu_item26 = SimpleMenuItem.create({name: "Garlic Gyoza 6pcs", alt_name: "Garlic Gyoza 6pcs",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item26, price:4000.0, is_on_promotion:false}]) + #Green Onion Gyoza 6Pcs + menu_category1_menu_item7 = SimpleMenuItem.create({name: "Green Onion Gyoza 6Pcs", alt_name: "Green Onion Gyoza 6Pcs",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item7, price:2500.0, is_on_promotion:false}]) + #Kimchi Mayo Gyoza 6Pcs + menu_category1_menu_item8 = SimpleMenuItem.create({name: "Kimchi Mayo Gyoza 6Pcs", alt_name: "Kimchi Mayo Gyoza 6Pcs",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item8, price:3000.0, is_on_promotion:false}]) + #White Onion Gyoza 6Pcs + menu_category1_menu_item9 = SimpleMenuItem.create({name: "White Onion Gyoza 6Pcs", alt_name: "White Onion Gyoza 6Pcs",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item9, price:3000.0, is_on_promotion:false}]) + # Gyoza 3pcs + menu_category1_menu_item0 = SimpleMenuItem.create({name: "Gyoza 3pcs", alt_name: "Gyoza 3pcs",menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item0, price:1500.0, is_on_promotion:false}]) + # Gyoza 2pcs + menu_category1_menu_item1 = SimpleMenuItem.create({name: "Gyoza 2pcs", alt_name: "Gyoza 2pcs",menu_category: menu_category1 , min_selectable_item: 2, max_selectable_item:2, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"", menu_item: menu_category1_menu_item1, price:1000.0, is_on_promotion:false}]) + # Curry Gyoza 6pcs + # menu_category1_menu_item3 = SimpleMenuItem.create({ name: "Curry Gyoza 6pcs", alt_name: "Curry Gyoza 6pcs", menu_category: menu_category1 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item3, price:5000.0, is_on_promotion:false}]) + + # Salad +menu_category4 = MenuCategory.create({menu: menu, name: "Salad", alt_name: "Salad", order_by: 4,created_by: "SYSTEM DEFAULT"}) + # S1-Glass Noodle Salad + menu_category1_menu_item37 = SimpleMenuItem.create({name: "S1-Glass Noodle Salad", alt_name: "S1-Glass Noodle Salad",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item37, price:2500.00, is_on_promotion:false}]) + # S2-Kimuchi + menu_category1_menu_item32 = SimpleMenuItem.create({ name: "S2-Kimuchi", alt_name: "S2-Kimuchi",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item32, price:1000.00, is_on_promotion:false}]) + # S3-Bean Sprout Salad + menu_category1_menu_item33 = SimpleMenuItem.create({ name: " S3-Bean Sprout Salad", alt_name: " S3-Bean Sprout Salad",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item33, price:1500.00, is_on_promotion:false}]) + # S4 Green Salad + # menu_category1_menu_item34 = SimpleMenuItem.create({name: "S4 Green Salad", alt_name: "S4 Green Salad",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item34, price:2500.00, is_on_promotion:false}]) + # S5-Otsumami Sansyu + # menu_category1_menu_item35 = SimpleMenuItem.create({name: "S5-Otsumami Sansyu", alt_name: "S5-Otsumami Sansyu",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item35, price:2500.00, is_on_promotion:false}]) + # S6-Edamame + menu_category1_menu_item36 = SimpleMenuItem.create({name: "S6-Edamame", alt_name: "S6-Edamame",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item36, price:2000.00, is_on_promotion:false}]) + # Fried Tofu Salad + menu_category1_menu_item31 = SimpleMenuItem.create({name: "Fried Tofu Salad", alt_name: "Fried Tofu Salad",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item31, price:3500.00, is_on_promotion:false}]) + # Apple Salad + # menu_category1_menu_item27 = SimpleMenuItem.create({name: "Apple Salad", alt_name: "Apple Salad",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item27, price:3500.00, is_on_promotion:false}]) + # Seaweed Salad + # menu_category1_menu_item28 = SimpleMenuItem.create({name: "Seaweed Salad", alt_name: "Seaweed Salad",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item28, price:3000.00, is_on_promotion:false}]) + # BBQ Pork Salad + menu_category1_menu_item29 = SimpleMenuItem.create({ name: "BBQ Pork Salad", alt_name: "BBQ Pork Salad",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item29, price:4000.00, is_on_promotion:false}]) + # Seafood Salad + menu_category1_menu_item30 = SimpleMenuItem.create({name: "Seafood Salad", alt_name: "Seafood Salad",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item30, price:5000.00, is_on_promotion:false}]) + # Gyoza Salad + menu_category1_menu_item59 = SimpleMenuItem.create({name: "Gyoza Salad", alt_name: "Gyoza Salad",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item59, price:4000.00, is_on_promotion:false}]) + +# Appetizer +menu_category5 = MenuCategory.create({menu: menu, name: "Appetizer", alt_name: "Appetizer", order_by: 5, created_by: "SYSTEM DEFAULT"}) + #A1 Pork Cutlet + menu_category1_menu_item47 = SimpleMenuItem.create({name: "A1 Pork Cutlet", alt_name: "A1 Pork Cutlet",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item47, price:3500.00, is_on_promotion:false}]) + # A2 Kushi Katsu + # menu_category1_menu_item48 = SimpleMenuItem.create({name: "A2 Kushi Katsu", alt_name: "A2 Kushi Katsu",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item48, price:4000.00, is_on_promotion:false}]) + # A3 Croquette + # menu_category1_menu_item49 = SimpleMenuItem.create({name: "A3 Croquette", alt_name: "A3 Croquette",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item49, price:3500.00, is_on_promotion:false}]) + # A4 Fried Prawn + menu_category1_menu_item50 = SimpleMenuItem.create({name: "A4 Fried Prawn", alt_name: "A4 Fried Prawn",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item50, price:4000.00, is_on_promotion:false}]) + # A5 Fried Soft Shell Crab + menu_category1_menu_item51 = SimpleMenuItem.create({name: "A5 Fried Soft Shell Crab", alt_name: "A5 Fried Soft Shell Crab",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item51, price:4000.00, is_on_promotion:false}]) + # A6 Vegetable Tempura + menu_category1_menu_item52 = SimpleMenuItem.create({name: "A6 Vegetable Tempura", alt_name: "A6 Vegetable Tempura",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item52, price:2500.00, is_on_promotion:false}]) + # A7 Tempura Assortment + menu_category1_menu_item53 = SimpleMenuItem.create({name: "A7 Tempura Assortment ", alt_name: "A7 Tempura Assortment ",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item53, price:4500.00, is_on_promotion:false}]) + # A8 - Fried Chicken + menu_category1_menu_item54 = SimpleMenuItem.create({name: "A8-Fried Chicken ", alt_name: "A8 - Fried Chicken ",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item54, price:3500.00, is_on_promotion:false}]) + # A9 - Fried Tofu + menu_category1_menu_item55 = SimpleMenuItem.create({name: "A9-Fried Tofu", alt_name: "A9 - Fried Tofu",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item55, price:1500.00, is_on_promotion:false}]) + # A 10 - Fried Potato + menu_category1_menu_item56 = SimpleMenuItem.create({name: "A10-Fried Potato", alt_name: "A10 - Fried Potato",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item56, price:1500.00, is_on_promotion:false}]) + # A11 Fried Gyoza + menu_category1_menu_item57 = SimpleMenuItem.create({name: "A11-Fried Gyoza", alt_name: "A11 - Fried Gyoza",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item57, price:2500.00, is_on_promotion:false}]) + # A12 Chicken Cutlet + menu_category1_menu_item58 = SimpleMenuItem.create({name: "A12-Chicken Cutlet", alt_name: "A12 - Chicken Cutlet",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item58, price:3500.00, is_on_promotion:false}]) + # Spicy Steamed Chicken + menu_category1_menu_item42 = SimpleMenuItem.create({name: "Spicy Steamed Chicken", alt_name: "Spicy Steamed Chicken",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item42, price:4500.00, is_on_promotion:false}]) + # Grilled Saba + menu_category1_menu_item43 = SimpleMenuItem.create({name: "Grilled Saba", alt_name: "Grilled Saba",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item43, price:7500.00, is_on_promotion:false}]) +# Yakitori + menu_category1_menu_item44 = SimpleMenuItem.create({name: "Yakitori", alt_name: "Yakitori",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item44, price:5000.00, is_on_promotion:false}]) + # Chicken Hamburg Steak + menu_category1_menu_item45 = SimpleMenuItem.create({name: "Chicken Hamburg Steak", alt_name: "Chicken Hamburg Steak",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item45, price:6500.00, is_on_promotion:false}]) + # Grilled Shishamo + menu_category1_menu_item46 = SimpleMenuItem.create({name: "Grilled Shishamo", alt_name: "Grilled Shishamo",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item46, price:5000.00, is_on_promotion:false}]) + # Party Set A + menu_category1_menu_item38 = SimpleMenuItem.create({name: "Party Set A", alt_name: "Party Set A",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item38, price:5500.00, is_on_promotion:false}]) + # Party Set B + menu_category1_menu_item39 = SimpleMenuItem.create({name: "Party Set B", alt_name: "Party Set A",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item39, price:5000.00, is_on_promotion:false}]) + # Croquette + menu_category1_menu_item40 = SimpleMenuItem.create({name: "Croquette", alt_name: "Croquette",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item40, price:3500.00, is_on_promotion:false}]) + # Fried Potato + menu_category1_menu_item41 = SimpleMenuItem.create({name: "Fried Potato", alt_name: "Fried Potato",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item41, price:1500.00, is_on_promotion:false}]) + +# set +menu_category6 = MenuCategory.create({menu: menu, name: "Set", alt_name: "Set", order_by: 6,created_by: "SYSTEM DEFAULT"}) + # Set A ( Soup + Gyoza 3 pcs) + menu_category1_menu_item60 = SimpleMenuItem.create({name: "Set A ( Soup + Gyoza 3 pcs)", alt_name: "",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item60, price:1500.00, is_on_promotion:false}]) + # Set B(Rice + Soup + Gyoza 3pcs) + menu_category1_menu_item61 = SimpleMenuItem.create({name: "Set B(Rice + Soup + Gyoza 3pcs)", alt_name: "",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item61, price:2000.00, is_on_promotion:false}]) + # Set C ( Rice + Soup + Salad + Gyoza 3pcs) + menu_category1_menu_item62 = SimpleMenuItem.create({name: "Set C ( Rice + Soup + Salad + Gyoza 3pcs)", alt_name: "",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item62, price:2500.00, is_on_promotion:false}]) + # Rice + # menu_category1_menu_item63 = SimpleMenuItem.create({name: "Rice", alt_name: "",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item63, price:500.00, is_on_promotion:false}]) + # Soup + # menu_category1_menu_item64 = SimpleMenuItem.create({name: "Soup", alt_name: "",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item64, price:500.00, is_on_promotion:false}]) + # Salad + # menu_category1_menu_item65 = SimpleMenuItem.create({name: "Salad", alt_name: "",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) + # menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item65, price:500.00, is_on_promotion:false}]) + +# A La Carte +menu_category7 = MenuCategory.create({menu: menu, name: "A La Carte", alt_name: "A La Carte", order_by: 7,created_by: "SYSTEM DEFAULT"}) + # F1 Mabo Tofu + menu_category1_menu_item70 = SimpleMenuItem.create({name: "F1 Mabo Tofu", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item70, price:2900.00, is_on_promotion:false}]) + # F2 Black Vinegar Chicken + menu_category1_menu_item71 = SimpleMenuItem.create({name: "F2 Black Vinegar Chicken", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item71, price:3900.00, is_on_promotion:false}]) + # Green Pepper Steak + menu_category1_menu_item72 = SimpleMenuItem.create({name: "Green Pepper Steak", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item72, price:3000.00, is_on_promotion:false}]) + # F4 Mabo Eggplant + menu_category1_menu_item73 = SimpleMenuItem.create({name: "F4 Mabo Eggplant", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item73, price:2900.00, is_on_promotion:false}]) + # F5 Fried Vegetable + menu_category1_menu_item74 = SimpleMenuItem.create({name: "F5 Fried Vegetable", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item74, price:2500.00, is_on_promotion:false}]) + #F6 - Ebichili + menu_category1_menu_item75 = SimpleMenuItem.create({name: "F6 - Ebichili", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item75, price:4900.00, is_on_promotion:false}]) + # F7 Ebimayo + menu_category1_menu_item76 = SimpleMenuItem.create({name: "F7 Ebimayo", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item76, price:4900.00, is_on_promotion:false}]) + #F8 Fried Pork Liver + menu_category1_menu_item77 = SimpleMenuItem.create({name: "F8 Fried Pork Liver", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item77, price:2900.00, is_on_promotion:false}]) + # F9 - Fried Pork with Kimuchi + menu_category1_menu_item78 = SimpleMenuItem.create({name: " F9 - Fried Pork with Kimuchi", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item78, price:2900.00, is_on_promotion:false}]) + # Fried Egg with Pork + menu_category1_menu_item67 = SimpleMenuItem.create({name: "Fried Egg with Pork", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item67, price:2900.00, is_on_promotion:false}]) + # Fried Eggplant with Pork + menu_category1_menu_item68 = SimpleMenuItem.create({name: " Fried Eggplant with Pork", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item68, price:2900.00, is_on_promotion:false}]) + # Spicy Fried Beef + menu_category1_menu_item69 = SimpleMenuItem.create({name: " Spicy Fried Beef", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item69, price:2900.00, is_on_promotion:false}]) + # Fried Egg with Beef + menu_category1_menu_item66 = SimpleMenuItem.create({name: "Fried Egg with Beef", alt_name: "",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item66, price:2900.00, is_on_promotion:false}]) + +# Ramen +menu_category8 = MenuCategory.create({menu: menu, name: "Ramen", alt_name: "Ramen", order_by: 8,created_by: "SYSTEM DEFAULT"}) + # N1 - Sio Ramen + menu_category1_menu_item80 = SimpleMenuItem.create({name: " N1 - Sio Ramen", alt_name: "",menu_category: menu_category8 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item80, price:4500.00, is_on_promotion:false}]) + # N2 Syoyu Ramen + menu_category1_menu_item82 = SimpleMenuItem.create({name: " N2 Syoyu Ramen", alt_name: "",menu_category: menu_category8 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item82, price:4500.00, is_on_promotion:false}]) + # N3 Tonkotsu Ramen + menu_category1_menu_item83 = SimpleMenuItem.create({name: "N3 Tonkotsu Ramen ", alt_name: "",menu_category: menu_category8 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item83, price:6900.00, is_on_promotion:false}]) + # N4-Fried Noodle with Thick Sauce + menu_category1_menu_item81 = SimpleMenuItem.create({name: "N4-Fried Noodle with Thick Sauce Fish", alt_name: "",menu_category: menu_category8 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item81, price:5900.00, is_on_promotion:false}]) + #N5 Curry Ramen + menu_category1_menu_item84 = SimpleMenuItem.create({name: "N5 Curry Ramen", alt_name: "",menu_category: menu_category8 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item84, price:6000.00, is_on_promotion:false}]) + # N6 Spicy Curry Ramen + menu_category1_menu_item85 = SimpleMenuItem.create({name: "N6 Spicy Curry Ramen", alt_name: " ",menu_category: menu_category8 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item85, price:6000.00, is_on_promotion:false}]) + # N7 Miso Ramen + menu_category1_menu_item86 = SimpleMenuItem.create({name: "N7 Miso Ramen", alt_name: "",menu_category: menu_category8 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item86, price:5500.00, is_on_promotion:false}]) + # N8 Spicy Miso Ramen + menu_category1_menu_item000 = SimpleMenuItem.create({name: "N8-Spicy Miso Ramen", alt_name: "",menu_category: menu_category8 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item000, price:5500.00, is_on_promotion:false}]) + # Cold Ramen + menu_category1_menu_item79 = SimpleMenuItem.create({name: "Cold Ramen", alt_name: "",menu_category: menu_category8 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item79, price:5000.00, is_on_promotion:false}]) + +# Ramen Topping +menu_category9 = MenuCategory.create({menu: menu, name: "Ramen Topping", alt_name: "Ramen Topping", order_by: 9, created_by: "SYSTEM DEFAULT"}) + # Green Onion + menu_category1_menu_item88 = SimpleMenuItem.create({name: "Green Onion ", alt_name: "",menu_category: menu_category9 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item88, price:400.00, is_on_promotion:false}]) + # Bamboo Shoot + menu_category1_menu_item89 = SimpleMenuItem.create({name: "Bamboo Shoot", alt_name: " ",menu_category: menu_category9 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item89, price:400.00, is_on_promotion:false}]) + # Egg + menu_category1_menu_item90 = SimpleMenuItem.create({name: "Egg", alt_name: " ",menu_category: menu_category9 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item90, price:500.00, is_on_promotion:false}]) + # Extra Noodle + menu_category1_menu_item91 = SimpleMenuItem.create({name: "Extra Noodle", alt_name: "",menu_category: menu_category9 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item91, price:800.00, is_on_promotion:false}]) + # BBQ Pork + menu_category1_menu_item92 = SimpleMenuItem.create({name: "BBQ Pork", alt_name: "",menu_category: menu_category9 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item92, price:1500.00, is_on_promotion:false}]) + # Half Egg + menu_category1_menu_item87 = SimpleMenuItem.create({name: "Half Egg", alt_name: "",menu_category: menu_category9 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item87, price:300.00, is_on_promotion:false}]) + +# Udon +menu_category10 = MenuCategory.create({menu: menu, name: "Udon", alt_name: "Udon", order_by: 10,created_by: "SYSTEM DEFAULT"}) + # U1 Ebi Ten udon + menu_category1_menu_item94 = SimpleMenuItem.create({name: "U1 Ebi Ten udon", alt_name: " ",menu_category: menu_category10 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item94, price:7900.00, is_on_promotion:false}]) + # U2 Vegetable Fried Udon + menu_category1_menu_item95 = SimpleMenuItem.create({name: "U2 Vegetable Fried Udon", alt_name: "",menu_category: menu_category10 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item95, price:5000.00, is_on_promotion:false}]) + # U3 Curry Udon + menu_category1_menu_item96 = SimpleMenuItem.create({name: "U3 Curry Udon", alt_name: "",menu_category: menu_category10 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item96, price:5500.00, is_on_promotion:false}]) + # U4 Pork Fried Udon + menu_category1_menu_item97 = SimpleMenuItem.create({name: "U4 Pork Fried Udon", alt_name: "",menu_category: menu_category10 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item97, price:4500.00, is_on_promotion:false}]) + # U5 Spicy Pork Fried Udon + menu_category1_menu_item98 = SimpleMenuItem.create({name: "U5 Spicy Pork Fried Udon", alt_name: "",menu_category: menu_category10 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item98, price:4500.00, is_on_promotion:false}]) + # U6 Seafood Fried Udon + menu_category1_menu_item99 = SimpleMenuItem.create({name: "U6 Seafood Fried Udon", alt_name: "",menu_category: menu_category10 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item99, price:4900.00, is_on_promotion:false}]) + # U7 Beef Frid Udon + menu_category1_menu_item100 = SimpleMenuItem.create({name: "U7 Beef Fried Udon", alt_name: "",menu_category: menu_category10 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item100, price:4500.00, is_on_promotion:false}]) + # U8 Spicy Beef Fried Udon + menu_category1_menu_item93 = SimpleMenuItem.create({name: "U8 Spicy Beef Fried Udon", alt_name: "",menu_category: menu_category10 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item93, price:4500.00, is_on_promotion:false}]) + +# Curry +menu_category12 = MenuCategory.create({menu: menu, name: "Curry", alt_name: "Curry", order_by: 12,created_by: "SYSTEM DEFAULT"}) + # C1-Pork Cutlet Curry + menu_category12_menu_item1 = SimpleMenuItem.create({name: "C1-Pork Cutlet Curry", alt_name: " ",menu_category: menu_category12 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category12_menu_item1, price:5500.00, is_on_promotion:false}]) + # C2-Beef Curry + menu_category12_menu_item2 = SimpleMenuItem.create({name: "C2-Beef Curry", alt_name: "",menu_category: menu_category12 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category12_menu_item2, price:5500.00, is_on_promotion:false}]) + # C3-Fried Chicken Curry + menu_category12_menu_item3 = SimpleMenuItem.create({name: "C3-Fried Chicken Curry", alt_name: "",menu_category: menu_category12 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category12_menu_item3, price:5500.00, is_on_promotion:false}]) + # C4-Curry Rice + menu_category12_menu_item4 = SimpleMenuItem.create({name: "C4-Curry Rice", alt_name: "",menu_category: menu_category12 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category12_menu_item4, price:3500.00, is_on_promotion:false}]) + # C5-Fried Prawn Curry + menu_category12_menu_item5 = SimpleMenuItem.create({name: "C5-Fried Prawn Curry", alt_name: "",menu_category: menu_category12 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category12_menu_item5, price:6900.00, is_on_promotion:false}]) + # Chicken Cutlet Curry + menu_category12_menu_item6 = SimpleMenuItem.create({name: "Chicken Cutlet Curry", alt_name: "",menu_category: menu_category12 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category12_menu_item6, price:5500.00, is_on_promotion:false}]) + +# Rice +menu_category13 = MenuCategory.create({menu: menu, name: "Rice", alt_name: "Rice", order_by: 13,created_by: "SYSTEM DEFAULT"}) + # R1-Katsu Don + menu_category13_menu_item1 = SimpleMenuItem.create({name: "R1-Katsu Don", alt_name: " ",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item1, price:5900.00, is_on_promotion:false}]) + # R2-Beef Don + menu_category13_menu_item2 = SimpleMenuItem.create({name: "R2-Beef Don", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item2, price:4000.00, is_on_promotion:false}]) + # R3-Pork Don + menu_category13_menu_item3 = SimpleMenuItem.create({name: "R3-Pork Don", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item3, price:4000.00, is_on_promotion:false}]) + # R4- Chicken Cutlet Don + menu_category13_menu_item4 = SimpleMenuItem.create({name: "R4- Chicken Cutlet Don", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item4, price:5900.00, is_on_promotion:false}]) + # R5-Egg and Chicken Don + menu_category13_menu_item5 = SimpleMenuItem.create({name: "R5-Egg and Chicken Don", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item5, price:5800.00, is_on_promotion:false}]) + # R6-Fried Prawn Don + menu_category13_menu_item6 = SimpleMenuItem.create({name: "R6-Fried Prawn Don", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item6, price:6900.00, is_on_promotion:false}]) + # R7-Fried Rice + menu_category13_menu_item7 = SimpleMenuItem.create({name: "R7-Fried Rice", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"R7-Fried Rice(Pork)",menu_item: menu_category13_menu_item7, price:3000.00, is_on_promotion:false}]) + menu_item1_instance = MenuItemInstance.create([{item_instance_name:"R7-Fried Rice(Chicken)",menu_item: menu_category13_menu_item7, price:3000.00, is_on_promotion:false}]) + # R8-Kimuchi Fried Rice + menu_category13_menu_item8 = SimpleMenuItem.create({name: "R8-Kimuchi Fried Rice", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item8, price:4500.00, is_on_promotion:false}]) + # R9-Crab Tenshinhan + menu_category13_menu_item9 = SimpleMenuItem.create({name: "R9-Crab Tenshinhan", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item9, price:4500.00, is_on_promotion:false}]) + # R10-Crab Fried Rice + menu_category13_menu_item10 = SimpleMenuItem.create({name: "R10-Crab Fried Rice", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item10, price:4500.00, is_on_promotion:false}]) + # Beef Fried Rice + menu_category13_menu_item11 = SimpleMenuItem.create({name: "Beef Fried Rice", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item11, price:5000.00, is_on_promotion:false}]) + # Mabo Fried Rice + menu_category13_menu_item12 = SimpleMenuItem.create({name: "Mabo Fried Rice", alt_name: " ",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item12, price:4500.00, is_on_promotion:false}]) + # Seafood Fried Rice + menu_category13_menu_item13 = SimpleMenuItem.create({name: "Seafood Fried Rice", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item13, price:6000.00, is_on_promotion:false}]) + # Mabo Tenshinhan + menu_category13_menu_item14 = SimpleMenuItem.create({name: "Mabo Tenshinhan", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item14, price:5500.00, is_on_promotion:false}]) + # KatsuCurry Tenshinhan + menu_category13_menu_item15 = SimpleMenuItem.create({name: "KatsuCurry Tenshinhan", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item15, price:7000.00, is_on_promotion:false}]) + # Fried Prawn Curry Tenshinhan + menu_category13_menu_item16 = SimpleMenuItem.create({name: "Fried Prawn Curry Tenshinhan", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item16, price:7900.00, is_on_promotion:false}]) + # Fried Chicken Curry Tenshinhan + menu_category13_menu_item17 = SimpleMenuItem.create({name: "Fried Chicken Curry Tenshinhan", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item17, price:6500.00, is_on_promotion:false}]) + # Chicken Cutlet Curry Tenshinhan + menu_category13_menu_item18 = SimpleMenuItem.create({name: "Chicken Cutlet Curry Tenshinhan", alt_name: "",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category13_menu_item18, price:7000.00, is_on_promotion:false}]) + +# Kids Set +menu_category14 = MenuCategory.create({menu: menu, name: "Kids Set", alt_name: "Kids Set", order_by: 14,created_by: "SYSTEM DEFAULT"}) + # Kids Set A (Fried Rice+Fried Potato+Gyoza 2pcs) + menu_category14_menu_item1 = SimpleMenuItem.create({name: "Kids Set A (Fried Rice+Fried Potato+Gyoza 2pcs)", alt_name: "",menu_category: menu_category14 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category14_menu_item1, price:3500.00, is_on_promotion:false}]) + # Kids Set B (Ramen+Fried Potato+Gyoza 2pcs) + menu_category14_menu_item2 = SimpleMenuItem.create({name: "Kids Set B (Ramen+Fried Potato+Gyoza 2pcs)", alt_name: "",menu_category: menu_category14 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category14_menu_item2, price:4500.00, is_on_promotion:false}]) + +# Drink +menu_category20 = MenuCategory.create({menu: menu, name: "Drink", alt_name: "Drink", order_by: 20, created_by: "SYSTEM DEFAULT"}) + # Lime Juice + menu_category20_menu_item1 = SimpleMenuItem.create({name: "Lime Juice", alt_name: " ",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item1, price:1500.00, is_on_promotion:false}]) + # Pineapple Juice + menu_category20_menu_item2 = SimpleMenuItem.create({name: "Pineapple Juice", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item2, price:1500.00, is_on_promotion:false}]) + # Watermelon Juice + menu_category20_menu_item3 = SimpleMenuItem.create({name: "Watermelon Juice", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item3, price:1500.00, is_on_promotion:false}]) + # Honey Dew Melon Juice + menu_category20_menu_item4 = SimpleMenuItem.create({name: "Honey Dew Melon Juice", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item4, price:1500.00, is_on_promotion:false}]) + # Banana Juice + menu_category20_menu_item5 = SimpleMenuItem.create({name: "Banana Juice", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item5, price:1500.00, is_on_promotion:false}]) + # Papaya Juice + menu_category20_menu_item6 = SimpleMenuItem.create({name: "Papaya Juice", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item6, price:1500.00, is_on_promotion:false}]) + # Avocado Juice + menu_category20_menu_item7 = SimpleMenuItem.create({name: "Avocado Juice", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Avocado Juice",menu_item: menu_category20_menu_item7, price:2000.00, is_on_promotion:false}]) + # Kiwi Juice + menu_category20_menu_item9 = SimpleMenuItem.create({name: "Kiwi Juice", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item9, price:2000.00, is_on_promotion:false}]) + # Mango Juice + menu_category20_menu_item10 = SimpleMenuItem.create({name: "Mango Juice", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item10, price:2000.00, is_on_promotion:false}]) + # Lime Soda + menu_category20_menu_item11 = SimpleMenuItem.create({name: "Lime Soda", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item11, price:2000.00, is_on_promotion:false}]) + # Ice + menu_category20_menu_item12 = SimpleMenuItem.create({name: "Ice", alt_name: " ",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item12, price:500.00, is_on_promotion:false}]) + # Green Apple Juice + menu_category20_menu_item13 = SimpleMenuItem.create({name: "Green Apple Juice", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item13, price:1500.00, is_on_promotion:false}]) + # Snow Tower + menu_category20_menu_item14 = SimpleMenuItem.create({name: "Snow Tower", alt_name: "",menu_category: menu_category20 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category20_menu_item14, price:200.00, is_on_promotion:false}]) + +# Hot Drinks +menu_category17 = MenuCategory.create({menu: menu, name: "Hot Drinks", alt_name: "Hot Drinks", order_by: 17,created_by: "SYSTEM DEFAULT"}) + # Espresso + menu_category17_menu_item1 = SimpleMenuItem.create({name: "Espresso", alt_name: " ",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Espresso",menu_item: menu_category17_menu_item1, price:1500.00, is_on_promotion:false}]) + # Green Tea Pot + menu_category17_menu_item2 = SimpleMenuItem.create({name: "Green Tea Pot", alt_name: "",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Green Tea Pot",menu_item: menu_category17_menu_item2, price:1500.00, is_on_promotion:false}]) + # Cafe' Americano + menu_category17_menu_item3 = SimpleMenuItem.create({name: "Cafe' Americano", alt_name: "",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cafe' Americano",menu_item: menu_category17_menu_item3, price:1800.00, is_on_promotion:false}]) + # Double Espresso + menu_category17_menu_item4 = SimpleMenuItem.create({name: "Double Espresso", alt_name: "",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Double Espresso",menu_item: menu_category17_menu_item4, price:2000.00, is_on_promotion:false}]) + # Cappuccino + menu_category17_menu_item5 = SimpleMenuItem.create({name: "Cappuccino", alt_name: "",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cappuccino",menu_item: menu_category17_menu_item5, price:2500.00, is_on_promotion:false}]) + # Cafe' latte + menu_category17_menu_item6 = SimpleMenuItem.create({name: "Cafe' latte", alt_name: "",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cafe' latte",menu_item: menu_category17_menu_item6, price:2500.00, is_on_promotion:false}]) + # Matcha latte + menu_category17_menu_item7 = SimpleMenuItem.create({name: "Matcha latte", alt_name: "",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Matcha latte",menu_item: menu_category17_menu_item7, price:2500.00, is_on_promotion:false}]) + # Hot Chocolate + menu_category17_menu_item9 = SimpleMenuItem.create({name: "Hot Chocolate", alt_name: "",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Hot Chocolate",menu_item: menu_category17_menu_item9, price:2500.00, is_on_promotion:false}]) + # Cafe' Mocha + menu_category17_menu_item10 = SimpleMenuItem.create({name: "Cafe' Mocha", alt_name: "",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cafe' Mocha",menu_item: menu_category17_menu_item10, price:3000.00, is_on_promotion:false}]) + # Flavor latte + menu_category17_menu_item11 = SimpleMenuItem.create({name: "Flavor latte", alt_name: "",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Flavor latte (Caramel)",menu_item: menu_category17_menu_item11, price:3000.00, is_on_promotion:false}]) + menu_item1_instance = MenuItemInstance.create([{item_instance_name:"Flavor latte (Hazelnut)",menu_item: menu_category17_menu_item11, price:3000.00, is_on_promotion:false}]) + menu_item2_instance = MenuItemInstance.create([{item_instance_name:"Flavor latte (Almond)",menu_item: menu_category17_menu_item11, price:3000.00, is_on_promotion:false}]) + menu_item3_instance = MenuItemInstance.create([{item_instance_name:"Flavor latte (Butterscotch)",menu_item: menu_category17_menu_item11, price:3000.00, is_on_promotion:false}]) + # Roasted Almond Matchal latte + menu_category17_menu_item12 = SimpleMenuItem.create({name: "Roasted Almond Matchal latte", alt_name: " ",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Roasted Almond Matchal latte",menu_item: menu_category17_menu_item12, price:3000.00, is_on_promotion:false}]) + # Coconut Matcha latte + menu_category17_menu_item13 = SimpleMenuItem.create({name: "Coconut Matcha latte", alt_name: "",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Coconut Matcha latte",menu_item: menu_category17_menu_item13, price:3000.00, is_on_promotion:false}]) + +# Cold Drinks +menu_category3 = MenuCategory.create({menu: menu,name: "Cold Drinks", alt_name: "Cold Drinks", order_by: 3,created_by: "SYSTEM DEFAULT"}) + # Ice Cappuccino + menu_category1_menu_item18 = SimpleMenuItem.create({name: "Ice Cappuccino", alt_name: "Ice Cappuccino",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item18, price:3000.00, is_on_promotion:false}]) + # Ice Cafe Latte + menu_category1_menu_item19 = SimpleMenuItem.create({name: "Ice Cafe Latte", alt_name: "Ice Cafe Latte",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item19, price:3000.00, is_on_promotion:false}]) + # Ice Cafe Mocha + menu_category1_menu_item20 = SimpleMenuItem.create({name: "Ice Cafe Mocha", alt_name: "Ice Cafe Mocha",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item20, price:3500.00, is_on_promotion:false}]) + # Ice Flavor Latte + menu_category1_menu_item21 = SimpleMenuItem.create({name: "Ice Flavor Latte", alt_name: "Ice Flavor Latte",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Caramel",menu_item: menu_category1_menu_item21, price:3500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Hazelut",menu_item: menu_category1_menu_item21, price:3500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Almond",menu_item: menu_category1_menu_item21, price:3500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Butterscotch",menu_item: menu_category1_menu_item21, price:3500.00, is_on_promotion:false}]) + # Ice Espresso + menu_category1_menu_item22 = SimpleMenuItem.create({name: "Ice Espresso", alt_name: "Ice Espresso",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item22, price:2000.00, is_on_promotion:false}]) + # Ice Americano + menu_category1_menu_item23 = SimpleMenuItem.create({name: "Ice Americano", alt_name: "Ice Americano",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item23, price:2000.00, is_on_promotion:false}]) + # Ice Lemon Tea + menu_category1_menu_item24 = SimpleMenuItem.create({name: "Ice Lemon Tea", alt_name: "Ice Lemon Tea",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item24, price:2000.00, is_on_promotion:false}]) + # Sassy High Tea + menu_category1_menu_item25 = SimpleMenuItem.create({name: "Sassy High Tea", alt_name: "Sassy High Tea",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item25, price:2500.00, is_on_promotion:false}]) + +# Can Soda +menu_category2 = MenuCategory.create({menu: menu, name: "Can Soda", alt_name: "Can Soda", order_by: 2, created_by: "SYSTEM DEFAULT"}) + # Water + menu_category1_menu_item10 = SimpleMenuItem.create({ name: "Water", alt_name: "Water",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item10, price:500.00, is_on_promotion:false}]) + # Coke + menu_category1_menu_item11 = SimpleMenuItem.create({name: "Coke", alt_name: "Coke",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item11, price:1000.00, is_on_promotion:false}]) + # Coke Zero + menu_category1_menu_item12 = SimpleMenuItem.create({ name: "Coke Zero", alt_name: "Coke Zero",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item12, price:1000.0, is_on_promotion:false}]) +# Sunkist + menu_category1_menu_item13 = SimpleMenuItem.create({ name: "Sunkist", alt_name: "Sunkist",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item13, price:1000.00, is_on_promotion:false}]) +# Sprite + menu_category1_menu_item14 = SimpleMenuItem.create({ name: "Sprite", alt_name: "Sprite",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item14, price:1000.00, is_on_promotion:false}]) +# Pocari Sweat + menu_category1_menu_item15 = SimpleMenuItem.create({ name: "Pocari Sweat", alt_name: "Pocari Sweat",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item15, price:1000.00, is_on_promotion:false}]) +#Green Tea + menu_category1_menu_item16 = SimpleMenuItem.create({ name: "Green Tea", alt_name: "Green Tea",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item16, price:2000.00, is_on_promotion:false}]) +# Soda Water + menu_category1_menu_item17 = SimpleMenuItem.create({name: "Soda Water", alt_name: "Soda Water",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item17, price:1000.00, is_on_promotion:false}]) + +# Cocktail +menu_category26 = MenuCategory.create({menu: menu, name: "Cocktail", alt_name: "Cocktail", order_by: 26,created_by: "SYSTEM DEFAULT"}) + # Moscow's Sky + menu_category1_menu_item200 = SimpleMenuItem.create({name: "Moscow's Sky", alt_name: " ",menu_category: menu_category26 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item200, price:3500.00, is_on_promotion:false}]) + # Tokyo Sunset + menu_category1_menu_item201 = SimpleMenuItem.create({name: "Tokyo Sunset", alt_name: "",menu_category: menu_category26 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item201, price:4500.00, is_on_promotion:false}]) + # Crane at Lakeside + menu_category1_menu_item202 = SimpleMenuItem.create({name: "Crane at Lakeside", alt_name: "",menu_category: menu_category26 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item202, price:2500.00, is_on_promotion:false}]) + # Memoir of a Geisha + menu_category1_menu_item203 = SimpleMenuItem.create({name: "Memoir of a Geisha", alt_name: "",menu_category: menu_category26 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item203, price:2500.00, is_on_promotion:false}]) + # Dawn to Dark + menu_category1_menu_item204 = SimpleMenuItem.create({name: "Dawn to Dark", alt_name: "",menu_category: menu_category26 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item204, price:2500.00, is_on_promotion:false}]) + # Sakura Night + menu_category1_menu_item205 = SimpleMenuItem.create({name: "Sakura Night", alt_name: "",menu_category: menu_category26 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item205, price:3500.00, is_on_promotion:false}]) + # Kyoto Temptation + menu_category1_menu_item206 = SimpleMenuItem.create({name: "Kyoto Temptation", alt_name: "",menu_category: menu_category26 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item206, price:4500.00, is_on_promotion:false}]) + # Love Potion + menu_category1_menu_item207 = SimpleMenuItem.create({name: "Love Potion", alt_name: "",menu_category: menu_category26 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",menu_item: menu_category1_menu_item207, price:3500.00, is_on_promotion:false}]) + +# Whisky +menu_category21 = MenuCategory.create({menu: menu, name: "Whisky", alt_name: "Whisky", order_by: 21, created_by: "SYSTEM DEFAULT"}) + # BLACK LABEL 1Lit + menu_category21_menu_item200 = SimpleMenuItem.create({name: "BLACK LABEL 1Lit", alt_name: " ",menu_category: menu_category21 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"BLACK LABEL 1Lit",menu_item: menu_category21_menu_item200, price:48000.00, is_on_promotion:false}]) + # GOLD LABEL RESERVE + menu_category21_menu_item201 = SimpleMenuItem.create({name: "GOLD LABEL RESERVE", alt_name: "",menu_category: menu_category21 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"GOLD LABEL RESERVE",menu_item: menu_category21_menu_item201, price:70000.00, is_on_promotion:false}]) + # BLUE LABEL 75cl + menu_category21_menu_item202 = SimpleMenuItem.create({name: "BLUE LABEL 75cl", alt_name: "",menu_category: menu_category21 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"BLUE LABEL 75cl",menu_item: menu_category21_menu_item202, price:188000.00, is_on_promotion:false}]) + # CHIVAS 12year (1Lit) + menu_category21_menu_item203 = SimpleMenuItem.create({name: "CHIVAS 12year (1Lit)", alt_name: "",menu_category: menu_category21 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"CHIVAS 12year (1Lit)",menu_item: menu_category21_menu_item203, price:37000.00, is_on_promotion:false}]) + # CHIVAS REGAL Extra (1Lit) + menu_category21_menu_item204 = SimpleMenuItem.create({name: "CHIVAS REGAL Extra (1Lit)", alt_name: "",menu_category: menu_category21 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"CHIVAS REGAL Extra (1Lit)",menu_item: menu_category21_menu_item204, price:67000.00, is_on_promotion:false}]) + # Glenfiddich 12 years 1Lit + menu_category21_menu_item205 = SimpleMenuItem.create({name: "Glenfiddich 12 years 1Lit", alt_name: "",menu_category: menu_category21 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Glenfiddich 12 years 1Lit",menu_item: menu_category21_menu_item205, price:48000.00, is_on_promotion:false}]) + # Glenfiddish 15 years 75cl + menu_category21_menu_item206 = SimpleMenuItem.create({name: "Glenfiddish 15 years 75cl", alt_name: "",menu_category: menu_category21 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Glenfiddish 15 years 75cl",menu_item: menu_category21_menu_item206, price:62000.00, is_on_promotion:false}]) + # PLATINUM LABEL + menu_category21_menu_item207 = SimpleMenuItem.create({name: "PLATINUM LABEL", alt_name: "",menu_category: menu_category21 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"PLATINUM LABEL",menu_item: menu_category21_menu_item207, price:78000.00, is_on_promotion:false}]) + # DOUBLE BLACK + menu_category21_menu_item208 = SimpleMenuItem.create({name: "DOUBLE BLACK", alt_name: "",menu_category: menu_category21 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"DOUBLE BLACK",menu_item: menu_category21_menu_item208, price:48000.00, is_on_promotion:false}]) + +#Japanese Sake & Shochu +menu_category25 = MenuCategory.create({menu: menu, name: "Japanese Sake", alt_name: "Japanese Sake", order_by: 25, created_by: "SYSTEM DEFAULT"}) + # Iichiko Silhouette 720ml + menu_category25_menu_item200 = SimpleMenuItem.create({name: "Iichiko Silhouette 720ml", alt_name: " ",menu_category: menu_category25 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Iichiko Silhouette 720ml",menu_item: menu_category25_menu_item200, price:39000.00, is_on_promotion:false}]) + # Kurokirishima Imo Shochu 720ml + menu_category25_menu_item201 = SimpleMenuItem.create({name: "Kurokirishima Imo Shochu 720ml", alt_name: "",menu_category: menu_category25 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Kurokirishima Imo Shochu 720ml",menu_item: menu_category25_menu_item201, price:29000.00, is_on_promotion:false}]) + # Sawanotsuru Fresh 300ml + menu_category25_menu_item202 = SimpleMenuItem.create({name: "Sawanotsuru Fresh 300ml", alt_name: "",menu_category: menu_category25 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Sawanotsuru Fresh 300ml",menu_item: menu_category25_menu_item202, price:9000.00, is_on_promotion:false}]) + # Kha Ka Bora Soba Fresh Shochu + menu_category25_menu_item203 = SimpleMenuItem.create({name: "Kha Ka Bora Soba Fresh Shochu", alt_name: "",menu_category: menu_category25 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Kha Ka Bora Soba Fresh Shochu",menu_item: menu_category25_menu_item203, price:2500.00, is_on_promotion:false}]) + # Shwe Yi Soba Shochu + menu_category25_menu_item204 = SimpleMenuItem.create({name: "Shwe Yi Soba Shochu", alt_name: "",menu_category: menu_category25 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Shwe Yi Soba Shochu",menu_item: menu_category25_menu_item204, price:7000.00, is_on_promotion:false}]) + +#Breakfast Kitchen +menu_category28 = MenuCategory.create({menu: menu, name: "Breakfast Kitchen", alt_name: "Breakfast Kitchen", order_by: 28, created_by: "SYSTEM DEFAULT"}) + # Ham and Cheese Sandwich with French Fries + menu_category28_menu_item200 = SimpleMenuItem.create({name: "Ham and Cheese Sandwich with French Fries", alt_name: " ",menu_category: menu_category28 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Ham and Cheese Sandwich with French Fries",menu_item: menu_category28_menu_item200, price:3500.00, is_on_promotion:false}]) + # Grilled Cheese Sandwich with French Fries + menu_category28_menu_item201 = SimpleMenuItem.create({name: "Grilled Cheese Sandwich with French Fries", alt_name: "",menu_category: menu_category28 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Grilled Cheese Sandwich with French Fries",menu_item: menu_category28_menu_item201, price:3500.00, is_on_promotion:false}]) + +#Frappe +menu_category27 = MenuCategory.create({menu: menu, name: "Frappe", alt_name: "Frappe", order_by: 27, created_by: "SYSTEM DEFAULT"}) + # Cappuccino Frappe + menu_category27_menu_item200 = SimpleMenuItem.create({name: "Cappuccino Frappe", alt_name: " ",menu_category: menu_category27 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cappuccino Frappe",menu_item: menu_category27_menu_item200, price:3900.00, is_on_promotion:false}]) + # Caramel frappe + menu_category27_menu_item201 = SimpleMenuItem.create({name: "Caramel frappe", alt_name: "",menu_category: menu_category27 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Caramel frappe",menu_item: menu_category27_menu_item201, price:3900.00, is_on_promotion:false}]) + # Green Tea frappe + menu_category27_menu_item202 = SimpleMenuItem.create({name: "Green Tea frappe", alt_name: "",menu_category: menu_category27 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Green Tea frappe",menu_item: menu_category27_menu_item202, price:3900.00, is_on_promotion:false}]) + # KBanoffee + menu_category27_menu_item203 = SimpleMenuItem.create({name: "KBanoffee", alt_name: "",menu_category: menu_category27 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"KBanoffee",menu_item: menu_category27_menu_item203, price:3900.00, is_on_promotion:false}]) + # Butterscotch Popcorn frappe + menu_category27_menu_item204 = SimpleMenuItem.create({name: "Butterscotch Popcorn frappe", alt_name: "",menu_category: menu_category27 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Butterscotch Popcorn frappe",menu_item: menu_category27_menu_item204, price:3900.00, is_on_promotion:false}]) + # Mocha frappe + menu_category27_menu_item205 = SimpleMenuItem.create({name: "Mocha frappe", alt_name: "",menu_category: menu_category27 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Mocha frappe",menu_item: menu_category27_menu_item205, price:3900.00, is_on_promotion:false}]) + # Chocolate frappe + menu_category27_menu_item206 = SimpleMenuItem.create({name: "Chocolate frappe", alt_name: "",menu_category: menu_category27 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Chocolate frappe",menu_item: menu_category27_menu_item206, price:3900.00, is_on_promotion:false}]) + +#Smoothies +menu_category23 = MenuCategory.create({menu: menu, name: "Smoothies", alt_name: "Smoothies", order_by: 23, created_by: "SYSTEM DEFAULT"}) + # Strawberry smoothie + menu_category23_menu_item200 = SimpleMenuItem.create({name: "Strawberry smoothie", alt_name: " ",menu_category: menu_category23 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Strawberry smoothie",menu_item: menu_category23_menu_item200, price:3500.00, is_on_promotion:false}]) + # Passion fruit smoothie + menu_category23_menu_item201 = SimpleMenuItem.create({name: "Passion fruit smoothie", alt_name: "",menu_category: menu_category23 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Passion fruit smoothie",menu_item: menu_category23_menu_item201, price:3500.00, is_on_promotion:false}]) + # Mixederry smoothie + menu_category23_menu_item202 = SimpleMenuItem.create({name: "Mixedberry smoothie", alt_name: "",menu_category: menu_category23 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Mixedberry smoothie",menu_item: menu_category23_menu_item202, price:3500.00, is_on_promotion:false}]) + # Blueberry smoothie + menu_category23_menu_item203 = SimpleMenuItem.create({name: "Blueberry smoothie", alt_name: "",menu_category: menu_category23 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Blueberry smoothie",menu_item: menu_category23_menu_item203, price:3500.00, is_on_promotion:false}]) + # Berry Sunshine Smoothie + menu_category23_menu_item204 = SimpleMenuItem.create({name: "Berry Sunshine Smoothie", alt_name: "",menu_category: menu_category23 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Berry Sunshine Smoothie",menu_item: menu_category23_menu_item204, price:3500.00, is_on_promotion:false}]) + # Mango Smoothie + menu_category23_menu_item205 = SimpleMenuItem.create({name: "Mango Smoothie", alt_name: "",menu_category: menu_category23 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Mango Smoothie",menu_item: menu_category23_menu_item205, price:3500.00, is_on_promotion:false}]) + +#Sushi +menu_category30 = MenuCategory.create({menu: menu, name: "Sushi", alt_name: "Sushi", order_by: 30, created_by: "SYSTEM DEFAULT"}) + # Grilled Salmon Roll + menu_category30_menu_item200 = SimpleMenuItem.create({name: "Grilled Salmon Roll", alt_name: " ",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Grilled Salmon Roll",menu_item: menu_category30_menu_item200, price:7500.00, is_on_promotion:false}]) + # Avocado Roll + menu_category30_menu_item201 = SimpleMenuItem.create({name: "Avocado Roll", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Avocado Roll",menu_item: menu_category30_menu_item201, price:5000.00, is_on_promotion:false}]) + # Sushi Tempura + menu_category30_menu_item202 = SimpleMenuItem.create({name: "Sushi Tempura", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Sushi Tempura",menu_item: menu_category30_menu_item202, price:6500.00, is_on_promotion:false}]) + # Fried Prawn Roll + menu_category30_menu_item203 = SimpleMenuItem.create({name: "Fried Prawn Roll", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Fried Prawn Roll",menu_item: menu_category30_menu_item203, price:7000.00, is_on_promotion:false}]) + # Jade Garden Roll + menu_category30_menu_item204 = SimpleMenuItem.create({name: "Jade Garden Roll", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Jade Garden Roll",menu_item: menu_category30_menu_item204, price:5000.00, is_on_promotion:false}]) + # California Roll + menu_category30_menu_item205 = SimpleMenuItem.create({name: "California Roll", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"California Roll",menu_item: menu_category30_menu_item205, price:5000.00, is_on_promotion:false}]) + # Philadelphia Roll + menu_category30_menu_item206 = SimpleMenuItem.create({name: "Philadelphia Roll", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Philadelphia Roll",menu_item: menu_category30_menu_item206, price:7500.00, is_on_promotion:false}]) + # Soft Shell Crab Roll + menu_category30_menu_item207 = SimpleMenuItem.create({name: "Soft Shell Crab Roll", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Soft Shell Crab Roll",menu_item: menu_category30_menu_item207, price:5500.00, is_on_promotion:false}]) + # Fried Chicken Roll + menu_category30_menu_item208 = SimpleMenuItem.create({name: "Fried Chicken Roll", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Fried Chicken Roll",menu_item: menu_category30_menu_item208, price:5500.00, is_on_promotion:false}]) + # Apple Salad + menu_category30_menu_item209 = SimpleMenuItem.create({name: "Apple Salad", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Apple Salad",menu_item: menu_category30_menu_item209, price:3500.00, is_on_promotion:false}]) + # Seaweed Salad + menu_category30_menu_item2010 = SimpleMenuItem.create({name: "Seaweed Salad", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Seaweed Salad",menu_item: menu_category30_menu_item2010, price:3000.00, is_on_promotion:false}]) + # Salmon Skin Roll + menu_category30_menu_item2011 = SimpleMenuItem.create({name: "Salmon Skin Roll", alt_name: "",menu_category: menu_category30 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Salmon Skin Roll",menu_item: menu_category30_menu_item2011, price:6500.00, is_on_promotion:false}]) + +# Extra +menu_category16 = MenuCategory.create({menu: menu, name: "Extra", alt_name: "Extra", order_by: 16,created_by: "SYSTEM DEFAULT"}) + # Rice + menu_category16_menu_item200 = SimpleMenuItem.create({name: "Rice", alt_name: " ",menu_category: menu_category16 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Rice",menu_item: menu_category16_menu_item200, price:500.00, is_on_promotion:false}]) + # Soup + menu_category16_menu_item201 = SimpleMenuItem.create({name: "Soup", alt_name: "",menu_category: menu_category16 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Soup",menu_item: menu_category16_menu_item201, price:500.00, is_on_promotion:false}]) + # Salad + menu_category16_menu_item202 = SimpleMenuItem.create({name: "Salad", alt_name: "",menu_category: menu_category16 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Salad",menu_item: menu_category16_menu_item202, price:500.00, is_on_promotion:false}]) + # Curry + menu_category16_menu_item203 = SimpleMenuItem.create({name: "Curry", alt_name: "",menu_category: menu_category16 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Curry",menu_item: menu_category16_menu_item203, price:3000.00, is_on_promotion:false}]) + # Beef + menu_category16_menu_item204 = SimpleMenuItem.create({name: "Beef", alt_name: "",menu_category: menu_category16 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beef",menu_item: menu_category16_menu_item204, price:3500.00, is_on_promotion:false}]) + # Pieces of Chicken + menu_category16_menu_item205 = SimpleMenuItem.create({name: "Pieces of Chicken", alt_name: "",menu_category: menu_category16 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Pieces of Chicken",menu_item: menu_category16_menu_item205, price:1000.00, is_on_promotion:false}]) + # Pieces of Prawn + menu_category16_menu_item206 = SimpleMenuItem.create({name: "Pieces of Prawn", alt_name: "",menu_category: menu_category16 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Pieces of Prawn",menu_item: menu_category16_menu_item206, price:1500.00, is_on_promotion:false}]) + # Ginger + menu_category16_menu_item207 = SimpleMenuItem.create({name: "Ginger", alt_name: "",menu_category: menu_category16 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Ginger",menu_item: menu_category16_menu_item207, price:500.00, is_on_promotion:false}]) + +# Bar Dessert +menu_category11 = MenuCategory.create({menu: menu, name: "Bar Dessert", alt_name: "Bar Dessert", order_by: 11, created_by: "SYSTEM DEFAULT"}) + # D4-Banana Tempura With Ice Cream + menu_category11_menu_item200 = SimpleMenuItem.create({name: "D4-Banana Tempura With Ice Cream", alt_name: " ",menu_category: menu_category11 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"D4-Banana Tempura With Ice Cream",menu_item: menu_category11_menu_item200, price:3500.00, is_on_promotion:false}]) + # D5-Ice Cream Chocolate + menu_category11_menu_item201 = SimpleMenuItem.create({name: "D5-Ice Cream", alt_name: "",menu_category: menu_category11 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"D5-Ice Cream Chocolate",menu_item: menu_category11_menu_item201, price:1500.00, is_on_promotion:false}]) + menu_item1_instance = MenuItemInstance.create([{item_instance_name:"D5-Ice Cream Green Tea",menu_item: menu_category11_menu_item201, price:1500.00, is_on_promotion:false}]) + menu_item2_instance = MenuItemInstance.create([{item_instance_name:"D5-Ice Cream Strawberry",menu_item: menu_category11_menu_item201, price:1500.00, is_on_promotion:false}]) + menu_item3_instance = MenuItemInstance.create([{item_instance_name:"D5-Ice Cream Vanilla",menu_item: menu_category11_menu_item201, price:1500.00, is_on_promotion:false}]) + # D6-Seasonal Fruits + menu_category11_menu_item202 = SimpleMenuItem.create({name: "D6-Seasonal Fruits", alt_name: "",menu_category: menu_category11 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"D6-Seasonal Fruits",menu_item: menu_category11_menu_item202, price:1500.00, is_on_promotion:false}]) + # D7-Seasona Fruits with Ice Cream + menu_category11_menu_item203 = SimpleMenuItem.create({name: "D7-Seasona Fruits with Ice Cream", alt_name: "",menu_category: menu_category11 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"D7-Seasona Fruits with Ice Cream",menu_item: menu_category11_menu_item203, price:2000.00, is_on_promotion:false}]) + # Ice Cream + menu_category11_menu_item204 = SimpleMenuItem.create({name: "Ice Cream", alt_name: "",menu_category: menu_category11 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Ice Cream",menu_item: menu_category11_menu_item204, price:800.00, is_on_promotion:false}]) + +# Kitchen Dessert +menu_category15 = MenuCategory.create({menu: menu, name: "Kitchen Dessert", alt_name: "Kitchen Dessert", order_by: 15, created_by: "SYSTEM DEFAULT"}) + # D1-Peanuts Butter Gyoza + menu_category15_menu_item200 = SimpleMenuItem.create({name: "D1-Peanuts Butter Gyoza", alt_name: " ",menu_category: menu_category15 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"D1-Peanuts Butter Gyoza",menu_item: menu_category15_menu_item200, price:3000.00, is_on_promotion:false}]) + # D2-Red Bean Gyoza + menu_category15_menu_item201 = SimpleMenuItem.create({name: "D2-Red Bean Gyoza", alt_name: "",menu_category: menu_category15 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"D2-Red Bean Gyoza",menu_item: menu_category15_menu_item201, price:2500.00, is_on_promotion:false}]) + # D3-Banana Gyoza + menu_category15_menu_item202 = SimpleMenuItem.create({name: "D3-Banana Gyoza", alt_name: "",menu_category: menu_category15 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"D3-Banana Gyoza",menu_item: menu_category15_menu_item202, price:2500.00, is_on_promotion:false}]) + # Dessert Gyoza 2Pcs + menu_category15_menu_item203 = SimpleMenuItem.create({name: "Dessert Gyoza 2Pcs", alt_name: "",menu_category: menu_category15 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Dessert Gyoza 2Pcs",menu_item: menu_category15_menu_item203, price:1000.00, is_on_promotion:false}]) + +# Beer +menu_category18 = MenuCategory.create({menu: menu, name: "Beer", alt_name: "Beer", order_by: 18,created_by: "SYSTEM DEFAULT"}) + # Myanmar Premium Draft Beer + menu_category18_menu_item200 = SimpleMenuItem.create({name: "Myanmar Premium Draft Beer", alt_name: " ",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Myanmar Premium Draft Beer",menu_item: menu_category18_menu_item200, price:1800.00, is_on_promotion:false}]) + # Kirin Ichiban Draft Beer + menu_category18_menu_item201 = SimpleMenuItem.create({name: "Kirin Ichiban Draft Beer", alt_name: "",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Kirin Ichiban Draft Beer",menu_item: menu_category18_menu_item201, price:2200.00, is_on_promotion:false}]) + # Myanmar Beer + menu_category18_menu_item202 = SimpleMenuItem.create({name: "Myanmar Beer", alt_name: "",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Myanmar Beer",menu_item: menu_category18_menu_item202, price:2300.00, is_on_promotion:false}]) + # Tuborg Beer + menu_category18_menu_item203 = SimpleMenuItem.create({name: "Tuborg Beer", alt_name: "",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Tuborg Beer",menu_item: menu_category18_menu_item203, price:2500.00, is_on_promotion:false}]) + # Wine by the Glass + menu_category18_menu_item204 = SimpleMenuItem.create({name: "Wine by the Glass", alt_name: "",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Wine by the Glass",menu_item: menu_category18_menu_item204, price:3000.00, is_on_promotion:false}]) + +# Green Tea +menu_category19 = MenuCategory.create({menu: menu, name: "Green Tea", alt_name: "Green Tea", order_by: 19, created_by: "SYSTEM DEFAULT"}) + # Hot Green Tea + menu_category19_menu_item200 = SimpleMenuItem.create({name: "Hot Green Tea", alt_name: " ",menu_category: menu_category19 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Hot Green Tea",menu_item: menu_category19_menu_item200, price:1500.00, is_on_promotion:false}]) + # Ice Green Tea + menu_category19_menu_item201 = SimpleMenuItem.create({name: "Ice Green Tea", alt_name: "",menu_category: menu_category19 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Ice Green Tea",menu_item: menu_category19_menu_item201, price:1500.00, is_on_promotion:false}]) + +# Chinese Tea +menu_category31 = MenuCategory.create({menu: menu, name: "Chinese Tea", alt_name: "Chinese Tea", order_by: 31, created_by: "SYSTEM DEFAULT"}) + # Hot China Tea + menu_category19_menu_item200 = SimpleMenuItem.create({name: "Hot China Tea", alt_name: " ",menu_category: menu_category19 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Hot China Tea",menu_item: menu_category19_menu_item200, price:500.00, is_on_promotion:false}]) + # Cold China Tea + menu_category19_menu_item201 = SimpleMenuItem.create({name: "Cold China Tea", alt_name: "",menu_category: menu_category19 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cold China Tea",menu_item: menu_category19_menu_item201, price:500.00, is_on_promotion:false}]) + +# Wine +menu_category32 = MenuCategory.create({menu: menu, name: "Wine", alt_name: "Wine", order_by: 32, created_by: "SYSTEM DEFAULT"}) + # Viejo Vinedo (Arge;) + menu_category32_menu_item200 = SimpleMenuItem.create({name: "Viejo Vinedo (Arge;)", alt_name: " ",menu_category: menu_category32 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Viejo Vinedo (Arge;)",menu_item: menu_category32_menu_item200, price:15000.00, is_on_promotion:false}]) + # Church Lane + menu_category32_menu_item201 = SimpleMenuItem.create({name: "Church Lane", alt_name: "",menu_category: menu_category32 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Church Lane (SHIRAZ)",menu_item: menu_category32_menu_item201, price:20000.00, is_on_promotion:false}]) + menu_item1_instance = MenuItemInstance.create([{item_instance_name:"Church Lane (Cabernet Sauvignon)",menu_item: menu_category32_menu_item201, price:20000.00, is_on_promotion:false}]) + # Chardonnay Layer Cake (Napa Valley) + menu_category32_menu_item202 = SimpleMenuItem.create({name: "Chardonnay Layer Cake (Napa Valley)", alt_name: "",menu_category: menu_category32 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Chardonnay Layer Cake (Napa Valley)",menu_item: menu_category32_menu_item202, price:30000.00, is_on_promotion:false}]) + # PINOT NOIR + menu_category32_menu_item203 = SimpleMenuItem.create({name: "PINOT NOIR", alt_name: "",menu_category: menu_category32 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"PINOT NOIR",menu_item: menu_category32_menu_item203, price:25000.00, is_on_promotion:false}]) + +# Grilled +menu_category33 = MenuCategory.create({menu: menu, name: "Grilled", alt_name: "Grilled", order_by: 33, created_by: "SYSTEM DEFAULT"}) + # Grilled Salmon + menu_category33_menu_item200 = SimpleMenuItem.create({name: "Grilled Salmon", alt_name: " ",menu_category: menu_category33 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Grilled Salmon",menu_item: menu_category33_menu_item200, price:13000.00, is_on_promotion:false}]) + # Grilled Garlic + menu_category33_menu_item201 = SimpleMenuItem.create({name: "Grilled Garlic", alt_name: "",menu_category: menu_category33 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Grilled Garlic",menu_item: menu_category33_menu_item201, price:1500.00, is_on_promotion:false}]) + # Grilled Shishamo + menu_category33_menu_item202 = SimpleMenuItem.create({name: "Grilled Shishamo", alt_name: "",menu_category: menu_category33 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Grilled Shishamo",menu_item: menu_category33_menu_item202, price:3800.00, is_on_promotion:false}]) + # Grilled Saba + menu_category33_menu_item203 = SimpleMenuItem.create({name: "Grilled Saba", alt_name: "",menu_category: menu_category33 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Grilled Saba",menu_item: menu_category33_menu_item203, price:4800.00, is_on_promotion:false}]) + # Pork Yakiniku + menu_category33_menu_item204 = SimpleMenuItem.create({name: "Pork Yakiniku", alt_name: "",menu_category: menu_category33 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Pork Yakiniku",menu_item: menu_category33_menu_item204, price:600.00, is_on_promotion:false}]) + # Beef Yakiniku + menu_category33_menu_item205 = SimpleMenuItem.create({name: "Beef Yakiniku", alt_name: " ",menu_category: menu_category33 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beef Yakiniku",menu_item: menu_category33_menu_item205, price:700.00, is_on_promotion:false}]) + # Yakitori + menu_category33_menu_item206 = SimpleMenuItem.create({name: "Yakitori", alt_name: "",menu_category: menu_category33 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Yakitori (Chicken Liver)",menu_item: menu_category33_menu_item206, price:600.00, is_on_promotion:false}]) + menu_item1_instance = MenuItemInstance.create([{item_instance_name:"Yakitori (Chicken Thigh)",menu_item: menu_category33_menu_item206, price:600.00, is_on_promotion:false}]) + menu_item2_instance = MenuItemInstance.create([{item_instance_name:"Yakitori (Pork Liver)",menu_item: menu_category33_menu_item206, price:600.00, is_on_promotion:false}]) + menu_item3_instance = MenuItemInstance.create([{item_instance_name:"Yakitori (Asparagus Bacon)",menu_item: menu_category33_menu_item206, price:3800.00, is_on_promotion:false}]) + # Yakitori Assortment + menu_category33_menu_item207 = SimpleMenuItem.create({name: "Yakitori Assortment", alt_name: "",menu_category: menu_category33 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Yakitori Assortment",menu_item: menu_category33_menu_item207, price:5000.00, is_on_promotion:false}]) + # Shiitake mushroom (1 piece) + menu_category33_menu_item208 = SimpleMenuItem.create({name: "Shiitake mushroom (1 piece)", alt_name: "",menu_category: menu_category33 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Shiitake mushroom (1 piece)",menu_item: menu_category33_menu_item208, price:600.00, is_on_promotion:false}]) + # Lady finger (1 piece) + menu_category33_menu_item209 = SimpleMenuItem.create({name: "Lady finger (1 piece)", alt_name: "",menu_category: menu_category33 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Lady finger (1 piece)",menu_item: menu_category33_menu_item209, price:600.00, is_on_promotion:false}]) + +#discount +# menu_category22 = MenuCategory.create({menu: menu, name: "Discount", alt_name: "Discount", order_by: 22, created_by: "SYSTEM DEFAULT"}) + +#Italion Soda +# menu_category24 = MenuCategory.create({menu: menu, name: "Italion Soda", alt_name: "Italion Soda", order_by: 24, created_by: "SYSTEM DEFAULT"}) + +#Cocktail +# menu_category26 = MenuCategory.create({menu: menu, name: "Cocktail", alt_name: "Cocktail", order_by: 26, created_by: "SYSTEM DEFAULT"}) + +#Grilled +# menu_category29 = MenuCategory.create({menu: menu, name: "Grilled", alt_name: "Grilled", order_by: 29, created_by: "SYSTEM DEFAULT"}) + +puts "Osaka's menu setup" + +zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"1", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"2", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"3", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"4", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"5", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"6", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"7", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"8", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"9", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"10", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"11", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"12", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone, name:"13", 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({zone: zone2, name:"14", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"15", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"16", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"17", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"18", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"19", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"20", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"21", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"22", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"23", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"24", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"25", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"26", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone2, name:"27", 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({zone: zone3, name:"28", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone3, name:"29", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone3, name:"30", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone3, name:"31", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone3, name:"32", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone3, name:"33", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone3, name:"34", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + table = Table.create({zone: zone3, name:"35", status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"}) + +#Default Order Queue stations +order_queue_station1 = OrderQueueStation.create({station_name: "K1", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['I0001','I0002','I0003','I0004']), print_copy:false, cut_per_item: false, use_alternate_name: false, created_by: "SYSTEM DEFAULT"}) +order_queue_station2 = OrderQueueStation.create({station_name: "K2", is_active: true,printer_name: "Cashier", processing_items: JSON.generate(['I0005','I0006','I0007','I0008']), print_copy:false, cut_per_item: false, use_alternate_name: false, created_by: "SYSTEM DEFAULT"}) +zone_order_queue_station = OrderQueueStation.create({station_name: "K3", is_active: true, printer_name: "Cashier", processing_items: JSON.generate(['I0001','I0002','I0003','I0004','I0005','I0006','I0007','I0008']), print_copy: false, cut_per_item: false, 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}) +end +end diff --git a/public/image/loading-ajax.gif b/public/image/loading-ajax.gif new file mode 100755 index 00000000..e3d3cb83 Binary files /dev/null and b/public/image/loading-ajax.gif differ