suite
This commit is contained in:
parent
a9a99de45f
commit
94547f1fed
@ -171,6 +171,30 @@ class Customer < ActiveRecord::Base
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user