From 71636b36db6bb444f230635851f63155d5633f07 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 30 Jun 2017 19:05:13 +0630 Subject: [PATCH 01/10] add Re-compute all amoute for sale --- .../origami/discounts_controller.rb | 14 +++-- .../origami/other_charges_controller.rb | 18 +++--- app/controllers/origami/sales_controller.rb | 3 + app/models/sale.rb | 62 +++++++++++++++++++ app/models/sale_payment.rb | 8 +++ 5 files changed, 93 insertions(+), 12 deletions(-) diff --git a/app/controllers/origami/discounts_controller.rb b/app/controllers/origami/discounts_controller.rb index 6c76c27a..02a85f91 100644 --- a/app/controllers/origami/discounts_controller.rb +++ b/app/controllers/origami/discounts_controller.rb @@ -22,10 +22,10 @@ class Origami::DiscountsController < BaseOrigamiController sale = Sale.find(sale_id) table_id = sale.bookings[0].dining_facility_id table_type = DiningFacility.find(table_id).type - sale.total_discount = overall_discount.to_f - sale.total_amount = sub_total.to_f - sale.grand_total = (sub_total.to_f - overall_discount.to_f) + sale.total_tax; - sale.save + # sale.total_discount = overall_discount.to_f + # sale.total_amount = sub_total.to_f + # sale.grand_total = (sub_total.to_f - overall_discount.to_f) + sale.total_tax; + # sale.save if discount_items.length > 0 #save sale item for discount discount_items.each do |di| @@ -35,6 +35,7 @@ class Origami::DiscountsController < BaseOrigamiController sale_item.sale_id = sale_id sale_item.product_code = origin_sale_item != nil ? origin_sale_item.product_code : sale_id sale_item.product_name = di["name"] + sale_item.product_alt_name = "" sale_item.remark = "Discount" sale_item.qty = 1 @@ -45,7 +46,10 @@ class Origami::DiscountsController < BaseOrigamiController sale_item.price = di["price"] sale_item.save end - end + end + + # Re-calc All Amount in Sale + sale.compute_by_sale_items(sale_id, sale.sale_items, overall_discount.to_f) end dining = {:table_id => table_id, :table_type => table_type } diff --git a/app/controllers/origami/other_charges_controller.rb b/app/controllers/origami/other_charges_controller.rb index 22a4fb2c..a23ebd16 100644 --- a/app/controllers/origami/other_charges_controller.rb +++ b/app/controllers/origami/other_charges_controller.rb @@ -16,10 +16,11 @@ class Origami::OtherChargesController < BaseOrigamiController if Sale.exists?(sale_id) sale = Sale.find(sale_id) table_id = sale.bookings[0].dining_facility_id - table_type = DiningFacility.find(table_id).type - sale.total_amount = sub_total.to_f - sale.grand_total = sub_total.to_f + sale.total_tax; - sale.save + table_type = DiningFacility.find(table_id).type + + # sale.total_amount = sub_total.to_f + # sale.grand_total = sub_total.to_f + sale.total_tax; + # sale.save if other_charges_items.length > 0 #save sale item for discount other_charges_items.each do |di| @@ -34,14 +35,17 @@ class Origami::OtherChargesController < BaseOrigamiController sale_item.qty = 1 sale_item.unit_price = di["price"] - sale_item.taxable_price = di["price"] + sale_item.taxable_price = 0 sale_item.is_taxable = 0 sale_item.price = di["price"] sale_item.save end - end - end + end + + # Re-calc All Amount in Sale + sale.compute_by_sale_items(sale_id, sale.sale_items, sale.total_discount) + end dining = {:table_id => table_id, :table_type => table_type } render :json => dining.to_json diff --git a/app/controllers/origami/sales_controller.rb b/app/controllers/origami/sales_controller.rb index e272c1ee..c397da0f 100644 --- a/app/controllers/origami/sales_controller.rb +++ b/app/controllers/origami/sales_controller.rb @@ -26,6 +26,9 @@ class Origami::SalesController < BaseOrigamiController order.order_items.each do |orer_item| saleobj.add_item (orer_item) end + + # Re-compute for add + saleobj.compute saleobj.save order.save booking.save diff --git a/app/models/sale.rb b/app/models/sale.rb index 6ab83279..0df2d81b 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -41,8 +41,10 @@ class Sale < ApplicationRecord end booking.sale_id = sale_id end + order = booking.booking_orders.take.order link_order_sale(order.id) + return status, sale_id end end @@ -207,6 +209,33 @@ class Sale < ApplicationRecord end + #compute - invoice total + def compute_by_sale_items(sale_id, sale_itemss, total_discount) + sale = Sale.find(sale_id) + sales_items = sale_itemss + + #Computation Fields + subtotal_price = 0 + total_taxable = 0 + rounding_adjustment = 0 + + sales_items.each do |item| + #compute each item and added to total + subtotal_price = subtotal_price + item.price + total_taxable = total_taxable + (item.taxable_price * item.qty) + end + + compute_tax(sale, total_taxable) + sale.total_amount = subtotal_price + sale.total_discount = total_discount + sale.grand_total = (sale.total_amount - sale.total_discount) + sale.total_tax + #compute rounding adjustment + # adjust_rounding + + sale.save! + + end + def compute_without_void sales_items = self.sale_items @@ -232,6 +261,39 @@ class Sale < ApplicationRecord self.save! end + + # Tax Re-Calculte + def compute_tax(sale, total_taxable) + #if tax is not apply create new record + SaleTax.where("sale_id='#{sale.sale_id}'").find_each do |existing_tax| + #delete existing and create new + existing_tax.delete + end + + total_tax_amount = 0 + #tax_profile - list by order_by + tax_profiles = TaxProfile.all.order("order_by asc") + + # #Creat new tax records + tax_profiles.each do |tax| + sale_tax = SaleTax.new(:sale => sale) + sale_tax.tax_name = tax.name + sale_tax.tax_rate = tax.rate + #include or execulive + # sale_tax.tax_payable_amount = total_taxable * tax.rate + sale_tax.tax_payable_amount = total_taxable * tax.rate / 100 + #new taxable amount + total_taxable = total_taxable + sale_tax.tax_payable_amount + + sale_tax.inclusive = tax.inclusive + sale_tax.save + + total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount + end + + sale.total_tax = total_tax_amount + end + # Tax Calculate def apply_tax(total_taxable) #if tax is not apply create new record diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index c78b6cd8..11b201d2 100644 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -54,6 +54,14 @@ class SalePayment < ApplicationRecord 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) + # update complete order items in oqs + SaleOrder.where("sale_id = '#{ invoice.sale_id }'").find_each do |sodr| + AssignedOrderItem.where("order_id = '#{ sodr.order_id }'").find_each do |aoi| + aoi.delivery_status = 1 + aoi.save + end + end + return true, self.save else #record an payment in sale-audit From a851f6de70ffb26221a7c5ac3b2320cdd1752d57 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 30 Jun 2017 19:27:46 +0630 Subject: [PATCH 02/10] update taxobj in sale --- app/models/sale.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index 5a8f5359..55e53d39 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -598,9 +598,9 @@ end def get_commerical_tax tax = 0.0 - self.sale_taxes.each do |tax| - if tax.tax_name == "Commerical Tax" - tax += tax.tax_payable_amount + self.sale_taxes.each do |taxobj| + if taxobj.tax_name == "Commerical Tax" + tax += taxobj.tax_payable_amount end end end From 3681a9558bdd83ce0ed53059b4f9321000163a51 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 30 Jun 2017 19:35:00 +0630 Subject: [PATCH 03/10] sale return --- app/models/sale.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/sale.rb b/app/models/sale.rb index 55e53d39..2578221d 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -603,6 +603,7 @@ end tax += taxobj.tax_payable_amount end end + return tax end private From 219944abbdc533708eedaf3d01c08e7d610bad0c Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 30 Jun 2017 20:07:49 +0630 Subject: [PATCH 04/10] update migrate --- db/migrate/20170403160742_create_sales.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20170403160742_create_sales.rb b/db/migrate/20170403160742_create_sales.rb index ae806472..9deeb9b8 100644 --- a/db/migrate/20170403160742_create_sales.rb +++ b/db/migrate/20170403160742_create_sales.rb @@ -20,7 +20,7 @@ class CreateSales < ActiveRecord::Migration[5.1] t.decimal :rounding_adjustment, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :amount_received, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :amount_changed, :precision => 10, :scale => 2, :null => false, :default => 0.00 - t.integer :shift_sale_id, :null => false + t.integer :shift_sale_id t.timestamps end end From c589f11758779cd6f3ce54829d5f510840179a0c Mon Sep 17 00:00:00 2001 From: Nweni Date: Sat, 1 Jul 2017 09:46:14 +0630 Subject: [PATCH 05/10] shift sale --- app/controllers/origami/shifts_controller.rb | 6 +++--- app/models/sale.rb | 11 ++++++----- app/models/sale_payment.rb | 4 +++- app/models/shift_sale.rb | 4 ++-- app/views/origami/shifts/new.html.erb | 19 ++++++++++++++----- db/migrate/20170403160742_create_sales.rb | 2 +- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/app/controllers/origami/shifts_controller.rb b/app/controllers/origami/shifts_controller.rb index 3329aa0b..35af84b6 100644 --- a/app/controllers/origami/shifts_controller.rb +++ b/app/controllers/origami/shifts_controller.rb @@ -4,7 +4,6 @@ class Origami::ShiftsController < BaseOrigamiController end def show - puts current_user.id @shift = ShiftSale.current_open_shift(current_user.id) end @@ -15,8 +14,9 @@ class Origami::ShiftsController < BaseOrigamiController def create opening_balance = params[:opening_balance] + cashier_terminal = params[:cashier_terminal] @shift = ShiftSale.new - @shift.create(opening_balance,current_user) + @shift.create(opening_balance,cashier_terminal, current_user) end def update_shift @@ -30,7 +30,7 @@ class Origami::ShiftsController < BaseOrigamiController end end - def edit end + end diff --git a/app/models/sale.rb b/app/models/sale.rb index 693f6874..1df94034 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -345,8 +345,8 @@ class Sale < ApplicationRecord else ## up to 100 value = 100 - get_last_no.to_f - num += value - puts 'up to 100' + num += value + puts 'up to 100' end end end @@ -479,11 +479,12 @@ end def get_commerical_tax tax = 0.0 - self.sale_taxes.each do |tax| - if tax.tax_name == "Commerical Tax" - tax += tax.tax_payable_amount + self.sale_taxes.each do |taxobj| + if taxobj.tax_name == "Commerical Tax" + tax += taxobj.tax_payable_amount end end + return tax end diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index c78b6cd8..741abfc2 100644 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -266,6 +266,8 @@ class SalePayment < ApplicationRecord shift = ShiftSale.current_open_shift(self.sale.cashier_id) if !shift.nil? shift.update(self.sale) + self.sale.shift_sale_id = shift.id + self.sale.save end end @@ -324,7 +326,7 @@ class SalePayment < ApplicationRecord }, :timeout => 10) rescue Net::OpenTimeout response = { status: false } - + rescue OpenURI::HTTPError response = { status: false} diff --git a/app/models/shift_sale.rb b/app/models/shift_sale.rb index a897de2b..ae4c93a8 100644 --- a/app/models/shift_sale.rb +++ b/app/models/shift_sale.rb @@ -27,8 +27,8 @@ class ShiftSale < ApplicationRecord #end end - def create(opening_balance,current_user) - self.cashier_terminal_id = CashierTerminal.first.id + def create(opening_balance,cashier_terminal, current_user) + self.cashier_terminal_id = cashier_terminal self.shift_started_at = DateTime.now self.employee_id = current_user.id self.opening_balance = opening_balance diff --git a/app/views/origami/shifts/new.html.erb b/app/views/origami/shifts/new.html.erb index 2903a8ae..f5f032bc 100644 --- a/app/views/origami/shifts/new.html.erb +++ b/app/views/origami/shifts/new.html.erb @@ -1,12 +1,19 @@

