fix first bill amount less than actual sales

This commit is contained in:
Thein Lin Kyaw
2019-09-27 20:35:05 +06:30
parent 9d330bb28c
commit 327a6e17bf
10 changed files with 242 additions and 313 deletions

View File

@@ -5,12 +5,12 @@ class Origami::PaymentsController < BaseOrigamiController
def first_bill
sale_id = params[:sale_id] # sale_id
sale_data = Sale.find_by_sale_id(sale_id)
sale_data = Sale.find(sale_id)
sale_items = SaleItem.get_all_sale_items(sale_id)
member_info = nil
# For Cashier by Zone
bookings = Booking.where("sale_id='#{sale_id}'")
booking = Booking.find_by_sale_id(sale_id)
# if bookings.count > 1
# # for Multiple Booking
# table = DiningFacility.find(bookings[0].dining_facility_id)
@@ -21,12 +21,12 @@ class Origami::PaymentsController < BaseOrigamiController
if !shift.nil?
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
else
if bookings[0].dining_facility_id.to_i > 0
table = DiningFacility.find(bookings[0].dining_facility_id)
if booking.dining_facility_id.to_i > 0
table = DiningFacility.find(booking.dining_facility_id)
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
else
shift = ShiftSale.find(saleObj.shift_sale_id)
shift = ShiftSale.find(sale_data.shift_sale_id)
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
end
end