From 25a2c24b1aedc8eb3907c9de70137c16039cea09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A9?= Date: Wed, 1 Sep 2021 18:45:43 +0200 Subject: [PATCH] Match fournisseur --- .../admin/price_documents_controller.rb | 3 +++ .../_form_p_fournisseur.html.haml | 16 ++++++++++++++++ .../match_p_fournisseur.html.haml | 1 + .../price_documents/match_p_fournisseur.js.erb | 1 + config/routes.rb | 2 +- 5 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 app/views/admin/price_documents/_form_p_fournisseur.html.haml create mode 100644 app/views/admin/price_documents/match_p_fournisseur.html.haml create mode 100644 app/views/admin/price_documents/match_p_fournisseur.js.erb diff --git a/app/controllers/admin/price_documents_controller.rb b/app/controllers/admin/price_documents_controller.rb index 492ed2c..2aed63a 100644 --- a/app/controllers/admin/price_documents_controller.rb +++ b/app/controllers/admin/price_documents_controller.rb @@ -595,5 +595,8 @@ class Admin::PriceDocumentsController < ApplicationController end + def match_p_fournisseur + @price_document = PriceDocument.find(params[:id]) + end end diff --git a/app/views/admin/price_documents/_form_p_fournisseur.html.haml b/app/views/admin/price_documents/_form_p_fournisseur.html.haml new file mode 100644 index 0000000..3514749 --- /dev/null +++ b/app/views/admin/price_documents/_form_p_fournisseur.html.haml @@ -0,0 +1,16 @@ +=semantic_form_for [:admin, @price_document], :html => {:class => "qi_price_form"}, :remote => false do |f| + =diag do + =f.object.errors.messages + + .content + %h1.mb-2 Rapprochemnet du fournisseur + .form-row + .col-md-6 + = f.input :public_fournisseur_name, label: "Nom indiqué par le fournisseur :", :input_html => { :disabled => true, class: "mx-3" } + .form-row + .col-md-6 + =f.semantic_fields_for :price_line_block do |form| + =form.input :p_fournisseur, as: :select, collection: PFournisseur.pluck(:name, :id), label: "Correspondance base fournisseurs :", :input_html => { class: "mx-3"} + + .large_actions + .actions=f.submit "sauvegarder", :class => "btn btn-primary" diff --git a/app/views/admin/price_documents/match_p_fournisseur.html.haml b/app/views/admin/price_documents/match_p_fournisseur.html.haml new file mode 100644 index 0000000..ee81044 --- /dev/null +++ b/app/views/admin/price_documents/match_p_fournisseur.html.haml @@ -0,0 +1 @@ +.qi_row=render :partial => "form_p_fournisseur" diff --git a/app/views/admin/price_documents/match_p_fournisseur.js.erb b/app/views/admin/price_documents/match_p_fournisseur.js.erb new file mode 100644 index 0000000..aca251b --- /dev/null +++ b/app/views/admin/price_documents/match_p_fournisseur.js.erb @@ -0,0 +1 @@ +show_pane_hover("<%= escape_javascript(render(:partial => "form_p_fournisseur"))%>",700,900); diff --git a/config/routes.rb b/config/routes.rb index 2ec3aac..f511c3a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -615,7 +615,7 @@ Rails.application.routes.draw do post :consult_create get :consult_edit put :consult_update - + get :match_p_fournisseur end collection do get :search_to_affect