sadem_app/app/models/p_customer_rib.rb
Nicolas Bally 000500e534 init
2020-02-25 02:33:11 +01:00

14 lines
335 B
Ruby

class PCustomerRib < ActiveRecord::Base
belongs_to :p_customer
has_many :p_documents, :dependent => :nullify
def generate_rum
if self.sign_date
self.rum = "JOA"+self.p_customer.ref.to_s+self.sign_date.year.to_s+('%02d' % self.sign_date.month)+('%02d' % self.sign_date.day)
self.save
end
end
end