35 require
'../main.inc.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.product.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/product/dynamic_price/class/price_expression.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/product/dynamic_price/class/price_parser.class.php';
43 if (!empty($conf->barcode->enabled)) {
47 $langs->loadLangs(array(
'products',
'suppliers',
'bills',
'margins',
'stocks'));
51 $rowid =
GETPOST(
'rowid',
'int');
52 $action =
GETPOST(
'action',
'aZ09');
53 $cancel =
GETPOST(
'cancel',
'alpha');
54 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'pricesuppliercard';
56 $socid =
GETPOST(
'socid',
'int');
60 $backtopage =
GETPOST(
'backtopage',
'alpha');
66 if (
GETPOST(
'search_fourn_id',
'int')) {
67 $_GET[
'id_fourn'] =
GETPOST(
'search_fourn_id',
'int');
68 $_POST[
'id_fourn'] =
GETPOST(
'search_fourn_id',
'int');
72 $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref :
''));
73 $fieldtype = (!empty($ref) ?
'ref' :
'rowid');
75 $socid = $user->socid;
78 if (empty($user->rights->fournisseur->lire)) {
82 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
83 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
84 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
86 if (empty($page) || $page == -1) {
89 $offset = $limit * $page;
90 $pageprev = $page - 1;
91 $pagenext = $page + 1;
100 $hookmanager->initHooks(array(
'pricesuppliercard',
'globalcard'));
103 if ($id > 0 || $ref) {
104 $object->fetch($id, $ref);
110 if ($object->id > 0) {
111 if ($object->type == $object::TYPE_PRODUCT) {
112 restrictedArea($user,
'produit', $object->id,
'product&product',
'',
'');
114 if ($object->type == $object::TYPE_SERVICE) {
115 restrictedArea($user,
'service', $object->id,
'product&product',
'',
'');
118 restrictedArea($user,
'produit|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
130 $parameters = array(
'socid'=>$socid,
'id_prod'=>$id);
131 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
136 if (empty($reshook)) {
137 if ($action ==
'setcost_price') {
139 $result = $object->fetch($id);
140 $object->cost_price =
price2num($cost_price);
141 $result = $object->update($object->id, $user);
151 if ($action ==
'setpmp') {
153 $result = $object->fetch($id);
155 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"product SET pmp = ".((
float) $object->pmp).
" WHERE rowid = ".((int) $id);
156 $resql = $db->query($sql);
168 if ($action ==
'confirm_remove_pf') {
171 $result = $object->remove_product_fournisseur_price($rowid);
173 $db->query(
"DELETE FROM ".MAIN_DB_PREFIX.
"product_fournisseur_price_extrafields WHERE fk_object = ".((
int) $rowid));
182 if ($action ==
'save_price') {
183 $id_fourn =
GETPOST(
"id_fourn");
184 if (empty($id_fourn)) {
185 $id_fourn =
GETPOST(
"search_id_fourn");
187 $ref_fourn =
GETPOST(
"ref_fourn");
188 if (empty($ref_fourn)) {
189 $ref_fourn =
GETPOST(
"search_ref_fourn");
191 $ref_fourn_old =
GETPOST(
"ref_fourn_old");
192 if (empty($ref_fourn_old)) {
193 $ref_fourn_old = $ref_fourn;
198 $npr = preg_match(
'/\*/',
GETPOST(
'tva_tx',
'alpha')) ? 1 : 0;
199 $tva_tx = str_replace(
'*',
'',
GETPOST(
'tva_tx',
'alpha'));
200 if (!preg_match(
'/\((.*)\)/', $tva_tx)) {
204 $price_expression =
GETPOST(
'eid',
'int') ?
GETPOST(
'eid',
'int') :
'';
205 $delivery_time_days =
GETPOST(
'delivery_time_days',
'int') ?
GETPOST(
'delivery_time_days',
'int') :
'';
206 $supplier_reputation =
GETPOST(
'supplier_reputation');
207 $supplier_description =
GETPOST(
'supplier_description',
'restricthtml');
208 $barcode =
GETPOST(
'barcode',
'alpha');
209 $fk_barcode_type =
GETPOST(
'fk_barcode_type',
'int');
214 $langs->load(
"errors");
215 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"VATRateForSupplierProduct")),
null,
'errors');
217 if (!is_numeric($tva_tx)) {
219 $langs->load(
"errors");
220 setEventMessages($langs->trans(
"ErrorFieldMustBeANumeric", $langs->transnoentities(
"VATRateForSupplierProduct")),
null,
'errors');
222 if (empty($quantity)) {
224 $langs->load(
"errors");
225 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Qty")),
null,
'errors');
227 if (empty($ref_fourn)) {
229 $langs->load(
"errors");
230 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"RefSupplier")),
null,
'errors');
232 if ($id_fourn <= 0) {
234 $langs->load(
"errors");
235 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Supplier")),
null,
'errors');
238 if ($price_expression ===
'') {
240 $langs->load(
"errors");
241 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Price")),
null,
'errors');
246 if (!empty($conf->multicurrency->enabled)) {
247 if (!
GETPOST(
"multicurrency_code")) {
249 $langs->load(
"errors");
250 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Currency")),
null,
'errors');
254 $langs->load(
"errors");
255 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"CurrencyRate")),
null,
'errors');
259 $langs->load(
"errors");
260 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"PriceCurrency")),
null,
'errors');
268 $ret = $object->add_fournisseur($user, $id_fourn, $ref_fourn_old, $quantity);
273 $tmpobject->fetch($object->product_id_already_linked);
274 $productLink = $tmpobject->getNomUrl(1,
'supplier');
276 $texttoshow = $langs->trans(
"ReferenceSupplierIsAlreadyAssociatedWithAProduct",
'{s1}');
277 $texttoshow = str_replace(
'{s1}', $productLink, $texttoshow);
279 } elseif ($ret < 0) {
287 $result = $supplier->fetch($id_fourn);
289 $object->fetch_product_fournisseur_price(
GETPOST(
'ref_fourn_price_id',
'int'));
291 $extralabels = $extrafields->fetch_name_optionals_label(
"product_fournisseur_price");
292 $extrafield_values = $extrafields->getOptionalsFromPost(
"product_fournisseur_price");
296 if (empty($packaging)) {
303 $object->packaging = $packaging;
305 if (!empty($conf->multicurrency->enabled)) {
308 $multicurrency_code =
GETPOST(
"multicurrency_code",
'alpha');
310 $ret = $object->update_buyprice($quantity, $newprice, $user,
GETPOST(
"price_base_type"), $supplier,
GETPOST(
"oselDispo"), $ref_fourn, $tva_tx,
GETPOST(
"charges"), $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(),
'', $multicurrency_price,
GETPOST(
"multicurrency_price_base_type"), $multicurrency_tx, $multicurrency_code, $supplier_description, $barcode, $fk_barcode_type, $extrafield_values);
312 $ret = $object->update_buyprice($quantity, $newprice, $user,
GETPOST(
"price_base_type"), $supplier,
GETPOST(
"oselDispo"), $ref_fourn, $tva_tx,
GETPOST(
"charges"), $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(),
'', 0,
'HT', 1,
'', $supplier_description, $barcode, $fk_barcode_type, $extrafield_values);
318 if (!empty($conf->dynamicprices->enabled) && $price_expression !==
'') {
321 $object->fk_supplier_price_expression = $price_expression;
322 $price_result = $priceparser->parseProductSupplier($object);
323 if ($price_result < 0) {
328 if (!$error && !empty($conf->dynamicprices->enabled)) {
330 $ret = $object->setSupplierPriceExpression($price_expression);
346 $action =
'add_price';
358 $title = $langs->trans(
'ProductServiceCard');
360 $shortlabel =
dol_trunc($object->label, 16);
362 $title = $langs->trans(
'Product').
" ".$shortlabel.
" - ".$langs->trans(
'BuyingPrices');
363 $helpurl =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos|DE:Modul_Produkte';
366 $title = $langs->trans(
'Service').
" ".$shortlabel.
" - ".$langs->trans(
'BuyingPrices');
367 $helpurl =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Lesitungen';
370 llxHeader(
'', $title, $helpurl,
'', 0, 0,
'',
'',
'',
'classforhorizontalscrolloftabs');
372 if ($id > 0 || $ref) {
374 if ($action ==
'ask_remove_pf') {
376 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$id.
'&rowid='.$rowid, $langs->trans(
'DeleteProductBuyPrice'), $langs->trans(
'ConfirmDeleteProductBuyPrice'),
'confirm_remove_pf',
'', 0, 1);
380 if ($action !=
'edit' && $action !=
're-edit') {
382 $titre = $langs->trans(
"CardProduct".$object->type);
387 $linkback =
'<a href="'.DOL_URL_ROOT.
'/product/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
388 $object->next_prev_filter =
" fk_product_type = ".$object->type;
391 if ($user->socid && !in_array(
'product', explode(
',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
397 print
'<div class="fichecenter">';
399 print
'<div class="underbanner clearboth"></div>';
400 print
'<table class="border tableforfield centpercent">';
403 if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) {
404 $typeformat =
'select;0:'.$langs->trans(
"Product").
',1:'.$langs->trans(
"Service");
405 print
'<tr><td class="">';
406 print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ?
$form->editfieldkey(
"Type",
'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans(
'Type');
408 print
$form->editfieldval(
"Type",
'fk_product_type', $object->type, $object, 0, $typeformat);
414 $textdesc = $langs->trans(
"CostPriceDescription");
415 $textdesc .=
"<br>".$langs->trans(
"CostPriceUsage");
416 $text =
$form->textwithpicto($langs->trans(
"CostPrice"), $textdesc, 1,
'help',
'');
417 print
$form->editfieldkey($text,
'cost_price', $object->cost_price, $object, $usercancreate,
'amount:6');
419 print
$form->editfieldval($text,
'cost_price', $object->cost_price, $object, $usercancreate,
'amount:6');
424 if (!empty($conf->global->PRODUCT_CAN_EDIT_WAP)) {
425 $usercaneditpmp = $usercancreate;
427 print
'<tr><td class="titlefieldcreate">';
428 $textdesc = $langs->trans(
"AverageUnitPricePMPDesc");
429 $text =
$form->textwithpicto($langs->trans(
"AverageUnitPricePMPShort"), $textdesc, 1,
'help',
'');
430 print
$form->editfieldkey($text,
'pmp', $object->pmp, $object, $usercaneditpmp,
'amount:6');
432 print
$form->editfieldval($text,
'pmp', ($object->pmp > 0 ? $object->pmp :
''), $object, $usercaneditpmp,
'amount:6');
433 if ($object->pmp > 0) {
434 print
' '.$langs->trans(
"HT");
446 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"BuyingPriceMin").
'</td>';
449 if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) {
450 if ($product_fourn->product_fourn_price_id > 0) {
451 print $product_fourn->display_price_product_fournisseur();
453 print $langs->trans(
"NotDefined");
461 print
'<div style="clear:both"></div>';
467 if (($action ==
'add_price' || $action ==
'update_price') && $usercancreate) {
468 $langs->load(
"suppliers");
470 print
"<!-- form to add a supplier price -->\n";
474 $object->fetch_product_fournisseur_price($rowid, 1);
480 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'" method="POST">';
481 print
'<input type="hidden" name="token" value="'.newToken().
'">';
482 print
'<input type="hidden" name="action" value="save_price">';
486 print
'<table class="border centpercent">';
489 print
'<tr><td class="titlefield fieldrequired">'.$langs->trans(
"Supplier").
'</td><td>';
492 $supplier->fetch($socid);
493 print $supplier->getNomUrl(1);
494 print
'<input type="hidden" name="id_fourn" value="'.$socid.
'">';
495 print
'<input type="hidden" name="ref_fourn_price_id" value="'.$rowid.
'">';
496 print
'<input type="hidden" name="rowid" value="'.$rowid.
'">';
497 print
'<input type="hidden" name="socid" value="'.$socid.
'">';
500 $events[] = array(
'method' =>
'getVatRates',
'url' =>
dol_buildpath(
'/core/ajax/vatrates.php', 1),
'htmlname' =>
'tva_tx',
'params' => array());
501 print
img_picto(
'',
'company',
'class="pictofixedwidth"').$form->select_company(
GETPOST(
"id_fourn",
'alpha'),
'id_fourn',
'fournisseur=1',
'SelectThirdParty', 0, 0, $events);
503 $parameters = array(
'filtre'=>
"fournisseur=1",
'html_name'=>
'id_fourn',
'selected'=>
GETPOST(
"id_fourn"),
'showempty'=>1,
'prod_id'=>$object->id);
504 $reshook = $hookmanager->executeHooks(
'formCreateThirdpartyOptions', $parameters, $object, $action);
505 if (empty($reshook)) {
506 if (empty(
$form->result)) {
507 print
'<a href="'.DOL_URL_ROOT.
'/societe/card.php?action=create&type=f&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action='.$action).
'">';
508 print
img_picto($langs->trans(
"CreateDolibarrThirdPartySupplier"),
'add',
'class="marginleftonly"');
516 print
'<tr><td class="fieldrequired">'.$langs->trans(
"SupplierRef").
'</td><td>';
518 print
'<input type="hidden" name="ref_fourn_old" value="'.$object->ref_supplier.
'">';
519 print
'<input class="flat width150" maxlength="128" name="ref_fourn" value="'.$object->ref_supplier.
'">';
521 print
'<input class="flat width150" maxlength="128" name="ref_fourn" value="'.(GETPOST(
"ref_fourn") ?
GETPOST(
"ref_fourn") :
'').
'">';
528 $langs->load(
"propal");
529 print
'<tr><td>'.$langs->trans(
"Availability").
'</td><td>';
530 $form->selectAvailabilityDelay($object->fk_availability,
"oselDispo", 1);
531 print
'</td></tr>'.
"\n";
536 print
'<td class="fieldrequired">'.$langs->trans(
"QtyMin").
'</td>';
540 print
'<input type="hidden" name="qty" value="'.$object->fourn_qty.
'">';
541 print $object->fourn_qty;
543 print
'<input class="flat" name="qty" size="5" value="'.$quantity.
'">';
546 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
547 $unit = $object->getLabelOfUnit();
549 print
' '.$langs->trans($unit);
554 if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
558 print
'<td class="fieldrequired">'.$form->textwithpicto($langs->trans(
"PackagingForThisProduct"), $langs->trans(
"PackagingForThisProductDesc")).
'</td>';
561 print
'<input class="flat" name="packaging" size="5" value="'.$packaging.
'">';
564 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
565 $unit = $object->getLabelOfUnit();
567 print
' '.$langs->trans($unit);
576 $mysoc2 = clone $mysoc;
577 $mysoc2->name =
'Fictive seller with same country';
578 $mysoc2->tva_assuj = 1;
581 if (empty($default_vat)) {
582 $default_npr = $default_vat;
585 print
'<tr><td class="fieldrequired">'.$langs->trans(
"VATRateForSupplierProduct").
'</td>';
588 if (!empty($rowid)) {
590 $tmpproductsupplier->fetch_product_fournisseur_price($rowid, 1);
591 $default_vat = $tmpproductsupplier->fourn_tva_tx;
592 $default_npr = $tmpproductsupplier->fourn_tva_npr;
594 if (empty($default_vat)) {
595 $default_vat = $object->tva_tx;
599 $vattosuggest = preg_replace(
'/\s*\(.*\)$/',
'', $vattosuggest);
600 print
'<input type="text" class="flat" size="5" name="tva_tx" value="'.$vattosuggest.
'">';
603 if (!empty($conf->dynamicprices->enabled)) {
605 print
'<tr><td class="fieldrequired">'.$langs->trans(
"PriceMode").
'</td><td>';
607 $price_expression_list = array(0 => $langs->trans(
"PriceNumeric"));
608 foreach ($price_expression->list_price_expression() as $entry) {
609 $price_expression_list[$entry->id] = $entry->title;
611 $price_expression_preselection =
GETPOST(
'eid') ?
GETPOST(
'eid') : ($object->fk_supplier_price_expression ? $object->fk_supplier_price_expression :
'0');
612 print
$form->selectarray(
'eid', $price_expression_list, $price_expression_preselection);
613 print
' <div id="expression_editor" class="button">'.$langs->trans(
"PriceExpressionEditor").
'</div>';
616 print
'<script type="text/javascript">
617 jQuery(document).ready(run);
619 jQuery("#expression_editor").click(on_click);
620 jQuery("#eid").change(on_change);
623 function on_click() {
624 window.location = "'.DOL_URL_ROOT.
'/product/dynamic_price/editor.php?id='.$id.
'&tab=fournisseurs&eid=" + $("#eid").val();
626 function on_change() {
627 if ($("#eid").val() == 0) {
628 jQuery("#price_numeric").show();
630 jQuery("#price_numeric").hide();
636 if (!empty($conf->multicurrency->enabled)) {
638 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Currency").
'</td>';
640 $currencycodetouse =
GETPOST(
'multicurrency_code') ?
GETPOST(
'multicurrency_code') : (isset($object->fourn_multicurrency_code) ? $object->fourn_multicurrency_code :
'');
641 if (empty($currencycodetouse) && $object->fourn_multicurrency_tx == 1) {
642 $currencycodetouse = $conf->currency;
644 print
$form->selectMultiCurrency($currencycodetouse,
"multicurrency_code", 1);
645 print
' '.$langs->trans(
"CurrencyRate").
' ';
646 print
'<input class="flat" name="multicurrency_tx" size="4" value="'.vatrate(
GETPOST(
'multicurrency_tx') ?
GETPOST(
'multicurrency_tx') : (isset($object->fourn_multicurrency_tx) ? $object->fourn_multicurrency_tx :
'')).
'">';
651 print
'<tr><td class="fieldrequired">'.$form->textwithpicto($langs->trans(
"PriceQtyMinCurrency"), $langs->transnoentitiesnoconv(
"WithoutDiscount")).
'</td>';
652 $pricesupplierincurrencytouse = (
GETPOST(
'multicurrency_price') ?
GETPOST(
'multicurrency_price') : (isset($object->fourn_multicurrency_price) ? $object->fourn_multicurrency_price :
''));
653 print
'<td><input class="flat" name="multicurrency_price" size="8" value="'.price($pricesupplierincurrencytouse).
'">';
655 print
$form->selectPriceBaseType((
GETPOST(
'multicurrency_price_base_type') ?
GETPOST(
'multicurrency_price_base_type') :
'HT'),
"multicurrency_price_base_type");
659 print
'<tr><td class="fieldrequired">'.$form->textwithpicto($langs->trans(
"PriceQtyMin"), $langs->transnoentitiesnoconv(
"WithoutDiscount")).
'</td>';
660 print
'<td><input class="flat" name="disabled_price" size="8" value="">';
661 print
'<input type="hidden" name="price" value="">';
662 print
'<input type="hidden" name="price_base_type" value="">';
664 print
$form->selectPriceBaseType(
'',
"disabled_price_base_type");
667 $currencies = array();
668 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"multicurrency WHERE entity = ".((int) $conf->entity);
669 $resql = $db->query($sql);
672 while ($obj = $db->fetch_object(
$resql)) {
673 $currency->fetch($obj->rowid);
674 $currencies[$currency->code] = ((
float) $currency->rate->rate);
677 $currencies = json_encode($currencies);
680 <!-- javascript to autocalculate the minimum
price -->
681 <script
type=
"text/javascript">
682 function update_price_from_multicurrency() {
683 console.log(
"update_price_from_multicurrency");
684 var multicurrency_price =
price2numjs($(
'input[name="multicurrency_price"]').val());
685 var multicurrency_tx =
price2numjs($(
'input[name="multicurrency_tx"]').val());
686 if (multicurrency_tx != 0) {
687 $(
'input[name="price"]').val(multicurrency_price / multicurrency_tx);
688 $(
'input[name="disabled_price"]').val(multicurrency_price / multicurrency_tx);
690 $(
'input[name="price"]').val(
'');
691 $(
'input[name="disabled_price"]').val(
'');
695 jQuery(document).ready(
function () {
696 $(
'input[name="disabled_price"]').prop(
'disabled',
true);
697 $(
'select[name="disabled_price_base_type"]').prop(
'disabled',
true);
698 update_price_from_multicurrency();
700 $(
'input[name="multicurrency_price"], input[name="multicurrency_tx"]').keyup(
function () {
701 update_price_from_multicurrency();
703 $(
'input[name="multicurrency_price"], input[name="multicurrency_tx"]').change(
function () {
704 update_price_from_multicurrency();
706 $(
'input[name="multicurrency_price"], input[name="multicurrency_tx"]').on(
'paste',
function () {
707 update_price_from_multicurrency();
710 $(
'select[name="multicurrency_price_base_type"]').change(
function () {
711 $(
'input[name="price_base_type"]').val($(
this).val());
712 $(
'select[name="disabled_price_base_type"]').val($(
this).val());
715 var currencies_array = $currencies;
716 $(
'select[name="multicurrency_code"]').change(
function () {
717 console.log(
"We change the currency");
718 $(
'input[name="multicurrency_tx"]').val(currencies_array[$(
this).val()]);
719 update_price_from_multicurrency();
726 print
'<tr><td class="fieldrequired">'.$langs->trans(
"PriceQtyMin").
'</td>';
727 print
'<td><input class="flat" name="price" size="8" value="'.(GETPOST(
'price') ?
price(
GETPOST(
'price')) : (isset($object->fourn_price) ?
price($object->fourn_price) :
'')).
'">';
729 print
$form->selectPriceBaseType((
GETPOSTISSET(
'price_base_type') ?
GETPOST(
'price_base_type') :
'HT'),
"price_base_type");
734 print
'<tr><td>'.$langs->trans(
"DiscountQtyMin").
'</td>';
735 print
'<td><input class="flat" name="remise_percent" size="4" value="'.(GETPOSTISSET(
'remise_percent') ?
vatrate(
price2num(
GETPOST(
'remise_percent'),
'', 2)) : (isset($object->fourn_remise_percent) ?
vatrate($object->fourn_remise_percent) :
'')).
'"> %';
741 print
'<td>'.$langs->trans(
'NbDaysToDelivery').
'</td>';
742 print
'<td><input class="flat" name="delivery_time_days" size="4" value="'.($rowid ? $object->delivery_time_days :
'').
'"> '.$langs->trans(
'days').
'</td>';
746 print
'<tr><td>'.$langs->trans(
"ReferenceReputation").
'</td><td>';
747 echo
$form->selectarray(
'supplier_reputation', $object->reputations, !empty($supplier_reputation) ? $supplier_reputation : $object->supplier_reputation);
751 if (!empty($conf->barcode->enabled)) {
756 print
'<td>'.$langs->trans(
'GencodBuyPrice').
'</td>';
758 print
img_picto(
'',
'barcode',
'class="pictofixedwidth"');
759 print $formbarcode->selectBarcodeType((
GETPOSTISSET(
'fk_barcode_type') ?
GETPOST(
'fk_barcode_type',
'int') : ($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint(
"PRODUIT_DEFAULT_BARCODE_TYPE"))),
'fk_barcode_type', 1);
760 print
' <input class="flat" name="barcode" value="'.(GETPOSTISSET(
'barcode') ?
GETPOST(
'barcode') : ($rowid ? $object->supplier_barcode :
'')).
'"></td>';
765 if (!empty($conf->global->PRODUCT_CHARGES)) {
766 if (!empty($conf->margin->enabled)) {
768 print
'<td>'.$langs->trans(
"Charges").
'</td>';
769 print
'<td><input class="flat width75" name="charges" value="'.(GETPOST(
'charges') ?
price(
GETPOST(
'charges')) : (isset($object->fourn_charges) ?
price($object->fourn_charges) :
'')).
'">';
776 if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
778 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
781 print
'<td>'.$langs->trans(
'ProductSupplierDescription').
'</td>';
784 $doleditor =
new DolEditor(
'supplier_description', $object->desc_supplier,
'', 160,
'dolibarr_details',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4,
'90%');
785 $doleditor->Create();
792 $extrafields->fetch_name_optionals_label(
"product_fournisseur_price");
793 $extralabels = !empty($extrafields->attributes[
"product_fournisseur_price"][
'label']) ? $extrafields->attributes[
"product_fournisseur_price"][
'label'] :
'';
794 $extrafield_values = $extrafields->getOptionalsFromPost(
"product_fournisseur_price");
795 if (!empty($extralabels)) {
797 foreach ($extralabels as $key => $value) {
798 if (!empty($extrafields->attributes[
"product_fournisseur_price"][
'list'][$key]) && ($extrafields->attributes[
"product_fournisseur_price"][
'list'][$key] == 1 || $extrafields->attributes[
"product_fournisseur_price"][
'list'][$key] == 3 || ($action ==
"update_price" && $extrafields->attributes[
"product_fournisseur_price"][
'list'][$key] == 4))) {
799 if (!empty($extrafields->attributes[
"product_fournisseur_price"][
'langfile'][$key])) {
800 $langs->load($extrafields->attributes[
"product_fournisseur_price"][
'langfile'][$key]);
803 print
'<tr><td'.($extrafields->attributes[
"product_fournisseur_price"][
'required'][$key] ?
' class="fieldrequired"' :
'').
'>';
804 if (!empty($extrafields->attributes[
"product_fournisseur_price"][
'help'][$key])) {
805 print
$form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes[
"product_fournisseur_price"][
'help'][$key]));
807 print $langs->trans($value);
809 print
'</td><td>'.$extrafields->showInputField($key,
GETPOSTISSET(
'options_'.$key) ? $extrafield_values[
'options_'.$key] :
'',
'',
'',
'',
'', 0,
'product_fournisseur_price').
'</td></tr>';
814 $sql .=
" fk_object";
815 foreach ($extralabels as $key => $value) {
818 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product_fournisseur_price_extrafields";
819 $sql .=
" WHERE fk_object = ".((int) $rowid);
820 $resql = $db->query($sql);
822 $obj = $db->fetch_object(
$resql);
823 foreach ($extralabels as $key => $value) {
824 if (!empty($extrafields->attributes[
"product_fournisseur_price"][
'list'][$key]) && ($extrafields->attributes[
"product_fournisseur_price"][
'list'][$key] == 1 || $extrafields->attributes[
"product_fournisseur_price"][
'list'][$key] == 3 || ($action ==
"update_price" && $extrafields->attributes[
"product_fournisseur_price"][
'list'][$key] == 4))) {
825 if (!empty($extrafields->attributes[
"product_fournisseur_price"][
'langfile'][$key])) {
826 $langs->load($extrafields->attributes[
"product_fournisseur_price"][
'langfile'][$key]);
829 print
'<tr><td'.($extrafields->attributes[
"product_fournisseur_price"][
'required'][$key] ?
' class="fieldrequired"' :
'').
'>';
830 if (!empty($extrafields->attributes[
"product_fournisseur_price"][
'help'][$key])) {
831 print
$form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes[
"product_fournisseur_price"][
'help'][$key]));
833 print $langs->trans($value);
835 print
'</td><td>'.$extrafields->showInputField($key,
GETPOSTISSET(
'options_'.$key) ? $extrafield_values[
'options_'.$key] : $obj->{$key},
'',
'',
'',
'', 0,
'product_fournisseur_price');
845 if (is_object($hookmanager)) {
846 $parameters = array(
'id_fourn'=>!empty($id_fourn) ? $id_fourn : 0,
'prod_id'=>$object->id);
847 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
848 print $hookmanager->resPrint;
855 print
'<div class="center">';
856 print
'<input class="button button-save" type="submit" value="'.$langs->trans(
"Save").
'">';
857 print
' ';
858 print
'<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
861 print
'</form>'.
"\n";
867 print
'<div class="tabsAction">'.
"\n";
869 if ($action !=
'add_price' && $action !=
'update_price') {
870 $parameters = array();
871 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
872 if (empty($reshook)) {
873 if ($usercancreate) {
874 print
'<a class="butAction" href="'.DOL_URL_ROOT.
'/product/fournisseurs.php?id='.$object->id.
'&action=add_price&token='.
newToken().
'">';
875 print $langs->trans(
"AddSupplierPrice").
'</a>';
882 if ($user->rights->fournisseur->lire) {
884 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
885 $param .=
'&contextpage='.urlencode($contextpage);
887 if ($limit > 0 && $limit != $conf->liste_limit) {
888 $param .=
'&limit='.urlencode($limit);
890 $param .=
'&ref='.urlencode($object->ref);
893 $product_fourn_list = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder, $limit, $offset);
894 $product_fourn_list_all = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder, 0, 0);
895 $nbtotalofrecords = count($product_fourn_list_all);
896 $num = count($product_fourn_list);
897 if (($num + ($offset * $limit)) < $nbtotalofrecords) {
901 print_barre_liste($langs->trans(
'SupplierPrices'), $page, $_SERVER[
'PHP_SELF'], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'title_accountancy.png', 0,
'',
'', $limit, 1);
905 $arrayfields = array(
906 'pfp.datec'=>array(
'label'=>$langs->trans(
"AppliedPricesFrom"),
'checked'=>1,
'position'=>1),
907 's.nom'=>array(
'label'=>$langs->trans(
"Suppliers"),
'checked'=>1,
'position'=>2),
908 'pfp.fk_availability'=>array(
'label'=>$langs->trans(
"Availability"),
'enabled' =>
getDolGlobalInt(
'FOURN_PRODUCT_AVAILABILITY'),
'checked'=>0,
'position'=>4),
909 'pfp.quantity'=>array(
'label'=>$langs->trans(
"QtyMin"),
'checked'=>1,
'position'=>5),
910 'pfp.unitprice'=>array(
'label'=>$langs->trans(
"UnitPriceHT"),
'checked'=>1,
'position'=>9),
911 'pfp.multicurrency_unitprice'=>array(
'label'=>$langs->trans(
"UnitPriceHTCurrency"),
'enabled' =>
isModEnabled(
'multicurrency'),
'checked'=>0,
'position'=>10),
912 'pfp.delivery_time_days'=>array(
'label'=>$langs->trans(
"NbDaysToDelivery"),
'checked'=>1,
'position'=>13),
913 'pfp.supplier_reputation'=>array(
'label'=>$langs->trans(
"ReputationForThisProduct"),
'checked'=>1,
'position'=>14),
914 'pfp.fk_barcode_type'=>array(
'label'=>$langs->trans(
"BarcodeType"),
'enabled' =>
isModEnabled(
'barcode'),
'checked'=>0,
'position'=>15),
915 'pfp.barcode'=>array(
'label'=>$langs->trans(
"BarcodeValue"),
'enabled' =>
isModEnabled(
'barcode'),
'checked'=>0,
'position'=>16),
916 'pfp.packaging'=>array(
'label'=>$langs->trans(
"PackagingForThisProduct"),
'enabled' =>
getDolGlobalInt(
'PRODUCT_USE_SUPPLIER_PACKAGING'),
'checked'=>0,
'position'=>17),
917 'pfp.tms'=>array(
'label'=>$langs->trans(
"DateModification"),
'enabled' =>
isModEnabled(
'barcode'),
'checked'=>1,
'position'=>18),
921 $extrafields->fetch_name_optionals_label(
"product_fournisseur_price");
922 if ($extrafields->attributes[
"product_fournisseur_price"] && array_key_exists(
'label', $extrafields->attributes[
"product_fournisseur_price"])) {
923 $extralabels = $extrafields->attributes[
"product_fournisseur_price"][
'label'];
925 if (!empty($extralabels)) {
926 foreach ($extralabels as $key => $value) {
928 if (!empty($extrafields->attributes[
"product_fournisseur_price"][
'list'][$key]) && $extrafields->attributes[
"product_fournisseur_price"][
'list'][$key] != 3) {
929 $extratitle = $langs->trans($value);
930 $arrayfields[
'ef.' . $key] = array(
'label' => $extratitle,
'checked' => 0,
931 'position' => (end($arrayfields)[
'position'] + 1),
932 'langfile' => $extrafields->attributes[
"product_fournisseur_price"][
'langfile'][$key],
933 'help' => $extrafields->attributes[
"product_fournisseur_price"][
'help'][$key]);
940 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
942 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
943 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
945 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'" method="post" name="formulaire">';
946 print
'<input type="hidden" name="token" value="'.newToken().
'">';
947 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
948 print
'<input type="hidden" name="action" value="list">';
949 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
950 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
953 print
'<div class="div-table-responsive">';
954 print
'<table class="liste centpercent">';
956 $param =
"&id=".$object->id;
960 print
'<tr class="liste_titre">';
961 if (!empty($arrayfields[
'pfp.datec'][
'checked'])) {
962 print_liste_field_titre(
"AppliedPricesFrom", $_SERVER[
"PHP_SELF"],
"pfp.datec",
"", $param,
"", $sortfield, $sortorder,
'',
'', 1);
965 if (!empty($arrayfields[
's.nom'][
'checked'])) {
966 print_liste_field_titre(
"Suppliers", $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder,
'',
'', 1);
969 print_liste_field_titre(
"SupplierRef", $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder,
'',
'', 1);
971 if (!empty($arrayfields[
'pfp.fk_availability'][
'checked'])) {
972 print_liste_field_titre(
"Availability", $_SERVER[
"PHP_SELF"],
"pfp.fk_availability",
"", $param,
"", $sortfield, $sortorder);
975 if (!empty($arrayfields[
'pfp.quantity'][
'checked'])) {
976 print_liste_field_titre(
"QtyMin", $_SERVER[
"PHP_SELF"],
"pfp.quantity",
"", $param,
'', $sortfield, $sortorder,
'right ');
979 print_liste_field_titre(
"VATRate", $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
981 print_liste_field_titre(
"PriceQtyMinHT", $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
983 if (!empty($conf->multicurrency->enabled)) {
984 print_liste_field_titre(
"PriceQtyMinHTCurrency", $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
987 if (!empty($arrayfields[
'pfp.unitprice'][
'checked'])) {
988 print_liste_field_titre(
"UnitPriceHT", $_SERVER[
"PHP_SELF"],
"pfp.unitprice",
"", $param,
'', $sortfield, $sortorder,
'right ');
991 if (!empty($arrayfields[
'pfp.multicurrency_unitprice'][
'checked'])) {
992 print_liste_field_titre(
"UnitPriceHTCurrency", $_SERVER[
"PHP_SELF"],
"pfp.multicurrency_unitprice",
"", $param,
'', $sortfield, $sortorder,
'right ');
995 if (!empty($conf->multicurrency->enabled)) {
996 print_liste_field_titre(
"Currency", $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'right ');
999 print_liste_field_titre(
"DiscountQtyMin", $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
1001 if (!empty($arrayfields[
'pfp.delivery_time_days'][
'checked'])) {
1002 print_liste_field_titre(
"NbDaysToDelivery", $_SERVER[
"PHP_SELF"],
"pfp.delivery_time_days",
"", $param,
'', $sortfield, $sortorder,
'right ');
1005 if (!empty($arrayfields[
'pfp.supplier_reputation'][
'checked'])) {
1006 print_liste_field_titre(
"ReputationForThisProduct", $_SERVER[
"PHP_SELF"],
"pfp.supplier_reputation",
"", $param,
'', $sortfield, $sortorder,
'center ');
1009 if (!empty($arrayfields[
'pfp.fk_barcode_type'][
'checked'])) {
1010 print_liste_field_titre(
"BarcodeType", $_SERVER[
"PHP_SELF"],
"pfp.fk_barcode_type",
"", $param,
'', $sortfield, $sortorder,
'center ');
1013 if (!empty($arrayfields[
'pfp.barcode'][
'checked'])) {
1014 print_liste_field_titre(
"BarcodeValue", $_SERVER[
"PHP_SELF"],
"pfp.barcode",
"", $param,
'', $sortfield, $sortorder,
'center ');
1017 if (!empty($arrayfields[
'pfp.packaging'][
'checked'])) {
1018 print_liste_field_titre(
"PackagingForThisProduct", $_SERVER[
"PHP_SELF"],
"pfp.packaging",
"", $param,
'align="center"', $sortfield, $sortorder);
1021 if (!empty($arrayfields[
'pfp.tms'][
'checked'])) {
1022 print_liste_field_titre(
"DateModification", $_SERVER[
"PHP_SELF"],
"pfp.tms",
"", $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1027 $extrafields->fetch_name_optionals_label(
"product_fournisseur_price");
1028 if ($extrafields->attributes[
"product_fournisseur_price"] && array_key_exists(
'label', $extrafields->attributes[
"product_fournisseur_price"])) {
1029 $extralabels = $extrafields->attributes[
"product_fournisseur_price"][
'label'];
1031 if (!empty($extralabels)) {
1032 foreach ($extralabels as $key => $value) {
1034 if (!empty($extrafields->attributes[
"product_fournisseur_price"][
'list'][$key]) && $extrafields->attributes[
"product_fournisseur_price"][
'list'][$key] != 3) {
1035 if (!empty($extrafields->attributes[
"product_fournisseur_price"][
'langfile'][$key])) {
1036 $langs->load($extrafields->attributes[
"product_fournisseur_price"][
'langfile'][$key]);
1038 if (!empty($extrafields->attributes[
"product_fournisseur_price"][
'help'][$key])) {
1039 $extratitle =
$form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes[
"product_fournisseur_price"][
'help'][$key]));
1041 $extratitle = $langs->trans($value);
1043 if (!empty($arrayfields[
'ef.' . $key][
'checked'])) {
1044 print_liste_field_titre($extratitle, $_SERVER[
"PHP_SELF"],
'ef.' . $key,
'', $param,
'', $sortfield, $sortorder,
'right ');
1052 if (is_object($hookmanager)) {
1053 $parameters = array(
'id_fourn'=>(!empty($id_fourn)?$id_fourn:
''),
'prod_id'=>$object->id,
'nbfields'=>$nbfields);
1054 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1056 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1060 if (is_array($product_fourn_list)) {
1061 foreach ($product_fourn_list as $productfourn) {
1062 print
'<tr class="oddeven">';
1065 if (!empty($arrayfields[
'pfp.datec'][
'checked'])) {
1066 print
'<td>'.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation),
'dayhour').
'</td>';
1070 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1071 print
'<td class="tdoverflowmax150">'.$productfourn->getSocNomUrl(1,
'supplier').
'</td>';
1075 if ($usercancreate) {
1076 print
'<td class="tdoverflowmax150">'.$productfourn->getNomUrl().
'</td>';
1078 print
'<td class="tdoverflowmax150">'.dol_escape_htmltag($productfourn->fourn_ref).
'</td>';
1082 if (!empty($arrayfields[
'pfp.fk_availability'][
'checked'])) {
1083 $form->load_cache_availability();
1084 $availability =
$form->cache_availability[$productfourn->fk_availability][
'label'];
1085 print
'<td class="left">'.$availability.
'</td>';
1089 if (!empty($arrayfields[
'pfp.quantity'][
'checked'])) {
1090 print
'<td class="right">';
1091 print $productfourn->fourn_qty;
1093 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
1094 $unit = $object->getLabelOfUnit();
1096 print
' '.$langs->trans($unit);
1103 print
'<td class="right">';
1104 print
vatrate($productfourn->fourn_tva_tx,
true);
1108 print
'<td class="right">';
1109 print $productfourn->fourn_price ?
'<span class="amount">'.price($productfourn->fourn_price).
'</span>' :
"";
1112 if (!empty($conf->multicurrency->enabled)) {
1114 print
'<td class="right">';
1115 print $productfourn->fourn_multicurrency_price ?
'<span class="amount">'.price($productfourn->fourn_multicurrency_price).
'</span>' :
"";
1120 if (!empty($arrayfields[
'pfp.unitprice'][
'checked'])) {
1121 print
'<td class="right">';
1122 print
price($productfourn->fourn_unitprice);
1128 if (!empty($arrayfields[
'pfp.multicurrency_unitprice'][
'checked'])) {
1129 print
'<td class="right">';
1130 print
price($productfourn->fourn_multicurrency_unitprice);
1135 if (!empty($conf->multicurrency->enabled)) {
1136 print
'<td class="right nowraponall">';
1137 print $productfourn->fourn_multicurrency_code ?
currency_name($productfourn->fourn_multicurrency_code) :
'';
1142 print
'<td class="right">';
1143 print
price2num($productfourn->fourn_remise_percent).
'%';
1147 if (!empty($arrayfields[
'pfp.delivery_time_days'][
'checked'])) {
1148 print
'<td class="right">';
1149 print $productfourn->delivery_time_days;
1154 if (!empty($arrayfields[
'pfp.supplier_reputation'][
'checked'])) {
1155 print
'<td class="center">';
1156 if (!empty($productfourn->supplier_reputation) && !empty($object->reputations[$productfourn->supplier_reputation])) {
1157 print $object->reputations[$productfourn->supplier_reputation];
1163 if (!empty($arrayfields[
'pfp.fk_barcode_type'][
'checked'])) {
1164 print
'<td class="center">';
1165 $productfourn->barcode_type = !empty($productfourn->supplier_fk_barcode_type) ? $productfourn->supplier_fk_barcode_type : 0;
1166 $productfourn->fetch_barcode();
1167 print $productfourn->barcode_type_label ? $productfourn->barcode_type_label : ($productfourn->supplier_barcode ?
'<div class="warning">'.$langs->trans(
"SetDefaultBarcodeType").
'<div>' :
'');
1172 if (!empty($arrayfields[
'pfp.barcode'][
'checked'])) {
1173 print
'<td align="right">';
1174 print $productfourn->supplier_barcode;
1179 if (!empty($arrayfields[
'pfp.packaging'][
'checked'])) {
1180 print
'<td align="center">';
1181 print
price2num($productfourn->packaging);
1186 if (!empty($arrayfields[
'pfp.tms'][
'checked'])) {
1187 print
'<td class="right nowraponall">';
1188 print
dol_print_date(($productfourn->fourn_date_modification ? $productfourn->fourn_date_modification : $productfourn->date_modification),
"dayhour");
1193 if (!empty($extralabels)) {
1195 $sql .=
" fk_object";
1196 foreach ($extralabels as $key => $value) {
1199 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product_fournisseur_price_extrafields";
1200 $sql .=
" WHERE fk_object = ".((int) $productfourn->product_fourn_price_id);
1201 $resql = $db->query($sql);
1203 if ($db->num_rows(
$resql) != 1) {
1204 foreach ($extralabels as $key => $value) {
1205 if (!empty($arrayfields[
'ef.'.$key][
'checked']) && !empty($extrafields->attributes[
"product_fournisseur_price"][
'list'][$key]) && $extrafields->attributes[
"product_fournisseur_price"][
'list'][$key] != 3) {
1210 $obj = $db->fetch_object(
$resql);
1211 foreach ($extralabels as $key => $value) {
1212 if (!empty($arrayfields[
'ef.'.$key][
'checked']) && !empty($extrafields->attributes[
"product_fournisseur_price"][
'list'][$key]) && $extrafields->attributes[
"product_fournisseur_price"][
'list'][$key] != 3) {
1213 print
'<td align="right">'.$extrafields->showOutputField($key, $obj->{$key},
'',
'product_fournisseur_price').
"</td>";
1221 if (is_object($hookmanager)) {
1222 $parameters = array(
'id_pfp'=>$productfourn->product_fourn_price_id,
'id_fourn'=>(!empty($id_fourn)?$id_fourn:
''),
'prod_id'=>$object->id);
1223 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1227 print
'<td class="center nowraponall">';
1229 if ($usercancreate) {
1230 print
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?id='.((int) $object->id).
'&socid='.((int) $productfourn->fourn_id).
'&action=update_price&token='.
newToken().
'&rowid='.((int) $productfourn->product_fourn_price_id).
'">'.
img_edit().
"</a>";
1232 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?id='.((int) $object->id).
'&socid='.((int) $productfourn->fourn_id).
'&action=ask_remove_pf&token='.
newToken().
'&rowid='.((int) $productfourn->product_fourn_price_id).
'">'.
img_picto($langs->trans(
"Remove"),
'delete').
'</a>';
1240 if (empty($product_fourn_list)) {
1241 print
'<tr><td colspan="'.$nbfields.
'"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
1254 print $langs->trans(
"ErrorUnknown");