diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 69208e5278e..d346d885a4f 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -192,7 +192,7 @@ class ProductFournisseur extends Product if (empty($charges)) $charges=0; if (empty($availability)) $availability=0; if (empty($remise_percent)) $remise_percent=0; - if (empty($supplier_reputation)) $supplier_reputation=''; + if (empty($supplier_reputation) || $supplier_reputation == -1) $supplier_reputation=''; if ($delivery_time_days != '' && ! is_numeric($delivery_time_days)) $delivery_time_days = ''; if ($price_base_type == 'TTC') { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 34f9995267c..ff37543f42e 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -77,7 +77,7 @@ if ($id > 0 || $ref) $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); -$reputations=array(''=>$langs->trans('Standard'),'FAVORITE'=>$langs->trans('Favorite'),'NOTTHGOOD'=>$langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER'=>$langs->trans('DoNotOrderThisProductToThisSupplier')); +$reputations=array('-1'=>'', 'FAVORITE'=>$langs->trans('Favorite'),'NOTTHGOOD'=>$langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER'=>$langs->trans('DoNotOrderThisProductToThisSupplier')); if (! $sortfield) $sortfield="s.nom"; if (! $sortorder) $sortorder="ASC"; @@ -219,7 +219,7 @@ if (empty($reshook)) if (isset($_POST['ref_fourn_price_id'])) $object->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); - $ret=$object->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days); + $ret=$object->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation); if ($ret < 0) { @@ -352,6 +352,7 @@ if ($id > 0 || $ref) print '
| '.$langs->trans("Supplier").' | '; if ($rowid) { @@ -368,7 +369,7 @@ if ($id > 0 || $ref) { $events=array(); $events[]=array('method' => 'getVatRates', 'url' => dol_buildpath('/core/ajax/vatrates.php',1), 'htmlname' => 'tva_tx', 'params' => array()); - print $form->select_company(GETPOST("id_fourn"),'id_fourn','fournisseur=1',1,0,0,$events); + print $form->select_company(GETPOST("id_fourn"),'id_fourn','fournisseur=1','SelectThirdParty',0,0,$events); $parameters=array('filtre'=>"fournisseur=1",'html_name'=>'id_fourn','selected'=>GETPOST("id_fourn"),'showempty'=>1,'prod_id'=>$object->id); $reshook=$hookmanager->executeHooks('formCreateThirdpartyOptions',$parameters,$object,$action); @@ -382,11 +383,6 @@ if ($id > 0 || $ref) } print ' | ||||
| '.$langs->trans("SupplierReputation").' | '; - echo $form->selectarray('supplier_reputation', $reputations,$product->supplier_reputation); - print ' | ||||
| '.$langs->trans("SupplierRef").' | '; if ($rowid) @@ -510,6 +506,11 @@ if ($id > 0 || $ref) print ' | '.$langs->trans('days').' | '; print '|||
| '.$langs->trans("SupplierReputation").' | '; + echo $form->selectarray('supplier_reputation', $reputations, $supplier_reputation?$supplier_reputation:$object->supplier_reputation); + print ' | ||||
| '.$productfourn->getSocNomUrl(1,'supplier').' | '; - print ''; - if(!empty($productfourn->supplier_reputation) && !empty($reputations[$productfourn->supplier_reputation])) { - print $reputations[$productfourn->supplier_reputation]; - } - print' | '; - + // Supplier print ''.$productfourn->fourn_ref.' | '; - //Availability + // Availability if(!empty($conf->global->FOURN_PRODUCT_AVAILABILITY)) { $form->load_cache_availability(); @@ -638,17 +635,6 @@ if ($id > 0 || $ref) print $productfourn->fourn_price?price($productfourn->fourn_price):""; print ''; - // Charges ???? - if ($conf->global->PRODUCT_CHARGES) - { - if (! empty($conf->margin->enabled)) - { - print ''; - print $productfourn->fourn_charges?price($productfourn->fourn_charges):""; - print ' | '; - } - } - // Unit price print ''; print price($productfourn->fourn_unitprice); @@ -665,6 +651,13 @@ if ($id > 0 || $ref) print $productfourn->delivery_time_days; print ' | '; + // Reputation + print ''; + if (!empty($productfourn->supplier_reputation) && !empty($reputations[$productfourn->supplier_reputation])) { + print $reputations[$productfourn->supplier_reputation]; + } + print' | '; + // Charges ???? if ($conf->global->PRODUCT_CHARGES) { @@ -695,6 +688,10 @@ if ($id > 0 || $ref) print '