Restricted query of ExtraFields for supplier orders

This commit is contained in:
Tim Otte 2019-09-27 15:42:57 +02:00
parent b673c88fab
commit 10f7bd3494

View File

@ -589,6 +589,8 @@ abstract class CommonDocGenerator
$resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs); $resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs);
// Check if the current line belongs to a supplier order
if (get_class($line) == 'CommandeFournisseurLigne') {
// Add the product supplier extrafields to the substitutions // Add the product supplier extrafields to the substitutions
$extralabels=$extrafields->fetch_name_optionals_label("product_fournisseur_price"); $extralabels=$extrafields->fetch_name_optionals_label("product_fournisseur_price");
$columns = ""; $columns = "";
@ -602,6 +604,8 @@ abstract class CommonDocGenerator
foreach ($extralabels as $key => $value) { foreach ($extralabels as $key => $value) {
$resarray['line_product_supplier_'.$key] = $resql->{$key}; $resarray['line_product_supplier_'.$key] = $resql->{$key};
} }
}
} }
// Load product data optional fields to the line -> enables to use "line_options_{extrafield}" // Load product data optional fields to the line -> enables to use "line_options_{extrafield}"