Amélioration interface saisie des prix par les fournisseurs.
Consulter le lien avec le token en navigation privée, épuration de l'affichage, méthodes dédiées...
This commit is contained in:
parent
e9e0f009a6
commit
b09b941321
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
class Admin::PriceDocumentsController < ApplicationController
|
class Admin::PriceDocumentsController < ApplicationController
|
||||||
layout "admin"
|
layout "admin"
|
||||||
before_action :auth_admin, :except => :print
|
before_action :auth_admin, :except => [:print, :consult, :consult_create, :consult_edit, :consult_update]
|
||||||
|
|
||||||
before_action :admin_space, :except => :print
|
before_action :admin_space, :except => :print
|
||||||
|
|
||||||
@ -267,6 +267,7 @@ class Admin::PriceDocumentsController < ApplicationController
|
|||||||
|
|
||||||
|
|
||||||
def consult
|
def consult
|
||||||
|
@consult = true
|
||||||
|
|
||||||
@demande = PriceDocument.where(:f_token => params[:id]).first
|
@demande = PriceDocument.where(:f_token => params[:id]).first
|
||||||
|
|
||||||
@ -285,6 +286,28 @@ class Admin::PriceDocumentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def consult_create
|
||||||
|
@consult = true
|
||||||
|
|
||||||
|
@price_document = PriceDocument.new(params.require(:price_document).permit!)
|
||||||
|
@price_document.date = Date.today
|
||||||
|
if @price_document.save
|
||||||
|
redirect_to consult_edit_admin_price_document_path(:id => @price_document.token)
|
||||||
|
else
|
||||||
|
render action: "consult"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def consult_edit
|
||||||
|
@consult = true
|
||||||
|
|
||||||
|
@price_document = PriceDocument.where(:token => params[:id]).first
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@price_document = PriceDocument.find(params[:id])
|
@price_document = PriceDocument.find(params[:id])
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
class Admin::PriceLinesController < ApplicationController
|
class Admin::PriceLinesController < ApplicationController
|
||||||
layout "admin"
|
layout "admin"
|
||||||
before_action :auth_admin
|
before_action :auth_admin, :except => [:edit, :update]
|
||||||
|
|
||||||
before_action :admin_space
|
before_action :admin_space
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ module TranslationHelper
|
|||||||
content = capture(&block) if block_given?
|
content = capture(&block) if block_given?
|
||||||
r = ""
|
r = ""
|
||||||
|
|
||||||
if current_admin.id == 1
|
if current_admin and current_admin.id == 1
|
||||||
r += "<span class='admin_diag'>"
|
r += "<span class='admin_diag'>"
|
||||||
r += ic(:"stethoscope") if show_icon
|
r += ic(:"stethoscope") if show_icon
|
||||||
|
|
||||||
|
@ -17,7 +17,10 @@ class PriceLine < ApplicationRecord
|
|||||||
:ref => {:name => "Ref", :reorder => true},
|
:ref => {:name => "Ref", :reorder => true},
|
||||||
:title => {:name => "Désignation", :reorder => true},
|
:title => {:name => "Désignation", :reorder => true},
|
||||||
:qte => {:name => "Qté", :reorder => true},
|
:qte => {:name => "Qté", :reorder => true},
|
||||||
|
|
||||||
:qte_available => {:name => "Qté dispo.", :reorder => true},
|
:qte_available => {:name => "Qté dispo.", :reorder => true},
|
||||||
|
|
||||||
|
:ct_u_price_ht => {:name => "Prix de vente", :reorder => true},
|
||||||
:ref_fournisseur => {:name => "Réf. fournisseur", :reorder => true},
|
:ref_fournisseur => {:name => "Réf. fournisseur", :reorder => true},
|
||||||
:p_product_power_id => {:name => "Chargeur", :reorder => true},
|
:p_product_power_id => {:name => "Chargeur", :reorder => true},
|
||||||
:p_product_zone_id => {:name => "Zone", :reorder => true},
|
:p_product_zone_id => {:name => "Zone", :reorder => true},
|
||||||
@ -26,7 +29,8 @@ class PriceLine < ApplicationRecord
|
|||||||
:ram_unit => {:name => "Ram unité", :reorder => true},
|
:ram_unit => {:name => "Ram unité", :reorder => true},
|
||||||
:eu => {:name => "EU ?", :reorder => true},
|
:eu => {:name => "EU ?", :reorder => true},
|
||||||
:fullkit => {:name => "Fullkit ?", :reorder => true},
|
:fullkit => {:name => "Fullkit ?", :reorder => true},
|
||||||
:lang_start => {:name => "Démarrage écran langue ?", :reorder => true}
|
:lang_start => {:name => "Démarrage écran langue ?", :reorder => true},
|
||||||
|
:actions => {:name => "Actions"}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
-if current_admin
|
||||||
.qi_header
|
.qi_header
|
||||||
|
|
||||||
%h1
|
%h1
|
||||||
@ -9,7 +10,15 @@
|
|||||||
|
|
||||||
.qi_row
|
.qi_row
|
||||||
|
|
||||||
=semantic_form_for [:admin, @price_document], :html => {:class => "qi_price_form"}, :remote => false do |f|
|
%p{:style => "text-align:center;font-size:1.2em;"}
|
||||||
|
Vous allez pouvoir répondre à une demande de cotation envoyée par Arcom.
|
||||||
|
%p{:style => "text-align:center;font-size:1.2em;"}
|
||||||
|
Pour cela, merci de nous indiquer pour quelle société vous répondez à notre demande de chiffrage.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=semantic_form_for [:admin, @price_document], :url => consult_create_admin_price_documents_path(), :html => {:class => "qi_price_form"}, :remote => false do |f|
|
||||||
-@p_customer = @price_document.p_customer
|
-@p_customer = @price_document.p_customer
|
||||||
=diag do
|
=diag do
|
||||||
=f.object.errors.messages
|
=f.object.errors.messages
|
||||||
@ -22,24 +31,23 @@
|
|||||||
=f.hidden_field :price_document_type_id
|
=f.hidden_field :price_document_type_id
|
||||||
|
|
||||||
|
|
||||||
= f.input :public_fournisseur_name, :label => "Nom entreprise"
|
%center= f.input :public_fournisseur_name, :label => "Nom de votre société :"
|
||||||
|
|
||||||
|
|
||||||
|
%p{:style => "text-align:center;font-size:1.2em;"}
|
||||||
|
Vous pouvez également indiquer votre référence interne :
|
||||||
|
|
||||||
|
|
||||||
=hidden_field_tag :public_edit, params[:public_edit]
|
=hidden_field_tag :public_edit, params[:public_edit]
|
||||||
|
|
||||||
= @price_document.price_line_block.block_type
|
|
||||||
|
|
||||||
|
|
||||||
.price_line_block_form
|
.price_line_block_form
|
||||||
=f.semantic_fields_for :price_line_block do |f|
|
=f.semantic_fields_for :price_line_block do |f|
|
||||||
=render :partial => "admin/price_line_blocks/form_#{f.object.block_type_slug}", :locals => {:f => f}
|
%center=render :partial => "admin/price_line_blocks/form_#{f.object.block_type_slug}", :locals => {:f => f}
|
||||||
|
|
||||||
|
|
||||||
|
%center
|
||||||
|
=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
||||||
|
|
||||||
.large_actions
|
|
||||||
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
38
app/views/admin/price_documents/consult_edit.html.haml
Normal file
38
app/views/admin/price_documents/consult_edit.html.haml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
|
||||||
|
.qi_row
|
||||||
|
.qi_pannel.padding
|
||||||
|
|
||||||
|
%table.table.table-striped
|
||||||
|
%tr
|
||||||
|
%td
|
||||||
|
Numéro réponse
|
||||||
|
|
||||||
|
%td
|
||||||
|
=@price_document.d_number
|
||||||
|
%tr
|
||||||
|
%td
|
||||||
|
Nom fournisseur saisi
|
||||||
|
%td
|
||||||
|
=@price_document.public_fournisseur_name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-params[:search][:per_page] = params[:search][:per_page] || 5000
|
||||||
|
-per_page = params[:search][:per_page]
|
||||||
|
-page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
||||||
|
|
||||||
|
-@price_lines = @price_document.price_line_block.price_lines
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-@price_lines = sort_by_sorting(@price_lines, "created_at DESC")
|
||||||
|
-@price_lines = @price_lines.page(page).per(per_page)
|
||||||
|
%br
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.clear
|
||||||
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @price_lines, :key => "reponses-prix-show"}
|
||||||
|
|
||||||
|
|
@ -3,17 +3,19 @@
|
|||||||
|
|
||||||
|
|
||||||
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
|
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
|
||||||
.qi_pannel.qi_plain.padding{:style => "margin:20px 0;"}
|
|
||||||
|
|
||||||
= f.input :p_fournisseur_id, :label => "Fournisseur", :collection => PFournisseur.all, :as => :select, :member_label => :name if @price_document.label == "Réponse fournisseur" and current_admin
|
= f.input :p_fournisseur_id, :label => "Fournisseur", :collection => PFournisseur.all, :as => :select, :member_label => :name if @price_document.label == "Réponse fournisseur" and current_admin
|
||||||
= f.input :customer_ref, :label => "Référence cotation fournisseur :"
|
= f.input :customer_ref, :label => "Votre référence de cotation :"
|
||||||
|
|
||||||
|
|
||||||
|
%div{:style => ("display:none" if !current_admin)}
|
||||||
|
|
||||||
.price_lines_form
|
.price_lines_form
|
||||||
=f.semantic_fields_for :price_lines do |f|
|
=f.semantic_fields_for :price_lines do |f|
|
||||||
=render :partial => "admin/price_lines/form_#{f.object.block_type_slug}", :locals => {:form => f}
|
=render :partial => "admin/price_lines/form_#{f.object.block_type_slug}", :locals => {:form => f}
|
||||||
|
|
||||||
%p= link_to_add_fields "Ajouter une ligne", f, :price_lines, {:class => "btn btn-primary"}
|
%p= link_to_add_fields "Ajouter une ligne", f, :price_lines, {:class => "btn btn-primary"} if current_admin
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@
|
|||||||
-else
|
-else
|
||||||
=qi_js_field(form, :price_line, :price_u_ht, :label => "Prix U HT :")
|
=qi_js_field(form, :price_line, :price_u_ht, :label => "Prix U HT :")
|
||||||
|
|
||||||
%div{:style => ("display:none;" if !current_admin.has_permission?("customer-sheets-personalised-price"))}
|
%div{:style => ("display:none;" if !current_admin or !current_admin.has_permission?("customer-sheets-personalised-price"))}
|
||||||
= form.input :forced_price, :label => "Prix personnalisé ?", :as => :boolean, :input_html => {:class => "input_price_line_forced_price"}
|
= form.input :forced_price, :label => "Prix personnalisé ?", :as => :boolean, :input_html => {:class => "input_price_line_forced_price"}
|
||||||
.forced_price_wrapper{:style => ("display:none;" if !form.object.forced_price)}= form.input :ct_u_price_ht, :label => false, :input_html => {:class => "input_price_line_ct_u_price_ht"}
|
.forced_price_wrapper{:style => ("display:none;" if !form.object.forced_price)}= form.input :ct_u_price_ht, :label => false, :input_html => {:class => "input_price_line_ct_u_price_ht"}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
= form.input :ram, :label => "Ram"
|
= form.input :ram, :label => "Ram"
|
||||||
|
|
||||||
%td
|
%td
|
||||||
= form.input :ram, :label => "Ram unité"
|
= form.input :ram_unit, :label => "Ram unité"
|
||||||
|
|
||||||
|
|
||||||
%td
|
%td
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
%tr#price_document_row{:id => price_line.id}
|
%tr#price_line_row{:id => price_line.id}
|
||||||
-tr = {}
|
-tr = {}
|
||||||
|
-tr[:actions] = capture do
|
||||||
|
%td
|
||||||
|
=link_to ic(:pencil), edit_admin_price_line_path(price_line), :remote => true
|
||||||
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => price_line}
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => price_line}
|
||||||
|
|
@ -0,0 +1,61 @@
|
|||||||
|
|
||||||
|
|
||||||
|
=semantic_form_for [:admin, @price_line], :remote => true do |form|
|
||||||
|
|
||||||
|
.content
|
||||||
|
Produit :
|
||||||
|
=form.object.p_product_ref.cc_name if form.object.p_product_ref
|
||||||
|
%br
|
||||||
|
Quantité à satisfaire :
|
||||||
|
=form.object.qte
|
||||||
|
|
||||||
|
%br
|
||||||
|
%br
|
||||||
|
|
||||||
|
%table.top_td{:style => "width:100%;"}
|
||||||
|
%tr
|
||||||
|
|
||||||
|
%td
|
||||||
|
= form.input :p_product_power_id, :label => "Type de chargeur", :collection => PProductPower.all, :include_blank => false, :as => :select
|
||||||
|
|
||||||
|
%td
|
||||||
|
= form.input :qte_available, :label => "Qté disponible :", :input_html => {:class => "input_price_line_qte"}
|
||||||
|
|
||||||
|
|
||||||
|
%td
|
||||||
|
= form.input :ct_u_price_ht, :label => "Prix vente"
|
||||||
|
|
||||||
|
%td
|
||||||
|
= form.input :ready_stock, :label => "Ready stock", :as => :select
|
||||||
|
|
||||||
|
%td
|
||||||
|
= form.input :ram, :label => "Ram"
|
||||||
|
|
||||||
|
%td
|
||||||
|
= form.input :ram_unit, :label => "Ram unité"
|
||||||
|
|
||||||
|
|
||||||
|
%td
|
||||||
|
= form.input :eu, :label => "EU ?", :as => :select
|
||||||
|
|
||||||
|
|
||||||
|
%td
|
||||||
|
= form.input :p_product_zone_id, :label => "Zone", :collection => PProductZone.all, :include_blank => true, :as => :select
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%td
|
||||||
|
= form.input :fullkit, :label => "Fullkit", :as => :select
|
||||||
|
|
||||||
|
%td
|
||||||
|
= form.input :lang_start, :label => "Démarage sur l'écran de langue (starting on screen language)", :as => :select
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
= form.input :comment, :label => "Commentaire", :input_html => {:style => "height:70px;"}
|
||||||
|
|
||||||
|
.actions= form.submit "Sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
@ -1 +1 @@
|
|||||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
show_pane_hover("<%= escape_javascript(render(:partial => "reponse_pane_hover_form"))%>",1200,900);
|
@ -30,6 +30,7 @@
|
|||||||
=link_to image_tag("/logo-presta.png"), "/", :id => "logo"
|
=link_to image_tag("/logo-presta.png"), "/", :id => "logo"
|
||||||
|
|
||||||
|
|
||||||
|
-if current_admin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -73,7 +74,7 @@
|
|||||||
.bottom
|
.bottom
|
||||||
.element
|
.element
|
||||||
|
|
||||||
-if current_admin.has_permission?("admins")
|
-if current_admin and current_admin.has_permission?("admins")
|
||||||
=link_to admin_admins_path do
|
=link_to admin_admins_path do
|
||||||
.cat#big_cat_preferences
|
.cat#big_cat_preferences
|
||||||
=ic :"cog"
|
=ic :"cog"
|
||||||
@ -90,6 +91,7 @@
|
|||||||
%nav#admin_nav.navbar.navbar-expand-lg.navbar-dark.bg-light
|
%nav#admin_nav.navbar.navbar-expand-lg.navbar-dark.bg-light
|
||||||
%button.navbar-toggler{"aria-controls" => "navbarSupportedContent", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-target" => "#navbarSupportedContent", "data-toggle" => "collapse", :type => "button"}
|
%button.navbar-toggler{"aria-controls" => "navbarSupportedContent", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-target" => "#navbarSupportedContent", "data-toggle" => "collapse", :type => "button"}
|
||||||
%span.navbar-toggler-icon
|
%span.navbar-toggler-icon
|
||||||
|
-if current_admin
|
||||||
#navbarSupportedContent.collapse.navbar-collapse
|
#navbarSupportedContent.collapse.navbar-collapse
|
||||||
%ul.navbar-nav.mr-auto
|
%ul.navbar-nav.mr-auto
|
||||||
-if @qi_menu_active
|
-if @qi_menu_active
|
||||||
|
@ -612,9 +612,14 @@ Rails.application.routes.draw do
|
|||||||
|
|
||||||
get :consult
|
get :consult
|
||||||
post :consult_save
|
post :consult_save
|
||||||
|
post :consult_create
|
||||||
|
get :consult_edit
|
||||||
|
put :consult_update
|
||||||
|
|
||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
get :search_to_affect
|
get :search_to_affect
|
||||||
|
post :consult_create
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user