Finished Request Bill print function

This commit is contained in:
Aung Myo
2017-06-03 17:04:17 +06:30
parent 138850fb24
commit a2c9996b76
7 changed files with 131 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
class Origami::RequestBillsController < BaseOrigamiController
def show
@sale = Sale.new
check_order = Order.find_by_id(params[:id])
if check_order
@order_details = OrderItem.get_order_items_details(check_order.id)
@@ -9,5 +10,13 @@ class Origami::RequestBillsController < BaseOrigamiController
@sale_data = Sale.find_by_id(@sale_id)
@sale_items = SaleItem.where("sale_id=?",@sale_id)
end
unique_code="ReceiptBillPdf"
print_settings=PrintSetting.find_by_unique_code(unique_code)
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_receipt_bill(print_settings,@sale_items,@sale)
end
end