From 743b978c446e524ec29ee2d87b1d8a40b5d11bbf Mon Sep 17 00:00:00 2001 From: Nweni Date: Sun, 4 Jun 2017 15:52:29 +0630 Subject: [PATCH 01/37] update --- app/views/settings/menu_item_instances/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/settings/menu_item_instances/_form.html.erb b/app/views/settings/menu_item_instances/_form.html.erb index c0170245..7d326c95 100644 --- a/app/views/settings/menu_item_instances/_form.html.erb +++ b/app/views/settings/menu_item_instances/_form.html.erb @@ -1,5 +1,5 @@ -<%= simple_form_for([:settings,:menu_item, @settings_menu_item_instance]) do |f| %> +<%= simple_form_for([:settings,@item, @settings_menu_item_instances]) do |f| %> <%= f.error_notification %> From fcd159086818c784e0cf4aeea27f962fb5b5fce4 Mon Sep 17 00:00:00 2001 From: Nweni Date: Mon, 19 Jun 2017 15:51:04 +0630 Subject: [PATCH 02/37] change query --- app/assets/stylesheets/origami.scss | 4 ++++ app/models/order.rb | 4 ++-- app/views/origami/payments/show.html.erb | 7 ++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 71a9915e..c96237fa 100644 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -95,6 +95,10 @@ background-color:#7a62d3; } +.orange{ + background-color:#FF7F50; +} + .red { background-color:#ff0000; } diff --git a/app/models/order.rb b/app/models/order.rb index f3ae798c..9c65304b 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -231,7 +231,7 @@ class Order < ApplicationRecord .joins("left join orders on orders.order_id = booking_orders.order_id") .joins("left join sales on sales.sale_id = bookings.sale_id") .where("(orders.status = 'new' or orders.status = 'billed') and (dining_facilities.type=? and dining_facilities.is_active=?)",DiningFacility::TABLE_TYPE,true) - .group("bookings.booking_id") + .group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id") # For PG # booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true # sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id @@ -262,7 +262,7 @@ class Order < ApplicationRecord .joins("left join orders on orders.order_id = booking_orders.order_id") .joins("left join sales on sales.sale_id = bookings.sale_id") .where("(orders.status = 'new' or orders.status = 'billed') and (dining_facilities.type=? and dining_facilities.is_active=?)",DiningFacility::ROOM_TYPE,true) - .group("bookings.booking_id") + .group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.customer_id,orders.order_id") # For PG # booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true # sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.customer_id,orders.order_id diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 995e13e9..91d5b6b2 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -235,9 +235,10 @@
- - - + + + +
From 25b6a893f2168721b5f2d118fa371347dc031c0a Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Thu, 22 Jun 2017 15:33:55 +0630 Subject: [PATCH 03/37] first cancan --- app/controllers/application_controller.rb | 13 +++++++------ app/controllers/base_origami_controller.rb | 9 +++++++++ app/controllers/origami/customers_controller.rb | 4 +--- app/controllers/origami/request_bills_controller.rb | 1 + app/controllers/settings/employees_controller.rb | 2 +- app/models/ability.rb | 13 +++++++------ 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 50278d71..6a5070f6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,16 +3,17 @@ class ApplicationController < ActionController::Base #before_action :check_installation protect_from_forgery with: :exception - helper_method :current_company,:current_login_employee - + helper_method :current_company,:current_login_employee,:current_user + # alias_method :current_user, :current_login_employee,:current_user #this is base api base controller to need to inherit. #all token authentication must be done here #response format must be set to JSON - # rescue_from CanCan::AccessDenied do |exception| - # flash[:warning] = exception.message - # redirect_to root_path - # end + + rescue_from CanCan::AccessDenied do |exception| + flash[:warning] = exception.message + redirect_to root_path + end def current_user @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] diff --git a/app/controllers/base_origami_controller.rb b/app/controllers/base_origami_controller.rb index b250303d..2af895da 100644 --- a/app/controllers/base_origami_controller.rb +++ b/app/controllers/base_origami_controller.rb @@ -5,5 +5,14 @@ class BaseOrigamiController < ActionController::Base #before_action :check_installation protect_from_forgery with: :exception + rescue_from CanCan::AccessDenied do |exception| + flash[:warning] = exception.message + redirect_to root_path + end + + def current_user + @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] + end + end diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index 373dc2f5..ef813e26 100644 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -1,8 +1,6 @@ class Origami::CustomersController < BaseOrigamiController - #Form to add customer - + load_and_authorize_resource def index - - end # GET /crm/customers/1 diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb index 37eef687..1bce60e6 100644 --- a/app/controllers/origami/request_bills_controller.rb +++ b/app/controllers/origami/request_bills_controller.rb @@ -1,4 +1,5 @@ class Origami::RequestBillsController < BaseOrigamiController + load_and_authorize_resource # Print Request Bill and add to sale tables def print @sale = Sale.new diff --git a/app/controllers/settings/employees_controller.rb b/app/controllers/settings/employees_controller.rb index dc7093f3..07656470 100644 --- a/app/controllers/settings/employees_controller.rb +++ b/app/controllers/settings/employees_controller.rb @@ -1,5 +1,5 @@ class Settings::EmployeesController < ApplicationController - # load_and_authorize_resource + load_and_authorize_resource before_action :set_employee, only: [:show, :edit, :update, :destroy] diff --git a/app/models/ability.rb b/app/models/ability.rb index 2b28ab61..f48220a8 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -4,20 +4,22 @@ class Ability def initialize(user) user ||= Employee.new - if user.role? :administrator + if user.role == "administrator" can :manage, :all - elsif user.role? :cashier + elsif user.role == "cashier" + can :read, Order can :update, Order - can :completed_order_item, Order can :read, Sale can :update, Sale + can :add_customer, Customer + can :update_sale_by_customer, Customer - elsif user.role? :accountant + elsif user.role == "accountant" can :read, Order can :update, Order @@ -28,6 +30,5 @@ class Ability can :manual_complete_sale, Sale end - end -end \ No newline at end of file +end From 01e5b7ba6c3d849fd464efb3131a13779dfb2473 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 23 Jun 2017 09:41:48 +0630 Subject: [PATCH 04/37] update authorize --- .../javascripts/reports/daily_sales.coffee | 3 + .../javascripts/reports/dailysales.coffee | 3 + .../javascripts/reports/sale_items.coffee | 3 + .../stylesheets/reports/daily_sales.scss | 3 + .../stylesheets/reports/dailysales.scss | 3 + .../stylesheets/reports/sale_items.scss | 3 + app/controllers/base_crm_controller.rb | 12 +- app/controllers/base_oqs_controller.rb | 8 + app/controllers/base_report_controller.rb | 9 + app/controllers/crm/bookings_controller.rb | 2 +- app/controllers/crm/customers_controller.rb | 1 + .../crm/dining_queues_controller.rb | 1 + app/controllers/home_controller.rb | 6 + .../origami/discounts_controller.rb | 1 + .../origami/moveroom_controller.rb | 4 +- .../origami/movetable_controller.rb | 2 + .../origami/payments_controller.rb | 2 +- .../origami/request_bills_controller.rb | 2 +- app/controllers/print_settings_controller.rb | 1 + ...ntroller.rb => bksale_items_controller.rb} | 4 +- .../reports/daily_sales_controller.rb | 17 ++ ...troller.rb => daily_salesbk_controller.rb} | 4 +- .../reports/sale_items_controller.rb | 19 ++ .../settings/accounts_controller.rb | 1 + .../settings/cashier_terminals_controller.rb | 1 + .../settings/membership_actions_controller.rb | 1 + .../membership_settings_controller.rb | 1 + .../settings/menu_categories_controller.rb | 1 + .../menu_item_attributes_controller.rb | 1 + .../menu_item_instances_controller.rb | 1 + .../settings/menu_item_options_controller.rb | 1 + app/controllers/settings/menus_controller.rb | 1 + .../order_queue_stations_controller.rb | 1 + .../payment_method_settings_controller.rb | 1 + .../settings/tax_profiles_controller.rb | 1 + app/controllers/settings/zones_controller.rb | 1 + .../transactions/orders_controller.rb | 1 + .../transactions/sales_controller.rb | 1 + app/helpers/reports/daily_sales_helper.rb | 2 + app/helpers/reports/dailysales_helper.rb | 2 + app/helpers/reports/sale_items_helper.rb | 2 + app/models/ability.rb | 62 ++++-- app/views/layouts/_header.html.erb | 4 +- app/views/origami/home/show.html.erb | 7 + app/views/reports/daily_sale/index.html.erb | 4 +- .../_shift_sale_report_filter.html.erb | 151 ++++++++++++++ app/views/reports/daily_sales/index.html.erb | 190 ++++++++++++++++++ app/views/reports/daily_sales/index.xls.erb | 116 +++++++++++ app/views/reports/sale_item/index.html.erb | 4 +- .../_shift_sale_report_filter.html.erb | 156 ++++++++++++++ app/views/reports/sale_items/index.html.erb | 141 +++++++++++++ app/views/reports/sale_items/index.xls.erb | 136 +++++++++++++ app/views/settings/lookups/index.html.erb | 4 +- config/routes.rb | 6 +- .../reports/daily_sales_controller_spec.rb | 5 + .../reports/dailysales_controller_spec.rb | 5 + .../reports/sale_items_controller_spec.rb | 5 + .../reports/daily_sales_helper_spec.rb | 15 ++ .../helpers/reports/dailysales_helper_spec.rb | 15 ++ .../helpers/reports/sale_items_helper_spec.rb | 15 ++ 60 files changed, 1141 insertions(+), 34 deletions(-) create mode 100644 app/assets/javascripts/reports/daily_sales.coffee create mode 100644 app/assets/javascripts/reports/dailysales.coffee create mode 100644 app/assets/javascripts/reports/sale_items.coffee create mode 100644 app/assets/stylesheets/reports/daily_sales.scss create mode 100644 app/assets/stylesheets/reports/dailysales.scss create mode 100644 app/assets/stylesheets/reports/sale_items.scss rename app/controllers/reports/{sale_item_controller.rb => bksale_items_controller.rb} (74%) create mode 100644 app/controllers/reports/daily_sales_controller.rb rename app/controllers/reports/{daily_sale_controller.rb => daily_salesbk_controller.rb} (72%) create mode 100644 app/controllers/reports/sale_items_controller.rb create mode 100644 app/helpers/reports/daily_sales_helper.rb create mode 100644 app/helpers/reports/dailysales_helper.rb create mode 100644 app/helpers/reports/sale_items_helper.rb create mode 100644 app/views/reports/daily_sales/_shift_sale_report_filter.html.erb create mode 100644 app/views/reports/daily_sales/index.html.erb create mode 100644 app/views/reports/daily_sales/index.xls.erb create mode 100644 app/views/reports/sale_items/_shift_sale_report_filter.html.erb create mode 100644 app/views/reports/sale_items/index.html.erb create mode 100644 app/views/reports/sale_items/index.xls.erb create mode 100644 spec/controllers/reports/daily_sales_controller_spec.rb create mode 100644 spec/controllers/reports/dailysales_controller_spec.rb create mode 100644 spec/controllers/reports/sale_items_controller_spec.rb create mode 100644 spec/helpers/reports/daily_sales_helper_spec.rb create mode 100644 spec/helpers/reports/dailysales_helper_spec.rb create mode 100644 spec/helpers/reports/sale_items_helper_spec.rb diff --git a/app/assets/javascripts/reports/daily_sales.coffee b/app/assets/javascripts/reports/daily_sales.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/reports/daily_sales.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/reports/dailysales.coffee b/app/assets/javascripts/reports/dailysales.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/reports/dailysales.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/reports/sale_items.coffee b/app/assets/javascripts/reports/sale_items.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/reports/sale_items.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/reports/daily_sales.scss b/app/assets/stylesheets/reports/daily_sales.scss new file mode 100644 index 00000000..79ed876a --- /dev/null +++ b/app/assets/stylesheets/reports/daily_sales.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the reports/daily_sales controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/reports/dailysales.scss b/app/assets/stylesheets/reports/dailysales.scss new file mode 100644 index 00000000..cfc48374 --- /dev/null +++ b/app/assets/stylesheets/reports/dailysales.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the reports/dailysales controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/reports/sale_items.scss b/app/assets/stylesheets/reports/sale_items.scss new file mode 100644 index 00000000..b9692327 --- /dev/null +++ b/app/assets/stylesheets/reports/sale_items.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the reports/sale_items controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/base_crm_controller.rb b/app/controllers/base_crm_controller.rb index a6bf7754..38f0df3d 100644 --- a/app/controllers/base_crm_controller.rb +++ b/app/controllers/base_crm_controller.rb @@ -1,9 +1,17 @@ class BaseCrmController < ActionController::Base - include LoginVerification - layout "CRM" + include LoginVerification + layout "CRM" #before_action :check_installation protect_from_forgery with: :exception + rescue_from CanCan::AccessDenied do |exception| + flash[:warning] = exception.message + redirect_to root_path + end + + def current_user + @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] + end end diff --git a/app/controllers/base_oqs_controller.rb b/app/controllers/base_oqs_controller.rb index 16fe9b07..50d7bd55 100644 --- a/app/controllers/base_oqs_controller.rb +++ b/app/controllers/base_oqs_controller.rb @@ -5,5 +5,13 @@ class BaseOqsController < ActionController::Base #before_action :check_installation protect_from_forgery with: :exception + rescue_from CanCan::AccessDenied do |exception| + flash[:warning] = exception.message + redirect_to root_path + end + + def current_user + @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] + end end diff --git a/app/controllers/base_report_controller.rb b/app/controllers/base_report_controller.rb index 0ea51cf5..28ba5c2b 100644 --- a/app/controllers/base_report_controller.rb +++ b/app/controllers/base_report_controller.rb @@ -5,6 +5,15 @@ class BaseReportController < ActionController::Base #before_action :check_installation protect_from_forgery with: :exception + rescue_from CanCan::AccessDenied do |exception| + flash[:warning] = exception.message + redirect_to root_path + end + + def current_user + @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] + end + PERIOD = { "today" => 0, "yesterday" => 1, diff --git a/app/controllers/crm/bookings_controller.rb b/app/controllers/crm/bookings_controller.rb index 65511512..efaa5419 100644 --- a/app/controllers/crm/bookings_controller.rb +++ b/app/controllers/crm/bookings_controller.rb @@ -1,5 +1,5 @@ class Crm::BookingsController < BaseCrmController - + load_and_authorize_resource def update_booking booking = Booking.find(params[:booking_id]) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index ce585686..41d3d6ad 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -1,4 +1,5 @@ class Crm::CustomersController < BaseCrmController + load_and_authorize_resource except: [:create] before_action :set_crm_customer, only: [:show, :edit, :update, :destroy] # GET /crm/customers diff --git a/app/controllers/crm/dining_queues_controller.rb b/app/controllers/crm/dining_queues_controller.rb index 734793b3..c4d9426b 100644 --- a/app/controllers/crm/dining_queues_controller.rb +++ b/app/controllers/crm/dining_queues_controller.rb @@ -1,4 +1,5 @@ class Crm::DiningQueuesController < BaseCrmController + load_and_authorize_resource before_action :set_dining_queue, only: [:show, :edit, :update, :destroy] # GET /crm/dining_queues diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 29e9082a..f480b95f 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -18,6 +18,12 @@ class HomeController < ApplicationController elsif @employee.role == "cashier" session[:session_token] = @employee.token_session redirect_to origami_root_path + elsif @employee.role == "manager" + session[:session_token] = @employee.token_session + redirect_to dashboard_path + elsif @employee.role == "accountant" + session[:session_token] = @employee.token_session + redirect_to dashboard_path else render :index end diff --git a/app/controllers/origami/discounts_controller.rb b/app/controllers/origami/discounts_controller.rb index a195bb6a..0c9971f4 100644 --- a/app/controllers/origami/discounts_controller.rb +++ b/app/controllers/origami/discounts_controller.rb @@ -1,4 +1,5 @@ class Origami::DiscountsController < BaseOrigamiController + authorize_resource :class => false #discount page show from origami index with selected order def index diff --git a/app/controllers/origami/moveroom_controller.rb b/app/controllers/origami/moveroom_controller.rb index c51fcbb1..ef1c286a 100644 --- a/app/controllers/origami/moveroom_controller.rb +++ b/app/controllers/origami/moveroom_controller.rb @@ -1,5 +1,7 @@ class Origami::MoveroomController < BaseOrigamiController - + + authorize_resource :class => false + def move_dining @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') diff --git a/app/controllers/origami/movetable_controller.rb b/app/controllers/origami/movetable_controller.rb index cc6281ce..fa067976 100644 --- a/app/controllers/origami/movetable_controller.rb +++ b/app/controllers/origami/movetable_controller.rb @@ -1,4 +1,6 @@ class Origami::MovetableController < BaseOrigamiController + + authorize_resource :class => false def move_dining @tables = Table.all.active.order('status desc') diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 38225fae..d415c965 100644 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -1,6 +1,6 @@ class Origami::PaymentsController < BaseOrigamiController - + authorize_resource :class => false def index end diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb index 1bce60e6..58419abe 100644 --- a/app/controllers/origami/request_bills_controller.rb +++ b/app/controllers/origami/request_bills_controller.rb @@ -1,5 +1,5 @@ class Origami::RequestBillsController < BaseOrigamiController - load_and_authorize_resource + # Print Request Bill and add to sale tables def print @sale = Sale.new diff --git a/app/controllers/print_settings_controller.rb b/app/controllers/print_settings_controller.rb index fa5af7e8..bdd3061a 100644 --- a/app/controllers/print_settings_controller.rb +++ b/app/controllers/print_settings_controller.rb @@ -1,4 +1,5 @@ class PrintSettingsController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_print_setting, only: [:show, :edit, :update, :destroy] # GET /print_settings diff --git a/app/controllers/reports/sale_item_controller.rb b/app/controllers/reports/bksale_items_controller.rb similarity index 74% rename from app/controllers/reports/sale_item_controller.rb rename to app/controllers/reports/bksale_items_controller.rb index eb7d3b86..1f349320 100644 --- a/app/controllers/reports/sale_item_controller.rb +++ b/app/controllers/reports/bksale_items_controller.rb @@ -1,5 +1,5 @@ -class Reports::SaleItemController < BaseReportController - +class Reports::SaleItemsController < BaseReportController + authorize_resource :class => false def index from, to, report_type = get_date_range_from_params diff --git a/app/controllers/reports/daily_sales_controller.rb b/app/controllers/reports/daily_sales_controller.rb new file mode 100644 index 00000000..6d99551d --- /dev/null +++ b/app/controllers/reports/daily_sales_controller.rb @@ -0,0 +1,17 @@ +class Reports::DailySalesController < BaseReportController + # authorize_resource :class => false + def index + from, to ,report_type = get_date_range_from_params + @sale_data = Sale.daily_sales_list(from,to) + @tax = SaleTax.get_tax(from,to) + respond_to do |format| + format.html + format.xls + end + end + + def show + + end + +end \ No newline at end of file diff --git a/app/controllers/reports/daily_sale_controller.rb b/app/controllers/reports/daily_salesbk_controller.rb similarity index 72% rename from app/controllers/reports/daily_sale_controller.rb rename to app/controllers/reports/daily_salesbk_controller.rb index ba453f55..1a878aaa 100644 --- a/app/controllers/reports/daily_sale_controller.rb +++ b/app/controllers/reports/daily_salesbk_controller.rb @@ -1,5 +1,5 @@ -class Reports::DailySaleController < BaseReportController - +class Reports::DailySalesController < BaseReportController + authorize_resource :class => false def index from, to ,report_type = get_date_range_from_params @sale_data = Sale.daily_sales_list(from,to) diff --git a/app/controllers/reports/sale_items_controller.rb b/app/controllers/reports/sale_items_controller.rb new file mode 100644 index 00000000..81f7af01 --- /dev/null +++ b/app/controllers/reports/sale_items_controller.rb @@ -0,0 +1,19 @@ +class Reports::SaleItemsController < 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 \ No newline at end of file diff --git a/app/controllers/settings/accounts_controller.rb b/app/controllers/settings/accounts_controller.rb index 90e6a304..54f27480 100644 --- a/app/controllers/settings/accounts_controller.rb +++ b/app/controllers/settings/accounts_controller.rb @@ -1,4 +1,5 @@ class Settings::AccountsController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_account, only: [:show, :edit, :update, :destroy] # GET /settings/accounts diff --git a/app/controllers/settings/cashier_terminals_controller.rb b/app/controllers/settings/cashier_terminals_controller.rb index b397d68d..0808c0a7 100644 --- a/app/controllers/settings/cashier_terminals_controller.rb +++ b/app/controllers/settings/cashier_terminals_controller.rb @@ -1,4 +1,5 @@ class Settings::CashierTerminalsController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_cashier_terminal, only: [:show, :edit, :update, :destroy] # GET /settings/cashier_terminals diff --git a/app/controllers/settings/membership_actions_controller.rb b/app/controllers/settings/membership_actions_controller.rb index ad7311f2..f386aecd 100644 --- a/app/controllers/settings/membership_actions_controller.rb +++ b/app/controllers/settings/membership_actions_controller.rb @@ -1,4 +1,5 @@ class Settings::MembershipActionsController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_membership_action, only: [:show, :edit, :update, :destroy] # GET /settings/membership_actions diff --git a/app/controllers/settings/membership_settings_controller.rb b/app/controllers/settings/membership_settings_controller.rb index cfd672d0..36bb0092 100644 --- a/app/controllers/settings/membership_settings_controller.rb +++ b/app/controllers/settings/membership_settings_controller.rb @@ -1,4 +1,5 @@ class Settings::MembershipSettingsController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_membership_setting, only: [:show, :edit, :update, :destroy] # GET /settings/membership_settings diff --git a/app/controllers/settings/menu_categories_controller.rb b/app/controllers/settings/menu_categories_controller.rb index c2a521ae..8ca9cfb4 100644 --- a/app/controllers/settings/menu_categories_controller.rb +++ b/app/controllers/settings/menu_categories_controller.rb @@ -1,4 +1,5 @@ class Settings::MenuCategoriesController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_menu_category, only: [:show, :edit, :update, :destroy] before_action :set_settings_menu, only: [:new] diff --git a/app/controllers/settings/menu_item_attributes_controller.rb b/app/controllers/settings/menu_item_attributes_controller.rb index 1433cf34..162325a2 100644 --- a/app/controllers/settings/menu_item_attributes_controller.rb +++ b/app/controllers/settings/menu_item_attributes_controller.rb @@ -1,4 +1,5 @@ class Settings::MenuItemAttributesController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_menu_item_attribute, only: [:show, :edit, :update, :destroy] # GET /settings/menu_item_attributes diff --git a/app/controllers/settings/menu_item_instances_controller.rb b/app/controllers/settings/menu_item_instances_controller.rb index 2b1fcecf..fd651e5e 100644 --- a/app/controllers/settings/menu_item_instances_controller.rb +++ b/app/controllers/settings/menu_item_instances_controller.rb @@ -1,4 +1,5 @@ class Settings::MenuItemInstancesController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_menu_item_instance, only: [:show, :edit, :update, :destroy] before_action :set_settings_menu_item, only: [ :show, :edit, :new, :update] diff --git a/app/controllers/settings/menu_item_options_controller.rb b/app/controllers/settings/menu_item_options_controller.rb index 4a3a44b7..41679796 100644 --- a/app/controllers/settings/menu_item_options_controller.rb +++ b/app/controllers/settings/menu_item_options_controller.rb @@ -1,4 +1,5 @@ class Settings::MenuItemOptionsController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_menu_item_option, only: [:show, :edit, :update, :destroy] # GET /settings/menu_item_options diff --git a/app/controllers/settings/menus_controller.rb b/app/controllers/settings/menus_controller.rb index fa6ac158..1a5ada31 100644 --- a/app/controllers/settings/menus_controller.rb +++ b/app/controllers/settings/menus_controller.rb @@ -1,4 +1,5 @@ class Settings::MenusController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_menu, only: [:show, :edit, :update, :destroy] # GET /settings/menus diff --git a/app/controllers/settings/order_queue_stations_controller.rb b/app/controllers/settings/order_queue_stations_controller.rb index 5a540ddb..9fe78de4 100644 --- a/app/controllers/settings/order_queue_stations_controller.rb +++ b/app/controllers/settings/order_queue_stations_controller.rb @@ -1,4 +1,5 @@ class Settings::OrderQueueStationsController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_order_queue_station, only: [:show, :edit, :update, :destroy] # GET /settings/order_queue_stations diff --git a/app/controllers/settings/payment_method_settings_controller.rb b/app/controllers/settings/payment_method_settings_controller.rb index f3ac595e..ecbbcced 100644 --- a/app/controllers/settings/payment_method_settings_controller.rb +++ b/app/controllers/settings/payment_method_settings_controller.rb @@ -1,4 +1,5 @@ class Settings::PaymentMethodSettingsController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_payment_method_setting, only: [:show, :edit, :update, :destroy] # GET /settings/payment_method_settings diff --git a/app/controllers/settings/tax_profiles_controller.rb b/app/controllers/settings/tax_profiles_controller.rb index 1064055b..992f637a 100644 --- a/app/controllers/settings/tax_profiles_controller.rb +++ b/app/controllers/settings/tax_profiles_controller.rb @@ -1,4 +1,5 @@ class Settings::TaxProfilesController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_tax_profile, only: [:show, :edit, :update, :destroy] # GET /settings/tax_profiles diff --git a/app/controllers/settings/zones_controller.rb b/app/controllers/settings/zones_controller.rb index 08a6f189..49505854 100644 --- a/app/controllers/settings/zones_controller.rb +++ b/app/controllers/settings/zones_controller.rb @@ -1,4 +1,5 @@ class Settings::ZonesController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_settings_zone, only: [:show, :edit, :update, :destroy] # GET /settings/zones diff --git a/app/controllers/transactions/orders_controller.rb b/app/controllers/transactions/orders_controller.rb index 35cefe6f..8303780f 100644 --- a/app/controllers/transactions/orders_controller.rb +++ b/app/controllers/transactions/orders_controller.rb @@ -1,4 +1,5 @@ class Transactions::OrdersController < ApplicationController + load_and_authorize_resource except: [:create] def index filter = params[:filter] diff --git a/app/controllers/transactions/sales_controller.rb b/app/controllers/transactions/sales_controller.rb index 0a069b1b..29b6cda2 100644 --- a/app/controllers/transactions/sales_controller.rb +++ b/app/controllers/transactions/sales_controller.rb @@ -1,4 +1,5 @@ class Transactions::SalesController < ApplicationController + load_and_authorize_resource except: [:create] before_action :set_transactions_sale, only: [:show, :edit, :update, :destroy] # GET /transactions/sales diff --git a/app/helpers/reports/daily_sales_helper.rb b/app/helpers/reports/daily_sales_helper.rb new file mode 100644 index 00000000..eb04c7b9 --- /dev/null +++ b/app/helpers/reports/daily_sales_helper.rb @@ -0,0 +1,2 @@ +module Reports::DailySalesHelper +end diff --git a/app/helpers/reports/dailysales_helper.rb b/app/helpers/reports/dailysales_helper.rb new file mode 100644 index 00000000..94e34c27 --- /dev/null +++ b/app/helpers/reports/dailysales_helper.rb @@ -0,0 +1,2 @@ +module Reports::DailysalesHelper +end diff --git a/app/helpers/reports/sale_items_helper.rb b/app/helpers/reports/sale_items_helper.rb new file mode 100644 index 00000000..63e884d7 --- /dev/null +++ b/app/helpers/reports/sale_items_helper.rb @@ -0,0 +1,2 @@ +module Reports::SaleItemsHelper +end diff --git a/app/models/ability.rb b/app/models/ability.rb index f48220a8..f3e8da5c 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -8,26 +8,62 @@ class Ability can :manage, :all + elsif user.role == "manager" + + can :manage, Menu + can :manage, MenuCategory + can :manage, MenuItemAttribute + can :manage, MenuItemInstance + can :manage, MenuItemOption + can :manage, SetMenuItem + can :manage, OrderQueueStation + can :manage, Zone + can :manage, CashierTerminal + can :manage, Employee + can :manage, MembershipSetting + can :manage, MembershipAction + can :manage, PaymentMethodSetting + can :manage, TaxProfile + can :manage, PrintSetting + can :manage, Account + + can :manage, Order + can :manage, Sale + + can :index, :dailysale + can :index, :saleitem + elsif user.role == "cashier" - can :read, Order - can :update, Order + can :read, Order + can :update, Order - can :read, Sale - can :update, Sale + 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, :discount + can :create, :discount + + can :show, :payment + can :create, :payment + can :reprint, :payment + + can :move_dining, :movetable + can :moving, :movetable + + can :move_dining, :moveroom elsif user.role == "accountant" - can :read, Order - can :update, Order - can :completed_order_item, Order - - can :read, Sale - can :update, Sale - can :manual_complete_sale, Sale + can :index, :dailysale + can :index, :saleitem + can :index, :receiptno + can :show, :dailysale + can :show, :saleitem + can :show, :receiptno end end diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index c528003d..24211081 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -38,8 +38,8 @@ diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 2719a758..a56d1266 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -307,6 +307,13 @@ $(document).ready(function(){ window.location.href = '/origami/'+ sale_id + "/customers" }); + $('#re-print').click(function() { + var sale_id = $('#sale_id').val(); + window.location.href = '/origami/'+ sale_id + "/reprint" + + return false; + }); + // Discount for Payment $('#discount').click(function() { var sale = $('#sale_id').val(); diff --git a/app/views/reports/daily_sale/index.html.erb b/app/views/reports/daily_sale/index.html.erb index a2403045..7c2a8c61 100644 --- a/app/views/reports/daily_sale/index.html.erb +++ b/app/views/reports/daily_sale/index.html.erb @@ -7,14 +7,14 @@
<%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_daily_sale_index_path} %> + :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_daily_sales_path} %>
diff --git a/app/views/reports/daily_sales/_shift_sale_report_filter.html.erb b/app/views/reports/daily_sales/_shift_sale_report_filter.html.erb new file mode 100644 index 00000000..3a5d788c --- /dev/null +++ b/app/views/reports/daily_sales/_shift_sale_report_filter.html.erb @@ -0,0 +1,151 @@ +
+
+ <%= 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/daily_sales/index.html.erb b/app/views/reports/daily_sales/index.html.erb new file mode 100644 index 00000000..7c2a8c61 --- /dev/null +++ b/app/views/reports/daily_sales/index.html.erb @@ -0,0 +1,190 @@ + + +
+ <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_daily_sales_path} %> +
+
+ +
+
+ +
+
+ +
+
+
+ + + <% if params[:from]%> + + + + <% end %> + + + + + + + + + + + + + + + + + + + <% unless @sale_data.empty? %> + + + <% void = 0 %> + <% mpu = 0 %> + <% master = 0 %> + <% visa = 0 %> + <% jcb = 0 %> + <% paypar = 0 %> + <% cash = 0 %> + <% credit = 0 %> + <% foc = 0 %> + <% discount = 0 %> + <% total = 0 %> + <% grand_total = 0 %> + <% count = 1 %> <% rounding_adj = 0 %> + <% @sale_data.each do |sale| %> + <% void += sale[:void_amount] %> + <% mpu += sale[:mpu_amount] %> + <% master += sale[:master_amount] %> + <% visa += sale[:visa_amount] %> + <% jcb += sale[:jcb_amount] %> + <% paypar += sale[:paypar_amount] %> + <% cash += sale[:cash_amount] %> + <% credit += sale[:credit_amount] %> + <% foc += sale[:foc_amount] %> + <% discount += sale[:total_discount] %> + <% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %> + <% grand_total += sale[:grand_total].to_f %> + <% rounding_adj += sale[:rounding_adj].to_f %> + + + + + + + + + + + + + + + + + + <% count = count + 1 %> + <% end %> + + + + + + + + + + + + + + + + + + <% total_tax = 0 %> + <% unless @tax.empty? %> + <% @tax.each do |tax| %> + <% total_tax += tax.tax_amount.to_f %> + + + + + + + <% end %> + <% net = total - total_tax %> + + + + + + <% end %> + + <% end %> +
Sale (<%= params[:from] rescue '-' %> - <%= params[:to] rescue '-'%>)
Sr.noDateVoid AmountMpu SalesMaster SalesVisa SalesJcb SalesPaypar SalesCash SalesCredit SalesFOC Sales(Discount)Grand Total +
Rounding Adj.
Rounding Adj.Grand Total
<%= count %><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %><%= number_with_delimiter(sprintf("%.2f",sale[:void_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:mpu_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:master_amount]), :delimiter => ',') rescue '-'%><%= 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[: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[:rounding_adj].to_f), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[: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",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 '-'%>
<%= tax.tax_name rescue '-'%><%= number_with_delimiter(sprintf("%.2f",tax.tax_amount), :delimiter => ',') rescue '-'%> 
Net Amount<%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%> 
+
+
+
+ + + \ No newline at end of file diff --git a/app/views/reports/daily_sales/index.xls.erb b/app/views/reports/daily_sales/index.xls.erb new file mode 100644 index 00000000..67e76e3c --- /dev/null +++ b/app/views/reports/daily_sales/index.xls.erb @@ -0,0 +1,116 @@ +
+
+ + + <% if params[:from]%> + + + + <% end %> + + + + + + + + + + + + + + + + + + + <% unless @sale_data.empty? %> + + + <% void = 0 %> + <% mpu = 0 %> + <% master = 0 %> + <% visa = 0 %> + <% jcb = 0 %> + <% paypar = 0 %> + <% cash = 0 %> + <% credit = 0 %> + <% foc = 0 %> + <% discount = 0 %> + <% total = 0 %> + <% grand_total = 0 %> + <% count = 1 %> <% rounding_adj = 0 %> + <% @sale_data.each do |sale| %> + <% void += sale[:void_amount] %> + <% mpu += sale[:mpu_amount] %> + <% master += sale[:master_amount] %> + <% visa += sale[:visa_amount] %> + <% jcb += sale[:jcb_amount] %> + <% paypar += sale[:paypar_amount] %> + <% cash += sale[:cash_amount] %> + <% credit += sale[:credit_amount] %> + <% foc += sale[:foc_amount] %> + <% discount += sale[:total_discount] %> + <% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %> + <% grand_total += sale[:grand_total].to_f %> + <% rounding_adj += sale[:rounding_adj].to_f %> + + + + + + + + + + + + + + + + + + <% count = count + 1 %> + <% end %> + + + + + + + + + + + + + + + + + + <% total_tax = 0 %> + <% unless @tax.empty? %> + <% @tax.each do |tax| %> + <% total_tax += tax.tax_amount.to_f %> + + + + + + + <% end %> + <% net = total - total_tax %> + + + + + + <% end %> + + <% end %> +
Sale (<%= params[:from] rescue '-' %> - <%= params[:to] rescue '-'%>)
Sr.noDateVoid AmountMpu SalesMaster SalesVisa SalesJcb SalesPaypar SalesCash SalesCredit SalesFOC Sales(Discount)Grand Total +
Rounding Adj.
Rounding Adj.Grand Total
<%= count %><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %><%= number_with_delimiter(sprintf("%.2f",sale[:void_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:mpu_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:master_amount]), :delimiter => ',') rescue '-'%><%= 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[: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[:rounding_adj].to_f), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[: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",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 '-'%>
<%= tax.tax_name rescue '-'%><%= number_with_delimiter(sprintf("%.2f",tax.tax_amount), :delimiter => ',') rescue '-'%> 
Net Amount<%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%> 
+
+
\ No newline at end of file diff --git a/app/views/reports/sale_item/index.html.erb b/app/views/reports/sale_item/index.html.erb index cce5a210..a3b460fc 100644 --- a/app/views/reports/sale_item/index.html.erb +++ b/app/views/reports/sale_item/index.html.erb @@ -7,14 +7,14 @@
<%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_sale_item_index_path} %> + :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_sale_items_path} %>
diff --git a/app/views/reports/sale_items/_shift_sale_report_filter.html.erb b/app/views/reports/sale_items/_shift_sale_report_filter.html.erb new file mode 100644 index 00000000..7f95b6b9 --- /dev/null +++ b/app/views/reports/sale_items/_shift_sale_report_filter.html.erb @@ -0,0 +1,156 @@ +
+
+ <%= 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/sale_items/index.html.erb b/app/views/reports/sale_items/index.html.erb new file mode 100644 index 00000000..a3b460fc --- /dev/null +++ b/app/views/reports/sale_items/index.html.erb @@ -0,0 +1,141 @@ + + +
+ <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_sale_items_path} %> +
+
+ +
+
+ +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + +
Date
Menu CategoryCodeProductTotal ItemUnit PriceRevenue
+
+
+
+ + \ No newline at end of file diff --git a/app/views/reports/sale_items/index.xls.erb b/app/views/reports/sale_items/index.xls.erb new file mode 100644 index 00000000..2807ec3f --- /dev/null +++ b/app/views/reports/sale_items/index.xls.erb @@ -0,0 +1,136 @@ + + + + + + + +
+<% 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 !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 %> + + <% 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 %> + + + + <% @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%> + <% total_discount = total_discount + total_price %> + <% total_price = 0.0%> + <% count = 0%> + <% end %> + <% end %> + <% 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.account_name %> Total Price By <%= sale.account_name %> + <% @totalByAccount.each do |account, total| %> + <% if sale.account_id == account %> + <%= total %> + <% end %> + <% end %> +
 <%= 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 '-' %>
 Sub Total<%= sub_total + total_price %>
 Grand Total<%= grand_total + total_discount %>
