This commit is contained in:
Nweni
2017-06-17 13:32:16 +06:30
parent 064f132906
commit b2ed77947e
6 changed files with 33 additions and 19 deletions

View File

@@ -22,6 +22,22 @@ class Api::BillController < Api::ApiController
@status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee)
end
unique_code = "ReceiptBillPdf"
customer= Customer.where('customer_id=' + @sale.customer_id)
# get printer info
print_settings=PrintSetting.find_by_unique_code(unique_code)
# find order id by sale id
# sale_order = SaleOrder.find_by_sale_id(@sale_data.sale_id)
# Calculate Food and Beverage Total
food_total, beverage_total = SaleItem.calculate_food_beverage(@sale.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_receipt_bill(print_settings,@sale.sale_items,@sale,customer.name, food_total, beverage_total)
end