update update void print and sale item report
This commit is contained in:
@@ -46,6 +46,44 @@ class Origami::VoidController < BaseOrigamiController
|
||||
remark = "Void Sale ID #{sale_id} | Receipt No #{sale.receipt_no} | Receipt No #{sale.receipt_no} | Table ->#{table.name}"
|
||||
sale_audit = SaleAudit.record_audit_for_edit(sale_id,sale.cashier_id, action_by,remark,"SALEVOID" )
|
||||
|
||||
# For Print
|
||||
|
||||
member_info = nil
|
||||
rebate_amount = nil
|
||||
|
||||
# For Cashier by Zone
|
||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||
if bookings.count > 1
|
||||
# for Multiple Booking
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
else
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
end
|
||||
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(sale.customer_id)
|
||||
|
||||
#shop detail
|
||||
shop_details = Shop.find(1)
|
||||
# get member information
|
||||
rebate = MembershipSetting.find_by_rebate(1)
|
||||
if customer.membership_id != nil && rebate
|
||||
member_info = Customer.get_member_account(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
end
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# Calculate Food and Beverage Total
|
||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale.sale_items)
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID")
|
||||
|
||||
#end print
|
||||
|
||||
# update complete order items in oqs
|
||||
SaleOrder.where("sale_id = '#{ sale_id }'").find_each do |sodr|
|
||||
|
||||
@@ -614,7 +614,7 @@ def self.get_item_query()
|
||||
" JOIN shift_sales sh ON sh.`id` = sales.shift_sale_id" +
|
||||
" JOIN menu_categories mc ON mc.id = mi.menu_category_id ")
|
||||
# "JOIN employee_accesses ea ON ea.`employee_id` = sales.cashier_id ")
|
||||
|
||||
query = query.where("i.unit_price > 0")
|
||||
query = query.joins(" JOIN accounts acc ON acc.id = mi.account_id")
|
||||
query = query.group('i.product_code ').order("mi.account_id, mi.menu_category_id")
|
||||
end
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.printer_name") %></th>
|
||||
<th><%= t("views.right_panel.detail.active") %></th>
|
||||
<th><%= t("views.right_panel.detail.login") %>?</th>
|
||||
<th><%= t("views.right_panel.detail.auto_print") %></th>
|
||||
@@ -32,6 +33,7 @@
|
||||
<% @settings_cashier_terminals.each do |settings_cashier_terminal| %>
|
||||
<tr>
|
||||
<td><%= settings_cashier_terminal.name%></td>
|
||||
<td><%= settings_cashier_terminal.printer_name%></td>
|
||||
<td><%= settings_cashier_terminal.is_active %></td>
|
||||
<td><%= settings_cashier_terminal.is_currently_login %></td>
|
||||
<td><%= settings_cashier_terminal.auto_print_receipt %></td>
|
||||
|
||||
Reference in New Issue
Block a user