Merge pull request #6399 from fappels/5.0
Qual reputation for price supplier
This commit is contained in:
commit
e0850b29cd
@ -70,7 +70,8 @@ class ProductFournisseur extends Product
|
||||
var $fourn_unitcharges; // old version used a buggy system to calculate margin of a charge field on supplier price. Now margin is on pmp, best supplier price or cost price.
|
||||
|
||||
var $fk_supplier_price_expression;
|
||||
|
||||
var $supplier_reputation; // reputation of supplier
|
||||
var $reputations=array(); // list of available supplier reputations
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -79,7 +80,11 @@ class ProductFournisseur extends Product
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$this->db = $db;
|
||||
$langs->load("suppliers");
|
||||
$this->reputations= array('-1'=>'', 'FAVORITE'=>$langs->trans('Favorite'),'NOTTHGOOD'=>$langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER'=>$langs->trans('DoNotOrderThisProductToThisSupplier'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -77,8 +77,6 @@ if ($id > 0 || $ref)
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
|
||||
$reputations=array('-1'=>'', 'FAVORITE'=>$langs->trans('Favorite'),'NOTTHGOOD'=>$langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER'=>$langs->trans('DoNotOrderThisProductToThisSupplier'));
|
||||
|
||||
if (! $sortfield) $sortfield="s.nom";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
@ -527,7 +525,7 @@ if ($id > 0 || $ref)
|
||||
|
||||
// Reputation
|
||||
print '<tr><td>'.$langs->trans("SupplierReputation").'</td><td>';
|
||||
echo $form->selectarray('supplier_reputation', $reputations, $supplier_reputation?$supplier_reputation:$object->supplier_reputation);
|
||||
echo $form->selectarray('supplier_reputation', $object->reputations, $supplier_reputation?$supplier_reputation:$object->supplier_reputation);
|
||||
print '</td></tr>';
|
||||
|
||||
// Option to define a transport cost on supplier price
|
||||
@ -673,8 +671,8 @@ if ($id > 0 || $ref)
|
||||
|
||||
// Reputation
|
||||
print '<td align="center">';
|
||||
if (!empty($productfourn->supplier_reputation) && !empty($reputations[$productfourn->supplier_reputation])) {
|
||||
print $reputations[$productfourn->supplier_reputation];
|
||||
if (!empty($productfourn->supplier_reputation) && !empty($object->reputations[$productfourn->supplier_reputation])) {
|
||||
print $object->reputations[$productfourn->supplier_reputation];
|
||||
}
|
||||
print'</td>';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user