small front upgrades

This commit is contained in:
Barnabé 2021-09-15 18:39:16 +02:00
parent 084e71905f
commit 74992c6607
5 changed files with 10 additions and 25 deletions

View File

@ -25,7 +25,7 @@ class PriceDocument < ApplicationRecord
has_many :avoir_p_payment_documents, :dependent => :destroy, :foreign_key => :avoir_id, :class_name => "PPaymentDocument" has_many :avoir_p_payment_documents, :dependent => :destroy, :foreign_key => :avoir_id, :class_name => "PPaymentDocument"
accepts_nested_attributes_for :avoir_p_payment_documents, allow_destroy: true accepts_nested_attributes_for :avoir_p_payment_documents, allow_destroy: true
PURCHASES = ["Demande prix", "Réponse fournisseur", "Commande achat", "Facture d'achat", "Consultation fournisseur"] PURCHASES = ["Demande prix", "Réponse fournisseur", "Commande achat", "Facture achat", "Consultation fournisseur"]
SALES = ["Bon de commande", "Devis", "Bon de livraison", "Facture", "Avoir"] SALES = ["Bon de commande", "Devis", "Bon de livraison", "Facture", "Avoir"]
# AVANCEMENT = ["0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"] # AVANCEMENT = ["0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"]
AVANCEMENT = ["0%", "25%", "50%", "75%", "100"] AVANCEMENT = ["0%", "25%", "50%", "75%", "100"]

View File

@ -224,6 +224,7 @@
.modal-footer .modal-footer
%button.btn.btn-light{"data-dismiss" => "modal"} %button.btn.btn-light{"data-dismiss" => "modal"}
Close Close
- if PriceDocument.where(doc_ref_id: @price_document, price_document_type: PriceDocumentType.find_by_label("Consultation fournisseur")).empty?
=link_to "Generer les consultations", generate_final_consult_admin_price_document_path, class: "btn btn-primary ml-4 mt-4" =link_to "Generer les consultations", generate_final_consult_admin_price_document_path, class: "btn btn-primary ml-4 mt-4"
=link_to "Acceder aux consultations", admin_price_document_path(@price_document, anchor: "consult"), class: "btn btn-primary ml-4 mt-4" =link_to "Acceder aux consultations", admin_price_document_path(@price_document, anchor: "consult"), class: "btn btn-primary ml-4 mt-4"

View File

@ -65,7 +65,7 @@
Type de document : Type de document :
%td %td
-if [1,2,6,7].include?(params[:price_document_type_id].to_i)or (params[:price_document_type_ids] and (params[:price_document_type_ids].include?("6") or params[:price_document_type_ids].include?("7"))) -if [3,4,5,6,7,9,10].include?(params[:price_document_type_id].to_i)or (params[:price_document_type_ids] and (params[:price_document_type_ids].include?("6") or params[:price_document_type_ids].include?("7")))
-PriceDocumentType.where(:label => PriceDocument::PURCHASES, :enabled => true).order("id DESC").each do |pdt| -PriceDocumentType.where(:label => PriceDocument::PURCHASES, :enabled => true).order("id DESC").each do |pdt|
%p.d-inline-flex.ml-3 %p.d-inline-flex.ml-3
= check_box_tag :"price_document_type_ids[]", pdt.id, (true if params[:price_document_type_ids].include?(pdt.id.to_s)), {:id => "price_document_type_ids_#{pdt.id}", class: "my-auto"} = check_box_tag :"price_document_type_ids[]", pdt.id, (true if params[:price_document_type_ids].include?(pdt.id.to_s)), {:id => "price_document_type_ids_#{pdt.id}", class: "my-auto"}

View File

@ -1,22 +1,6 @@
=f.inputs do =f.inputs do
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
.qi_pannel.qi_plain.padding{:style => "margin:20px 0;"}
%table{:style => "width:100%;"}
%tr
%td{:style => "width:50%;"}
= f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date
-if @price_document.label != "Demande prix"
= f.input :customer_ref, :label => "Référence commande client :"
-if current_admin.has_permission?("customer-sheets-bl")
= f.input :bl_comment, :label => "Commentaire à mettre sur le BL :", :input_html => {:style => "min-height:50px;height:50px;"}
.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}

View File

@ -7,11 +7,11 @@
=ic :arrows =ic :arrows
%label %label
ref : ref :
%input.p_product_ref_autocomplete_input.form-control.col{:type => "text", tabindex: 1, autofocus: true, :value => ("#{form.object.p_product_ref.ref} #{form.object.p_product_ref.cc_name}" if form.object.p_product_ref)} %input.p_product_ref_autocomplete_input.form-control.col{:type => "text", :value => ("#{form.object.p_product_ref.ref} #{form.object.p_product_ref.cc_name}" if form.object.p_product_ref)}
.col-3.ml-2 .col-3.ml-2
.form-inline .form-inline
= form.input :qte, :label => "qte :", :input_html => { class: "mx-2", tabindex: 1} = form.input :qte, :label => "qte :", :input_html => { class: "mx-2", autofocus: true, tabindex: 1}
.col-2 .col-2
.form-inline .form-inline
= form.input :ct_u_price_ht, :label => "PU :", :input_html => { class: "mx-2"} = form.input :ct_u_price_ht, :label => "PU :", :input_html => { class: "mx-2"}