custom primary key for transaction

This commit is contained in:
Min Zeya Phyo
2017-06-04 16:27:14 +06:30
parent 394d2ed938
commit 4fc511d531
19 changed files with 88 additions and 55 deletions

View File

@@ -14,8 +14,9 @@ class SeedGenerator < ApplicationRecord
seed.current = current_no
seed.save
end
padding_len = 16 - prefix.len
return prefix + "-" + seed.current.to_s
return prefix +"-"+ seed.current.to_s.to_s.rjust((16-prefix.length)+1,'0')
end
def self.new_receipt_no