+<% end %> +
+ + \ No newline at end of file diff --git a/app/views/settings/lookups/index.html.erb b/app/views/settings/lookups/index.html.erb index f427b561..9ac392a5 100644 --- a/app/views/settings/lookups/index.html.erb +++ b/app/views/settings/lookups/index.html.erb @@ -18,9 +18,9 @@ <%= settings_lookup.lookup_type %> <%= settings_lookup.name %> <%= settings_lookup.value %> - <%= link_to 'Show', settings_lookup %> + <%= link_to 'Show', settings_lookup_path(settings_lookup) %> <%= link_to 'Edit', edit_settings_lookup_path(settings_lookup) %> - <%= link_to 'Destroy', settings_lookup, method: :delete, data: { confirm: 'Are you sure?' } %> + <%= link_to 'Destroy', settings_lookup_path(settings_lookup), method: :delete, data: { confirm: 'Are you sure?' } %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index 3b647fa9..cfaec2d0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -88,7 +88,7 @@ Rails.application.routes.draw do get "/:id/discount" => "discounts#index" post "/:id/discount" => "discounts#create" - post "/:id/request_bills" => "request_bills#print" ,:defaults => { :format => 'json' } + post "/:id/request_bills" => "request_bills#print",:as => "request_bill" ,:defaults => { :format => 'json' } get '/:sale_id/reprint' => 'payments#reprint' ,:defaults => { :format => 'json' } #--------- Payment ------------# get 'sale/:sale_id/payment' => 'payments#show' @@ -217,8 +217,8 @@ Rails.application.routes.draw do #--------- Reports Controller Sections ------------# namespace :reports do resources :receipt_no, :only => [:index, :show] - resources :daily_sale, :only => [:index, :show] - resources :sale_item, :only => [:index, :show] + resources :daily_sales, :only => [:index, :show] + resources :sale_items, :only => [:index, :show] # resources :sales, :only => [:index, :show] # resources :orders, :only => [:index, :show] # resources :customers, :only => [:index, :show] diff --git a/spec/controllers/reports/daily_sales_controller_spec.rb b/spec/controllers/reports/daily_sales_controller_spec.rb new file mode 100644 index 00000000..6cc8e9fd --- /dev/null +++ b/spec/controllers/reports/daily_sales_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Reports::DailySalesController, type: :controller do + +end diff --git a/spec/controllers/reports/dailysales_controller_spec.rb b/spec/controllers/reports/dailysales_controller_spec.rb new file mode 100644 index 00000000..83fcb321 --- /dev/null +++ b/spec/controllers/reports/dailysales_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Reports::DailysalesController, type: :controller do + +end diff --git a/spec/controllers/reports/sale_items_controller_spec.rb b/spec/controllers/reports/sale_items_controller_spec.rb new file mode 100644 index 00000000..546fc874 --- /dev/null +++ b/spec/controllers/reports/sale_items_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Reports::SaleItemsController, type: :controller do + +end diff --git a/spec/helpers/reports/daily_sales_helper_spec.rb b/spec/helpers/reports/daily_sales_helper_spec.rb new file mode 100644 index 00000000..17d70035 --- /dev/null +++ b/spec/helpers/reports/daily_sales_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the Reports::DailySalesHelper. For example: +# +# describe Reports::DailySalesHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe Reports::DailySalesHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/reports/dailysales_helper_spec.rb b/spec/helpers/reports/dailysales_helper_spec.rb new file mode 100644 index 00000000..96853812 --- /dev/null +++ b/spec/helpers/reports/dailysales_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the Reports::DailysalesHelper. For example: +# +# describe Reports::DailysalesHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe Reports::DailysalesHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/reports/sale_items_helper_spec.rb b/spec/helpers/reports/sale_items_helper_spec.rb new file mode 100644 index 00000000..ea2807c4 --- /dev/null +++ b/spec/helpers/reports/sale_items_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the Reports::SaleItemsHelper. For example: +# +# describe Reports::SaleItemsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe Reports::SaleItemsHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end From 6a6c629da4ad1822e1f8a9e4fa7ca909074482c1 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 23 Jun 2017 17:56:09 +0630 Subject: [PATCH 05/37] update cancan alert message --- app/views/layouts/application.html.erb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1d4991e6..d2b57a7a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -18,7 +18,16 @@ <%= render 'layouts/header' %>
<% flash.each do |type, message| %> -
+ <% + if type== "warning" + alert = "alert-warning" + elsif type== "notice" + alert = "alert-success" + else + alert = "alert-danger" + end + %> +
<%= message %>
From 05b4dbac7c70bb7987bf52589a4dce7546fcf61a Mon Sep 17 00:00:00 2001 From: Phyo Date: Fri, 23 Jun 2017 18:45:15 +0630 Subject: [PATCH 06/37] Rebate Redeem add field --- app/models/sale_payment.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 950334cb..65fc96b0 100644 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -54,7 +54,7 @@ class SalePayment < ApplicationRecord #record an payment in sale-audit remark = "Payment #{payment_method}- for Invoice #{invoice.receipt_no} Due [#{amount_due}]| pay amount -> #{cash_amount} | Payment Status ->#{payment_status}" sale_audit = SaleAudit.record_payment(invoice.id, remark, action_by) - + return true, self.save else #record an payment in sale-audit @@ -94,10 +94,15 @@ class SalePayment < ApplicationRecord sale_data = Sale.find_by_sale_id(sale_id) if sale_data + others = 0 + sale_data.sale_payments.each do |sale_payment| + others = others + sale_payment.payment_amount + end + redeem_prices = sale_data.grand_total -others # Control for Paypar Cloud begin response = HTTParty.post(url, - :body => { generic_customer_id:membership_id,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' @@ -292,7 +297,7 @@ class SalePayment < ApplicationRecord # Control for Paypar Cloud begin - response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id ,merchant_uid:merchant_uid,total_amount: total_amount,campaign_type_id: campaign_type_id, + 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', From ecabed5d5d05cc893238a59aaea2f1c8f90a807c Mon Sep 17 00:00:00 2001 From: Phyo Date: Fri, 23 Jun 2017 18:45:46 +0630 Subject: [PATCH 07/37] Account type change --- db/seeds.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index fc3e1bde..dced96dd 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -73,8 +73,8 @@ booking_status = Lookup.create([{lookup_type:'booking_status', name: 'Available' {lookup_type:'booking_status', name: 'Moved', value: 'moved'}]) #booking_status -account_type = Lookup.create([{lookup_type:'account_type', name: 'Income', value: 'income'}, - {lookup_type:'account_type', name: 'Expense', value: 'expense'}]) +account_type = Lookup.create([{lookup_type:'account_type', name: 'Income', value: '0'}, + {lookup_type:'account_type', name: 'Expense', value: '1'}]) # sale void reason void_reason = Lookup.create([{lookup_type:'void_reason', name: 'Approve By Manager', value: 'Approve By Manager'}, From e9fb90d8a09443f87268f20d274d5133cc897027 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 23 Jun 2017 19:00:49 +0630 Subject: [PATCH 08/37] updating oqs --- app/assets/javascripts/OQS.js | 4 ++++ app/assets/stylesheets/OQS.scss | 6 ++++++ app/views/oqs/home/index.html.erb | 5 +++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index 4c8300e2..0574148b 100644 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -67,6 +67,10 @@ $(document).ready(function(){ $(this).addClass('selected-item'); }); + $(".order-item-edit").on('click', function(){ + + }); + // complete for queue item $('.order-complete').on('click',function(e){ //e.preventDefault(); diff --git a/app/assets/stylesheets/OQS.scss b/app/assets/stylesheets/OQS.scss index b516836a..57c5a36d 100644 --- a/app/assets/stylesheets/OQS.scss +++ b/app/assets/stylesheets/OQS.scss @@ -19,3 +19,9 @@ color: #fff !important; background-color: blue; } + +.order-item { + width: 49%; + font-size: 18px; + margin: 0px 0px 5px 0px; +} \ No newline at end of file diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 85858a02..ce82cbfa 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -116,8 +116,9 @@
- <% From 9ed6b510c45b127eeea5f57f0bfde471d7d389d9 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 23 Jun 2017 19:01:33 +0630 Subject: [PATCH 09/37] updating oqs --- app/controllers/oqs/edit_controller.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/controllers/oqs/edit_controller.rb diff --git a/app/controllers/oqs/edit_controller.rb b/app/controllers/oqs/edit_controller.rb new file mode 100644 index 00000000..e69de29b From d9c53e73f85be90df3fea3195c2bb7224f1b5e4d Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Sat, 24 Jun 2017 11:12:30 +0630 Subject: [PATCH 10/37] update customer --- app/controllers/crm/customers_controller.rb | 2 +- app/controllers/origami/home_controller.rb | 1 + app/pdf/receipt_bill_pdf.rb | 4 ++-- app/views/origami/home/show.html.erb | 2 +- app/views/origami/orders/show.html.erb | 2 +- app/views/origami/rooms/show.html.erb | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index ca1aafb2..43b0618e 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -168,7 +168,7 @@ end 'Content-Type' => 'application/json', 'Accept' => 'application/json' }, - :timeout 10 + :timeout => 10 ) rescue Net::OpenTimeout response = { status: false } diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 4a070788..c4edcc0b 100644 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -30,6 +30,7 @@ class Origami::HomeController < BaseOrigamiController order.order_items.each do |item| @order_items.push(item) end + end end @status_order = 'order' else diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 96e16cf4..5a86ddfb 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -93,10 +93,10 @@ class ReceiptBillPdf < Prawn::Document y_position = cursor bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do - text "Time In: #{ sale_data.bookings[0].checkin_at.strftime('%I:%M %p') }", :size => self.item_font_size,:align => :left + text "Time In: #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') }", :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 "Time Out: #{ sale_data.bookings[0].checkout_at.strftime('%I:%M %p') }" , :size => self.item_font_size,:align => :right + text "Time Out: #{ sale_data.bookings[0].checkout_at.utc.getlocal.strftime('%I:%M %p') }" , :size => self.item_font_size,:align => :right end move_down 5 diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 73f298ec..06263bed 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -292,7 +292,7 @@ <% end %> - + <% end %>
diff --git a/app/views/origami/orders/show.html.erb b/app/views/origami/orders/show.html.erb index 92ffc7f1..d2c065a1 100644 --- a/app/views/origami/orders/show.html.erb +++ b/app/views/origami/orders/show.html.erb @@ -189,7 +189,7 @@ <% if @sale_status != 'completed' %> <% end %> - + -class CreateDiningQueues < ActiveRecord::Migration[5.1] - def change - create_table :dining_queues do |t| - t.string :name - t.string :contact_no - t.string :queue_no - t.string :status - t.references :dining_facility, foreign_key: true - t.timestamps - end - end -end From 6e49f91b89ccb2e3885d27bf484280baeb6e88d3 Mon Sep 17 00:00:00 2001 From: Phyo Date: Mon, 26 Jun 2017 11:10:49 +0630 Subject: [PATCH 14/37] Multiple Invoices Phase 1 --- .../origami/room_invoices_controller.rb | 40 +++++ .../origami/table_invoices_controller.rb | 40 +++++ app/views/origami/home/show.html.erb | 20 ++- .../origami/room_invoices/index.html.erb | 82 ++++++++++ app/views/origami/room_invoices/show.html.erb | 147 ++++++++++++++++++ .../origami/table_invoices/index.html.erb | 82 ++++++++++ .../origami/table_invoices/show.html.erb | 147 ++++++++++++++++++ config/routes.rb | 6 + 8 files changed, 557 insertions(+), 7 deletions(-) create mode 100644 app/controllers/origami/room_invoices_controller.rb create mode 100644 app/controllers/origami/table_invoices_controller.rb create mode 100644 app/views/origami/room_invoices/index.html.erb create mode 100644 app/views/origami/room_invoices/show.html.erb create mode 100644 app/views/origami/table_invoices/index.html.erb create mode 100644 app/views/origami/table_invoices/show.html.erb diff --git a/app/controllers/origami/room_invoices_controller.rb b/app/controllers/origami/room_invoices_controller.rb new file mode 100644 index 00000000..8d805771 --- /dev/null +++ b/app/controllers/origami/room_invoices_controller.rb @@ -0,0 +1,40 @@ +class Origami::RoomInvoicesController < BaseOrigamiController + def index + @room = DiningFacility.find(params[:room_id]) + puts "room bookig lenght" + @sale_array = Array.new + @room.bookings.each do |booking| + puts booking.sale_id + + if booking.sale_id.nil? + else + sale = Sale.find(booking.sale_id) + + if sale.sale_status != "completed" + @sale_array.push(sale) + end + end + end + end + + def show + @room = DiningFacility.find(params[:room_id]) + @sale_array = Array.new + @room.bookings.each do |booking| + if booking.sale_id.nil? + else + sale = Sale.find(booking.sale_id) + + if sale.sale_status != "completed" + @sale_array.push(sale) + end + end + end + + @sale = Sale.find(params[:invoice_id]) + @date = @sale.created_at + @status_sale = 'sale' + @customer = @sale.customer + end + +end diff --git a/app/controllers/origami/table_invoices_controller.rb b/app/controllers/origami/table_invoices_controller.rb new file mode 100644 index 00000000..32e0ef7f --- /dev/null +++ b/app/controllers/origami/table_invoices_controller.rb @@ -0,0 +1,40 @@ +class Origami::TableInvoicesController < BaseOrigamiController + def index + @table = DiningFacility.find(params[:table_id]) + puts "table bookig lenght" + @sale_array = Array.new + @table.bookings.each do |booking| + puts booking.sale_id + + if booking.sale_id.nil? + else + sale = Sale.find(booking.sale_id) + + if sale.sale_status != "completed" + @sale_array.push(sale) + end + end + end + end + + def show + @table = DiningFacility.find(params[:table_id]) + @sale_array = Array.new + @table.bookings.each do |booking| + if booking.sale_id.nil? + else + sale = Sale.find(booking.sale_id) + + if sale.sale_status != "completed" + @sale_array.push(sale) + end + end + end + + @sale = Sale.find(params[:invoice_id]) + @date = @sale.created_at + @status_sale = 'sale' + @customer = @sale.customer + end + +end diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 73f298ec..c25c1b2f 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -126,7 +126,7 @@

