sale receipt generation and bill api

This commit is contained in:
Min Zeya Phyo
2017-04-17 13:09:54 +06:30
parent 3e9a2a0ce7
commit 6a84a34a9f
15 changed files with 177 additions and 71 deletions

View File

@@ -1,10 +1,21 @@
class Api::Restaurant::BillController < Api::ApiController
class Api::BillController < Api::ApiController
#Create invoice based on booking
#Output and invoice
def create
@status = false
@error_message = "Order ID or Booking ID is require to request for a bill."
#create Bill by Booking ID
if (params[:booking_id])
@sale = Sale.new
@sale.generate_invoice_from_booking(params[:booking_id], current_login_employee.name)
elsif (params[:order_id])
@sale = Sale.new
@sale.generate_invoice_from_order(params[:order_id], current_login_employee.name)
end
end