This commit is contained in:
yarzar_code
2020-01-12 20:07:28 +06:30
parent 314cc507a3
commit dff2c69627
89 changed files with 492 additions and 469 deletions

View File

@@ -54,7 +54,7 @@ class Origami::WasteSpoileController < BaseOrigamiController
# FOr Sale Audit
action_by = current_user.name
if access_code != "null" && current_user.role == "cashier"
action_by = Employee.find_by_emp_id_and_shop_code(access_code,@shop.shop_code).name
action_by = Employee.find_by_emp_id(access_code).name
end
# 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,current_user.name, action_by,remark,remark )
@@ -87,7 +87,7 @@ class Origami::WasteSpoileController < BaseOrigamiController
# unique_code = "ReceiptBillPdf"
customer= Customer.find(sale.customer_id)
# get member information
rebate = MembershipSetting.find_by_rebate_and_shop_code(1,@shop.shop_code)
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,sale.receipt_no)
@@ -95,7 +95,7 @@ class Origami::WasteSpoileController < BaseOrigamiController
current_balance = 0
end
printer = PrintSetting.where("shop_code='#{@shop.shop_code}'")
printer = PrintSetting.all
unique_code="ReceiptBillPdf"
if !printer.empty?
@@ -111,7 +111,7 @@ class Origami::WasteSpoileController < BaseOrigamiController
end
# get printer info
print_settings=PrintSetting.find_by_unique_code_and_shop_code(unique_code,@shop.shop_code)
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)