From 5e0bdf1e36042c88f5e250127dc2679c7b263d10 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 11 May 2018 09:57:26 +0630 Subject: [PATCH] update bugs --- app/controllers/origami/waste_spoile_controller.rb | 6 ++++-- app/models/ability.rb | 1 + app/views/origami/addorders/detail.html.erb | 2 +- app/views/origami/sales/show.html.erb | 12 +++++++----- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/controllers/origami/waste_spoile_controller.rb b/app/controllers/origami/waste_spoile_controller.rb index de7df434..9cfde698 100755 --- a/app/controllers/origami/waste_spoile_controller.rb +++ b/app/controllers/origami/waste_spoile_controller.rb @@ -55,9 +55,11 @@ class Origami::WasteSpoileController < BaseOrigamiController # FOr Sale Audit action_by = current_user.name - approved_by = Employee.find_by_emp_id(access_code) + if access_code != "null" + 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,sale.cashier_id, approved_by.name,remark,remark ) + sale_audit = SaleAudit.record_audit_for_edit(sale_id,sale.cashier_id, action_by,remark,remark ) # For Print diff --git a/app/models/ability.rb b/app/models/ability.rb index 497e9322..fbf66f57 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -248,6 +248,7 @@ class Ability can :reprint, :payment can :rounding_adj, :payment can :print, :payment + can :foc, :payment can :manage, Commission can :manage, Commissioner diff --git a/app/views/origami/addorders/detail.html.erb b/app/views/origami/addorders/detail.html.erb index 93f7f2a2..62bbf3a4 100644 --- a/app/views/origami/addorders/detail.html.erb +++ b/app/views/origami/addorders/detail.html.erb @@ -710,7 +710,7 @@ $(document).on('click', '#clear_all', function(event){ $(".summary-items tbody").empty(); - $('#sub_total').text(0.00); + $('#sub_total').text("0.00"); $(".create").attr("disabled","disabled"); }); diff --git a/app/views/origami/sales/show.html.erb b/app/views/origami/sales/show.html.erb index 7e3fc7e1..98dce056 100755 --- a/app/views/origami/sales/show.html.erb +++ b/app/views/origami/sales/show.html.erb @@ -199,11 +199,13 @@
<% if @sale.sale_status != 'void' %> - <% if current_login_employee.role == "cashier" %> - Void - <% else %> - - <% end %> + <% if @sale.sale_status != "waste" || @sale.sale_status != "spoile"%> + <% if current_login_employee.role == "cashier" %> + Void + <% else %> + + <% end %> + <% end %> <% end %>