diff --git a/app/views/admin/price_documents/print.html.haml b/app/views/admin/price_documents/print.html.haml index e8c6b76..c6e495f 100644 --- a/app/views/admin/price_documents/print.html.haml +++ b/app/views/admin/price_documents/print.html.haml @@ -196,37 +196,40 @@ %tr %td - Forfait - ="#{price_line.qte}J location" - =price_line.title - - - -if price_line.ship_price_ht.to_f > 0.0 - ="+ livraison incluse" - %br - Livraison : - - =l price_line.ship_at, :format => :short_date if price_line.ship_at - - %br - Récupération : - - =l price_line.return_at, :format => :short_date if price_line.return_at - - -if price_line.carburant + -if price_line.location_template + Forfait + ="#{price_line.qte}J location" + =price_line.title + + + -if price_line.ship_price_ht.to_f > 0.0 + ="+ livraison incluse" %br - Carburant : livrée réservoir plein, rendu plein, remise à niveau : - =price_line.carburant_type - =number_to_currency price_line.carburant_price - HT / litres - ="(#{number_to_currency(price_line.carburant_price*(price_line.tva_account_value/100+1))} TTC)" - - %br - %br - - Caution : chèque de - =number_to_currency price_line.caution - non encaissé + Livraison : + + =l price_line.ship_at, :format => :short_date if price_line.ship_at + + %br + Récupération : + + =l price_line.return_at, :format => :short_date if price_line.return_at + + -if price_line.carburant + %br + Carburant : livrée réservoir plein, rendu plein, remise à niveau : + =price_line.carburant_type + =number_to_currency price_line.carburant_price + HT / litres + ="(#{number_to_currency(price_line.carburant_price*(price_line.tva_account_value/100+1))} TTC)" + + %br + %br + + Caution : chèque de + =number_to_currency price_line.caution + non encaissé + -else + =price_line.title %td.numeraire @@ -237,21 +240,22 @@ %tr %td - %br - %br - %br - -if @price_document.label == "Facture" - %strong - Le réglement de cette facture vaut acceptation de nos conditions générales de vente et acceptation du contrat N° - =@price_document.contrat_reference + -if price_line_block.covid + %br + %br + %br + -if @price_document.label == "Facture" + %strong + Le réglement de cette facture vaut acceptation de nos conditions générales de vente et acceptation du contrat N° + =@price_document.contrat_reference + + -else @price_document.label == "Contrat" + %strong La signature de ce contrat avec "Bon pour accord" où le réglement de la facture associée vaut acceptation de nos conditions générales de vente et acceptation de ce contrat. - -else @price_document.label == "Contrat" - %strong La signature de ce contrat avec "Bon pour accord" où le réglement de la facture associée vaut acceptation de nos conditions générales de vente et acceptation de ce contrat. - - %br - %br - %strong - COVID-19 : Nous vous demandons de respecter les gestes barrières avec le livreur, et laisser la machine au moins 5h sans utilisation à la livraison & avant la récupération. + %br + %br + %strong + COVID-19 : Nous vous demandons de respecter les gestes barrières avec le livreur, et laisser la machine au moins 5h sans utilisation à la livraison & avant la récupération. %td %td diff --git a/app/views/admin/price_line_blocks/_price_document_form.html.haml b/app/views/admin/price_line_blocks/_price_document_form.html.haml index 67ce669..dd8b70f 100644 --- a/app/views/admin/price_line_blocks/_price_document_form.html.haml +++ b/app/views/admin/price_line_blocks/_price_document_form.html.haml @@ -44,6 +44,7 @@ = f.input :customer_ref, :label => "Référence commande client :" + = f.input :covid, :label => "Mention covid ?" .price_lines_form diff --git a/app/views/admin/price_lines/_form.html.haml b/app/views/admin/price_lines/_form.html.haml index 4909549..9809025 100644 --- a/app/views/admin/price_lines/_form.html.haml +++ b/app/views/admin/price_lines/_form.html.haml @@ -134,6 +134,8 @@ %table.form-table{:style => "width:100%;margin-top:5px;"} %tr %td{:style => "width:30px"} + %td + = form.input :location_template, :label => "Location ?" %td = form.input :start_at, :label => "Date de début de location :", :as => :date %td diff --git a/db/migrate/20200525113606_add_covid_to_price_line_blocks.rb b/db/migrate/20200525113606_add_covid_to_price_line_blocks.rb new file mode 100644 index 0000000..ef2694b --- /dev/null +++ b/db/migrate/20200525113606_add_covid_to_price_line_blocks.rb @@ -0,0 +1,5 @@ +class AddCovidToPriceLineBlocks < ActiveRecord::Migration[6.0] + def change + add_column :price_line_blocks, :covid, :boolean, :default => true + end +end diff --git a/db/migrate/20200525113631_add_location_template_to_price_lines.rb b/db/migrate/20200525113631_add_location_template_to_price_lines.rb new file mode 100644 index 0000000..cd382f6 --- /dev/null +++ b/db/migrate/20200525113631_add_location_template_to_price_lines.rb @@ -0,0 +1,5 @@ +class AddLocationTemplateToPriceLines < ActiveRecord::Migration[6.0] + def change + add_column :price_lines, :location_template, :boolean, :default => true + end +end diff --git a/db/schema.rb b/db/schema.rb index 4dc248e..8d94aa3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_04_12_143258) do +ActiveRecord::Schema.define(version: 2020_05_25_113631) do create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| t.string "name" @@ -1953,6 +1953,7 @@ ActiveRecord::Schema.define(version: 2020_04_12_143258) do t.boolean "cc_remise_qte_ok" t.integer "p_fournisseur_id" t.date "ct_payment_end_at" + t.boolean "covid", default: true t.index ["p_customer_id"], name: "index_price_line_blocks_on_p_customer_id" end @@ -2112,6 +2113,7 @@ ActiveRecord::Schema.define(version: 2020_04_12_143258) do t.datetime "end_at" t.datetime "ship_at" t.datetime "return_at" + t.boolean "location_template", default: true end create_table "quote_contents", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|