update sale audit

This commit is contained in:
Aung Myo
2017-10-31 12:08:27 +06:30
parent a687b45193
commit 56940d7f00
21 changed files with 348 additions and 215 deletions

View File

@@ -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