Qual reputation for price supplier
Move available reputation constants from view-controller to class
This commit is contained in:
parent
76bd5e009a
commit
a84c6f9b45
@ -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>';
|
||||
|
||||
@ -700,7 +698,6 @@ if ($id > 0 || $ref)
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$productfourn->fourn_id.'&action=add_price&rowid='.$productfourn->product_fourn_price_id.'">'.img_edit()."</a>";
|
||||
print ' ';
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$productfourn->fourn_id.'&action=ask_remove_pf&rowid='.$productfourn->product_fourn_price_id.'">'.img_picto($langs->trans("Remove"),'disable.png').'</a>';
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user