update sale audit
This commit is contained in:
@@ -16,7 +16,7 @@ class Origami::OtherChargesController < BaseOrigamiController
|
||||
if Sale.exists?(sale_id)
|
||||
sale = Sale.find(sale_id)
|
||||
table_id = sale.bookings[0].dining_facility_id
|
||||
table_type = DiningFacility.find(table_id).type
|
||||
table = DiningFacility.find(table_id)
|
||||
|
||||
# sale.total_amount = sub_total.to_f
|
||||
# sale.grand_total = sub_total.to_f + sale.total_tax;
|
||||
@@ -41,6 +41,11 @@ class Origami::OtherChargesController < BaseOrigamiController
|
||||
|
||||
sale_item.price = di["price"]
|
||||
sale_item.save
|
||||
|
||||
action_by = current_user.id
|
||||
remark = "Add Other Charges - Receipt No #{sale.receipt_no} | Sale ID #{sale.sale_id} |Charges ->#{di["price"]} For ->#{di["name"]}- Table ->#{table.name}"
|
||||
sale_audit = SaleAudit.record_audit_for_edit(sale.sale_id,sale.cashier_id, action_by,remark,"ADDOTHERCHARGES" )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -48,7 +53,7 @@ class Origami::OtherChargesController < BaseOrigamiController
|
||||
sale.compute_by_sale_items(sale_id, sale.sale_items, sale.total_discount)
|
||||
end
|
||||
|
||||
dining = {:table_id => table_id, :table_type => table_type }
|
||||
dining = {:table_id => table_id, :table_type => table.type }
|
||||
render :json => dining.to_json
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user