custom primary key for transaction
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class SaleAudit < ApplicationRecord
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
|
||||
belongs_to :sale
|
||||
|
||||
def record_audit_void(sale_id, void_by, approved_by, reason)
|
||||
@@ -50,4 +50,9 @@ class SaleAudit < ApplicationRecord
|
||||
sale_audit.remark = remark
|
||||
sale_audit.save!
|
||||
end
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.sale_audit_id = SeedGenerator.generate_id(self.class.name, "SAI")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user