api discount and change tax

This commit is contained in:
Thein Lin Kyaw
2023-10-17 16:52:12 +06:30
parent 81eb30c03a
commit 3441811bb0
27 changed files with 1225 additions and 1067 deletions

View File

@@ -3,13 +3,13 @@ class Api::Foodcourt::BillsController < Api::ApiController
def create
Sale.transaction do
if shift = ShiftSale.current_open_shift(current_login_employee)
if booking = Booking.find(params[:booking_id])
if @booking = Booking.find(params[:booking_id])
cashier = Employee.find(shift.employee_id)
order = booking.orders.first
order = @booking.orders.first
if @sale_data = booking.sale
if @sale_data = @booking.sale
@status = true
elsif @sale_data = Sale.generate_invoice_from_booking(booking, current_login_employee, cashier, order.source, params[:current_checkin_induties_count])
elsif @sale_data = Sale.generate_invoice_from_booking(@booking, current_login_employee, cashier, order.source, params[:current_checkin_induties_count])
@status = true
else
@status = false