Fix ref supplier must be output if it exists, even for free products

This commit is contained in:
Laurent Destailleur 2017-11-13 11:30:41 +01:00
parent d59ad412a4
commit 97c9549087

View File

@ -1265,12 +1265,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
} }
} }
// If line linked to a product // We add ref of product (and supplier ref if defined)
if ($idprod)
{
// We add ref
if ($prodser->ref)
{
$prefix_prodserv = ""; $prefix_prodserv = "";
$ref_prodserv = ""; $ref_prodserv = "";
if (! empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS)) // In standard mode, we do not show this if (! empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS)) // In standard mode, we do not show this
@ -1293,18 +1288,21 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
$ref_prodserv = $ref_supplier; $ref_prodserv = $ref_supplier;
elseif ($conf->global->PDF_HIDE_PRODUCT_REF_IN_SUPPLIER_LINES == 2) elseif ($conf->global->PDF_HIDE_PRODUCT_REF_IN_SUPPLIER_LINES == 2)
$ref_prodserv = $ref_supplier. ' ('.$outputlangs->transnoentitiesnoconv("InternalRef").' '.$prodser->ref.')'; $ref_prodserv = $ref_supplier. ' ('.$outputlangs->transnoentitiesnoconv("InternalRef").' '.$prodser->ref.')';
else else // Common case
$ref_prodserv = $prodser->ref.($ref_supplier ? ' ('.$outputlangs->transnoentitiesnoconv("SupplierRef").' '.$ref_supplier.')' : ''); {
$ref_prodserv = $prodser->ref; // Show local ref
if ($ref_supplier) $ref_prodserv.= ($prodser->ref?' (':'').$outputlangs->transnoentitiesnoconv("SupplierRef").' '.$ref_supplier.($prodser->ref?')':'');
}
} }
else else
{
$ref_prodserv = $prodser->ref; // Show local ref only $ref_prodserv = $prodser->ref; // Show local ref only
}
if (! empty($libelleproduitservice)) $ref_prodserv .= " - "; if (! empty($libelleproduitservice) && ! empty($ref_prodserv)) $ref_prodserv .= " - ";
} }
$libelleproduitservice=$prefix_prodserv.$ref_prodserv.$libelleproduitservice; $libelleproduitservice=$prefix_prodserv.$ref_prodserv.$libelleproduitservice;
}
}
// Add an additional description for the category products // Add an additional description for the category products
if (! empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && ! empty($conf->categorie->enabled)) if (! empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && ! empty($conf->categorie->enabled))