change receipt no
This commit is contained in:
@@ -16,19 +16,25 @@ class SeedGenerator < ApplicationRecord
|
||||
def self.new_receipt_no
|
||||
seed = SeedGenerator.find_by_model("Sale")
|
||||
new_receipt_no = 0
|
||||
if (seed.nil?)
|
||||
seed = SeedGenerator.new()
|
||||
seed.model = "Sale"
|
||||
new_receipt_no = seed.next
|
||||
seed.save
|
||||
# if (seed.nil?)
|
||||
# seed = SeedGenerator.new()
|
||||
# seed.model = "Sale"
|
||||
# new_receipt_no = seed.next
|
||||
# seed.save
|
||||
# else
|
||||
# current_no = seed.next
|
||||
# seed.next = seed.next
|
||||
# seed.current = current_no
|
||||
# seed.save
|
||||
# end
|
||||
|
||||
if seed.current > 0
|
||||
new_receipt_no = seed.current
|
||||
else
|
||||
new_receipt_no = seed.current + 1
|
||||
end
|
||||
|
||||
return seed.current
|
||||
return new_receipt_no
|
||||
end
|
||||
|
||||
# Generate for 4 digit Code
|
||||
|
||||
Reference in New Issue
Block a user