finish reprint

This commit is contained in:
Aung Myo
2017-06-15 19:07:33 +06:30
parent b5743eb7a7
commit f0ea6f3c56
4 changed files with 41 additions and 2 deletions

View File

@@ -77,4 +77,28 @@ class Origami::PaymentsController < BaseOrigamiController
end
end
end
def reprint
sale_id = params[:sale_id]
saleObj = Sale.find(sale_id)
unique_code = "ReceiptBillPdf"
customer= Customer.find(saleObj.customer_id)
# get member information
member_info = Customer.get_member_account(customer)
# get printer info
print_settings=PrintSetting.find_by_unique_code(unique_code)
# Calculate Food and Beverage Total
food_total, beverage_total = SaleItem.calculate_food_beverage(saleObj.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info)
end
end