Date: <%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>

- +
@@ -241,18 +241,18 @@ %> - <% - end - @sale_array.each do |sale| + <% end %> +

+ Pending Payment + <% @sale_array.each do |sale| if @sale_array.size > 1 unless sale.receipt_no == @sale_array[0].receipt_no %> -

- Pending Payment + - +
Receipt No - <%= sale.receipt_no %>
<% @@ -298,6 +298,11 @@
diff --git a/app/views/origami/room_invoices/index.html.erb b/app/views/origami/room_invoices/index.html.erb new file mode 100644 index 00000000..011aff11 --- /dev/null +++ b/app/views/origami/room_invoices/index.html.erb @@ -0,0 +1,82 @@ +
+
+ <% @sale_array.each do |sale| %> +
+
+ <%= sale.receipt_no %> +
+
+ <% end %> +
+ + +
+
+
+
INVOICE DETAILS
+
+
+
+
+

Receipt No: + <%= @sale.receipt_no rescue '' %> +

+
+
+

Date: <%= @sale.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>

+
+
+
+
+

Customer :

+
+ +
+ + +
+
+
+ + +
+ + +
+
+ diff --git a/app/views/origami/room_invoices/show.html.erb b/app/views/origami/room_invoices/show.html.erb new file mode 100644 index 00000000..46e9a892 --- /dev/null +++ b/app/views/origami/room_invoices/show.html.erb @@ -0,0 +1,147 @@ +
+
+ + <% @sale_array.each do |sale| %> +
+ <% if sale.id == @sale.id %> +
+ <%= sale.receipt_no %> +
+ <% else %> +
+ <%= sale.receipt_no %> +
+ <% end %> +
+ <% end %> +
+ +
+
+
+
INVOICE DETAILS
+
+
+
+
+

Receipt No: + <%= @sale.receipt_no rescue '' %> +

+
+
+

Date: <%= @sale.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>

+
+
+
+
+ + +

Customer : <%= @customer.name %>

+ +
+ +
+
+ + + + + + + + + <% + count = 0 + sub_total = 0 + if @status_sale == "sale" + @sale.sale_items.each do |sale_item| + count += 1 + sub_total = sub_total + sale_item.price + %> + + <% + # Can't check for discount + unless sale_item.price == 0 + %> + + + + + + + <% + end + end + end + + if @status_order == 'order' && @status_sale != 'sale' + unless @order_items.nil? + count = 0 + @order_items.each do |order_item | + count += 1 + sub_total = sub_total + order_item.price + + unless order_item.price == 0 %> + + + + + + + <% + end + end + end + end + %> + +
#ItemsQTY + Price +
<%= count %><%= sale_item.product_name %><%= sale_item.qty %><%= sale_item.price %>
<%= count %><%= order_item.item_name %><%= order_item.qty %><%= order_item.qty*order_item.price %>
+
+ +
+
+
+ + +
+ + +
+
+ diff --git a/app/views/origami/table_invoices/index.html.erb b/app/views/origami/table_invoices/index.html.erb new file mode 100644 index 00000000..d5cbe84d --- /dev/null +++ b/app/views/origami/table_invoices/index.html.erb @@ -0,0 +1,82 @@ +
+
+ <% @sale_array.each do |sale| %> +
+
+ <%= sale.receipt_no %> +
+
+ <% end %> +
+ + +
+
+
+
INVOICE DETAILS
+
+
+
+
+

Receipt No: + <%= @sale.receipt_no rescue '' %> +

+
+
+

Date: <%= @sale.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>

+
+
+
+
+

Customer :

+
+ +
+ + +
+
+
+ + +
+ + +
+
+ diff --git a/app/views/origami/table_invoices/show.html.erb b/app/views/origami/table_invoices/show.html.erb new file mode 100644 index 00000000..065c7f8d --- /dev/null +++ b/app/views/origami/table_invoices/show.html.erb @@ -0,0 +1,147 @@ +
+
+ + <% @sale_array.each do |sale| %> +
+ <% if sale.id == @sale.id %> +
+ <%= sale.receipt_no %> +
+ <% else %> +
+ <%= sale.receipt_no %> +
+ <% end %> +
+ <% end %> +
+ +
+
+
+
INVOICE DETAILS
+
+
+
+
+

Receipt No: + <%= @sale.receipt_no rescue '' %> +

+
+
+

Date: <%= @sale.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>

+
+
+
+
+ + +

Customer : <%= @customer.name %>

