mmsc_app/app/models/p_customer_rib.rb
Nicolas Bally a6aa1f6074 Initial
2020-05-25 11:40:11 +02: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