Reliquat bug-fix

This commit is contained in:
Barnabé 2021-09-15 10:09:16 +02:00
parent 28490c3e96
commit d6e1986935

View File

@ -712,7 +712,7 @@ class Admin::PriceDocumentsController < ApplicationController
new_pl.price_line_ref_id = pl.id
new_pl.ac_block_type = nil
if price_document.reliquat and @p_customer_sheet
if price_document.reliquat #and @p_customer_sheet
bls = PriceDocument.where(:bon_de_commande_achat_id => @past_price_document.id, :price_document_type => PriceDocumentType.find_by_label("Bon de réception achat"))
qte_ok = PriceLine.where(:price_line_ref_id => new_pl.price_line_ref_id).where(:price_line_block_id => PriceLineBlock.where(:price_lineable_type => "PriceDocument", :price_lineable_id => bls.ids)).sum(:qte)