+ +
+ +
+
+ + + + + + + + + <% + count = 0 + sub_total = 0 + if @status_sale == "sale" + @sale.sale_items.each do |sale_item| + count += 1 + sub_total = sub_total + sale_item.price + %> + + <% + # Can't check for discount + unless sale_item.price == 0 + %> + + + + + + + <% + end + end + end + + if @status_order == 'order' && @status_sale != 'sale' + unless @order_items.nil? + count = 0 + @order_items.each do |order_item | + count += 1 + sub_total = sub_total + order_item.price + + unless order_item.price == 0 %> + + + + + + + <% + end + end + end + end + %> + +
#ItemsQTY + Price +
<%= count %><%= sale_item.product_name %><%= sale_item.qty %><%= sale_item.price %>
<%= count %><%= order_item.item_name %><%= order_item.qty %><%= order_item.qty*order_item.price %>
+
+ +
+
+
+ + +
+ + +
+
+ diff --git a/config/routes.rb b/config/routes.rb index c93beb92..6466b664 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -109,6 +109,12 @@ Rails.application.routes.draw do get 'sale/:sale_id/payment/others_payment/JCB' => "jcb#index" get 'sale/:sale_id/payment/others_payment/Redeem' => "redeem_payments#index" + #---------Multiple Invoices --------------# + get 'table/:table_id/table_invoices' => "table_invoices#index" , :as => "table_invoice_index" + get 'table/:table_id/table_invoice/:invoice_id' => "table_invoices#show" , :as => "table_invoice_show" + get 'room/:room_id/room_invoices' => "room_invoices#index" , :as => "room_invoice_index" + get 'room/:room_id/room_invoice/:invoice_id' => "room_invoices#show" , :as => "room_invoice_show" + #---------Add Customer --------------# #resources :customers get '/:sale_id/customers', to: "customers#add_customer" From a05fc0f6460a564b4dc179bed817b1058ba2c5dc Mon Sep 17 00:00:00 2001 From: Phyo Date: Mon, 26 Jun 2017 12:55:44 +0630 Subject: [PATCH 15/37] Up to Amount bug fix --- app/views/origami/redeem_payments/index.html.erb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/origami/redeem_payments/index.html.erb b/app/views/origami/redeem_payments/index.html.erb index cbe356b5..a4783010 100644 --- a/app/views/origami/redeem_payments/index.html.erb +++ b/app/views/origami/redeem_payments/index.html.erb @@ -5,7 +5,7 @@
- +

@@ -21,7 +21,7 @@ <% end %>
- +

@@ -98,6 +98,12 @@
diff --git a/app/views/origami/sale_edit/item_void_cancel.json.jbuilder b/app/views/origami/sale_edit/item_void_cancel.json.jbuilder new file mode 100644 index 00000000..08bf292c --- /dev/null +++ b/app/views/origami/sale_edit/item_void_cancel.json.jbuilder @@ -0,0 +1 @@ +json.status true diff --git a/config/routes.rb b/config/routes.rb index bf5d6483..c295f6be 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -78,6 +78,10 @@ Rails.application.routes.draw do post 'moving' => "movetable#moving" get "/table/:table_id/sale/:sale_id/edit" => "sale_edit#edit" post 'item_void' => "sale_edit#item_void" + post 'item_void_cancel' => "sale_edit#item_void_cancel" + post 'cancel_all_void' => 'sale_edit#cancel_all_void' + post 'apply_void' => 'sale_edit#apply_void' + get 'table/:dining_id/movetable' => "movetable#move_dining" get 'table/:dining_id/moveroom' => "moveroom#move_dining" get 'sale/:sale_id' => 'sales#show' From d3dc2e2dd8a69130ddcba0e9cd20b3c8e715dca9 Mon Sep 17 00:00:00 2001 From: Yan Date: Mon, 26 Jun 2017 16:39:55 +0630 Subject: [PATCH 24/37] remove pg in gem --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 227cfa72..8f16e924 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem 'rails', '~> 5.1.0' gem 'mysql2', '>= 0.3.18', '< 0.5' #Use PosgreSQL -gem 'pg' +#gem 'pg' # redis server for cable # gem 'redis', '~> 3.0' From 6e77a71946e0cd2d75c867afcd56a3f7ac590173 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 26 Jun 2017 16:50:04 +0630 Subject: [PATCH 25/37] update customer seed shop and receipt bill --- app/controllers/crm/customers_controller.rb | 3 +- .../origami/customers_controller.rb | 4 + app/pdf/receipt_bill_pdf.rb | 82 +++++++-------- app/views/crm/customers/show.html.erb | 99 +++++++------------ app/views/layouts/_header.html.erb | 3 + db/seeds.rb | 3 +- 6 files changed, 81 insertions(+), 113 deletions(-) diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 4984150a..213a6229 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -47,7 +47,8 @@ class Crm::CustomersController < BaseCrmController #get customer amount @customer = Customer.find(params[:id]) - @response = Customer.get_membership_transactions(@customer) + @response = Customer.get_membership_transactions(@customer) + # @response = "" #end customer amount end diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index f15b8545..0859694d 100644 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -54,6 +54,10 @@ class Origami::CustomersController < BaseOrigamiController if(id == "SAL") sale = Sale.find(params[:sale_id]) status = sale.update_attributes(customer_id: params[: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]) + end else @booking = BookingOrder.find_by_order_id(params[:sale_id]) @orders = BookingOrder.where("booking_id = ? ", @booking.booking_id) diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 5a86ddfb..4689de9d 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -30,7 +30,6 @@ class ReceiptBillPdf < Prawn::Document cashier_info(sale_data, customer_name) line_items(sale_items) - items_account(item_price_by_accounts) all_total(sale_data) @@ -39,6 +38,8 @@ class ReceiptBillPdf < Prawn::Document end customer(customer_name) + + items_account(item_price_by_accounts) footer end @@ -61,19 +62,10 @@ class ReceiptBillPdf < Prawn::Document 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 - text "#{ sale_data.bookings[0].dining_facility.name }" , :size => self.item_font_size,:align => :right + 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 - # y_position = cursor - # bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do - # text "Customer:", :size => self.item_font_size,:align => :left - # end - # bounding_box([self.label_width,y_position], :width =>self.item_width) do - # text "#{customer_name}" , :size => self.item_font_size,:align => :left - # end - # move_down 5 - y_position = cursor bounding_box([0, y_position], :width =>self.item_width) do text "Waiter: #{sale_data.requested_by}" , :size => self.item_font_size, :align => :left @@ -86,27 +78,26 @@ class ReceiptBillPdf < Prawn::Document end move_down 5 - # bounding_box([self.label_width,y_position], :width =>self.item_width) do - # text "#{customer_name}" , :size => self.item_font_size,:align => :left - # end - # move_down 5 - y_position = cursor - bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do - text "Time In: #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') }", :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 "Time Out: #{ sale_data.bookings[0].checkout_at.utc.getlocal.strftime('%I:%M %p') }" , :size => self.item_font_size,:align => :right + bounding_box([0,y_position], :width =>self.page_width - 10, :height => self.item_height) do + text "Receipt Date : #{ sale_data.receipt_date.strftime('%d-%m-%Y') } ( #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } )",:size => self.item_font_size,:align => :left end + + # bounding_box([self.item_description_width,y_position], :width =>self.label_width+5) do + # text "(#{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } + # - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') })" , + # :size => self.item_font_size,:align => :right + # end + move_down 5 stroke_horizontal_rule - move_down 5 end def line_items(sale_items) + move_down 5 y_position = cursor - + move_down 5 pad_top(15) { # @item_width.to_i + @half_qty.to_i text_box "Items", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :size => self.item_font_size, :overflow => :shrink_to_fix @@ -114,10 +105,8 @@ class ReceiptBillPdf < Prawn::Document text_box "Qty", :at =>[(self.item_width+self.price_width),y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix text_box "Total", :at =>[(self.item_width+self.price_width+4),y_position], :width => self.total_width+3, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix } - - move_down 5 + move_down -5 stroke_horizontal_rule - add_line_item_row(sale_items) end @@ -142,7 +131,7 @@ class ReceiptBillPdf < Prawn::Document text_box "#{qty}", :at =>[item_name_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix text_box "#{total_price}", :at =>[(item_name_width+4),y_position], :width =>self.total_width+3, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix } - move_down 3 + move_down 1 end stroke_horizontal_rule @@ -158,20 +147,6 @@ class ReceiptBillPdf < Prawn::Document move_down 5 end - def items_account(item_price_by_accounts) - 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 - text "#{ ipa[:name] }", :size => self.item_font_size,:align => :left - end - bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{ ipa[:price] }" , :size => self.item_font_size,:align => :right - end - move_down 5 - end - end - def all_total(sale_data) item_name_width = self.item_width y_position = cursor @@ -267,7 +242,7 @@ class ReceiptBillPdf < Prawn::Document move_down 5 y_position = cursor bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do - text "Rebate Amount", :size => self.item_font_size,:align => :left + text "Current Rebate Amount", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do text "#{ res["rebate"] }" , :size => self.item_font_size,:align => :right @@ -278,10 +253,10 @@ class ReceiptBillPdf < Prawn::Document move_down 5 y_position = cursor bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do - text "Redeem Amount", :size => self.item_font_size,:align => :left + text "Current Redeem Amount", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{ res["redeem"] }" , :size => self.item_font_size,:align => :right + text "(#{ res["redeem"] })" , :size => self.item_font_size,:align => :right end end @@ -317,7 +292,23 @@ class ReceiptBillPdf < Prawn::Document end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do text "#{ customer_name }" , :size => self.item_font_size,:align => :right - end + end + end + + def items_account(item_price_by_accounts) + move_down 5 + stroke_horizontal_rule + move_down 5 + 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 + text "#{ ipa[:name] }", :size => self.item_font_size,:align => :left + end + bounding_box([self.item_description_width,y_position], :width =>self.label_width) do + text "#{ ipa[:price] }" , :size => self.item_font_size,:align => :right + end + end end def footer @@ -331,3 +322,4 @@ class ReceiptBillPdf < Prawn::Document end end + diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index c6ec25c2..5c4bf7c8 100644 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -55,7 +55,9 @@
- <% if @response["status"] == true && $response["data"] != "[]"%> + <% puts "'''''''''''''''''''" + puts @response + if @response["status"] == true %> <% if @response["status"] == true %> @@ -101,28 +103,22 @@
Membership Transactions
- - - - - - - - + + + + + - <% @order_items.each do |order_item| %> + <% @orders.each do |order| %> - - - - - - - - + + + + + <% end %> @@ -137,62 +133,33 @@
Order IDMenu ItemQTYUnit Price OptionStatusWaiterCreated at Order ID TypeOrder statusOrder dateItems Count
<%= order_item.order_id %><%= order_item.item_name %><%= order_item.qty %><%= order_item.price %><%= order_item.options %><%= order_item.order_item_status %><%= order_item.item_order_by %> <%= order_item.created_at.strftime("%d-%m-%y") %><%= order.order_id %><%= order.order_type %><%= order.status %><%= order.date.strftime("%d-%m-%Y") %> <%= order.item_count %>
- - - - - - + + + + + + + - <% @sale_items.each do |sale_item| %> - - - - - - - - - - <% end %> + <% @sales.each do |sale| %> + + + + + + + + + + <% end %>
Sale ID Menu ItemQTYUnit Price Tax PriceCreated AtSale Id Receipt no Grand totalTax amountCashierSales statusReceipt Date
<%= sale_item.sale_id %><%= sale_item.product_name %><%= sale_item.qty %><%= sale_item.unit_price %><%= sale_item.taxable_price %><%= sale_item.created_at %>
<%= sale.sale_id %><%= sale.receipt_no %><%= sale.grand_total rescue '-' %><%= sale.total_tax %><%= sale.cashier_name rescue '-' %> <%= sale.sale_status %> <%= sale.receipt_date.strftime("%d-%m-%Y") %>
-
-

Sale Details

-
- - - - - - - - - - - - - - <% @sale_items.each do |sale_item| %> - - - - - - - - - - <% end %> - -
Sale ID Menu ItemQTYUnit Price Tax PriceCreated At
<%= sale_item.sale_id %><%= sale_item.product_name %><%= sale_item.qty %><%= sale_item.unit_price %><%= sale_item.taxable_price %><%= sale_item.created_at %>
-
-
+
diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index c528003d..3d723782 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -49,10 +49,13 @@ <% if current_login_employee %>
<% end %> diff --git a/db/seeds.rb b/db/seeds.rb index fc3e1bde..e02ba1d5 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -131,7 +131,8 @@ 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.3, 23 street', township:"Yankin",state:"Yangon",city:"Yangon", country:"Myanmar", phone_no:"09 99988888, 0912374734",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"}) # order_queue_station2 = OrderQueueStation.create({station_name: "Queue Station 2", is_active: true,printer_name: "drink_printer", processing_items: JSON.generate(['02005','02006','02007','02008']), print_copy:true, cut_per_item: true, use_alternate_name: true, created_by: "SYSTEM DEFAULT"}) From c81663003f78f8622f83b37d2459caf40584aebf Mon Sep 17 00:00:00 2001 From: Yan Date: Mon, 26 Jun 2017 17:01:25 +0630 Subject: [PATCH 26/37] update in discount --- app/views/origami/discounts/index.html.erb | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/app/views/origami/discounts/index.html.erb b/app/views/origami/discounts/index.html.erb index 5f6b1396..e3cca128 100644 --- a/app/views/origami/discounts/index.html.erb +++ b/app/views/origami/discounts/index.html.erb @@ -249,19 +249,24 @@ $(document).ready(function(){ // Select for account types $(".accounts-type").on('click', function(e){ + var account_id = $(this).attr('id').substr(8); + if($(this).hasClass('selected-account') == true){ $(this).removeClass('selected-account'); + $(".item-row").each(function(i){ + if($(this).children().find("#item-account-type").text() == account_id){ + $(this).removeClass("selected-item"); + } + }); } else { $(this).addClass('selected-account'); - } - - var account_id = $(this).attr('id').substr(8); - $(".item-row").each(function(i){ - if($(this).children().find("#item-account-type").text() == account_id){ - $(this).addClass("selected-item"); - } - }); + $(".item-row").each(function(i){ + if($(this).children().find("#item-account-type").text() == account_id){ + $(this).addClass("selected-item"); + } + }); + } }); // Calculate Net Discount for Payment From d4983fabf59c037be91fc58da5d8fdfb77ff55bd Mon Sep 17 00:00:00 2001 From: Nweni Date: Mon, 26 Jun 2017 17:07:17 +0630 Subject: [PATCH 27/37] item void --- .../origami/sale_edit_controller.rb | 4 +- app/models/sale.rb | 51 ++++++++++++++----- .../sale_edit/apply_void.json.jbuilder | 1 + 3 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 app/views/origami/sale_edit/apply_void.json.jbuilder diff --git a/app/controllers/origami/sale_edit_controller.rb b/app/controllers/origami/sale_edit_controller.rb index 575cc008..70a5a380 100644 --- a/app/controllers/origami/sale_edit_controller.rb +++ b/app/controllers/origami/sale_edit_controller.rb @@ -51,6 +51,8 @@ class Origami::SaleEditController < BaseOrigamiController end def apply_void - + sale_id = params[:sale_id] + saleObj = Sale.find(sale_id) + saleObj.compute_without_void end end diff --git a/app/models/sale.rb b/app/models/sale.rb index f79d8642..791e9369 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -21,9 +21,9 @@ class Sale < ApplicationRecord "daily" => 0, "monthly" => 1, "yearly" => 2 - } + } - SALE_STATUS_COMPLETED = "completed" + SALE_STATUS_COMPLETED = "completed" def generate_invoice_from_booking(booking_id, requested_by) booking = Booking.find(booking_id) @@ -199,6 +199,31 @@ class Sale < ApplicationRecord end + def compute_without_void + sales_items = self.sale_items + + #Computation Fields + subtotal_price = 0 + total_taxable = 0 + rounding_adjustment = 0 + + sales_items.each do |item| + if item.remark != 'void' + #compute each item and added to total + subtotal_price = subtotal_price + item.price + total_taxable = total_taxable + item.taxable_price + end + end + + apply_tax (total_taxable) + self.total_amount = subtotal_price + self.total_discount = total_discount + self.grand_total = (self.total_amount - self.total_discount) + self.total_tax + #compute rounding adjustment + adjust_rounding + + self.save! + end # Tax Calculate def apply_tax(total_taxable) #if tax is not apply create new record @@ -354,28 +379,28 @@ def self.get_by_range_by_saleitems(from,to,status,report_type) mc.name as menu_category_name, mc.id as menu_category_id ") .group('mi.id') - .order("mi.menu_category_id") - - query = query.joins("JOIN sale_items i ON i.sale_id = sales.sale_id - JOIN menu_items mi ON i.product_code = mi.item_code" + - " JOIN menu_categories mc ON mc.id = mi.menu_category_id + .order("mi.menu_category_id") + + query = query.joins("JOIN sale_items i ON i.sale_id = sales.sale_id + JOIN menu_items mi ON i.product_code = mi.item_code" + + " JOIN menu_categories mc ON mc.id = mi.menu_category_id JOIN employees ea ON ea.id = sales.cashier_id") - + query = query.where("receipt_date between ? and ? and sale_status=?",from,to,status) - + case report_type.to_i when REPORT_TYPE["daily"] return query when REPORT_TYPE["monthly"] - - return query.group("MONTH(date)") + + return query.group("MONTH(date)") when REPORT_TYPE["yearly"] - return query.group("YEAR(date)") + return query.group("YEAR(date)") end - + end private diff --git a/app/views/origami/sale_edit/apply_void.json.jbuilder b/app/views/origami/sale_edit/apply_void.json.jbuilder new file mode 100644 index 00000000..08bf292c --- /dev/null +++ b/app/views/origami/sale_edit/apply_void.json.jbuilder @@ -0,0 +1 @@ +json.status true From 089848ed4a217c026802c8700d39d4e2640bd92b Mon Sep 17 00:00:00 2001 From: Nweni Date: Mon, 26 Jun 2017 17:49:55 +0630 Subject: [PATCH 28/37] credit note payment --- Gemfile | 2 +- .../origami/credit_payments_controller.rb | 22 +++ .../origami/payments_controller.rb | 3 + app/models/sale_payment.rb | 13 +- .../credit_payments/create.json.jbuilder | 1 + .../origami/credit_payments/index.html.erb | 167 +++++++++++++++++- app/views/origami/payments/show.html.erb | 2 +- config/routes.rb | 3 +- 8 files changed, 200 insertions(+), 13 deletions(-) create mode 100644 app/views/origami/credit_payments/create.json.jbuilder diff --git a/Gemfile b/Gemfile index 8f16e924..227cfa72 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem 'rails', '~> 5.1.0' gem 'mysql2', '>= 0.3.18', '< 0.5' #Use PosgreSQL -#gem 'pg' +gem 'pg' # redis server for cable # gem 'redis', '~> 3.0' diff --git a/app/controllers/origami/credit_payments_controller.rb b/app/controllers/origami/credit_payments_controller.rb index a348951e..ff9ae413 100644 --- a/app/controllers/origami/credit_payments_controller.rb +++ b/app/controllers/origami/credit_payments_controller.rb @@ -2,9 +2,31 @@ class Origami::CreditPaymentsController < BaseOrigamiController def index + @sale_id = params[:sale_id] + + # limit visa_amount + sale_data = Sale.find_by_sale_id(@sale_id) + total = sale_data.grand_total + @creditcount = 0 + others = 0 + sale_data.sale_payments.each do |sale_payment| + if sale_payment.payment_method == "visa" + @creditcount = @creditcount + sale_payment.payment_amount + else + others = others + sale_payment.payment_amount + end + end + @can_credit = total - @creditcount - others end def create + cash = params[:amount] + sale_id = params[:sale_id] + if(Sale.exists?(sale_id)) + saleObj = Sale.find(sale_id) + sale_payment = SalePayment.new + @status, @sale = sale_payment.process_payment(saleObj, @user, cash, "creditnote") + end end end diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 310dfbc5..e3705294 100644 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -39,6 +39,7 @@ class Origami::PaymentsController < BaseOrigamiController @visacount= 0.0 @jcbcount= 0.0 @mastercount = 0.0 + @credit = 0.0 @sale_data = Sale.find_by_sale_id(sale_id) #get customer amount @@ -75,6 +76,8 @@ class Origami::PaymentsController < BaseOrigamiController @jcbcount += spay.payment_amount elsif spay.payment_method == "master" @mastercount += spay.payment_amount + elsif spay.payment_method == "creditnote" + @credit += spay.payment_amount end end end diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 65fc96b0..e4ad5364 100644 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -9,7 +9,6 @@ class SalePayment < ApplicationRecord attr_accessor :received_amount, :card_payment_reference, :voucher_no, :giftcard_no, :customer_id, :external_payment_status def process_payment(invoice, action_by, cash_amount, payment_method) - self.sale = invoice self.received_amount = cash_amount amount_due = invoice.grand_total @@ -28,7 +27,7 @@ class SalePayment < ApplicationRecord when "cash" payment_status = cash_payment when "creditnote" - if !self.customer_id.nil? + if !self.sale.customer_id.nil? payment_status = creditnote_payment(self.customer_id) end when "visa" @@ -142,7 +141,7 @@ class SalePayment < ApplicationRecord self.payment_method = "creditnote" self.payment_amount = self.received_amount self.customer_id = self.customer_id - self.outstanding_amount = 0 - self.received_amount + self.outstanding_amount = 0 - self.received_amount.to_f self.payment_status = "outstanding" payment_method = self.save! @@ -207,10 +206,7 @@ class SalePayment < ApplicationRecord customer_data = Customer.find_by_customer_id(self.sale.customer_id) membership_setting = MembershipSetting.find_by_membership_type("paypar_url") membership_data = SalePayment.redeem(membership_setting.gateway_url,membership_setting.auth_token,customer_data.membership_id,self.received_amount,self.sale.sale_id) - puts 'mmmmmmmmmmmmmmmmmmmmmmmmmmm' - puts membership_data.to_json - puts "amountttttttttttttttttttttt" - puts self.received_amount + if membership_data["status"]==true self.payment_method = "paypar" self.payment_amount = self.received_amount @@ -271,8 +267,7 @@ class SalePayment < ApplicationRecord def rebat(sObj) rebate_prices = SaleItem.calculate_rebate_by_account(sObj.sale_items) - puts "eeeeeeeeeeeeeeeeeeeeeeee" - puts rebate_prices + generic_customer_id = sObj.customer.membership_id if generic_customer_id != nil || generic_customer_id != "" || generic_customer_id != 0 paypar = sObj.sale_payments diff --git a/app/views/origami/credit_payments/create.json.jbuilder b/app/views/origami/credit_payments/create.json.jbuilder new file mode 100644 index 00000000..08bf292c --- /dev/null +++ b/app/views/origami/credit_payments/create.json.jbuilder @@ -0,0 +1 @@ +json.status true diff --git a/app/views/origami/credit_payments/index.html.erb b/app/views/origami/credit_payments/index.html.erb index e4f97119..dc2b5b85 100644 --- a/app/views/origami/credit_payments/index.html.erb +++ b/app/views/origami/credit_payments/index.html.erb @@ -1 +1,166 @@ -hello Credit + +
+ +
+
+
+

