From 5fc91dcdda06894e68bcc26238f7236cbd8274bf Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Tue, 24 Oct 2017 13:26:02 +0200 Subject: [PATCH] suite --- app/models/customer.rb | 35 +++++++++--------- app/views/admin/product_orders/bl.html.haml | 36 +++++++++++++------ app/views/admin/product_orders/show.html.haml | 6 +++- app/views/layouts/mail.html.haml | 2 +- .../confirmation_cheque.html.haml | 14 ++++++-- .../product_orders/particulars_save.html.haml | 9 +++++ 6 files changed, 71 insertions(+), 31 deletions(-) create mode 100644 app/views/public/product_orders/particulars_save.html.haml diff --git a/app/models/customer.rb b/app/models/customer.rb index f7799e9..5e513ab 100755 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -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 diff --git a/app/views/admin/product_orders/bl.html.haml b/app/views/admin/product_orders/bl.html.haml index a53d3c9..b50cf5c 100644 --- a/app/views/admin/product_orders/bl.html.haml +++ b/app/views/admin/product_orders/bl.html.haml @@ -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