Display price_line data on matching index

This commit is contained in:
Barnabé 2021-10-18 14:32:05 +02:00
parent 5da5246800
commit 0fad587a3e
3 changed files with 22 additions and 12 deletions

View File

@ -4,21 +4,27 @@
.qi_row.field .qi_row.field
.padding .padding
%h1 Ajouter une références %h1 Ajouter une référence
.card.border.border-primary.mb-3
%h5.card-header.border-bottom Rappel des infos fournisseurs
.card-body
%h5.card-title libellé :
%p.card-text
=@p_product_ref.ct_sub_name
%table.form-table %table.form-table
%tr %tr
%td{colspan: 3} %td{colspan: 3}
%label Selectionner le produit parent %label Selectionner le produit parent :
.input-group .input-group
%input.p_product_autocomplete_input.form-control{:type => "text", :style => "", tabindex: 1, autofocus: true, :class => "p_product_name"} %input.p_product_autocomplete_input.form-control{:type => "text", :style => "", tabindex: 1, autofocus: true, :class => "p_product_name"}
=form.hidden_field :p_product_id, :class => "p_product_id" =form.hidden_field :p_product_id, :class => "p_product_id"
=link_to ic(:plus)+ " Ajouter produit", new_admin_p_product_path(fournisseur_label: @p_product_ref.ct_sub_name, price_line_id: @price_line.id) =link_to ic(:plus)+ " Ajouter produit", new_admin_p_product_path(fournisseur_label: @p_product_ref.ct_sub_name, price_line_id: @price_line.id)
%br
%tr %tr{height: "20px"}
%td{:colspan => 3}
%input.form-control{type: "text", placeholder: @p_product_ref.ct_sub_name, "aria-label" => "Disabled input example", disabled: true}
=#form.input :ct_sub_name, label: "Label fournisseur", input_html: {disabled: true}
%tr %tr
%td{:colspan => 3} %td{:colspan => 3}
@ -34,9 +40,9 @@
=form.input :p_product_color_id, :label => "Couleur :", :collection => PProductColor.all, :as => :select, :include_blank => true, input_html: {class: "custom-select"} =form.input :p_product_color_id, :label => "Couleur :", :collection => PProductColor.all, :as => :select, :include_blank => true, input_html: {class: "custom-select"}
%tr %tr
%td %td
=form.input :ct_sorecop, :label => "Sorecop personalisée :" =form.input :ct_sorecop, :label => "Sorecop personalisée (€) :"
%td %td
=form.input :sorecop_comment, :label => "Type de Sorecop :" =form.input :sorecop_comment, :label => "Commentaire Sorecop :"
%td %td
=form.input :ct_deee, :label => "DEEE personalisée :" =form.input :ct_deee, :label => "DEEE personalisée :"
%tr %tr

View File

@ -17,8 +17,9 @@
%th %th
%th Référence Produit Arcom %th Référence Produit Arcom
%th Créer une référence %th Créer une référence
%th Référence fournisseur %th Libélé fournisseur
%th %th Prix unitaire
%th Quantité
%tbody.price_lines_form %tbody.price_lines_form
=f.semantic_fields_for :price_lines do |form| =f.semantic_fields_for :price_lines do |form|
-if form.object.p_product_ref.nil? -if form.object.p_product_ref.nil?

View File

@ -27,6 +27,10 @@
%td.pl-2 %td.pl-2
=form.object.title =form.object.title
%td
=number_to_currency form.object.price_u_ht
%td
=form.object.qte
%td.text-center{style: "width: 30px;"} %td.text-center{style: "width: 30px;"}
%span.destroy=link_to_remove_fields ic(:"trash-o"), form %span.destroy=link_to_remove_fields ic(:"trash-o"), form
@ -35,7 +39,6 @@
= form.hidden_field :position, :class => "price_line_position_input" = form.hidden_field :position, :class => "price_line_position_input"
:javascript :javascript
$('.p_product_ref_autocomplete_input').focus() $('.p_product_ref_autocomplete_input').focus()
$( function() { $( function() {