CREDIT PAYMENT

+
+
+
+
+
+
+ + +
+
+
+ <% if @creditcount != 0 %> +
+
+ + +
+
+
+ <% end %> +
+
+ + +
+
+
+
+
+ +
0.0
+
+
+
+
+
+
+ +
+ +
+
+
+
1
+
2
+
3
+
+
+
4
+
5
+
6
+
+
+
7
+
8
+
9
+
+
+
0
+
.
+
00
+
+
+
Nett
+
Del
+
Clr
+
+
+
+
+
1000
+
3000
+
+
+
5000
+
10000
+
+
+
Pay
+
+
+
+ +
+ +
+ +
+
+ + diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 08f833a2..cef27145 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -105,7 +105,7 @@
Credit
-
0.0
+
<%= @credit %>
<% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0%>
diff --git a/config/routes.rb b/config/routes.rb index fea13a34..39b9aca5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -81,7 +81,7 @@ Rails.application.routes.draw do post 'item_void_cancel' => "sale_edit#item_void_cancel" post 'cancel_all_void' => 'sale_edit#cancel_all_void' post 'apply_void' => 'sale_edit#apply_void' - + get 'table/:dining_id/movetable' => "movetable#move_dining" get 'table/:dining_id/moveroom' => "moveroom#move_dining" get 'sale/:sale_id' => 'sales#show' @@ -105,6 +105,7 @@ Rails.application.routes.draw do post 'payment/master' => "master#create" post 'payment/visa' => "visa#create" post 'payment/paypar' => 'paypar_payments#create' + post 'payment/credit' => 'credit_payments#create' get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index" get 'sale/:sale_id/payment/others_payment' => "others_payments#index" From 02e3ebefda0a98b58600741c5da85ca7fc02473b Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 26 Jun 2017 17:56:31 +0630 Subject: [PATCH 29/37] update receipt --- .../origami/payments_controller.rb | 12 ++++--- .../origami/request_bills_controller.rb | 5 +-- app/models/printer/receipt_printer.rb | 4 +-- app/pdf/receipt_bill_pdf.rb | 34 +++++++++++-------- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 0119953f..e1108cfc 100644 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -17,6 +17,8 @@ class Origami::PaymentsController < BaseOrigamiController unique_code = "ReceiptBillPdf" customer= Customer.find(saleObj.customer_id) rebate_amount = Customer.get_membership_transactions(customer) + #shop detail + shop_details = Shop.find(1) # get member information member_info = Customer.get_member_account(customer) @@ -26,7 +28,7 @@ class Origami::PaymentsController < BaseOrigamiController item_price_by_accounts = SaleItem.calculate_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, member_info,rebate_amount) + printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, member_info,rebate_amount,shop_details) end end @@ -51,8 +53,8 @@ class Origami::PaymentsController < BaseOrigamiController @accountable_type = '' if response["status"]==true response["data"].each do |res| - if res["accountable_type"] == "RebateAccount" - @balance = res["balance"] + if res["accountable_type"] == "RebateAccount" || res["accountable_type"] == "RebatebonusAccount" + @balance += res["balance"] # @accountable_type = res["accountable_type"] @accountable_type = "Rebate Balance" end @@ -89,6 +91,8 @@ class Origami::PaymentsController < BaseOrigamiController unique_code = "ReceiptBillPdf" customer= Customer.find(saleObj.customer_id) + #shop detail + shop_details = Shop.find(1) # get member information member_info = Customer.get_member_account(customer) rebate_amount = Customer.get_membership_transactions(customer) @@ -99,7 +103,7 @@ class Origami::PaymentsController < BaseOrigamiController item_price_by_accounts = SaleItem.calculate_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, member_info,rebate_amount) + printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, member_info,rebate_amount,shop_details) end diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb index 95f63e58..bffec79d 100644 --- a/app/controllers/origami/request_bills_controller.rb +++ b/app/controllers/origami/request_bills_controller.rb @@ -20,8 +20,9 @@ class Origami::RequestBillsController < BaseOrigamiController end unique_code = "ReceiptBillPdf" + #shop detail + shop_details = Shop.find(1) # customer= Customer.where('customer_id=' +.customer_id) - customer= Customer.find(@sale_data.customer_id) # get member information member_info = Customer.get_member_account(customer) @@ -36,7 +37,7 @@ class Origami::RequestBillsController < BaseOrigamiController printer = Printer::ReceiptPrinter.new(print_settings) - printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, item_price_by_accounts,member_info) + printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, item_price_by_accounts,member_info,shop_details) # redirect_to origami_path(@sale_data.sale_id) end diff --git a/app/models/printer/receipt_printer.rb b/app/models/printer/receipt_printer.rb index 4b7287db..8e389e79 100644 --- a/app/models/printer/receipt_printer.rb +++ b/app/models/printer/receipt_printer.rb @@ -65,11 +65,11 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker end #Bill Receipt Print - def print_receipt_bill(printer_settings,sale_items,sale_data, customer_name, item_price_by_accounts, member_info = nil,rebate_amount=nil) + def print_receipt_bill(printer_settings,sale_items,sale_data, customer_name, item_price_by_accounts, member_info = nil,rebate_amount=nil,shop_details) #Use CUPS service #Generate PDF #Print - pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, member_info,rebate_amount) + pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, member_info,rebate_amount,shop_details) pdf.render_file "tmp/receipt_bill.pdf" self.print("tmp/receipt_bill.pdf") diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 4689de9d..b156e2c2 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -1,6 +1,6 @@ class ReceiptBillPdf < 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 - def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, member_info = nil,rebate_amount = nil) + def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details) self.page_width = 210 self.page_height = 2500 self.margin = 5 @@ -24,7 +24,7 @@ class ReceiptBillPdf < Prawn::Document self.header_font_size = 10 self.item_font_size = 8 - header( "Beauty In the Pot", printer_settings.name) + header( shop_details) stroke_horizontal_rule @@ -44,12 +44,15 @@ class ReceiptBillPdf < Prawn::Document footer end - def header (printer_name, name) - text "#{printer_name}", :left_margin => -10, :size => self.header_font_size,:align => :center + def header (shop_details) + move_down 7 + text "#{shop_details.name}", :left_margin => -10, :size => self.header_font_size,:align => :center move_down 5 - text "#{name}", :size => self.header_font_size,:align => :center + text "#{shop_details.address}", :size => self.item_font_size,:align => :center # move_down self.item_height move_down 5 + text "#{shop_details.phone_no}", :size => self.item_font_size,:align => :center + move_down 5 stroke_horizontal_rule end @@ -264,22 +267,23 @@ class ReceiptBillPdf < Prawn::Document end end if member_info["status"] == true + balance = 0.0 member_info["data"].each do |res| - if res["accountable_type"]== "RebateAccount" - - move_down 5 - y_position = cursor - bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do - text "Current Balance", :size => self.item_font_size,:align => :left - end - bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{ res["balance"] }" , :size => self.item_font_size,:align => :right - end + if res["accountable_type"] == "RebateAccount" || res["accountable_type"] == "RebatebonusAccount" + balance = balance + res["balance"] end end + move_down 5 + y_position = cursor + bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + text "Current Balance", :size => self.item_font_size,:align => :left + end + bounding_box([self.item_description_width,y_position], :width =>self.label_width) do + text "#{ balance }" , :size => self.item_font_size,:align => :right + end end end From feb1d662577f4bd7831a417447b07356a5ee7e8f Mon Sep 17 00:00:00 2001 From: Zin Lin Phyo Date: Mon, 26 Jun 2017 18:00:48 +0630 Subject: [PATCH 30/37] overall void --- Gemfile.lock | 2 -- app/controllers/origami/home_controller.rb | 2 +- app/views/origami/home/show.html.erb | 20 +++++++++++++++++++- config/routes.rb | 3 +++ dump.rdb | Bin 18163 -> 18262 bytes 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e4b905ea..5c0f8a10 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -122,7 +122,6 @@ GEM nokogiri (1.8.0) mini_portile2 (~> 2.2.0) pdf-core (0.7.0) - pg (0.21.0) prawn (2.2.2) pdf-core (~> 0.7.0) ttfunk (~> 1.5) @@ -261,7 +260,6 @@ DEPENDENCIES kaminari (~> 1.0.1) listen (~> 3.0.5) mysql2 (>= 0.3.18, < 0.5) - pg prawn prawn-table puma (~> 3.0) diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 3f70ad01..1b0aa491 100644 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -35,7 +35,7 @@ class Origami::HomeController < BaseOrigamiController @status_order = 'order' else sale = Sale.find(booking.sale_id) - if sale.sale_status != "completed" + if sale.sale_status != "completed" && sale.sale_status != 'void' puts "enter" @sale_array.push(sale) if @status_order == 'order' diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 73f298ec..6342aee4 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -288,7 +288,7 @@ - + <% end %> @@ -454,5 +454,23 @@ $('#edit').on('click',function(){ var sale_id = "<%= @obj_sale.sale_id rescue "" %>" window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit"; }) + + $('#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/'; + } + }) + } else { + + } + + }) diff --git a/config/routes.rb b/config/routes.rb index bf5d6483..db4acb5b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -110,6 +110,9 @@ Rails.application.routes.draw do get 'sale/:sale_id/payment/others_payment/JCB' => "jcb#index" get 'sale/:sale_id/payment/others_payment/Redeem' => "redeem_payments#index" + #---------Void --------------# + post 'sale/:sale_id/void' => 'void#overall_void' + #---------Add Customer --------------# #resources :customers get '/:sale_id/customers', to: "customers#add_customer" diff --git a/dump.rdb b/dump.rdb index 211fd505548a6a60b85596d4201ab6d1155b4f22..041df177e5969bb1b252b44f32d8d3f28339ced3 100644 GIT binary patch delta 3514 zcma)9YiyLq72PMs3HSjN2MBn)JOZ)3o|$i+3z*#n3aV5HL4DAmnzg-lRwyD5WRU4wF1%zazs8XUDIA0NK^#G!vLo)}LKc8?}UXIsv!@qFs}&lkL&mE*ZY zE;5uzjU)#n6cgEvMK@N(lbP^HW*{*V zVO&WS5oAc>Od+zl$nc8N3XX(7kWA~o=Yc2 zlc7lH^GQQpp?0V;n@bM%C32yNn@JGCY1om3V%ilNTbddSl^*X3~7aU5Aj3)#A6XTObbEmiM^wIUJ9*7MQ z#deeMtqKx8^MU8wC%tbsm=!*<<>5LYXTIWl5PSfvEFOT5SD&6-gZ?+nqMMc;S!*9^ zg+Dg=gV|&*JJ~)LyBY5{2b!i#X7#n^rHTO#!U-$s0Cna#Mdno7M)U188@mcEp45UD z=Vu#Pm;fz;s$(t*TnH(&8bM=Zy+;~j?SU;F|U22Cx33SeS>gG%TG}0DDH+7A#<@i@q_LY*nh3LS~3?( zU~L)$>7MBC&@W^DQoV24T!cx*%ee?;!VM{m>0Inae2;l%%ZsLO`%F_cmt-I<6Yd@B zQu%V7TR$`ibG8|;ya)K;lDhLsbrJjr3j_-E?cyrm6 z4K>m@<5;2ghqBpBwr?~!KAsqkp7c(nJNB6U+d|7OHttOHk0c{s&J0eVi^V-NBj&`~ z<&L ztUt8fbH*_72)v%h2APQQf|9a|J;R8UF_AC@4!>?!kC(G+zYQsqxm0-B-@vzoeb z?ylPBZLLaxgZi{W$ef_-%xL6GomEI?fgCKAgH@?;z=TWThNvsfCr#_h=gpBvueQ__ z#T;mkf;zuxzQ1;PS2dZ-G={FqOhYnZQGgIr0K+X8;FG4PfH!YU8N3PKr^;dMW}X;wYV+^>}faTK%uwHUG;()*gC(gR;JLBNnP&xRGZpf zJR5{LQJNK80z0GE(Ok?OiJrU#f)JShib|;zvJ_GnYQJG#3%q15w-j4z4=8YI0!Hw0 z@X!vJ07iiktPB4rE3a4~4CmkUvM{<8&_tGTwnpPv#$ z7mShDJSFkHQvnC(=iJ&Q2N!eIXN3(5fDp+YFtOXlCcn3MzA4~>j*!p#*W+bNlsix7 z&w_kG1_TRqHgW$0E;v|2d({WHwv(eN7gpYOa88;ZI`d0QPej|jjzEo;)g3T44$zOz z9J!Cyyi2Okiq=LF+%1eD#E3;bzRMk)S9q}oyVQ&^J2&PP5e?TsK5yNeQ;kW*YQdx3v&DFVm!&c~UEqQg{NCKH`OlfVV+g~>8H~hBVBLvJY^co)Zf#pWaHsO0R zIe<2LBawW=qJ5d%7h&bZ9{1ZrWx+eO#C2q)!W;&Kps6Dj|3K%XWwDoblEXzAb}M@g zK*3;3Vf_Q9=|%JBrYlV~Lk1Vb=Hc~+BYs9$9ZJ07t~1aaR#Z9FWlF%mN-@R(r`zs~ z-dR$=n<*$-S()^LOb8|#oqmu^+|=%@RIMBK13bqud;=7?saqSaR#hUklHgH5tM)VC z^+B}StP%jGy2`5~toaE5q>}X2mGxqQkt}7Ee$Av)%~~iUI}@;;AyALEyb0_qLQaS= z1rmJMWVXCyHV3DhmsAW;N#f|J>FM2S{@A)M?h=QwBWdC9Wh0rcY1~y1Fd=kJ;~K-P zLrhwa{R^xb>)3nIrRK)k6X>9a0~pA#jssnlbg)RQAYqy$_>$|Y(73V}1;ilPEZh_J zp8DyEtH*0f0CQ2|bE|o(X(F9Ur*f&pNb1?-AR0ig2XgkhywiLU<@2$bVb8vfwVvJ4 zgJ@M*sFMqx9|W{ejxPMI+~|dhr}Zp&e-==fu`1myoanH^3N{K9_D+1ad+5B^Io(nR zBy7uQyZPFx$RhX6!)C1akzN;2;y9}CLHU_W6}En1jT5#=^_~)v5O8G(X%5a=v7bM6 z*X&0-3O0keyP?PYA-t=*I@=}pkxW+)JxIpjmgH~>Xc(&N;AQqWd-;(|2WntSSdJ96 z2TONO$1bnEbDF=E&7_A>dSbLcnMIi))Dg}9+J`m|cf8e@Mx+ZRkB)%@WPONk=?DP2 zPuWhlx}7q~RN?({r@#4ZrxF%WN$QqoYmE+^t$^oEcYeH^uhdzO!XPR;n)_fcI|Qr_ z)m=W-ThiSPTroI(DkrpNup1!6vGO#zr~g>(udxyy_x?Y> QmhL?oSn*?M^tKJO6EWEn2z3cCB1* zUvrc86L%B*z4nKEJH;jEv(K8wFYI?6C%W!*ezac@VftAiZ+Ko&g(ZtdM@El~Rno7f zU+esS^69aO;%NR@A=#gVuamvWiDG`dSU7wjUrhFsPHvQ>lxdwJ98<1)lgCF6C;g&=nWYAX~1xfb}I2WS?6Ql2!80M-e z6j!g85^t`W0rr46q(1TBSvySMTwbpbLK44TPI#@}+>P1p|{nExIFhVUW)}JE8v|yFYyV>D7;4cl$w}s4O zL@_1-k#p((#;({@ro7+&ps!=V7b#a<&wdm@Ghai#uk=b>Xk`HJGYQYlJe4w;@?t>7 zKL+yJ*L=Mdy&bRG3Zv++sMEf^VaT3bwY9sJ3YUN>SV=`T1M`y926M-|)DGfeR25T-o3E{lxxz z$Lq^zOf@hEObOY)?A-G(x|DINdFFsqf{~ioAP)hcy%<%VIr#Q=VasA`yryCli)d)s zRo^yIA)$oo@OwjV01VOg1}Q?Gf=feAE~SS4Z)A7*0^Wz`mobWg5;X-3Qb!}*12lbl zN|(Pr{Z?de;Sk#D_V-W48+VTthrydOJq_M6T5`{>4&9p>qUtbJjn4;(P$_8LyQ?5U zOd1f(2Z2eoe`&e%F-gJ3Jk<<37h{S^!O6=`)lzRdqG~93ssdA1;J2#QrDA}EA2Qxz zsCoL#BX1_6K6a?Hkut8eB7(-`re+zW@dQCj=R76OHTsK4r27~8N=5aUN>i`#(%p<-1 zbvC`dR_)X!zjw|-y!Cn+14jY^!?LbA(saj<><62dkBwqDr~KWr6LyP+83x4s;?e?f z!#ue>v&O%Az(T!U2r&kxbSpdLGc(n`uxx8lg?fCa*lZ_z+8PWxWq;bUWhh?LC^{bj z{m$O4YV>Ld#vJ-h6c%ELg)dRK-IxcvXRKZuzx?uI0`3b+(NY`?1quS80ztHMu>t5} z(8b(+maijG3Vj@UHuFy(ZQ!u*)&Km%r9{XHf`zQNu=gQ!xoRW0bP1L?XrYRRXCe{< z8bCcL@J{wgC~(F;v3fDl8012oQ8<0zFqq%;ox#$tVqkuT^4Yrq6Ry_u(dUm*5tx{+ z*`Q*S8xRPG^9 zmK{#sO_;V@T6TRCj-*G+$0EDOzLpzs9!al5n*!^YDV>jLpr+xo^+g-jK8J2Lf+d2P zRvG9`8Ve|$Xo|I6+Ws>;xTYMgENWnD!;Nr!Tm5K+g#?CYY91K)D#QdK#5;~-Se7q3 i@Ka%Zl*m%&Tx;YHaWB3a!*PA@&dJ~1`Nz4g7yl25cAGN* From 9d76e1313a0805aaebf8649332258f8a0dfc0a1f Mon Sep 17 00:00:00 2001 From: Zin Lin Phyo Date: Mon, 26 Jun 2017 18:13:43 +0630 Subject: [PATCH 31/37] overall void update --- .idea/.generators | 8 + .idea/.rakeTasks | 7 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/sxrestaurant.iml | 236 ++++++ .idea/vcs.xml | 6 + .idea/workspace.xml | 817 +++++++++++++++++++++ app/controllers/origami/void_controller.rb | 28 + config/routes.rb | 2 +- dump.rdb | Bin 18262 -> 18261 bytes 10 files changed, 1115 insertions(+), 1 deletion(-) create mode 100644 .idea/.generators create mode 100644 .idea/.rakeTasks create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/sxrestaurant.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 app/controllers/origami/void_controller.rb diff --git a/.idea/.generators b/.idea/.generators new file mode 100644 index 00000000..16189766 --- /dev/null +++ b/.idea/.generators @@ -0,0 +1,8 @@ + + diff --git a/.idea/.rakeTasks b/.idea/.rakeTasks new file mode 100644 index 00000000..3577d8ad --- /dev/null +++ b/.idea/.rakeTasks @@ -0,0 +1,7 @@ + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..157739d4 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..21ecc838 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/sxrestaurant.iml b/.idea/sxrestaurant.iml new file mode 100644 index 00000000..586fd380 --- /dev/null +++ b/.idea/sxrestaurant.iml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..4d3242d5 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,817 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + origami + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + project + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1498458293643 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/controllers/origami/void_controller.rb b/app/controllers/origami/void_controller.rb new file mode 100644 index 00000000..bea37a21 --- /dev/null +++ b/app/controllers/origami/void_controller.rb @@ -0,0 +1,28 @@ +class Origami::VoidController < BaseOrigamiController + + def overall_void + + sale_id = params[:sale_id] + if Sale.exists?(sale_id) + sale = Sale.find_by_sale_id(sale_id) + sale.payment_status = 'void' + sale.sale_status = 'void' + sale.save + + table_avaliable = true + table = sale.bookings[0].dining_facility + table.bookings.each do |booking| + if booking.sale.sale_status == 'new' + table_avaliable = false + end + end + + if table_avaliable == true + table.status = 'available' + table.save + end + + end + end + +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3bb93268..73b361ce 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -128,7 +128,7 @@ Rails.application.routes.draw do #resources :customers get '/:sale_id/customers', to: "customers#add_customer" get '/:customer_id/get_customer' => 'home#get_customer',:as => "show_customer_details" - post '/:sale_id/update_sale' , to: "customers#update_sale_by_customer"#update customer id in sale table + post '/:sale_id/update_sale' , to: "customers#update_sale_by_customer" # update customer id in sale table end #--------- Waiter/Ordering Station ------------# diff --git a/dump.rdb b/dump.rdb index 041df177e5969bb1b252b44f32d8d3f28339ced3..acef6aa79d6c19cf0bb0d215a80225ad58500e81 100644 GIT binary patch delta 79 zcmV-V0I>hojsew<0gx~l!SYa9`UrJ%Wn?XFWo^Qs@f-mD0Q(gIlOPHgkzXDI&n7jI lfG`pfF*G?iG&eUgG&e3aIXE>qII+WvMhKKTSDj!bdc?;x9Bu#r delta 80 zcmV-W0I&bmjsez=0gx~lXYf#2`UrJ%Wn?XFWo^O`u^RyX0Q(gIlOGBfkzXDItLZC| mfG`shF*G?iG&eRjG%_wRGBYqYH#xDwi$(|>It&-MQ&#t<=^H`- From 1000968a8f8fc2464916404e72748bd1593aa4e7 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 26 Jun 2017 18:14:36 +0630 Subject: [PATCH 32/37] update --- app/controllers/transactions/credit_notes_controller.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/controllers/transactions/credit_notes_controller.rb diff --git a/app/controllers/transactions/credit_notes_controller.rb b/app/controllers/transactions/credit_notes_controller.rb new file mode 100644 index 00000000..e69de29b From cb77c771b88230f011146484f5a9363cbd1942ce Mon Sep 17 00:00:00 2001 From: Yan Date: Mon, 26 Jun 2017 18:45:20 +0630 Subject: [PATCH 33/37] oqs update --- app/controllers/oqs/home_controller.rb | 2 +- app/models/order_queue_station.rb | 5 +++-- app/models/printer/order_queue_printer.rb | 8 ++++---- app/pdf/order_item_pdf.rb | 4 ++-- app/pdf/order_summary_pdf.rb | 18 +++++++++++++----- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/app/controllers/oqs/home_controller.rb b/app/controllers/oqs/home_controller.rb index 9887df6c..692b9c4a 100644 --- a/app/controllers/oqs/home_controller.rb +++ b/app/controllers/oqs/home_controller.rb @@ -118,6 +118,6 @@ class Oqs::HomeController < BaseOqsController 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 = #{status}") - .group("odt.order_items_id") + .group("assigned_order_items.assigned_order_item_id") end end diff --git a/app/models/order_queue_station.rb b/app/models/order_queue_station.rb index 4166f7af..bac229a9 100644 --- a/app/models/order_queue_station.rb +++ b/app/models/order_queue_station.rb @@ -45,7 +45,8 @@ class OrderQueueStation < ApplicationRecord end # Auto Printing # ToDo per item per printer - if oqs.auto_print && is_auto_printed == false + if oqs.auto_print && is_auto_printed == false + puts oqs_order_items.length print_slip(oqs, order, oqs_order_items) is_auto_printed = true end @@ -59,7 +60,7 @@ class OrderQueueStation < ApplicationRecord print_settings=PrintSetting.find_by_unique_code(unique_code) order_queue_printer= Printer::OrderQueuePrinter.new(print_settings) - order_queue_printer.print_order_summary(oqs,order.order_id, print_status="") + order_queue_printer.print_order_summary(oqs,order.order_id, order_items, print_status="") AssignedOrderItem.where("order_id = '#{ order.order_id }'").find_each do |ai| # update print status for order items diff --git a/app/models/printer/order_queue_printer.rb b/app/models/printer/order_queue_printer.rb index 8535bcc2..bbeafecf 100644 --- a/app/models/printer/order_queue_printer.rb +++ b/app/models/printer/order_queue_printer.rb @@ -22,14 +22,14 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker end # Query for per order - def print_order_summary(oqs, order_id, print_status) + def print_order_summary(oqs, order_id, order_items, print_status) #Use CUPS service #Generate PDF - #Print + #Print order=print_query('order_summary', order_id) # For Print Per Item if oqs.cut_per_item - order.each do|odi| + order_items.each do|odi| filename = "tmp/order_item_#{odi.item_name}" + ".pdf" # For Item Options options = odi.options == "[]"? "" : odi.options @@ -46,7 +46,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker # For Print Order Summary else filename = "tmp/order_summary_#{ order_id }" + ".pdf" - pdf = OrderSummaryPdf.new(order, print_status) + pdf = OrderSummaryPdf.new(order, print_status, order_items) pdf.render_file filename if oqs.print_copy self.print(filename, oqs.printer_name) diff --git a/app/pdf/order_item_pdf.rb b/app/pdf/order_item_pdf.rb index 5a60b093..6d6346f9 100644 --- a/app/pdf/order_item_pdf.rb +++ b/app/pdf/order_item_pdf.rb @@ -18,8 +18,8 @@ class OrderItemPdf < Prawn::Document # font "public/fonts/#{font_name}".to_s + ".ttf".to_s # font "public/fonts/Zawgyi-One.ttf" # font "public/fonts/padauk.ttf" - self.header_font_size = 14 - self.item_font_size = 12 + self.header_font_size = 12 + self.item_font_size = 10 text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20 stroke_horizontal_rule diff --git a/app/pdf/order_summary_pdf.rb b/app/pdf/order_summary_pdf.rb index 2e9c41ec..d85a5916 100644 --- a/app/pdf/order_summary_pdf.rb +++ b/app/pdf/order_summary_pdf.rb @@ -1,6 +1,6 @@ class OrderSummaryPdf < 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 - def initialize(order, print_status) + def initialize(order, print_status, order_items = nil) self.page_width = 210 self.page_height = 1450 self.margin = 5 @@ -28,8 +28,11 @@ class OrderSummaryPdf < Prawn::Document order_info(order[0].order_id, order[0].order_by,order[0].order_at) # order items - order_items(order) - + if order_items == nil + order_items(order) + else + order_items(order_items) + end end # Write Order Information to PDF @@ -73,6 +76,7 @@ class OrderSummaryPdf < Prawn::Document #Add Order Item add_order_items(order_item) + end # Add order items under order info @@ -89,11 +93,11 @@ class OrderSummaryPdf < Prawn::Document # text_box "#{odi.qty}", :at =>[self.item_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix # } bounding_box([0,y_position], :width => self.item_width) do - text "#{odi.item_name}", :size => self.item_font_size,:align => :left, :height => self.item_height + text "#{odi.item_name}", :size => self.item_font_size,:align => :left end bounding_box([self.item_width,y_position], :width => self.qty_width) do - text "#{odi.qty}", :size => self.item_font_size,:align => :left, :height => self.item_height + text "#{odi.qty}", :size => self.item_font_size,:align => :left end move_down 5 @@ -109,6 +113,10 @@ class OrderSummaryPdf < Prawn::Document move_down 5 end + + dash(1, :space => 1, :phase => 1) + stroke_horizontal_line 0, (self.page_width - self.margin) + move_down 5 end end From 79befa4876e773dbf6862e5094b16e654424988d Mon Sep 17 00:00:00 2001 From: Phyo Date: Mon, 26 Jun 2017 18:49:41 +0630 Subject: [PATCH 34/37] rake task fix --- lib/tasks/menu_import.rake | 313 +++++++++++++++++++------------------ 1 file changed, 161 insertions(+), 152 deletions(-) diff --git a/lib/tasks/menu_import.rake b/lib/tasks/menu_import.rake index b533dbb2..8ec56ea6 100644 --- a/lib/tasks/menu_import.rake +++ b/lib/tasks/menu_import.rake @@ -10,215 +10,224 @@ menu_category1 = MenuCategory.create({menu: menu, code:"C001", name: "Soup Base" # single pot 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_item0_instance = MenuItemInstance.create([{item_instance_name:"Single Pot",item_instance_code:"II0011", menu_item: menu_category1_menu_item0, price:10.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0041", 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:"II0051", menu_item: menu_category1_menu_item0, price:15800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cooling Coconut Broth",item_instance_code:"II0071", 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:"II0081", 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:"II0061", menu_item: menu_category1_menu_item0, price:17800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Vitamin C Tomato Sweet Corn 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:"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: "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:10.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0042", 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:"II0052", 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:"II0072", 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:"II0082", 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:"II0062", 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:"II0092", menu_item: menu_category1_menu_item1, 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: "Single Pot",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:10.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beauty Collagen Broth",item_instance_code:"II0043", 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:"II0053", menu_item: menu_category1_menu_item2, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Cooling Coconut Broth",item_instance_code:"II0073", 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:"II0083", 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:"II0063", 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:"II0093", menu_item: menu_category1_menu_item2, 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:6000.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: "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:10.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:6000.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:8000.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 -menu_category2 = MenuCategory.create({menu: menu, code:"C002", name: "Assorted Platter", alt_name: "Assorted Platter", order_by: 2, created_by: "SYSTEM DEFAULT"}) +menu_category2 = MenuCategory.create({menu: menu, code:"C002", name: "Specialty Assorted Platter", alt_name: "Assorted Platter", order_by: 2, created_by: "SYSTEM DEFAULT"}) # Pork Platter menu_category1_menu_item3 = SimpleMenuItem.create({item_code:"01004", name: "Pork Platter", alt_name: "Twin Pot",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Pork Platter",item_instance_code:"II0101", menu_item: menu_category1_menu_item3, price:10000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Pork Platter",item_instance_code:"II0111", menu_item: menu_category1_menu_item3, price:10000.00, is_on_promotion:false}]) # Beef Platter menu_category1_menu_item4 = SimpleMenuItem.create({item_code:"01005", name: "Beef Platter", alt_name: "Twin Pot",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beef Platter",item_instance_code:"II0111", menu_item: menu_category1_menu_item4, price:24000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Beef Platter",item_instance_code:"II0121", menu_item: menu_category1_menu_item4, price:24000.00, is_on_promotion:false}]) # Assorted Seafood Platter menu_category1_menu_item5 = SimpleMenuItem.create({item_code:"01006", name: "Assorted Seafood Platter", alt_name: "Twin Pot",menu_category: menu_category2 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Assorted Seafood Platter",item_instance_code:"II0121", menu_item: menu_category1_menu_item5, price:66000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Assorted Seafood Platter",item_instance_code:"II0131", menu_item: menu_category1_menu_item5, price:66000.00, is_on_promotion:false}]) # Beef & Mutton menu_category3 = MenuCategory.create({menu: menu, code:"C003", name: "Beef & Mutton", alt_name: "Beef_and_mutton", order_by: 3,created_by: "SYSTEM DEFAULT"}) # Australia Angus Boneless Short Rib menu_category1_menu_item6 = SimpleMenuItem.create({item_code:"01007", name: "Australia Angus Boneless Short Rib", alt_name: "Twin Pot",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0132", menu_item: menu_category1_menu_item5, price:12500.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0131", menu_item: menu_category1_menu_item5, price:25000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0142", menu_item: menu_category1_menu_item5, price:12500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0141", menu_item: menu_category1_menu_item5, price:25000.00, is_on_promotion:false}]) # Spain Beef menu_category1_menu_item7 = SimpleMenuItem.create({item_code:"01008", name: "Spain Beef", alt_name: "Twin Pot",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0142", menu_item: menu_category1_menu_item7, price:8000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0141", menu_item: menu_category1_menu_item7, price:16000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0152", menu_item: menu_category1_menu_item7, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0151", menu_item: menu_category1_menu_item7, price:16000.00, is_on_promotion:false}]) # Sliced Beef (Thin) menu_category1_menu_item8 = SimpleMenuItem.create({item_code:"01009", name: "Sliced Beef (Thin)", alt_name: "Twin Pot",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0152", menu_item: menu_category1_menu_item7, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0151", menu_item: menu_category1_menu_item7, price:12000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0162", menu_item: menu_category1_menu_item8, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0161", menu_item: menu_category1_menu_item8, price:12000.00, is_on_promotion:false}]) # Tender Sliced Beef menu_category1_menu_item9 = SimpleMenuItem.create({item_code:"01010", name: "Tender Sliced Beef", alt_name: "Twin Pot",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0162", menu_item: menu_category1_menu_item7, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0161", menu_item: menu_category1_menu_item7, price:12000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0172", menu_item: menu_category1_menu_item9, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0171", menu_item: menu_category1_menu_item9, price:12000.00, is_on_promotion:false}]) # Beef Tripe menu_category1_menu_item10 = SimpleMenuItem.create({item_code:"01011", name: "Beef Tripe", alt_name: "Twin Pot",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0172", menu_item: menu_category1_menu_item7, price:3500.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0171", menu_item: menu_category1_menu_item7, price:7000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0182", menu_item: menu_category1_menu_item10, price:3500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0181", menu_item: menu_category1_menu_item10, price:7000.00, is_on_promotion:false}]) # Braised Cow's Stomach menu_category1_menu_item11 = SimpleMenuItem.create({item_code:"01012", name: "Braised Cow's Stomach", alt_name: "Twin Pot",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0182", menu_item: menu_category1_menu_item11, price:7000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0181", menu_item: menu_category1_menu_item11, price:14000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0192", menu_item: menu_category1_menu_item11, price:7000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0191", menu_item: menu_category1_menu_item11, price:14000.00, is_on_promotion:false}]) + # Sliced Lamb + menu_category1_menu_item11 = SimpleMenuItem.create({item_code:"01012", name: "Sliced Lamb", alt_name: "Twin Pot",menu_category: menu_category3 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0202", menu_item: menu_category1_menu_item11, price:7000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0201", menu_item: menu_category1_menu_item11, price:14000.00, is_on_promotion:false}]) + # Pork menu_category4 = MenuCategory.create({menu: menu, code:"C004", name: "Pork", alt_name: "Pork", order_by: 4,created_by: "SYSTEM DEFAULT"}) - # Sliced Lamb - menu_category1_menu_item12 = SimpleMenuItem.create({item_code:"01013", name: "Sliced Lamb", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0192", menu_item: menu_category1_menu_item12, price:6000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0191", menu_item: menu_category1_menu_item12, price:12000.00, is_on_promotion:false}]) # Sliced Tenderloin Pork menu_category1_menu_item13 = SimpleMenuItem.create({item_code:"01014", name: "Sliced Tenderloin Pork", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0202", menu_item: menu_category1_menu_item13, price:4000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0201", menu_item: menu_category1_menu_item13, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0212", menu_item: menu_category1_menu_item13, price:4000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0211", menu_item: menu_category1_menu_item13, price:8000.00, is_on_promotion:false}]) # Sliced Pork Belly menu_category1_menu_item14 = SimpleMenuItem.create({item_code:"01015", name: "Sliced Pork Belly", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0212", menu_item: menu_category1_menu_item14, price:4000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0211", menu_item: menu_category1_menu_item14, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0222", menu_item: menu_category1_menu_item14, price:4000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0221", menu_item: menu_category1_menu_item14, price:8000.00, is_on_promotion:false}]) # Sliced Pork Collar menu_category1_menu_item15 = SimpleMenuItem.create({item_code:"01016", name: "Sliced Pork Collar", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0222", menu_item: menu_category1_menu_item15, price:4000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0221", menu_item: menu_category1_menu_item15, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0232", menu_item: menu_category1_menu_item15, price:4000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0231", menu_item: menu_category1_menu_item15, price:8000.00, is_on_promotion:false}]) # Pork Jawl menu_category1_menu_item16 = SimpleMenuItem.create({item_code:"01017", name: "Pork Jawl", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0232", menu_item: menu_category1_menu_item16, price:4000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0231", menu_item: menu_category1_menu_item16, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0242", menu_item: menu_category1_menu_item16, price:4000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0241", menu_item: menu_category1_menu_item16, price:8000.00, is_on_promotion:false}]) # Tender Sliced Tenderloin Pork menu_category1_menu_item17 = SimpleMenuItem.create({item_code:"01018", name: "Tender Sliced Tenderloin Pork", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0242", menu_item: menu_category1_menu_item17, price:4000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0241", menu_item: menu_category1_menu_item17, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0252", menu_item: menu_category1_menu_item17, price:4000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0251", menu_item: menu_category1_menu_item17, price:8000.00, is_on_promotion:false}]) # Spicy Sliced Pork menu_category1_menu_item18 = SimpleMenuItem.create({item_code:"01019", name: "Spicy Sliced Pork", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0252", menu_item: menu_category1_menu_item18, price:4000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0251", menu_item: menu_category1_menu_item18, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0262", menu_item: menu_category1_menu_item18, price:4000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0261", menu_item: menu_category1_menu_item18, price:8000.00, is_on_promotion:false}]) # Pig's Tongue menu_category1_menu_item19 = SimpleMenuItem.create({item_code:"01020", name: "Pig's Tongue", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0262", menu_item: menu_category1_menu_item19, price:60000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0261", menu_item: menu_category1_menu_item19, price:12000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0272", menu_item: menu_category1_menu_item19, price:60000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0271", menu_item: menu_category1_menu_item19, price:12000.00, is_on_promotion:false}]) # Luncheon Meat menu_category1_menu_item20 = SimpleMenuItem.create({item_code:"01021", name: "Luncheon Meat", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0272", menu_item: menu_category1_menu_item20, price:2500.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0271", menu_item: menu_category1_menu_item20, price:5000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0282", menu_item: menu_category1_menu_item20, price:2500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0281", menu_item: menu_category1_menu_item20, price:5000.00, is_on_promotion:false}]) # Pig's Liver menu_category1_menu_item21 = SimpleMenuItem.create({item_code:"01022", name: "Pig's Liver", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0282", menu_item: menu_category1_menu_item21, price:2500.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0281", menu_item: menu_category1_menu_item21, price:5000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0292", menu_item: menu_category1_menu_item21, price:2500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0291", menu_item: menu_category1_menu_item21, price:5000.00, is_on_promotion:false}]) # Pig's Intestine menu_category1_menu_item22 = SimpleMenuItem.create({item_code:"01023", name: "Pig's Intestine", alt_name: "Twin Pot",menu_category: menu_category4 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0292", menu_item: menu_category1_menu_item22, price:3000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0291", menu_item: menu_category1_menu_item22, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0302", menu_item: menu_category1_menu_item22, price:3000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0301", menu_item: menu_category1_menu_item22, price:6000.00, is_on_promotion:false}]) # Chicken menu_category5 = MenuCategory.create({menu: menu, code:"C005", name: "Chicken", alt_name: "Chicken", order_by: 5, created_by: "SYSTEM DEFAULT"}) # Sliced Chicken Breast menu_category1_menu_item23 = SimpleMenuItem.create({item_code:"01024", name: "Sliced Chicken Breast", alt_name: "Twin Pot",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0302", menu_item: menu_category1_menu_item23, price:3500.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0301", menu_item: menu_category1_menu_item23, price:7000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0312", menu_item: menu_category1_menu_item23, price:3500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0311", menu_item: menu_category1_menu_item23, price:7000.00, is_on_promotion:false}]) # Sliced Chicken Thigh menu_category1_menu_item24 = SimpleMenuItem.create({item_code:"01025", name: "Sliced Chicken Thigh", alt_name: "Twin Pot",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0312", menu_item: menu_category1_menu_item24, price:3500.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0311", menu_item: menu_category1_menu_item24, price:7000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0322", menu_item: menu_category1_menu_item24, price:3500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0321", menu_item: menu_category1_menu_item24, price:7000.00, is_on_promotion:false}]) # Crunchy Gourmet Chicken Sausage menu_category1_menu_item25 = SimpleMenuItem.create({item_code:"01026", name: "Crunchy Gourmet Chicken Sausage", alt_name: "Twin Pot",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0322", menu_item: menu_category1_menu_item25, price:4000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0321", menu_item: menu_category1_menu_item25, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0332", menu_item: menu_category1_menu_item25, price:4000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0331", menu_item: menu_category1_menu_item25, price:8000.00, is_on_promotion:false}]) # Cheesy Chicken Sausage menu_category1_menu_item26 = SimpleMenuItem.create({item_code:"01027", name: "Cheesy Chicken Sausage", alt_name: "Twin Pot",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0332", menu_item: menu_category1_menu_item26, price:4800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0331", menu_item: menu_category1_menu_item26, price:9600.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0342", menu_item: menu_category1_menu_item26, price:4800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0341", menu_item: menu_category1_menu_item26, price:9600.00, is_on_promotion:false}]) # Chicken Feet Skin menu_category1_menu_item27 = SimpleMenuItem.create({item_code:"01028", name: "Chicken Feet Skin", alt_name: "Twin Pot",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0342", menu_item: menu_category1_menu_item27, price:2500.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0341", menu_item: menu_category1_menu_item27, price:5000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0352", menu_item: menu_category1_menu_item27, price:2500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0351", menu_item: menu_category1_menu_item27, price:5000.00, is_on_promotion:false}]) # Chinese Wine Kampong Chicken menu_category1_menu_item28 = SimpleMenuItem.create({item_code:"01029", name: "Chinese Wine Kampong Chicken", alt_name: "Twin Pot",menu_category: menu_category5 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0352", menu_item: menu_category1_menu_item28, price:8000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0351", menu_item: menu_category1_menu_item28, price:16000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0362", menu_item: menu_category1_menu_item28, price:8000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0361", menu_item: menu_category1_menu_item28, price:16000.00, is_on_promotion:false}]) # Handmade Balls menu_category6 = MenuCategory.create({menu: menu, code:"C006", name: "Handmade Balls", alt_name: "Soup_base", order_by: 6,created_by: "SYSTEM DEFAULT"}) # Soft Bone Pork Meatball menu_category1_menu_item29 = SimpleMenuItem.create({item_code:"01030", name: "Soft Bone Pork Meatball", alt_name: "Twin Pot",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0362", menu_item: menu_category1_menu_item29, price:3000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0361", menu_item: menu_category1_menu_item29, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0372", menu_item: menu_category1_menu_item29, price:3000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0371", menu_item: menu_category1_menu_item29, price:6000.00, is_on_promotion:false}]) # Fish Ball menu_category1_menu_item30 = SimpleMenuItem.create({item_code:"01031", name: "Fish Ball", alt_name: "Twin Pot",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0372", menu_item: menu_category1_menu_item30, price:3000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0371", menu_item: menu_category1_menu_item30, price:6000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0382", menu_item: menu_category1_menu_item30, price:3000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0381", menu_item: menu_category1_menu_item30, price:6000.00, is_on_promotion:false}]) # Beef Ball menu_category1_menu_item31 = SimpleMenuItem.create({item_code:"01032", name: "Beef Ball", alt_name: "Twin Pot",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0382", menu_item: menu_category1_menu_item31, price:3500.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0381", menu_item: menu_category1_menu_item31, price:7000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0392", menu_item: menu_category1_menu_item31, price:3500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0391", menu_item: menu_category1_menu_item31, price:7000.00, is_on_promotion:false}]) # Mushroom Ball - menu_category1_menu_item32 = SimpleMenuItem.create({item_code:"01033", name: "Mushroom Ball", alt_name: "Twin Pot",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0392", menu_item: menu_category1_menu_item32, price:3000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0391", menu_item: menu_category1_menu_item32, price:7000.00, is_on_promotion:false}]) + menu_category1_menu_item32 = SimpleMenuItem.create({item_code:"01033", name: "Mushroom Pork Ball", alt_name: "Twin Pot",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0402", menu_item: menu_category1_menu_item32, price:3000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0401", menu_item: menu_category1_menu_item32, price:7000.00, is_on_promotion:false}]) # Cuttlefish Ball menu_category1_menu_item33 = SimpleMenuItem.create({item_code:"01034", name: "Cuttlefish Ball", alt_name: "Twin Pot",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0402", menu_item: menu_category1_menu_item33, price:3000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0401", menu_item: menu_category1_menu_item33, price:7000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0412", menu_item: menu_category1_menu_item33, price:3000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0411", menu_item: menu_category1_menu_item33, price:7000.00, is_on_promotion:false}]) # Cheesy Pork Ball menu_category1_menu_item34 = SimpleMenuItem.create({item_code:"01035", name: "Cheesy Pork Ball", alt_name: "Twin Pot",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0412", menu_item: menu_category1_menu_item34, price:3500.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0411", menu_item: menu_category1_menu_item34, price:7000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0422", menu_item: menu_category1_menu_item34, price:3500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0421", menu_item: menu_category1_menu_item34, price:7000.00, is_on_promotion:false}]) # Assorted Ball Platter menu_category1_menu_item35 = SimpleMenuItem.create({item_code:"01036", name: "Assorted Ball Platter", alt_name: "Twin Pot",menu_category: menu_category6 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0421", menu_item: menu_category1_menu_item35, price:7800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0431", menu_item: menu_category1_menu_item35, price:7800.00, is_on_promotion:false}]) # Specialty Homemade Paste menu_category7 = MenuCategory.create({menu: menu, code:"C007", name: "Specialty Homemade Paste", alt_name: "Beef_and_mutton", order_by: 7,created_by: "SYSTEM DEFAULT"}) # Fish Paste menu_category1_menu_item36 = SimpleMenuItem.create({item_code:"01037", name: "Fish Paste", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0431", menu_item: menu_category1_menu_item36, price:4800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0441", menu_item: menu_category1_menu_item36, price:4800.00, is_on_promotion:false}]) # Century Egg Fish Paste menu_category1_menu_item37 = SimpleMenuItem.create({item_code:"01038", name: "Century Egg Fish Paste", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0441", menu_item: menu_category1_menu_item37, price:5800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0451", menu_item: menu_category1_menu_item37, price:5800.00, is_on_promotion:false}]) # Pork Paste menu_category1_menu_item38 = SimpleMenuItem.create({item_code:"01039", name: " Pork Paste", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0451", menu_item: menu_category1_menu_item38, price:5800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0461", menu_item: menu_category1_menu_item38, price:5800.00, is_on_promotion:false}]) # Dried Scallop Fish Paste menu_category1_menu_item39 = SimpleMenuItem.create({item_code:"01040", name: "Dried Scallop Fish Paste", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0461", menu_item: menu_category1_menu_item39, price:8800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0471", menu_item: menu_category1_menu_item39, price:8800.00, is_on_promotion:false}]) # Ebiko Prawn Paste menu_category1_menu_item40 = SimpleMenuItem.create({item_code:"01041", name: "Ebiko Prawn Paste", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0471", menu_item: menu_category1_menu_item40, price:11800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0481", menu_item: menu_category1_menu_item40, price:11800.00, is_on_promotion:false}]) # Seafood -menu_category8 = MenuCategory.create({menu: menu, code:"C008", name: "Seafood", alt_name: "Pork", order_by: 8,created_by: "SYSTEM DEFAULT"}) +menu_category8 = MenuCategory.create({menu: menu, code:"C008", name: "Seafood", alt_name: "Seafood", order_by: 8,created_by: "SYSTEM DEFAULT"}) # Promfret menu_category1_menu_item41 = SimpleMenuItem.create({item_code:"01042", name: "Promfret", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0481", menu_item: menu_category1_menu_item41, price:30.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0492", menu_item: menu_category1_menu_item41, price:30.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0491", menu_item: menu_category1_menu_item41, price:30.00, is_on_promotion:false}]) # Garoupa menu_category1_menu_item42 = SimpleMenuItem.create({item_code:"01043", name: "Garoupa", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Small",item_instance_code:"II0491", menu_item: menu_category1_menu_item42, price:13800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Medium",item_instance_code:"II0492", menu_item: menu_category1_menu_item42, price:18800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Large",item_instance_code:"II0493", menu_item: menu_category1_menu_item42, price:23900.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Small",item_instance_code:"II0501", menu_item: menu_category1_menu_item42, price:13800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Medium",item_instance_code:"II0502", menu_item: menu_category1_menu_item42, price:18800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Large",item_instance_code:"II0503", menu_item: menu_category1_menu_item42, price:23900.00, is_on_promotion:false}]) # Sliced Fish menu_category1_menu_item43 = SimpleMenuItem.create({item_code:"01044", name: "Sliced Fish", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0502", menu_item: menu_category1_menu_item43, price:4800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0501", menu_item: menu_category1_menu_item43, price:9600.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0512", menu_item: menu_category1_menu_item43, price:4800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0511", menu_item: menu_category1_menu_item43, price:9600.00, is_on_promotion:false}]) # Fresh Sea Prawns menu_category1_menu_item44 = SimpleMenuItem.create({item_code:"01045", name: "Fresh Sea Prawns", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0512", menu_item: menu_category1_menu_item44, price:9800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0511", menu_item: menu_category1_menu_item44, price:19600.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0522", menu_item: menu_category1_menu_item44, price:9800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0521", menu_item: menu_category1_menu_item44, price:19600.00, is_on_promotion:false}]) # Drunken Prawns menu_category1_menu_item45 = SimpleMenuItem.create({item_code:"01046", name: "Drunken Prawns", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0522", menu_item: menu_category1_menu_item45, price:11000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0521", menu_item: menu_category1_menu_item45, price:22000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0532", menu_item: menu_category1_menu_item45, price:11000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0531", menu_item: menu_category1_menu_item45, price:22000.00, is_on_promotion:false}]) # Fish Maw menu_category1_menu_item46 = SimpleMenuItem.create({item_code:"01047", name: "Fish Maw", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0532", menu_item: menu_category1_menu_item46, price:11000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0531", menu_item: menu_category1_menu_item46, price:22000.00, is_on_promotion:false}]) - # Fresh Cittlefish - menu_category1_menu_item47 = SimpleMenuItem.create({item_code:"01048", name: "Fresh Cittlefish", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0542", menu_item: menu_category1_menu_item47, price:4700.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0541", menu_item: menu_category1_menu_item47, price:9400.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0542", menu_item: menu_category1_menu_item46, price:11000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0541", menu_item: menu_category1_menu_item46, price:22000.00, is_on_promotion:false}]) # Sea Cucumber menu_category1_menu_item48 = SimpleMenuItem.create({item_code:"01049", name: "Sea Cucumber", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0552", menu_item: menu_category1_menu_item48, price:28800.00, is_on_promotion:false}]) @@ -232,7 +241,7 @@ menu_category8 = MenuCategory.create({menu: menu, code:"C008", name: "Seafood", menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0572", menu_item: menu_category1_menu_item50, price:4400.00, is_on_promotion:false}]) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0571", menu_item: menu_category1_menu_item50, price:8800.00, is_on_promotion:false}]) # Fish Head - menu_category1_menu_item51 = SimpleMenuItem.create({item_code:"01052", name: "Fish Head", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_category1_menu_item51 = SimpleMenuItem.create({item_code:"01052", name: "Fresh Fish Head", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0582", menu_item: menu_category1_menu_item51, price:2800.00, is_on_promotion:false}]) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0581", menu_item: menu_category1_menu_item51, price:5600.00, is_on_promotion:false}]) # 10-Head Abalone @@ -249,15 +258,15 @@ menu_category8 = MenuCategory.create({menu: menu, code:"C008", name: "Seafood", menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0611", menu_item: menu_category1_menu_item54, price:38000.00, is_on_promotion:false}]) # Baby Octopus menu_category1_menu_item55 = SimpleMenuItem.create({item_code:"01056", name: "Baby Octopus", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0622", menu_item: menu_category1_menu_item55, price:2900.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0621", menu_item: menu_category1_menu_item55, price:58000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0622", menu_item: menu_category1_menu_item55, price:3000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0621", menu_item: menu_category1_menu_item55, price:6000.00, is_on_promotion:false}]) # Fresh Cuttlefish menu_category1_menu_item56 = SimpleMenuItem.create({item_code:"01057", name: "Fresh Cuttlefish", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0632", menu_item: menu_category1_menu_item56, price:10.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0631", menu_item: menu_category1_menu_item56, price:10.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0632", menu_item: menu_category1_menu_item56, price:4700.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0631", menu_item: menu_category1_menu_item56, price:9400.00, is_on_promotion:false}]) # Squid Rings menu_category1_menu_item57 = SimpleMenuItem.create({item_code:"01058", name: "Squid Rings", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0042", menu_item: menu_category1_menu_item57, price:3400.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0642", menu_item: menu_category1_menu_item57, price:3400.00, is_on_promotion:false}]) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0641", menu_item: menu_category1_menu_item57, price:6800.00, is_on_promotion:false}]) # Green Mussels menu_category1_menu_item58 = SimpleMenuItem.create({item_code:"01059", name: "Green Mussels", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) @@ -265,16 +274,16 @@ menu_category8 = MenuCategory.create({menu: menu, code:"C008", name: "Seafood", menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0651", menu_item: menu_category1_menu_item58, price:13000.00, is_on_promotion:false}]) # Live Crab menu_category1_menu_item59 = SimpleMenuItem.create({item_code:"01060", name: "Live Crab", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0661", menu_item: menu_category1_menu_item59, price:60.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0661", menu_item: menu_category1_menu_item59, price:10.00, is_on_promotion:false}]) # Fresh Flower Crabs menu_category1_menu_item60 = SimpleMenuItem.create({item_code:"01061", name: "Fresh Flower Crabs", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0671", menu_item: menu_category1_menu_item60, price:60.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0671", menu_item: menu_category1_menu_item60, price:10.00, is_on_promotion:false}]) # Live Lobster menu_category1_menu_item61 = SimpleMenuItem.create({item_code:"01062", name: "Live Lobster", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0681", menu_item: menu_category1_menu_item61, price:150.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0681", menu_item: menu_category1_menu_item61, price:10.00, is_on_promotion:false}]) # Live Mantis menu_category1_menu_item62 = SimpleMenuItem.create({item_code:"01063", name: "Live Mantis", alt_name: "Twin Pot",menu_category: menu_category7 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0691", menu_item: menu_category1_menu_item62, price:150.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:" ",item_instance_code:"II0691", menu_item: menu_category1_menu_item62, price:10.00, is_on_promotion:false}]) # Dumpling menu_category9 = MenuCategory.create({menu: menu, code:"C009", name: "Dumpling", alt_name: "Chicken", order_by: 9, created_by: "SYSTEM DEFAULT"}) # Pork and Chives Dumpling @@ -295,12 +304,12 @@ menu_category9 = MenuCategory.create({menu: menu, code:"C009", name: "Dumpling", menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0731", menu_item: menu_category1_menu_item66, price:5000.00, is_on_promotion:false}]) # Assorted Dumpling Platter menu_category1_menu_item67 = SimpleMenuItem.create({item_code:"01068", name: "Assorted Dumpling Platter", alt_name: "Twin Pot",menu_category: menu_category9 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0741", menu_item: menu_category1_menu_item67, price:7800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0741", menu_item: menu_category1_menu_item67, price:7800.00, is_on_promotion:false}]) # Tofu & Beancurd menu_category10 = MenuCategory.create({menu: menu, code:"C0010", name: "Tofu & Beancurd", alt_name: "Soup_base", order_by: 10,created_by: "SYSTEM DEFAULT"}) # Signature Homemade Fish Tofu menu_category1_menu_item68 = SimpleMenuItem.create({item_code:"01069", name: "Signature Homemade Fish Tofu ", alt_name: "Twin Pot",menu_category: menu_category10 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0751", menu_item: menu_category1_menu_item68, price:1500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0751", menu_item: menu_category1_menu_item68, price:1500.00, is_on_promotion:false}]) # SilkenTofu menu_category1_menu_item69 = SimpleMenuItem.create({item_code:"01070", name: "SilkenTofu", alt_name: "Twin Pot",menu_category: menu_category10 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0762", menu_item: menu_category1_menu_item69, price:1000.00, is_on_promotion:false}]) @@ -337,7 +346,7 @@ menu_category12 = MenuCategory.create({menu: menu, code:"C0012", name: "Mushroom menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0831", menu_item: menu_category1_menu_item76, price:4600.00, is_on_promotion:false}]) # Enoki Mushroom menu_category1_menu_item77 = SimpleMenuItem.create({item_code:"01078", name: "Enoki Mushroom", alt_name: "Twin Pot",menu_category: menu_category12 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0824", menu_item: menu_category1_menu_item77, price:2300.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0842", menu_item: menu_category1_menu_item77, price:2300.00, is_on_promotion:false}]) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0841", menu_item: menu_category1_menu_item77, price:4600.00, is_on_promotion:false}]) # Fresh Mushroom menu_category1_menu_item78 = SimpleMenuItem.create({item_code:"01079", name: "Fresh Mushroom", alt_name: "Twin Pot",menu_category: menu_category12 , min_selectable_item: 1, max_selectable_item:1, account: food }) @@ -353,7 +362,7 @@ menu_category12 = MenuCategory.create({menu: menu, code:"C0012", name: "Mushroom menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0871", menu_item: menu_category1_menu_item80, price:3600.00, is_on_promotion:false}]) # Assorted Mushroom Platter menu_category1_menu_item81 = SimpleMenuItem.create({item_code:"01082", name: "Assorted Mushroom Platter", alt_name: "Twin Pot",menu_category: menu_category12 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0881", menu_item: menu_category1_menu_item81, price:10000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0881", menu_item: menu_category1_menu_item81, price:10000.00, is_on_promotion:false}]) # Vegetables menu_category13 = MenuCategory.create({menu: menu, code:"C0012", name: "Vegetables", alt_name: "Beef_and_mutton", order_by: 12,created_by: "SYSTEM DEFAULT"}) # Baby Chinese Spinach @@ -381,7 +390,7 @@ menu_category13 = MenuCategory.create({menu: menu, code:"C0012", name: "Vegetabl menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0942", menu_item: menu_category1_menu_item87, price:1800.00, is_on_promotion:false}]) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0941", menu_item: menu_category1_menu_item87, price:3600.00, is_on_promotion:false}]) # Sliced Potato - menu_category1_menu_item88 = SimpleMenuItem.create({item_code:"01089", name: "Sliced Potato ", alt_name: "Twin Pot",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_category1_menu_item88 = SimpleMenuItem.create({item_code:"01089", name: "Sliced Potato ", alt_name: "Twin Pot",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0952", menu_item: menu_category1_menu_item88, price:1300.00, is_on_promotion:false}]) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0951", menu_item: menu_category1_menu_item88, price:2600.00, is_on_promotion:false}]) # Sliced Winter Melon @@ -389,7 +398,7 @@ menu_category13 = MenuCategory.create({menu: menu, code:"C0012", name: "Vegetabl menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0962", menu_item: menu_category1_menu_item89, price:1200.00, is_on_promotion:false}]) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0961", menu_item: menu_category1_menu_item89, price:2400.00, is_on_promotion:false}]) # Fried Yam - menu_category1_menu_item90 = SimpleMenuItem.create({item_code:"01091", name: "Fried Yam ", alt_name: "Twin Pot",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_category1_menu_item90 = SimpleMenuItem.create({item_code:"01091", name: "Golden Taro", alt_name: "Twin Pot",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II0972", menu_item: menu_category1_menu_item90, price:1800.00, is_on_promotion:false}]) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II0971", menu_item: menu_category1_menu_item90, price:3600.00, is_on_promotion:false}]) # Pearl Sweet Corn @@ -452,32 +461,32 @@ menu_category13 = MenuCategory.create({menu: menu, code:"C0012", name: "Vegetabl menu_category1_menu_item105 = SimpleMenuItem.create({item_code:"01106", name: "Kangkung", alt_name: "Twin Pot",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1122", menu_item: menu_category1_menu_item105, price:1200.00, is_on_promotion:false}]) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1121", menu_item: menu_category1_menu_item105, price:2400.00, is_on_promotion:false}]) +# Bamboo Shoot + menu_category1_menu_item105 = SimpleMenuItem.create({item_code:"01106", name: "Kangkung", alt_name: "Twin Pot",menu_category: menu_category13 , min_selectable_item: 1, max_selectable_item:1, account: food }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1132", menu_item: menu_category1_menu_item105, price:1200.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1131", menu_item: menu_category1_menu_item105, price:2400.00, is_on_promotion:false}]) # Others menu_category14 = MenuCategory.create({menu: menu, code:"C0013", name: "Others", alt_name: "Pork", order_by: 13,created_by: "SYSTEM DEFAULT"}) # Quail’s Egg menu_category1_menu_item106 = SimpleMenuItem.create({item_code:"01107", name: "Quail’s Egg", alt_name: "Twin Pot",menu_category: menu_category14 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1132", menu_item: menu_category1_menu_item106, price:1500.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1131", menu_item: menu_category1_menu_item106, price:3000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1142", menu_item: menu_category1_menu_item106, price:1500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1141", menu_item: menu_category1_menu_item106, price:3000.00, is_on_promotion:false}]) # Sliced Kelp menu_category1_menu_item107 = SimpleMenuItem.create({item_code:"01108", name: "Sliced Kelp", alt_name: "Twin Pot",menu_category: menu_category14 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1142", menu_item: menu_category1_menu_item107, price:1800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1141", menu_item: menu_category1_menu_item107, price:3600.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1152", menu_item: menu_category1_menu_item107, price:1800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1151", menu_item: menu_category1_menu_item107, price:3600.00, is_on_promotion:false}]) # Crystal Vermicelli menu_category1_menu_item108 = SimpleMenuItem.create({item_code:"01109", name: "Crystal Vermicelli", alt_name: "Twin Pot",menu_category: menu_category14 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1152", menu_item: menu_category1_menu_item108, price:1800.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1151", menu_item: menu_category1_menu_item108, price:3600.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1162", menu_item: menu_category1_menu_item108, price:1800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1161", menu_item: menu_category1_menu_item108, price:3600.00, is_on_promotion:false}]) # Duck Blood menu_category1_menu_item109 = SimpleMenuItem.create({item_code:"01110", name: "Duck Blood", alt_name: "Twin Pot",menu_category: menu_category14 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1162", menu_item: menu_category1_menu_item109, price:1200.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1161", menu_item: menu_category1_menu_item109, price:2400.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1172", menu_item: menu_category1_menu_item109, price:1200.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1171", menu_item: menu_category1_menu_item109, price:2400.00, is_on_promotion:false}]) # HK Fried Fish Skin menu_category1_menu_item110 = SimpleMenuItem.create({item_code:"01111", name: "HK Fried Fish Skin", alt_name: "Twin Pot",menu_category: menu_category14 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1172", menu_item: menu_category1_menu_item110, price:7000.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1171", menu_item: menu_category1_menu_item110, price:14000.00, is_on_promotion:false}]) -# Bamboo Shoot - menu_category1_menu_item111 = SimpleMenuItem.create({item_code:"01112", name: "Bamboo Shoot", alt_name: "Twin Pot",menu_category: menu_category14 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1182", menu_item: menu_category1_menu_item111, price:2300.00, is_on_promotion:false}]) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1181", menu_item: menu_category1_menu_item111, price:4600.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1182", menu_item: menu_category1_menu_item110, price:7000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1181", menu_item: menu_category1_menu_item110, price:14000.00, is_on_promotion:false}]) # Fried Dough Sticks menu_category1_menu_item112 = SimpleMenuItem.create({item_code:"01113", name: "Fried Dough Sticks", alt_name: "Twin Pot",menu_category: menu_category14 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1192", menu_item: menu_category1_menu_item112, price:1000.00, is_on_promotion:false}]) @@ -498,59 +507,59 @@ menu_category15 = MenuCategory.create({menu: menu, code:"C0014", name: "Noodles" menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1221", menu_item: menu_category1_menu_item115, price:3800.00, is_on_promotion:false}]) # La Mian menu_category1_menu_item116 = SimpleMenuItem.create({item_code:"01117", name: "La Mian", alt_name: "Twin Pot",menu_category: menu_category15 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1231", menu_item: menu_category1_menu_item116, price:1800.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1231", menu_item: menu_category1_menu_item116, price:1800.00, is_on_promotion:false}]) # Glass Noodle menu_category1_menu_item117 = SimpleMenuItem.create({item_code:"01118", name: "Glass Noodle ", alt_name: "Twin Pot",menu_category: menu_category15 , min_selectable_item: 1, max_selectable_item:1, account: food }) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1242", menu_item: menu_category1_menu_item117, price:1200.00, is_on_promotion:false}]) menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Full Potion",item_instance_code:"II1241", menu_item: menu_category1_menu_item117, price:2400.00, is_on_promotion:false}]) # Rice menu_category1_menu_item118 = SimpleMenuItem.create({item_code:"01119", name: "Rice", alt_name: "Twin Pot",menu_category: menu_category15 , min_selectable_item: 1, max_selectable_item:1, account: food }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1251", menu_item: menu_category1_menu_item118, price:1000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1251", menu_item: menu_category1_menu_item118, price:1000.00, is_on_promotion:false}]) # Drinks menu_category16 = MenuCategory.create({menu: menu, code:"C0015", name: "Drinks", alt_name: "Soup_base", order_by: 15,created_by: "SYSTEM DEFAULT"}) # Hot Homemade Fruit Tea menu_category1_menu_item119 = SimpleMenuItem.create({item_code:"01120", name: "Hot Homemade Fruit Tea", alt_name: "Twin Pot",menu_category: menu_category16 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1261", menu_item: menu_category1_menu_item119, price:1500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1261", menu_item: menu_category1_menu_item119, price:1500.00, is_on_promotion:false}]) # Chinese Tea menu_category1_menu_item120 = SimpleMenuItem.create({item_code:"01121", name: "Chinese Tea", alt_name: "Twin Pot",menu_category: menu_category16 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1271", menu_item: menu_category1_menu_item120, price:1500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1271", menu_item: menu_category1_menu_item120, price:1500.00, is_on_promotion:false}]) # Juice menu_category17 = MenuCategory.create({menu: menu, code:"C0016", name: "Juice", alt_name: "Beef_and_mutton", order_by: 16,created_by: "SYSTEM DEFAULT"}) # Orange Juice menu_category1_menu_item121 = SimpleMenuItem.create({item_code:"01122", name: "Orange Juice", alt_name: "Twin Pot",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1281", menu_item: menu_category1_menu_item121, price:2000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1281", menu_item: menu_category1_menu_item121, price:2000.00, is_on_promotion:false}]) # Watermelon Juice menu_category1_menu_item122 = SimpleMenuItem.create({item_code:"01123", name: "Watermelon Juice ", alt_name: "Twin Pot",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1291", menu_item: menu_category1_menu_item122, price:2000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1291", menu_item: menu_category1_menu_item122, price:2000.00, is_on_promotion:false}]) # Lime Juice menu_category1_menu_item123 = SimpleMenuItem.create({item_code:"01124", name: "Lime Juice", alt_name: "Twin Pot",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1301", menu_item: menu_category1_menu_item123, price:2000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1301", menu_item: menu_category1_menu_item123, price:2000.00, is_on_promotion:false}]) # Sour Plum Juice - menu_category1_menu_item124 = SimpleMenuItem.create({item_code:"01125", name: "Sour Plum Juice ", alt_name: "Twin Pot",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1311", menu_item: menu_category1_menu_item124, price:2000.00, is_on_promotion:false}]) + menu_category1_menu_item124 = SimpleMenuItem.create({item_code:"01125", name: "Sour Plum Juice ", alt_name: "Twin Pot",menu_category: menu_category17 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1311", menu_item: menu_category1_menu_item124, price:2000.00, is_on_promotion:false}]) # Canned Drinks menu_category18 = MenuCategory.create({menu: menu, code:"C0017", name: "Canned Drinks", alt_name: "Pork", order_by: 17,created_by: "SYSTEM DEFAULT"}) # Coke menu_category1_menu_item125 = SimpleMenuItem.create({item_code:"01126", name: "Coke ", alt_name: "Twin Pot",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1321", menu_item: menu_category1_menu_item125, price:1000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1321", menu_item: menu_category1_menu_item125, price:1000.00, is_on_promotion:false}]) # Coke Light menu_category1_menu_item126 = SimpleMenuItem.create({item_code:"01127", name: "Coke Light ", alt_name: "Twin Pot",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1331", menu_item: menu_category1_menu_item126, price:1000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1331", menu_item: menu_category1_menu_item126, price:1000.00, is_on_promotion:false}]) # Sprite menu_category1_menu_item127 = SimpleMenuItem.create({item_code:"01128", name: "Sprite ", alt_name: "Twin Pot",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1341", menu_item: menu_category1_menu_item127, price:1000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1341", menu_item: menu_category1_menu_item127, price:1000.00, is_on_promotion:false}]) # Red Bull menu_category1_menu_item128 = SimpleMenuItem.create({item_code:"01129", name: "Red Bull ", alt_name: "Twin Pot",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1351", menu_item: menu_category1_menu_item128, price:1000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1351", menu_item: menu_category1_menu_item128, price:1000.00, is_on_promotion:false}]) # 100 Plus menu_category1_menu_item129 = SimpleMenuItem.create({item_code:"01130", name: "100 Plus ", alt_name: "Twin Pot",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1361", menu_item: menu_category1_menu_item129, price:1000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1361", menu_item: menu_category1_menu_item129, price:1000.00, is_on_promotion:false}]) # POP Soda menu_category1_menu_item130 = SimpleMenuItem.create({item_code:"01131", name: "POP Soda ", alt_name: "Twin Pot",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1371", menu_item: menu_category1_menu_item130, price:1000.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1371", menu_item: menu_category1_menu_item130, price:1000.00, is_on_promotion:false}]) # Mineral Water menu_category1_menu_item131 = SimpleMenuItem.create({item_code:"01132", name: "Mineral Water ", alt_name: "Twin Pot",menu_category: menu_category18 , min_selectable_item: 1, max_selectable_item:1, account: beverage }) - menu_item0_instance = MenuItemInstance.create([{item_instance_name:"Half Potion",item_instance_code:"II1381", menu_item: menu_category1_menu_item131, price:500.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II1381", menu_item: menu_category1_menu_item131, price:500.00, is_on_promotion:false}]) # Beer menu_category19 = MenuCategory.create({menu: menu, code:"C0018", name: "Beer", alt_name: "Chicken", order_by: 18, created_by: "SYSTEM DEFAULT"}) # Myanmar Beer From 376af85c64b4360f1941981b481a3121bf7e422b Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 26 Jun 2017 19:02:36 +0630 Subject: [PATCH 35/37] update credit --- .../transactions/credit_notes_controller.rb | 18 +++++ app/models/sale.rb | 2 +- app/views/layouts/_header.html.erb | 1 + .../transactions/credit_notes/index.html.erb | 70 +++++++++++++++++++ config/routes.rb | 1 + 5 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 app/views/transactions/credit_notes/index.html.erb diff --git a/app/controllers/transactions/credit_notes_controller.rb b/app/controllers/transactions/credit_notes_controller.rb index e69de29b..0f370c96 100644 --- a/app/controllers/transactions/credit_notes_controller.rb +++ b/app/controllers/transactions/credit_notes_controller.rb @@ -0,0 +1,18 @@ +class Transactions::CreditNotesController < ApplicationController + before_action :set_transactions_sale, only: [:show, :edit, :update, :destroy] + + # GET /transactions/sales + # GET /transactions/sales.json + def index + + @sales = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING) + + + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @sales } + end + + end + end \ No newline at end of file diff --git a/app/models/sale.rb b/app/models/sale.rb index 6b5efbb3..8f7f17d8 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -22,7 +22,7 @@ class Sale < ApplicationRecord "monthly" => 1, "yearly" => 2 } - + SALE_STATUS_OUTSTANDING = "outstanding" SALE_STATUS_COMPLETED = "completed" def generate_invoice_from_booking(booking_id, requested_by) diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 5505bad7..05b74b7a 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -33,6 +33,7 @@