SQA feedback
This commit is contained in:
@@ -249,7 +249,7 @@ function setCommPorts(comPortLists) {
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+"/payment/others_payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -342,6 +342,8 @@ function resCBPay(resMsg,card_sale_trans_id,cmd_type,payment_type,bnk_bill_amoun
|
||||
}else{
|
||||
if(payment_type!="master"){
|
||||
payment_type = payment_type.toUpperCase();
|
||||
}else{
|
||||
payment_type = "Master";
|
||||
}
|
||||
swal({
|
||||
title: 'Oops',
|
||||
|
||||
@@ -6,7 +6,7 @@ class Oqs::EditController < BaseOqsController
|
||||
if params[:type] == 'oqs'
|
||||
assigned_item = AssignedOrderItem.find(assigned_item_id)
|
||||
@order_item = OrderItem.where("order_id='#{ assigned_item.order_id }' AND item_instance_code='#{ assigned_item.instance_code }'")
|
||||
elsif
|
||||
elsif params[:type] == "pending"
|
||||
assigned_item = OrderItem.find(assigned_item_id)
|
||||
@booking = Booking.joins(" JOIN booking_orders as bko on bko.booking_id = bookings.booking_id")
|
||||
.where("bko.order_id = '#{assigned_item.order_id}'").first()
|
||||
|
||||
61
app/controllers/origami/jcb_controller.rb
Executable file → Normal file
61
app/controllers/origami/jcb_controller.rb
Executable file → Normal file
@@ -5,33 +5,43 @@ class Origami::JcbController < BaseOrigamiController
|
||||
@cashier_type = params[:type]
|
||||
# limit jcb_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = sale_data.grand_total
|
||||
total = 0
|
||||
@jcbcount = 0
|
||||
others = 0
|
||||
@shop = Shop::ShopDetail
|
||||
@rounding_adj = 0
|
||||
@can_jcb = 0
|
||||
@member_discount= 0
|
||||
@sub_total = 0
|
||||
@membership_id = nil
|
||||
@receipt_no = nil
|
||||
if !sale_data.nil?
|
||||
total = sale_data.grand_total
|
||||
|
||||
others = 0
|
||||
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "jcb"
|
||||
@jcbcount = @jcbcount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
@can_jcb = total - @jcbcount - others
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
@membership_id = sale_data.customer.membership_id
|
||||
#for bank integration
|
||||
@receipt_no = sale_data.receipt_no
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "jcb"
|
||||
@jcbcount = @jcbcount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
@can_jcb = total - @jcbcount - others
|
||||
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
@membership_id = sale_data.customer.membership_id
|
||||
#for bank integration
|
||||
@receipt_no = sale_data.receipt_no
|
||||
bank_integration = Lookup.collection_of('bank_integration')
|
||||
@bank_integration = 0
|
||||
if !bank_integration[0].nil?
|
||||
@@ -59,4 +69,9 @@ class Origami::JcbController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
60
app/controllers/origami/master_controller.rb
Executable file → Normal file
60
app/controllers/origami/master_controller.rb
Executable file → Normal file
@@ -5,32 +5,41 @@ class Origami::MasterController < BaseOrigamiController
|
||||
@cashier_type = params[:type]
|
||||
# limit master_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = sale_data.grand_total
|
||||
total = 0
|
||||
@mastercount = 0
|
||||
others = 0
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
@shop = Shop::ShopDetail
|
||||
@rounding_adj = 0
|
||||
@can_master = 0
|
||||
@member_discount = 0
|
||||
@sub_total = 0
|
||||
@membership_id = nil
|
||||
@receipt_no = nil
|
||||
if !sale_data.nil?
|
||||
total = sale_data.grand_total
|
||||
|
||||
others = 0
|
||||
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "master"
|
||||
@mastercount = @mastercount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "master"
|
||||
@mastercount = @mastercount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
@can_master = total - @mastercount - others
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
@membership_id = sale_data.customer.membership_id
|
||||
#for bank integration
|
||||
@receipt_no = sale_data.receipt_no
|
||||
end
|
||||
@can_master = total - @mastercount - others
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
@membership_id = sale_data.customer.membership_id
|
||||
#for bank integration
|
||||
@receipt_no = sale_data.receipt_no
|
||||
bank_integration = Lookup.collection_of('bank_integration')
|
||||
@bank_integration = 0
|
||||
if !bank_integration[0].nil?
|
||||
@@ -58,4 +67,9 @@ class Origami::MasterController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
63
app/controllers/origami/mpu_controller.rb
Executable file → Normal file
63
app/controllers/origami/mpu_controller.rb
Executable file → Normal file
@@ -4,33 +4,43 @@ class Origami::MpuController < BaseOrigamiController
|
||||
@cashier_type = params[:type]
|
||||
# limit mpu_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = sale_data.grand_total
|
||||
total = 0
|
||||
@mpucount = 0
|
||||
others = 0
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "mpu"
|
||||
@mpucount = @mpucount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
@can_mpu = total - @mpucount - others
|
||||
@rounding_adj = 0
|
||||
@can_mpu = 0
|
||||
@member_discount = 0
|
||||
@sub_total = 0
|
||||
@membership_id = nil
|
||||
@receipt_no = nil
|
||||
if !sale_data.nil?
|
||||
total = sale_data.grand_total
|
||||
|
||||
others = 0
|
||||
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "mpu"
|
||||
@mpucount = @mpucount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
@can_mpu = total - @mpucount - others
|
||||
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
@membership_id = sale_data.customer.membership_id
|
||||
#for bank integration
|
||||
@receipt_no = sale_data.receipt_no
|
||||
end
|
||||
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
@membership_id = sale_data.customer.membership_id
|
||||
#for bank integration
|
||||
@receipt_no = sale_data.receipt_no
|
||||
bank_integration = Lookup.collection_of('bank_integration')
|
||||
@bank_integration = 0
|
||||
if !bank_integration[0].nil?
|
||||
@@ -58,4 +68,9 @@ class Origami::MpuController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -177,8 +177,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
end
|
||||
|
||||
booking.booking_orders.each do |order|
|
||||
Order.pay_process_order_queue(order.order_id,table_id)
|
||||
# Order.pay_process_order_queue(order.order_id, table_id)
|
||||
oqs = OrderQueueStation.new
|
||||
oqs.pay_process_order_queue(order.order_id, table_id)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
#for card sale data
|
||||
|
||||
@@ -4,32 +4,40 @@ class Origami::UnionpayController < BaseOrigamiController
|
||||
@cashier_type = params[:type]
|
||||
# limit unionpay_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = sale_data.grand_total
|
||||
total = 0
|
||||
@unionpaycount = 0
|
||||
others = 0
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
@rounding_adj = 0
|
||||
@can_unionpay = 0
|
||||
@member_discount = 0
|
||||
@sub_total = 0
|
||||
@membership_id = nil
|
||||
@receipt_no = nil
|
||||
if !sale_data.nil?
|
||||
total = sale_data.grand_total
|
||||
others = 0
|
||||
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "unionpay"
|
||||
@unionpaycount = @unionpaycount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
@can_unionpay = total - @unionpaycount - others
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
@membership_id = sale_data.customer.membership_id
|
||||
#for bank integration
|
||||
@receipt_no = sale_data.receipt_no
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "unionpay"
|
||||
@unionpaycount = @unionpaycount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
@can_unionpay = total - @unionpaycount - others
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
@membership_id = sale_data.customer.membership_id
|
||||
#for bank integration
|
||||
@receipt_no = sale_data.receipt_no
|
||||
bank_integration = Lookup.collection_of('bank_integration')
|
||||
@bank_integration = 0
|
||||
if !bank_integration[0].nil?
|
||||
@@ -58,4 +66,9 @@ class Origami::UnionpayController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
59
app/controllers/origami/visa_controller.rb
Executable file → Normal file
59
app/controllers/origami/visa_controller.rb
Executable file → Normal file
@@ -4,32 +4,40 @@ class Origami::VisaController < BaseOrigamiController
|
||||
@cashier_type = params[:type]
|
||||
# limit visa_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = sale_data.grand_total
|
||||
total = 0
|
||||
@visacount = 0
|
||||
others = 0
|
||||
|
||||
@payment_method_setting_nav = PaymentMethodSetting.all
|
||||
@shop = Shop::ShopDetail
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
@rounding_adj = 0
|
||||
@can_visa = 0
|
||||
@member_discount = 0
|
||||
@sub_total = 0
|
||||
@membership_id = nil
|
||||
@receipt_no = nil
|
||||
if !sale_data.nil?
|
||||
total = sale_data.grand_total
|
||||
others = 0
|
||||
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
new_total = sale_data.grand_total
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "visa"
|
||||
@visacount = @visacount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
@can_visa = total - @visacount - others
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
@membership_id = sale_data.customer.membership_id
|
||||
#for bank integration
|
||||
@receipt_no = sale_data.receipt_no
|
||||
end
|
||||
@rounding_adj = new_total-sale_data.grand_total
|
||||
|
||||
sale_data.sale_payments.each do |sale_payment|
|
||||
if sale_payment.payment_method == "visa"
|
||||
@visacount = @visacount + sale_payment.payment_amount
|
||||
else
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
@can_visa = total - @visacount - others
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
@membership_id = sale_data.customer.membership_id
|
||||
#for bank integration
|
||||
@receipt_no = sale_data.receipt_no
|
||||
bank_integration = Lookup.collection_of('bank_integration')
|
||||
@bank_integration = 0
|
||||
if !bank_integration[0].nil?
|
||||
@@ -58,4 +66,9 @@ class Origami::VisaController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -71,9 +71,9 @@ class Order < ApplicationRecord
|
||||
BookingOrder.create({:booking_id => booking.booking_id, :order => self})
|
||||
|
||||
#Send order to queue one it done!
|
||||
if self.source != "quick_service"
|
||||
# if self.source != "quick_service"
|
||||
process_order_queue
|
||||
end
|
||||
# end
|
||||
|
||||
#send order to broadcast job
|
||||
send_order_broadcast(booking)
|
||||
@@ -297,7 +297,7 @@ class Order < ApplicationRecord
|
||||
else
|
||||
if order
|
||||
oqs = OrderQueueStation.new
|
||||
oqs.process_order(order, self.table_id)
|
||||
oqs.process_order(order, self.table_id, self.source)
|
||||
end
|
||||
assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id)
|
||||
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
@@ -313,7 +313,7 @@ class Order < ApplicationRecord
|
||||
else
|
||||
if order
|
||||
oqs = OrderQueueStation.new
|
||||
oqs.process_order(order, self.table_id)
|
||||
oqs.process_order(order, self.table_id, self.source)
|
||||
end
|
||||
assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id)
|
||||
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
@@ -326,7 +326,7 @@ class Order < ApplicationRecord
|
||||
else
|
||||
if order
|
||||
oqs = OrderQueueStation.new
|
||||
oqs.process_order(order, self.table_id)
|
||||
oqs.process_order(order, self.table_id, self.source)
|
||||
end
|
||||
assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id)
|
||||
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
|
||||
@@ -101,6 +101,80 @@ class OrderQueueStation < ApplicationRecord
|
||||
end #end else
|
||||
end
|
||||
|
||||
def pay_process_order_queue (order_id, table_id)
|
||||
|
||||
oqs_stations = OrderQueueStation.active
|
||||
|
||||
order = Order.find(order_id)
|
||||
order_items = order.order_items
|
||||
|
||||
if table_id.to_i > 0
|
||||
# get dining
|
||||
dining = DiningFacility.find(table_id)
|
||||
oqs_by_zones = OrderQueueProcessByZone.where("zone_id=#{dining.zone_id}")
|
||||
booking = Booking.find_by_dining_facility_id(dining.id)
|
||||
|
||||
# ToDo per item per printer
|
||||
|
||||
oqs_by_zones.each do |oqpbz|
|
||||
oqs = OrderQueueStation.find(oqpbz.order_queue_station_id)
|
||||
is_auto_printed = false
|
||||
oqs_order_items = []
|
||||
|
||||
if oqs.is_active
|
||||
#Get List of items -
|
||||
pq_items = JSON.parse(oqs.processing_items)
|
||||
#Loop through the processing items
|
||||
pq_items.each do |pq_item|
|
||||
#Processing through the looping items
|
||||
order_items.each do |order_item|
|
||||
if (pq_item == order_item.item_code)
|
||||
if (order_item.qty > 0)
|
||||
oqs_order_items.push(order_item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if oqs.auto_print
|
||||
if oqs_order_items.length > 0
|
||||
print_slip(oqs, order, oqs_order_items)
|
||||
is_auto_printed = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
oqs_stations.each do |oqs|
|
||||
is_auto_printed = false
|
||||
oqs_order_items = []
|
||||
|
||||
if oqs.is_active
|
||||
#Get List of items -
|
||||
pq_items = JSON.parse(oqs.processing_items)
|
||||
#Loop through the processing items
|
||||
pq_items.each do |pq_item|
|
||||
#Processing through the looping items
|
||||
order_items.each do |order_item|
|
||||
if (pq_item == order_item.item_code)
|
||||
if (order_item.qty > 0)
|
||||
oqs_order_items.push(order_item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if oqs.auto_print
|
||||
if oqs_order_items.length > 0
|
||||
print_slip(oqs, order, oqs_order_items)
|
||||
is_auto_printed = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end #end else
|
||||
end
|
||||
|
||||
private
|
||||
#Print order_items in 1 slip
|
||||
def print_slip(oqs, order, order_items)
|
||||
|
||||
@@ -325,6 +325,7 @@ class SalePayment < ApplicationRecord
|
||||
sObj = Sale.find(self.sale_id)
|
||||
is_credit = 0
|
||||
is_foc = 0
|
||||
is_cash = false
|
||||
sObj.sale_payments.each do |spay|
|
||||
all_received_amount += spay.payment_amount.to_f
|
||||
if spay.payment_method == "creditnote"
|
||||
@@ -333,8 +334,12 @@ class SalePayment < ApplicationRecord
|
||||
if spay.payment_method == "foc"
|
||||
is_foc = 1
|
||||
end
|
||||
if spay.payment_method.to_s == "cash"
|
||||
is_cash = true
|
||||
end
|
||||
end
|
||||
if (self.sale.grand_total <= all_received_amount)
|
||||
|
||||
if (self.sale.grand_total <= all_received_amount) && is_cash
|
||||
if is_credit == 0
|
||||
self.sale.payment_status = "paid"
|
||||
else
|
||||
@@ -374,11 +379,15 @@ class SalePayment < ApplicationRecord
|
||||
end
|
||||
|
||||
self.sale.save!
|
||||
table_update_status(sObj)
|
||||
|
||||
if check_foc
|
||||
table_update_status(sObj)
|
||||
update_shift
|
||||
elsif paid_amount.to_f > 0 #|| paid_amount != "0.0"
|
||||
table_update_status(sObj)
|
||||
update_shift
|
||||
elsif is_cash && paid_amount.to_f == 0
|
||||
table_update_status(sObj)
|
||||
update_shift
|
||||
end
|
||||
end
|
||||
|
||||
0
app/views/origami/pending_order/index.html.erb
Executable file → Normal file
0
app/views/origami/pending_order/index.html.erb
Executable file → Normal file
@@ -97,13 +97,15 @@
|
||||
<% end%>
|
||||
<% else%>
|
||||
<% sub_total = 0
|
||||
total = 0
|
||||
@order_items.each do |order_item|
|
||||
sub_total = sub_total + order_item.price %>
|
||||
total = order_item.qty * order_item.price
|
||||
sub_total = sub_total + total %>
|
||||
<input type="hidden" id="sale_id" value="<%= @bookings.booking_id %>">
|
||||
<tr class="edit_order" data-id='<%= order_item.order_items_id %>'>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.price %></td>
|
||||
<td class='item-attr'><%= total %></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
<% end%>
|
||||
@@ -210,7 +212,7 @@ $(document).ready(function(){
|
||||
swal("Information!", result.error_message);
|
||||
}
|
||||
else {
|
||||
location.reload();
|
||||
window.location.href = '/origami/quick_service/pending_order';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user