order reservation pdf setting
This commit is contained in:
@@ -145,7 +145,7 @@ class OrderReservation < ApplicationRecord
|
||||
return result
|
||||
end
|
||||
|
||||
def self.update_doemal_payment(order,current_user)
|
||||
def self.update_doemal_payment(order,current_user,receipt_bill)
|
||||
if(Sale.exists?(order.sale_id))
|
||||
saleObj = Sale.find(order.sale_id)
|
||||
shop_details = Shop.first
|
||||
@@ -175,8 +175,30 @@ class OrderReservation < ApplicationRecord
|
||||
#order reservation status updated
|
||||
update_order_reservation(order.id, saleObj.sale_id, DELIVERED)
|
||||
|
||||
result = {:status=> true, :message => DELIVERED }
|
||||
return result
|
||||
if receipt_bill == 1
|
||||
#receipt bill pdf setting
|
||||
# get printer info
|
||||
unique_code = "ReceiptBillOrderPdf"
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# Calculate Food and Beverage Total
|
||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
other_amount = SaleItem.calculate_other_charges(sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "Paid",current_balance,card_data,other_amount,latest_order_no,card_balance_amount)
|
||||
#receipt bill pdf setting
|
||||
|
||||
result = {:status=> true,
|
||||
:filepath => filename,
|
||||
:receipt_no => sale_receipt_no,
|
||||
:printer_model => print_settings.brand_name,
|
||||
:printer_url => print_settings.api_settings ,
|
||||
:message => DELIVERED }
|
||||
else
|
||||
result = {:status=> true, :message => DELIVERED }
|
||||
end
|
||||
return result
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user