This commit is contained in:
Nicolas Bally 2017-10-24 13:26:02 +02:00
parent abad718cec
commit 5fc91dcdda
6 changed files with 71 additions and 31 deletions

View File

@ -174,25 +174,28 @@ class Customer < ActiveRecord::Base
before_validation do
customer = self
if !self.particular_bill and !self.particular_send
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_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_send = customer.particular_send || Particular.new
customer.particular_send.skip_validation = true
customer.particular_idem = true
customer.particular_idem = true
end
end

View File

@ -130,6 +130,9 @@
=@product_order.particular_bill.city
%br
=@product_order.particular_bill.country
%br
%br
=@product_order.particular_bill.tel
%td{:style => "width:5.5cm;border:0"}
@ -152,6 +155,9 @@
=@product_order.particular_send.city
%br
=@product_order.particular_send.country
%br
%br
=@product_order.particular_bill.tel
%table.table{:style => "width:100%;margin:1cm 0;"}
%tr
@ -191,30 +197,40 @@
%tr
%td{:colspan => 3, :style => "border:0;text-align:right;"}
%td{:colspan => 3, :rowspan => 3, :style => "border:0;text-align:left;"}
%p
%br
Mode de paiment :
-if @product_order.product_order_payment_type_ok_id == 3
CB
-elsif @product_order.product_order_payment_type_ok_id == 1
Chèque
-elsif @product_order.product_order_payment_type_ok_id == 2
Virement
-elsif @product_order.product_order_payment_type_ok_id == 4
Mandat administratif
%br
%br
Franco de port pour le Pays Voironnais
%td Total HT :
%td{:style => "text-align:right;"}= number_to_currency(@product_order.archived_total_ht, locale: :fr)
%tr
%td{:colspan => 3, :style => "border:0;text-align:right;"}
%td TVA :
%td{:style => "text-align:right;"}= number_to_currency(@product_order.archived_total_tva, locale: :fr)
%tr
%td{:colspan => 3, :style => "border:0;text-align:right;"}
%td Total TTC :
%td{:style => "text-align:right;"}= number_to_currency(@product_order.archived_total_ttc, locale: :fr)
-if false
%p
Mode de paiment :
-if @product_order.product_order_payment_type_ok_id == 3
CB
-elsif @product_order.product_order_payment_type_ok_id == 1
Chèque
%br
<!---

View File

@ -37,6 +37,10 @@
CB
-elsif @product_order.product_order_payment_type_ok_id == 1
Chèque
-elsif @product_order.product_order_payment_type_ok_id == 2
Virement
-elsif @product_order.product_order_payment_type_ok_id == 4
Mandat administratif
%table.table

View File

@ -49,5 +49,5 @@
.content= yield
.bottom{:style => "padding:10px;font-size:0.9em;"}
=link_to image_tag("http://negos.pro/logo_mail.png", :style => "margin:20px auto;display:block;height:200px;"), "http://negos.pro"
=link_to image_tag("http://negos.pro/logo_mail.png", :style => "margin:20px auto;display:block;width:180px;max-width:100%;"), "http://negos.pro"

View File

@ -4,9 +4,17 @@
%p Bonjour,
%p Nous vous remercions pour votre pré-commande, celle-ci sera expédiée dès que nous aurons reçu votre règlement.
%p Nous vous remercions pour votre pré-commande.
%p Vous trouverez ci-dessous le récapitulatif de cette commande :
%p Nous vous confirmerons prochainement la date de livraison.
%p Par ailleurs, celle-ci vous sera expédiée dès que nous aurons reçu votre règlement.
%p
Pour cela, vous pouvez contacter LA VOUISIENNE au 04 76 55 30 94 ou par mail:
=link_to "contact@lavouisienne.fr.", "mailto:contact@lavouisienne.fr"
%p Vous trouverez ci-dessous le récapitulatif de votre commande :
=render :partial => "public/product_orders/mail_recap"

View File

@ -0,0 +1,9 @@
=debug params[:product_order][:particular_idem]
=debug params[:product_order]
%br
%br
suite
=debug @product_order.update_attributes(params.require(:product_order).permit!)
=debug @product_order.errors