FIX Editing a supplier price should keep the vat.
This commit is contained in:
parent
4eb7e023ed
commit
3d94e3d80e
@ -58,7 +58,7 @@ class ProductFournisseur extends Product
|
||||
var $fourn_remise_percent; // discount for quantity (percent)
|
||||
var $fourn_remise; // discount for quantity (amount)
|
||||
var $product_fourn_id; // supplier id
|
||||
var $fk_availability; // availability delay
|
||||
var $fk_availability; // availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay)
|
||||
var $fourn_unitprice;
|
||||
var $fourn_tva_npr;
|
||||
|
||||
@ -370,7 +370,8 @@ class ProductFournisseur extends Product
|
||||
//$this->fourn_tva_npr = $obj->fourn_tva_npr; // TODO this field not exist in llx_product_fournisseur_price. We should add it ?
|
||||
$this->fk_supplier_price_expression = $obj->fk_supplier_price_expression;
|
||||
|
||||
if (empty($ignore_expression) && !empty($this->fk_supplier_price_expression)) {
|
||||
if (empty($ignore_expression) && !empty($this->fk_supplier_price_expression))
|
||||
{
|
||||
$priceparser = new PriceParser($this->db);
|
||||
$price_result = $priceparser->parseProductSupplier($this->fk_product, $this->fk_supplier_price_expression, $this->fourn_qty, $this->fourn_tva_tx);
|
||||
if ($price_result >= 0) {
|
||||
|
||||
@ -65,8 +65,12 @@ $result=restrictedArea($user,'produit|service&fournisseur',$fieldvalue,'product&
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('pricesuppliercard','globalcard'));
|
||||
$product = new ProductFournisseur($db);
|
||||
$product->fetch($id,$ref);
|
||||
|
||||
$object = new ProductFournisseur($db);
|
||||
if ($id > 0 || $ref)
|
||||
{
|
||||
$object->fetch($id,$ref);
|
||||
}
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
@ -82,22 +86,18 @@ if (! $sortorder) $sortorder="ASC";
|
||||
if ($cancel) $action='';
|
||||
|
||||
$parameters=array('socid'=>$socid, 'id_prod'=>$id);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($action == 'remove_pf')
|
||||
{
|
||||
$product = new ProductFournisseur($db);
|
||||
if ($product->fetch($id) > 0)
|
||||
if ($rowid)
|
||||
{
|
||||
if ($rowid)
|
||||
{
|
||||
$result=$product->remove_product_fournisseur_price($rowid);
|
||||
$action = '';
|
||||
setEventMessage($langs->trans("PriceRemoved"));
|
||||
}
|
||||
$result=$object->remove_product_fournisseur_price($rowid);
|
||||
$action = '';
|
||||
setEventMessage($langs->trans("PriceRemoved"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,34 +159,26 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
$product = new ProductFournisseur($db);
|
||||
$result=$product->fetch($id);
|
||||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$ret=$product->add_fournisseur($user, $id_fourn, $ref_fourn, $quantity); // This insert record with no value for price. Values are update later with update_buyprice
|
||||
$ret=$object->add_fournisseur($user, $id_fourn, $ref_fourn, $quantity); // This insert record with no value for price. Values are update later with update_buyprice
|
||||
if ($ret == -3)
|
||||
{
|
||||
$error++;
|
||||
|
||||
$product->fetch($product->product_id_already_linked);
|
||||
$productLink = $product->getNomUrl(1,'supplier');
|
||||
$object->fetch($object->product_id_already_linked);
|
||||
$productLink = $object->getNomUrl(1,'supplier');
|
||||
|
||||
setEventMessage($langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink), 'errors');
|
||||
}
|
||||
else if ($ret < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($product->error, 'errors');
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,14 +187,14 @@ if (empty($reshook))
|
||||
$supplier=new Fournisseur($db);
|
||||
$result=$supplier->fetch($id_fourn);
|
||||
if (isset($_POST['ref_fourn_price_id']))
|
||||
$product->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']);
|
||||
$object->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']);
|
||||
|
||||
$ret=$product->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);
|
||||
if ($ret < 0)
|
||||
{
|
||||
|
||||
$error++;
|
||||
setEventMessage($product->error, $product->errors, 'errors');
|
||||
setEventMessage($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -217,11 +209,11 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
if (! $error && ! empty($conf->dynamicprices->enabled)) {
|
||||
$ret=$product->setPriceExpression($price_expression);
|
||||
$ret=$object->setPriceExpression($price_expression);
|
||||
if ($ret < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($product->error, 'errors');
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -251,23 +243,20 @@ if (empty($reshook))
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($id || $ref)
|
||||
if ($id > 0 || $ref)
|
||||
{
|
||||
if ($action <> 're-edit')
|
||||
{
|
||||
$product = new ProductFournisseur($db);
|
||||
$result = $product->fetch($id,$ref);
|
||||
//$result = $product->fetch_fourn_data($_REQUEST["id_fourn"]);
|
||||
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||
llxHeader("","",$langs->trans("CardProduct".$object->type));
|
||||
}
|
||||
|
||||
if ($result)
|
||||
{
|
||||
if ($action <> 'edit' && $action <> 're-edit')
|
||||
{
|
||||
$head=product_prepare_head($product);
|
||||
$titre=$langs->trans("CardProduct".$product->type);
|
||||
$picto=($product->type== Product::TYPE_SERVICE?'service':'product');
|
||||
$head=product_prepare_head($object);
|
||||
$titre=$langs->trans("CardProduct".$object->type);
|
||||
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
|
||||
dol_fiche_head($head, 'suppliers', $titre, 0, $picto);
|
||||
|
||||
|
||||
@ -276,18 +265,18 @@ if ($id || $ref)
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
print $form->showrefnav($product,'ref','',1,'ref');
|
||||
print $form->showrefnav($object,'ref','',1,'ref');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$product->label.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$object->label.'</td></tr>';
|
||||
|
||||
// Minimum Price
|
||||
print '<tr><td>'.$langs->trans("BuyingPriceMin").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$product_fourn = new ProductFournisseur($db);
|
||||
if ($product_fourn->find_min_price_product_fournisseur($product->id) > 0)
|
||||
if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0)
|
||||
{
|
||||
if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur();
|
||||
else print $langs->trans("NotDefined");
|
||||
@ -296,7 +285,7 @@ if ($id || $ref)
|
||||
|
||||
// Status (to buy)
|
||||
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
|
||||
print $product->getLibStatut(2,1);
|
||||
print $object->getLibStatut(2,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -310,7 +299,7 @@ if ($id || $ref)
|
||||
|
||||
if ($rowid)
|
||||
{
|
||||
$product->fetch_product_fournisseur_price($rowid, 1); //Ignore the math expression when getting the price
|
||||
$object->fetch_product_fournisseur_price($rowid, 1); //Ignore the math expression when getting the price
|
||||
print load_fiche_titre($langs->trans("ChangeSupplierPrice"));
|
||||
}
|
||||
else
|
||||
@ -318,7 +307,7 @@ if ($id || $ref)
|
||||
print load_fiche_titre($langs->trans("AddSupplierPrice"));
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" method="POST">';
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="updateprice">';
|
||||
|
||||
@ -333,7 +322,7 @@ if ($id || $ref)
|
||||
$supplier->fetch($socid);
|
||||
print $supplier->getNomUrl(1);
|
||||
print '<input type="hidden" name="id_fourn" value="'.$socid.'">';
|
||||
print '<input type="hidden" name="ref_fourn" value="'.$product->fourn_ref.'">';
|
||||
print '<input type="hidden" name="ref_fourn" value="'.$object->fourn_ref.'">';
|
||||
print '<input type="hidden" name="ref_fourn_price_id" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
@ -344,13 +333,13 @@ if ($id || $ref)
|
||||
$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);
|
||||
|
||||
$parameters=array('filtre'=>"fournisseur=1",'html_name'=>'id_fourn','selected'=>GETPOST("id_fourn"),'showempty'=>1,'prod_id'=>$product->id);
|
||||
$reshook=$hookmanager->executeHooks('formCreateThirdpartyOptions',$parameters,$product,$action);
|
||||
$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);
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (empty($form->result))
|
||||
{
|
||||
print ' - <a href="'.DOL_URL_ROOT.'/societe/soc.php?action=create&type=f&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$product->id.'&action='.$action).'">'.$langs->trans("CreateDolibarrThirdPartySupplier").'</a>';
|
||||
print ' - <a href="'.DOL_URL_ROOT.'/societe/soc.php?action=create&type=f&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id.'&action='.$action).'">'.$langs->trans("CreateDolibarrThirdPartySupplier").'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -360,7 +349,7 @@ if ($id || $ref)
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("SupplierRef").'</td><td>';
|
||||
if ($rowid)
|
||||
{
|
||||
print $product->fourn_ref;
|
||||
print $object->fourn_ref;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -374,7 +363,7 @@ if ($id || $ref)
|
||||
{
|
||||
$langs->load("propal");
|
||||
print '<tr><td>'.$langs->trans("Availability").'</td><td>';
|
||||
$form->selectAvailabilityDelay($product->fk_availability,"oselDispo",1);
|
||||
$form->selectAvailabilityDelay($object->fk_availability,"oselDispo",1);
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
@ -385,8 +374,8 @@ if ($id || $ref)
|
||||
$quantity = GETPOST('qty') ? GETPOST('qty') : "1";
|
||||
if ($rowid)
|
||||
{
|
||||
print '<input type="hidden" name="qty" value="'.$product->fourn_qty.'">';
|
||||
print $product->fourn_qty;
|
||||
print '<input type="hidden" name="qty" value="'.$object->fourn_qty.'">';
|
||||
print $object->fourn_qty;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -402,15 +391,23 @@ if ($id || $ref)
|
||||
$mysoc2 = clone $mysoc;
|
||||
$mysoc2->name='Fictive seller with same country';
|
||||
$mysoc2->tva_assuj=1;
|
||||
$default_vat=get_default_tva($mysoc2, $mysoc, $product->id, 0);
|
||||
$default_vat=get_default_tva($mysoc2, $mysoc, $object->id, 0);
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("VATRateForSupplierProduct").'</td>';
|
||||
print '<td>';
|
||||
//print $form->load_tva('tva_tx',$product->tva_tx,$supplier,$mysoc); // Do not use list here as it may be any vat rates for any country
|
||||
if (! empty($socid)) // When update
|
||||
//print $form->load_tva('tva_tx',$object->tva_tx,$supplier,$mysoc); // Do not use list here as it may be any vat rates for any country
|
||||
if (! empty($rowid)) // If we have a supplier, it is an update, we must show the vat of current supplier price
|
||||
{
|
||||
$default_vat=get_default_tva($supplier, $mysoc, $product->id);
|
||||
if (empty($default_vat)) $default_vat=$product->tva_tx;
|
||||
$tmpproductsupplier=new ProductFournisseur($db);
|
||||
$tmpproductsupplier->fetch_product_fournisseur_price($rowid, 1);
|
||||
$default_vat=$tmpproductsupplier->fourn_tva_tx;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (empty($default_vat))
|
||||
{
|
||||
$default_vat=$object->tva_tx;
|
||||
}
|
||||
}
|
||||
print '<input type="text" class="flat" size="5" name="tva_tx" value="'.(GETPOST("tva_tx")?vatrate(GETPOST("tva_tx")):($default_vat!=''?vatrate($default_vat):'')).'">';
|
||||
print '</td></tr>';
|
||||
@ -424,7 +421,7 @@ if ($id || $ref)
|
||||
foreach ($price_expression->list_price_expression() as $entry) {
|
||||
$price_expression_list[$entry->id] = $entry->title;
|
||||
}
|
||||
$price_expression_preselection = GETPOST('eid') ? GETPOST('eid') : ($product->fk_supplier_price_expression ? $product->fk_supplier_price_expression : '0');
|
||||
$price_expression_preselection = GETPOST('eid') ? GETPOST('eid') : ($object->fk_supplier_price_expression ? $object->fk_supplier_price_expression : '0');
|
||||
print $form->selectarray('eid', $price_expression_list, $price_expression_preselection);
|
||||
print ' <div id="expression_editor" class="button">'.$langs->trans("PriceExpressionEditor").'</div>';
|
||||
print '</td></tr>';
|
||||
@ -451,22 +448,21 @@ if ($id || $ref)
|
||||
|
||||
// Price qty min
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PriceQtyMin").'</td>';
|
||||
print '<td><input class="flat" name="price" size="8" value="'.(GETPOST('price')?price(GETPOST('price')):(isset($product->fourn_price)?price($product->fourn_price):'')).'">';
|
||||
print '<td><input class="flat" name="price" size="8" value="'.(GETPOST('price')?price(GETPOST('price')):(isset($object->fourn_price)?price($object->fourn_price):'')).'">';
|
||||
print ' ';
|
||||
print $form->selectPriceBaseType((GETPOST('price_base_type')?GETPOST('price_base_type'):$product->price_base_type), "price_base_type");
|
||||
print $form->selectPriceBaseType((GETPOST('price_base_type')?GETPOST('price_base_type'):'HT'), "price_base_type"); // We keep 'HT' here, price_base_type is not yet supported for supplier prices
|
||||
print '</td></tr>';
|
||||
|
||||
// Discount qty min
|
||||
print '<tr><td>'.$langs->trans("DiscountQtyMin").'</td>';
|
||||
print '<td><input class="flat" name="remise_percent" size="4" value="'.(GETPOST('remise_percent')?vatrate(GETPOST('remise_percent')):(isset($product->fourn_remise_percent)?vatrate($product->fourn_remise_percent):'')).'"> %';
|
||||
print '<td><input class="flat" name="remise_percent" size="4" value="'.(GETPOST('remise_percent')?vatrate(GETPOST('remise_percent')):(isset($object->fourn_remise_percent)?vatrate($object->fourn_remise_percent):'')).'"> %';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Delai livraison jours
|
||||
// Delivery delay in days
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('NbDaysToDelivery').'</td>';
|
||||
print '<td><input class="flat" name="delivery_time_days" size="4" value="'.($rowid ? $product->delivery_time_days : '').'"> '.$langs->trans('days').'</td>';
|
||||
print '<td><input class="flat" name="delivery_time_days" size="4" value="'.($rowid ? $object->delivery_time_days : '').'"> '.$langs->trans('days').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Charges ????
|
||||
@ -476,7 +472,7 @@ if ($id || $ref)
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Charges").'</td>';
|
||||
print '<td><input class="flat" name="charges" size="8" value="'.(GETPOST('charges')?price(GETPOST('charges')):(isset($product->fourn_charges)?price($product->fourn_charges):'')).'">';
|
||||
print '<td><input class="flat" name="charges" size="8" value="'.(GETPOST('charges')?price(GETPOST('charges')):(isset($object->fourn_charges)?price($object->fourn_charges):'')).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@ -484,8 +480,8 @@ if ($id || $ref)
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('id_fourn'=>$id_fourn,'prod_id'=>$product->id);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action);
|
||||
$parameters=array('id_fourn'=>$id_fourn,'prod_id'=>$object->id);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
@ -508,12 +504,12 @@ if ($id || $ref)
|
||||
if ($action != 'add_price' && $action != 'updateprice')
|
||||
{
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$product,$action); // Note that $action and $object may have been modified by hook
|
||||
$reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.$product->id.'&action=add_price">';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.$object->id.'&action=add_price">';
|
||||
print $langs->trans("AddSupplierPrice").'</a>';
|
||||
}
|
||||
}
|
||||
@ -527,19 +523,19 @@ if ($id || $ref)
|
||||
{
|
||||
// Suppliers list title
|
||||
print '<table class="noborder" width="100%">';
|
||||
if ($product->isproduct()) $nblignefour=4;
|
||||
if ($object->isproduct()) $nblignefour=4;
|
||||
else $nblignefour=4;
|
||||
|
||||
$param="&id=".$product->id;
|
||||
$param="&id=".$object->id;
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Suppliers"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("SupplierRef"));
|
||||
if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY)) print_liste_field_titre($langs->trans("Availability"),$_SERVER["PHP_SELF"],"pfp.fk_availability","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("QtyMin"),$_SERVER["PHP_SELF"],"pfp.quantity","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"));
|
||||
print_liste_field_titre($langs->trans("PriceQtyMinHT"));
|
||||
print_liste_field_titre($langs->trans("VATRate"),$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PriceQtyMinHT"),$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DiscountQtyMin"));
|
||||
print_liste_field_titre($langs->trans("DiscountQtyMin"),$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("NbDaysToDelivery"),$_SERVER["PHP_SELF"],"pfp.delivery_time_days","",$param,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
// Charges ????
|
||||
@ -551,7 +547,7 @@ if ($id || $ref)
|
||||
print "</tr>\n";
|
||||
|
||||
$product_fourn = new ProductFournisseur($db);
|
||||
$product_fourn_list = $product_fourn->list_product_fournisseur_price($product->id, $sortfield, $sortorder);
|
||||
$product_fourn_list = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder);
|
||||
|
||||
if (count($product_fourn_list)>0)
|
||||
{
|
||||
@ -631,16 +627,16 @@ if ($id || $ref)
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('id_pfp'=>$productfourn->product_fourn_price_id,'id_fourn'=>$id_fourn,'prod_id'=>$product->id);
|
||||
$reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$product,$action);
|
||||
$parameters=array('id_pfp'=>$productfourn->product_fourn_price_id,'id_fourn'=>$id_fourn,'prod_id'=>$object->id);
|
||||
$reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$object,$action);
|
||||
}
|
||||
|
||||
// Modify-Remove
|
||||
print '<td align="center">';
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'&socid='.$productfourn->fourn_id.'&action=add_price&rowid='.$productfourn->product_fourn_price_id.'">'.img_edit()."</a>";
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'&socid='.$productfourn->fourn_id.'&action=remove_pf&rowid='.$productfourn->product_fourn_price_id.'">'.img_picto($langs->trans("Remove"),'disable.png').'</a>';
|
||||
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 '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$productfourn->fourn_id.'&action=remove_pf&rowid='.$productfourn->product_fourn_price_id.'">'.img_picto($langs->trans("Remove"),'disable.png').'</a>';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user