Merge branch 'master' of gitlab.quartz.xyz:quartz/negos_app

This commit is contained in:
Nicolas Bally 2017-10-23 01:33:01 +02:00
commit 0d63783d18

View File

@ -172,6 +172,30 @@ class Customer < ActiveRecord::Base
end end
before_validation do
customer = self
customer.particular_bill = customer.particular_bill || Particular.new
customer.particular_bill.skip_validation = true
customer.particular_bill.organisation = customer.organisation
customer.particular_bill.name = customer.name
customer.particular_bill.firstname = customer.firstname
customer.particular_bill.address_2 = customer.address
customer.particular_bill.address_3 = customer.address2
customer.particular_bill.cp = customer.cp
customer.particular_bill.city = customer.city
customer.particular_bill.country = customer.country
customer.particular_bill.tel = customer.phone
customer.particular_bill.email = customer.email
customer.particular_send = customer.particular_send || Particular.new
customer.particular_send.skip_validation = true
customer.particular_idem = true
end