From f3246d020938aa27ae09f1894b923e1e7686e6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A9?= Date: Fri, 17 Sep 2021 10:11:16 +0200 Subject: [PATCH] Small fixes --- app/models/price_line_block.rb | 6 ++++-- app/views/admin/buy_lists/index.html.haml | 2 +- app/views/admin/price_documents/analyse_reponses.html.haml | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/price_line_block.rb b/app/models/price_line_block.rb index edfe0cb..6efcba4 100644 --- a/app/models/price_line_block.rb +++ b/app/models/price_line_block.rb @@ -23,7 +23,7 @@ class PriceLineBlock < ApplicationRecord belongs_to :p_payment_type - PURCHASE_BLOCKS = ["Réponse fournisseur", "Consultation fournisseur", "Facture d'achat", "Commande achat", "Demande de prix", "Bon de commande achat", "Bon de réception achat", "Facture achat", "Avoir achat"] + PURCHASE_BLOCKS = ["Réponse fournisseur", "Consultation fournisseur", "Facture d'achat", "Commande achat", "Demande prix", "Bon de commande achat", "Bon de réception achat", "Facture achat", "Avoir achat"] SALE_BLOCKS = ["Demande de commande", "Bon de commande", "Devis", "Bon de livraison", "Facture", "Avoir"] @@ -296,7 +296,9 @@ class PriceLineBlock < ApplicationRecord end def p_fournisseur_needed? - if PriceLineBlock::PURCHASE_BLOCKS.include?(self.block_type) + if ["Demande prix", "Consultation fournisseur", "Réponse fournisseur"].include?(self.block_type) + false + elsif PriceLineBlock::PURCHASE_BLOCKS.include?(self.block_type) true else false diff --git a/app/views/admin/buy_lists/index.html.haml b/app/views/admin/buy_lists/index.html.haml index ce0934c..1808240 100644 --- a/app/views/admin/buy_lists/index.html.haml +++ b/app/views/admin/buy_lists/index.html.haml @@ -204,7 +204,7 @@ %td.mask =check_box_tag :"p_product_ref_ids[]", plr.p_product_ref.id - =number_field_tag "qte[#{plr.p_product_ref.id}]", '', class: "small-input", value: (bpa_qte - qte_available) + =number_field_tag "qte[#{plr.p_product_ref.id}]", '', class: "small-input", value: ([bpa_qte - qte_available, 0].max) %td.mask = bpa_qte diff --git a/app/views/admin/price_documents/analyse_reponses.html.haml b/app/views/admin/price_documents/analyse_reponses.html.haml index 7b68000..5801960 100644 --- a/app/views/admin/price_documents/analyse_reponses.html.haml +++ b/app/views/admin/price_documents/analyse_reponses.html.haml @@ -89,7 +89,6 @@ -@price_document_responses.each do |resp| %th - =resp.id -if resp.p_fournisseur =resp.p_fournisseur.name -else