Small fixes

This commit is contained in:
Barnabé 2021-09-17 10:11:16 +02:00
parent 198cdbe898
commit f3246d0209
3 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -89,7 +89,6 @@
-@price_document_responses.each do |resp|
%th
=resp.id
-if resp.p_fournisseur
=resp.p_fournisseur.name
-else