check seed
This commit is contained in:
@@ -15,7 +15,7 @@ class SeedGenerator < ApplicationRecord
|
||||
# Generate Receipt No for number order (1,2,3) Don't touch
|
||||
def self.new_receipt_no
|
||||
seed = SeedGenerator.find_by_model("Sale")
|
||||
new_receipt_no = 0
|
||||
new_receipt_no = 1
|
||||
# if (seed.nil?)
|
||||
# seed = SeedGenerator.new()
|
||||
# seed.model = "Sale"
|
||||
@@ -27,11 +27,12 @@ class SeedGenerator < ApplicationRecord
|
||||
# seed.current = current_no
|
||||
# seed.save
|
||||
# end
|
||||
|
||||
if seed.current > 0
|
||||
new_receipt_no = seed.current
|
||||
else
|
||||
new_receipt_no = seed.current + 1
|
||||
if !seed.nil?
|
||||
if seed.current > 0
|
||||
new_receipt_no = seed.current
|
||||
else
|
||||
new_receipt_no = seed.current + 1
|
||||
end
|
||||
end
|
||||
|
||||
return new_receipt_no
|
||||
|
||||
Reference in New Issue
Block a user