From 95b78299270f8cd0713dbf24931cf41e040910e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A9?= Date: Mon, 23 Aug 2021 16:42:42 +0200 Subject: [PATCH 1/2] Remove status input --- app/models/p_customer_sheet.rb | 2 +- app/views/admin/p_customer_sheets/_form.html.haml | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/models/p_customer_sheet.rb b/app/models/p_customer_sheet.rb index 70d1426..c38ed4c 100644 --- a/app/models/p_customer_sheet.rb +++ b/app/models/p_customer_sheet.rb @@ -256,7 +256,7 @@ class PCustomerSheet < ApplicationRecord after_create do - #self.state = "brouillon" if self.state != "Panier web" + self.state = "brouillon" if self.state != "Panier web" self.save end diff --git a/app/views/admin/p_customer_sheets/_form.html.haml b/app/views/admin/p_customer_sheets/_form.html.haml index c8c82b9..16361e8 100755 --- a/app/views/admin/p_customer_sheets/_form.html.haml +++ b/app/views/admin/p_customer_sheets/_form.html.haml @@ -1,14 +1,7 @@ =semantic_form_for [:admin, @p_customer_sheet], :html => {:class => "qi_price_form"}, :remote => false do |form| .content - .qi_row - .qi_pannel.qi_plain.padding - -if @p_customer_sheet and @p_customer_sheet.state != "commande" - =#form.input :demande_type, :collection => ["Brouillon", "Demande de bon de commande","Demande de devis"], :as => :select, :include_blank => false, :label => "Type de demande :" - - =form.input :state, :collection => ["AV BPA", "PAS BPA","BPA", "Traitée"], :as => :select, :include_blank => false, :label => "Statut :" - - =form.input :past_id, :label => "N° système actuel" + .price_line_block_form =form.semantic_fields_for :price_line_block do |f| From 399cc1deaa57330d2a03d7fc0f767b483d1929e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A9?= Date: Tue, 24 Aug 2021 10:24:56 +0200 Subject: [PATCH 2/2] replace state --- app/controllers/admin/buy_lists_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/buy_lists_controller.rb b/app/controllers/admin/buy_lists_controller.rb index cd1b7b6..d68d6b3 100644 --- a/app/controllers/admin/buy_lists_controller.rb +++ b/app/controllers/admin/buy_lists_controller.rb @@ -8,7 +8,7 @@ class Admin::BuyListsController < ApplicationController @p_customer_sheets = PCustomerSheet.all - @p_customer_sheets = @p_customer_sheets.where(:state => ["AV BPA", "PAS BPA", "BPA"]) + @p_customer_sheets = @p_customer_sheets.where(:state => ["brouillon", "offre", "commande"]) @price_line_blocks = PriceLineBlock.where(:price_lineable_type => "PCustomerSheet", :price_lineable_id => @p_customer_sheets.ids)