to do req_bill_format and status changed after pay

This commit is contained in:
Yan
2017-06-12 00:45:26 +06:30
parent 518e15f5d1
commit f834911587
19 changed files with 567 additions and 248 deletions

View File

@@ -14,17 +14,23 @@ class Origami::RequestBillsController < BaseOrigamiController
@sale_items = SaleItem.where("sale_id=?",@sale_id)
else
@sale_data = Sale.find_by_sale_id(check_booking.sale_id)
@sale_items = SaleItem.where("sale_id=?",@sale_id)
@sale_items = SaleItem.where("sale_id=?",@sale_data.sale_id)
end
unique_code = "ReceiptBillPdf"
customer_name = Customer.select("name").where('customer_id=' + @sale_data.customer_id)
customer= Customer.where('customer_id=' + @sale_data.customer_id)
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_items)
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer_name)
redirect_to origami_root_path
printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, food_total, beverage_total)
redirect_to origami_path(sale_order.sale_id)
end
end