add audit for change tax

This commit is contained in:
NyanLinHtut
2019-12-24 11:14:04 +06:30
parent 180c61dc7a
commit 054de3731e
2 changed files with 13 additions and 0 deletions

View File

@@ -124,6 +124,17 @@ class SaleAudit < ApplicationRecord
sale_audit.save!
end
def self.record_audit_change_tax(sale_id, remark, action_by)
sale_audit = SaleAudit.new()
sale_audit.sale_id = sale_id
sale_audit.action = "CHANGE_TAX"
sale_audit.action_at = DateTime.now.utc
sale_audit.action_by = action_by
sale_audit.remark = remark
sale_audit.approved_by = action_by
sale_audit.save!
end
def self.paymal_search(sale_id)
amount = nil
paymal = SaleAudit.where("sale_id =? and action = 'PAYMAL'",sale_id)