Open Cashier


-
-
-
-
+
+ + + + <% @float.each do |float| %> @@ -69,10 +76,12 @@ $(document).on('focusout', '.float-value', function(event){ }) $('#open_cashier').on('click',function(){ + var cashier_terminal = $('#cashier_terminal').val(); + alert(cashier_terminal) var amount = $('#total').text(); $.ajax({type: "POST", url: "<%= origami_shifts_path %>", - data: "opening_balance=" + amount, + data: "opening_balance=" + amount + "&cashier_terminal="+ cashier_terminal, success:function(result){ if(result){ window.location.href = '/origami'; diff --git a/db/migrate/20170403160742_create_sales.rb b/db/migrate/20170403160742_create_sales.rb index ae806472..9deeb9b8 100644 --- a/db/migrate/20170403160742_create_sales.rb +++ b/db/migrate/20170403160742_create_sales.rb @@ -20,7 +20,7 @@ class CreateSales < ActiveRecord::Migration[5.1] t.decimal :rounding_adjustment, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :amount_received, :precision => 10, :scale => 2, :null => false, :default => 0.00 t.decimal :amount_changed, :precision => 10, :scale => 2, :null => false, :default => 0.00 - t.integer :shift_sale_id, :null => false + t.integer :shift_sale_id t.timestamps end end From abefd1f8f26d110c89f8d95ff2ec3147fead5c0d Mon Sep 17 00:00:00 2001 From: Nweni Date: Sat, 1 Jul 2017 14:55:37 +0630 Subject: [PATCH 06/10] Update --- app/models/order_item.rb | 8 ++-- app/models/shift_sale.rb | 2 +- app/views/origami/shifts/new.html.erb | 66 ++++++++++++++++++++------- 3 files changed, 54 insertions(+), 22 deletions(-) diff --git a/app/models/order_item.rb b/app/models/order_item.rb index f4f3efba..109665d0 100644 --- a/app/models/order_item.rb +++ b/app/models/order_item.rb @@ -43,10 +43,10 @@ class OrderItem < ApplicationRecord def self.get_order_items_details(booking_id) # booking_orders = BookingOrder.where("booking_id=?",booking.booking_id) # if booking_orders - # booking_orders.each do |book_order| + # booking_orders.each do |book_order| # order_details = OrderItem.select("order_items.item_name,order_items.qty,order_items.price,(order_items.qty*order_items.price) as total_price") # .joins("left join orders on orders.order_id = order_items.order_id") - # .where("order_items.order_id=?",book_order.order) + # .where("order_items.order_id=?",book_order.order) # return order_details # end # else @@ -57,9 +57,9 @@ class OrderItem < ApplicationRecord .joins("left join orders on orders.order_id = order_items.order_id") .joins("left join booking_orders on booking_orders.order_id = order_items.order_id") .joins("left join bookings on bookings.booking_id = booking_orders.booking_id") - .where("bookings.booking_id=?",booking_id) + .where("bookings.booking_id=?",booking_id) - return order_details + return order_details end private diff --git a/app/models/shift_sale.rb b/app/models/shift_sale.rb index aa471972..f59c2797 100644 --- a/app/models/shift_sale.rb +++ b/app/models/shift_sale.rb @@ -21,7 +21,7 @@ class ShiftSale < ApplicationRecord #find open shift where is open today and is not closed and login by current cashier today_date = DateTime.now.strftime("%Y-%m-%d") - shift = ShiftSale.where("DATE(shift_started_at)= #{ today_date } and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}").take + shift = ShiftSale.where("DATE(shift_started_at)=? and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}",today_date).take return shift #end diff --git a/app/views/origami/shifts/new.html.erb b/app/views/origami/shifts/new.html.erb index f5f032bc..83f4df55 100644 --- a/app/views/origami/shifts/new.html.erb +++ b/app/views/origami/shifts/new.html.erb @@ -17,7 +17,7 @@ <% @float.each do |float| %> - + <% end %> @@ -25,12 +25,7 @@
Cashier Terminal + +
<%= float.name %>
<%= float.name %>
-
-
-
- -
-
+
@@ -56,9 +51,9 @@
00
-
Del
-
Clr
-
Ent
+
Clr
+
Calculate
+
Open Cashier
@@ -67,17 +62,54 @@
diff --git a/app/views/origami/cash_outs/new.html.erb b/app/views/origami/cash_outs/new.html.erb index 17f9bdf8..9d628f24 100644 --- a/app/views/origami/cash_outs/new.html.erb +++ b/app/views/origami/cash_outs/new.html.erb @@ -1,6 +1,8 @@ -

Payment Debit

+ +
-
+
+

Payment Debit

Payment Reference @@ -20,13 +22,12 @@
+
+ + +
+
-
-

-
-
-
-
diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 4004e9cf..860633a4 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -188,10 +188,10 @@
0.0
<% end %> -
+
-
Balance
-
<%= @sale_data.grand_total %>
+
Balance
+
<%= @sale_data.grand_total %>

From 99986b1fb9afdd0c7cda7cb938552e7a24aead5f Mon Sep 17 00:00:00 2001 From: Nweni Date: Sat, 1 Jul 2017 15:30:06 +0630 Subject: [PATCH 08/10] open cashier clear --- app/views/origami/cash_ins/new.html.erb | 3 --- app/views/origami/shifts/new.html.erb | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/views/origami/cash_ins/new.html.erb b/app/views/origami/cash_ins/new.html.erb index 41330fc5..efc8a22b 100644 --- a/app/views/origami/cash_ins/new.html.erb +++ b/app/views/origami/cash_ins/new.html.erb @@ -24,7 +24,6 @@ - Reference Number @@ -36,8 +35,6 @@ - -
diff --git a/app/views/origami/shifts/new.html.erb b/app/views/origami/shifts/new.html.erb index 83f4df55..8d3ca457 100644 --- a/app/views/origami/shifts/new.html.erb +++ b/app/views/origami/shifts/new.html.erb @@ -82,7 +82,7 @@ $(document).on('focusout', '.float-value', function(event){ } break; case 'clr': - $('#cash').text("0"); + $('#'+float_value).val("0"); break; case 'ent': var sum = 0 From 5f3708e11d5249737826b0aa9d4c21546c5f97d8 Mon Sep 17 00:00:00 2001 From: Nweni Date: Sat, 1 Jul 2017 17:15:12 +0630 Subject: [PATCH 09/10] menu updated | edit qty updated --- app/controllers/home_controller.rb | 8 +++++++- .../origami/sale_edit_controller.rb | 20 +++++++++++++++++++ app/views/origami/sale_edit/edit.html.erb | 17 +++++++++------- config/routes.rb | 3 ++- lib/tasks/menu_import.rake | 8 ++++---- 5 files changed, 43 insertions(+), 13 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 3136417f..f2a8676c 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -77,7 +77,13 @@ class HomeController < ApplicationController def route_by_role(employee) if employee.role == "administrator" - redirect_to dashboard_path + # redirect_to dashboard_path + shift = ShiftSale.current_open_shift(employee.id) + if !shift.nil? + redirect_to origami_root_path + else + redirect_to new_origami_shift_path + end elsif employee.role == "cashier" #check if cashier has existing open cashier shift = ShiftSale.current_open_shift(employee.id) diff --git a/app/controllers/origami/sale_edit_controller.rb b/app/controllers/origami/sale_edit_controller.rb index d4fba302..f0d57679 100644 --- a/app/controllers/origami/sale_edit_controller.rb +++ b/app/controllers/origami/sale_edit_controller.rb @@ -23,6 +23,26 @@ class Origami::SaleEditController < BaseOrigamiController @newsaleitem.save end + def item_edit + saleitemId = params[:sale_item_id] + update_qty = params[:update_qty] + update_price = params[:update_price] + saleitemObj = SaleItem.find(saleitemId) + saleitemObj.remark = 'void' + saleitemObj.save + @newsaleitem = SaleItem.new + @newsaleitem = saleitemObj.dup + @newsaleitem.save + @newsaleitem.qty = update_qty + @newsaleitem.price = update_price + @newsaleitem.unit_price = update_price + @newsaleitem.taxable_price = update_price + @newsaleitem.is_taxable = 0 + @newsaleitem.remark = 'edit' + @newsaleitem.product_name = saleitemObj.product_name + " - updated" + @newsaleitem.save + end + # make cancel void item def item_void_cancel saleitemId = params[:sale_item_id] diff --git a/app/views/origami/sale_edit/edit.html.erb b/app/views/origami/sale_edit/edit.html.erb index 76bbeb08..13812e59 100644 --- a/app/views/origami/sale_edit/edit.html.erb +++ b/app/views/origami/sale_edit/edit.html.erb @@ -49,18 +49,18 @@ <%= count %> <%= sale_item.product_name %> - <% if sale_item.remark != 'void' %> - - + <% if sale_item.remark != 'void' && sale_item.remark != 'edit' %> + + - <% elsif sale_item.qty.to_i < 0 %> + <% elsif sale_item.qty.to_i < 0 || sale_item.remark == 'edit' %> - + <% else %> @@ -101,11 +101,14 @@ $(document).ready(function(){ $(".update").on('click',function() { var sale_item_id = $(this).attr('data-id'); - var ajax_url = "/origami/item_void"; + var qty = $('#'+sale_item_id + "_qty").val(); + var price = $('#'+ sale_item_id + "_price").val(); + console.log(qty + "|" + price) + var ajax_url = "/origami/item_edit"; $.ajax({ type: "POST", url: ajax_url, - data: 'order_id='+ order_id, + data: 'sale_item_id='+ sale_item_id + "&update_qty="+qty + "&update_price="+ price, success:function(result){ location.reload(); } diff --git a/config/routes.rb b/config/routes.rb index 35669703..544f67f3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,6 +80,7 @@ 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_edit' => "sale_edit#item_edit" 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' @@ -109,7 +110,7 @@ Rails.application.routes.draw do #---------Shift ---------------# resources :shifts, only: [:index, :new, :create, :edit] post 'close_shift' => 'shifts#update_shift' - get 'shift/close' => 'shifts#show' + get 'shift/close' => 'shifts#show' #shift - index (open/close shift landing page) #shift - show (sales summary display) #shift - new (open shift) diff --git a/lib/tasks/menu_import.rake b/lib/tasks/menu_import.rake index f229df94..9a287a2d 100644 --- a/lib/tasks/menu_import.rake +++ b/lib/tasks/menu_import.rake @@ -93,9 +93,9 @@ menu_category3 = MenuCategory.create({menu: menu, code:"C003", name: "Beef & Mut # Pork menu_category4 = MenuCategory.create({menu: menu, code:"C004", name: "Pork", alt_name: "Pork", order_by: 4,created_by: "SYSTEM DEFAULT"}) # 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:"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}]) + menu_category1_menu_item137 = 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:"II0212", menu_item: menu_category1_menu_item137, 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_item137, 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:"II0222", menu_item: menu_category1_menu_item14, price:4000.00, is_on_promotion:false}]) @@ -475,7 +475,7 @@ menu_category14 = MenuCategory.create({menu: menu, code:"C0013", name: "Others", 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_category1_menu_item107 = SimpleMenuItem.create({item_code:"01108", name: "Shredded 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:"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 From b0ec03f5911925222e9087ae980ddfe144e949c8 Mon Sep 17 00:00:00 2001 From: Nweni Date: Sat, 1 Jul 2017 18:12:48 +0630 Subject: [PATCH 10/10] Update --- lib/tasks/menu_import.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/menu_import.rake b/lib/tasks/menu_import.rake index 9a287a2d..5db6231f 100644 --- a/lib/tasks/menu_import.rake +++ b/lib/tasks/menu_import.rake @@ -207,7 +207,7 @@ menu_category7 = MenuCategory.create({menu: menu, code:"C007", name: "Specialty # Seafood 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_category1_menu_item41 = SimpleMenuItem.create({item_code:"01042", name: "Pomfret", 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:"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 @@ -280,13 +280,13 @@ menu_category8 = MenuCategory.create({menu: menu, code:"C008", name: "Seafood", 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:"",item_instance_code:"II0671", menu_item: menu_category1_menu_item60, price:10.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0671", menu_item: menu_category1_menu_item60, price:60.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:"",item_instance_code:"II0681", menu_item: menu_category1_menu_item61, price:10.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:"",item_instance_code:"II0681", menu_item: menu_category1_menu_item61, price:150.00, is_on_promotion:false}]) # Live Mantis menu_category1_menu_item62 = SimpleMenuItem.create({item_code:"01063", name: "Live Mantis Prawn", 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:" ",item_instance_code:"II0691", menu_item: menu_category1_menu_item62, price:10.00, is_on_promotion:false}]) + menu_item0_instance = MenuItemInstance.create([{item_instance_name:" ",item_instance_code:"II0691", menu_item: menu_category1_menu_item62, price:150.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