suite
This commit is contained in:
parent
abad718cec
commit
5fc91dcdda
@ -174,25 +174,28 @@ class Customer < ActiveRecord::Base
|
|||||||
|
|
||||||
before_validation do
|
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 = customer.particular_bill || Particular.new
|
||||||
customer.particular_bill.skip_validation = true
|
customer.particular_bill.skip_validation = true
|
||||||
customer.particular_bill.organisation = customer.organisation
|
customer.particular_bill.organisation = customer.organisation
|
||||||
customer.particular_bill.name = customer.name
|
customer.particular_bill.name = customer.name
|
||||||
customer.particular_bill.firstname = customer.firstname
|
customer.particular_bill.firstname = customer.firstname
|
||||||
customer.particular_bill.address_2 = customer.address
|
customer.particular_bill.address_2 = customer.address
|
||||||
customer.particular_bill.address_3 = customer.address2
|
customer.particular_bill.address_3 = customer.address2
|
||||||
customer.particular_bill.cp = customer.cp
|
customer.particular_bill.cp = customer.cp
|
||||||
customer.particular_bill.city = customer.city
|
customer.particular_bill.city = customer.city
|
||||||
customer.particular_bill.country = customer.country
|
customer.particular_bill.country = customer.country
|
||||||
customer.particular_bill.tel = customer.phone
|
customer.particular_bill.tel = customer.phone
|
||||||
customer.particular_bill.email = customer.email
|
customer.particular_bill.email = customer.email
|
||||||
|
|
||||||
customer.particular_send = customer.particular_send || Particular.new
|
customer.particular_send = customer.particular_send || Particular.new
|
||||||
customer.particular_send.skip_validation = true
|
customer.particular_send.skip_validation = true
|
||||||
|
|
||||||
customer.particular_idem = true
|
customer.particular_idem = true
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -130,6 +130,9 @@
|
|||||||
=@product_order.particular_bill.city
|
=@product_order.particular_bill.city
|
||||||
%br
|
%br
|
||||||
=@product_order.particular_bill.country
|
=@product_order.particular_bill.country
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
=@product_order.particular_bill.tel
|
||||||
|
|
||||||
|
|
||||||
%td{:style => "width:5.5cm;border:0"}
|
%td{:style => "width:5.5cm;border:0"}
|
||||||
@ -152,6 +155,9 @@
|
|||||||
=@product_order.particular_send.city
|
=@product_order.particular_send.city
|
||||||
%br
|
%br
|
||||||
=@product_order.particular_send.country
|
=@product_order.particular_send.country
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
=@product_order.particular_bill.tel
|
||||||
|
|
||||||
%table.table{:style => "width:100%;margin:1cm 0;"}
|
%table.table{:style => "width:100%;margin:1cm 0;"}
|
||||||
%tr
|
%tr
|
||||||
@ -191,30 +197,40 @@
|
|||||||
|
|
||||||
|
|
||||||
%tr
|
%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 Total HT :
|
||||||
%td{:style => "text-align:right;"}= number_to_currency(@product_order.archived_total_ht, locale: :fr)
|
%td{:style => "text-align:right;"}= number_to_currency(@product_order.archived_total_ht, locale: :fr)
|
||||||
|
|
||||||
%tr
|
%tr
|
||||||
%td{:colspan => 3, :style => "border:0;text-align:right;"}
|
|
||||||
%td TVA :
|
%td TVA :
|
||||||
%td{:style => "text-align:right;"}= number_to_currency(@product_order.archived_total_tva, locale: :fr)
|
%td{:style => "text-align:right;"}= number_to_currency(@product_order.archived_total_tva, locale: :fr)
|
||||||
|
|
||||||
%tr
|
%tr
|
||||||
%td{:colspan => 3, :style => "border:0;text-align:right;"}
|
|
||||||
%td Total TTC :
|
%td Total TTC :
|
||||||
%td{:style => "text-align:right;"}= number_to_currency(@product_order.archived_total_ttc, locale: :fr)
|
%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
|
%br
|
||||||
|
|
||||||
<!---
|
<!---
|
||||||
|
@ -37,7 +37,11 @@
|
|||||||
CB
|
CB
|
||||||
-elsif @product_order.product_order_payment_type_ok_id == 1
|
-elsif @product_order.product_order_payment_type_ok_id == 1
|
||||||
Chèque
|
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
|
%table.table
|
||||||
%tr
|
%tr
|
||||||
|
@ -49,5 +49,5 @@
|
|||||||
.content= yield
|
.content= yield
|
||||||
|
|
||||||
.bottom{:style => "padding:10px;font-size:0.9em;"}
|
.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"
|
||||||
|
|
@ -4,9 +4,17 @@
|
|||||||
|
|
||||||
%p Bonjour,
|
%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"
|
=render :partial => "public/product_orders/mail_recap"
|
||||||
|
|
||||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user