custom primary key for transaction
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
|
||||
class Sale < ApplicationRecord
|
||||
#primary key - need to be unique generated for multiple shops
|
||||
|
||||
#before_create :generate_receipt_no
|
||||
belongs_to :cashier, :optional => true
|
||||
belongs_to :customer, :optional => true
|
||||
@@ -242,4 +242,8 @@ class Sale < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.sale_id = SeedGenerator.generate_id(self.class.name, "SAL")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user