before sync
This commit is contained in:
@@ -14,6 +14,23 @@ class SeedGenerator < ApplicationRecord
|
||||
return saleOrderId
|
||||
end
|
||||
|
||||
def self.sync_seed_generator_records(seed_generators)
|
||||
if !seed_generators.nil?
|
||||
seed_generators.each do |sg|
|
||||
seed = SeedGenerator.find_by_model(sg['model'])
|
||||
if seed.nil?
|
||||
seed = SeedGenerator.new
|
||||
end
|
||||
seed.model = sg['model']
|
||||
seed.increase_by = sg['increase_by']
|
||||
seed.current = sg['current']
|
||||
seed.next = sg['next']
|
||||
seed.save
|
||||
end
|
||||
puts '....... Seed Generator sync completed! .......'
|
||||
end
|
||||
end
|
||||
|
||||
# Generate Receipt No for number order (1,2,3) Don't touch
|
||||
def self.new_receipt_no
|
||||
seed = SeedGenerator.find_by_model("Sale")
|
||||
|
||||
Reference in New Issue
Block a user