From aa1964a4a2fe3f90472c05f8eee29f34e01adcae Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Tue, 10 Apr 2018 00:51:07 +0200 Subject: [PATCH] suite --- app/mailers/product_orders_mails.rb | 16 ++++++---- .../fournisseur.html.haml | 30 +++++++++++++++++-- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/app/mailers/product_orders_mails.rb b/app/mailers/product_orders_mails.rb index b10878d..33035e1 100755 --- a/app/mailers/product_orders_mails.rb +++ b/app/mailers/product_orders_mails.rb @@ -16,17 +16,21 @@ class ProductOrdersMails < ActionMailer::Base def confirmation_cheque(product_order, options = {}) @options = options @product_order = product_order - @email = @product_order.customer.email - @title = "Merci pour votre commande." - mail(:to => @email, :bcc => "info@nicolasbally.com", :subject => @title) + if @product_order.reseaux_id != 19 + @email = @product_order.customer.email + @title = "Merci pour votre commande." + mail(:to => @email, :bcc => "info@nicolasbally.com", :subject => @title) + end end def confirmation_cb(product_order, options = {}) @options = options @product_order = product_order - @email = @product_order.customer.email - @title = "Merci pour votre commande." - mail(:to => @email, :bcc => "info@nicolasbally.com", :subject => @title) + if @product_order.reseaux_id != 19 + @email = @product_order.customer.email + @title = "Merci pour votre commande." + mail(:to => @email, :bcc => "info@nicolasbally.com", :subject => @title) + end end diff --git a/app/views/product_orders_mails/fournisseur.html.haml b/app/views/product_orders_mails/fournisseur.html.haml index b3f3927..679aefa 100644 --- a/app/views/product_orders_mails/fournisseur.html.haml +++ b/app/views/product_orders_mails/fournisseur.html.haml @@ -10,7 +10,11 @@ %p - Pour information, et suite à l’accord avec l’association Vouis’star veuillez trouver ci-joint le récapitulatif de la commande établie ce jour : + Bonjour, + %br + Nous vous prions de bien vouloir trouver notre ordre de commande numero + =@product_order.bl_number + conforme aux conditions tarifaires avec l'accord de l'association Vouis'Star pour la consitution du pack territorial. %table.table @@ -36,6 +40,8 @@ %th Référence %th Nom %th Nbr + -if @fournisseur.id != 4 and @fournisseur.id != 5 + %th Prix U. HT -@product_order.sub_products.group(:reference).where(:fournisseur_id => @fournisseur.id).each do |sub_product_group| @@ -53,6 +59,26 @@ -sub_products.each do |sub_product| -i += sub_product.qte_tot =i - + -if @fournisseur.id != 4 and @fournisseur.id != 5 + %td + + =number_to_currency sub_products[0].price_ht + +%br +%br + +%p + Merci de confirmer la disponnibilité de cette commande au grossiste : +%p{:style => "text-align:center"} + La Vouisienne + %br + 26 route du Colombier + %br + 38960 Saint Etienne de Crossey + %br + Tél : 04 76 55 30 94 - Mail : + =link_to "contact@lavouisienne.fr", "mailto:contact@lavouisienne.fr" +%br + Cordialement, \ No newline at end of file