dolibarr  16.0.5
fournisseurs.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2021 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
5  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
7  * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
8  * Copyright (C) 2014 Ion Agorria <ion@agorria.com>
9  * Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
10  * Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
11  * Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
12  * Copyright (C) 2019 Tim Otte <otte@meuser.it>
13  * Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
14  *
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program. If not, see <https://www.gnu.org/licenses/>.
27  */
28 
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)) {
44  dol_include_once('/core/class/html.formbarcode.class.php');
45 }
46 // Load translation files required by the page
47 $langs->loadLangs(array('products', 'suppliers', 'bills', 'margins', 'stocks'));
48 
49 $id = GETPOST('id', 'int');
50 $ref = GETPOST('ref', 'alpha');
51 $rowid = GETPOST('rowid', 'int');
52 $action = GETPOST('action', 'aZ09');
53 $cancel = GETPOST('cancel', 'alpha');
54 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'pricesuppliercard';
55 
56 $socid = GETPOST('socid', 'int');
57 $cost_price = price2num(GETPOST('cost_price', 'alpha'), '', 2);
58 $pmp = price2num(GETPOST('pmp', 'alpha'), '', 2);
59 
60 $backtopage = GETPOST('backtopage', 'alpha');
61 $error = 0;
62 
63 $extrafields = new ExtraFields($db);
64 
65 // If socid provided by ajax company selector
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');
69 }
70 
71 // Security check
72 $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
73 $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
74 if ($user->socid) {
75  $socid = $user->socid;
76 }
77 
78 if (empty($user->rights->fournisseur->lire)) {
80 }
81 
82 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
83 $sortfield = GETPOST('sortfield', 'aZ09comma');
84 $sortorder = GETPOST('sortorder', 'aZ09comma');
85 $page = (GETPOST("page", 'int') ?GETPOST("page", 'int') : 0);
86 if (empty($page) || $page == -1) {
87  $page = 0;
88 } // If $page is not defined, or '' or -1
89 $offset = $limit * $page;
90 $pageprev = $page - 1;
91 $pagenext = $page + 1;
92 if (!$sortfield) {
93  $sortfield = "s.nom";
94 }
95 if (!$sortorder) {
96  $sortorder = "ASC";
97 }
98 
99 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
100 $hookmanager->initHooks(array('pricesuppliercard', 'globalcard'));
101 
102 $object = new ProductFournisseur($db);
103 if ($id > 0 || $ref) {
104  $object->fetch($id, $ref);
105 }
106 
107 $usercanread = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->lire) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->lire));
108 $usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer));
109 
110 if ($object->id > 0) {
111  if ($object->type == $object::TYPE_PRODUCT) {
112  restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
113  }
114  if ($object->type == $object::TYPE_SERVICE) {
115  restrictedArea($user, 'service', $object->id, 'product&product', '', '');
116  }
117 } else {
118  restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
119 }
120 
121 
122 /*
123  * Actions
124  */
125 
126 if ($cancel) {
127  $action = '';
128 }
129 
130 $parameters = array('socid'=>$socid, 'id_prod'=>$id);
131 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
132 if ($reshook < 0) {
133  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
134 }
135 
136 if (empty($reshook)) {
137  if ($action == 'setcost_price') {
138  if ($id) {
139  $result = $object->fetch($id);
140  $object->cost_price = price2num($cost_price);
141  $result = $object->update($object->id, $user);
142  if ($result > 0) {
143  setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
144  $action = '';
145  } else {
146  $error++;
147  setEventMessages($object->error, $object->errors, 'errors');
148  }
149  }
150  }
151  if ($action == 'setpmp') {
152  if ($id) {
153  $result = $object->fetch($id);
154  $object->pmp = price2num($pmp);
155  $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".((float) $object->pmp)." WHERE rowid = ".((int) $id);
156  $resql = $db->query($sql);
157  //$result = $object->update($object->id, $user);
158  if ($resql) {
159  setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
160  $action = '';
161  } else {
162  $error++;
163  setEventMessages($object->error, $object->errors, 'errors');
164  }
165  }
166  }
167 
168  if ($action == 'confirm_remove_pf') {
169  if ($rowid) { // id of product supplier price to remove
170  $action = '';
171  $result = $object->remove_product_fournisseur_price($rowid);
172  if ($result > 0) {
173  $db->query("DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields WHERE fk_object = ".((int) $rowid));
174  setEventMessages($langs->trans("PriceRemoved"), null, 'mesgs');
175  } else {
176  $error++;
177  setEventMessages($object->error, $object->errors, 'errors');
178  }
179  }
180  }
181 
182  if ($action == 'save_price') {
183  $id_fourn = GETPOST("id_fourn");
184  if (empty($id_fourn)) {
185  $id_fourn = GETPOST("search_id_fourn");
186  }
187  $ref_fourn = GETPOST("ref_fourn");
188  if (empty($ref_fourn)) {
189  $ref_fourn = GETPOST("search_ref_fourn");
190  }
191  $ref_fourn_old = GETPOST("ref_fourn_old");
192  if (empty($ref_fourn_old)) {
193  $ref_fourn_old = $ref_fourn;
194  }
195  $quantity = price2num(GETPOST("qty", 'alphanohtml'), 'MS');
196  $remise_percent = price2num(GETPOST('remise_percent', 'alpha'));
197 
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)) {
201  $tva_tx = price2num($tva_tx);
202  }
203 
204  $price_expression = GETPOST('eid', 'int') ? GETPOST('eid', 'int') : ''; // Discard expression if not in expression mode
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');
210  $packaging = price2num(GETPOST("packaging", 'alphanohtml'), 'MS');
211 
212  if ($tva_tx == '') {
213  $error++;
214  $langs->load("errors");
215  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("VATRateForSupplierProduct")), null, 'errors');
216  }
217  if (!is_numeric($tva_tx)) {
218  $error++;
219  $langs->load("errors");
220  setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("VATRateForSupplierProduct")), null, 'errors');
221  }
222  if (empty($quantity)) {
223  $error++;
224  $langs->load("errors");
225  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")), null, 'errors');
226  }
227  if (empty($ref_fourn)) {
228  $error++;
229  $langs->load("errors");
230  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefSupplier")), null, 'errors');
231  }
232  if ($id_fourn <= 0) {
233  $error++;
234  $langs->load("errors");
235  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Supplier")), null, 'errors');
236  }
237  if (price2num(GETPOST("price")) < 0 || GETPOST("price") == '') {
238  if ($price_expression === '') { // Return error of missing price only if price_expression not set
239  $error++;
240  $langs->load("errors");
241  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), null, 'errors');
242  } else {
243  $_POST["price"] = 0;
244  }
245  }
246  if (!empty($conf->multicurrency->enabled)) {
247  if (!GETPOST("multicurrency_code")) {
248  $error++;
249  $langs->load("errors");
250  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Currency")), null, 'errors');
251  }
252  if (price2num(GETPOST("multicurrency_tx")) <= 0 || GETPOST("multicurrency_tx") == '') {
253  $error++;
254  $langs->load("errors");
255  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("CurrencyRate")), null, 'errors');
256  }
257  if (price2num(GETPOST("multicurrency_price")) < 0 || GETPOST("multicurrency_price") == '') {
258  $error++;
259  $langs->load("errors");
260  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PriceCurrency")), null, 'errors');
261  }
262  }
263 
264  if (!$error) {
265  $db->begin();
266 
267  if (!$error) {
268  $ret = $object->add_fournisseur($user, $id_fourn, $ref_fourn_old, $quantity); // This insert record with no value for price. Values are update later with update_buyprice
269  if ($ret == -3) {
270  $error++;
271 
272  $tmpobject = new Product($db);
273  $tmpobject->fetch($object->product_id_already_linked);
274  $productLink = $tmpobject->getNomUrl(1, 'supplier');
275 
276  $texttoshow = $langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct", '{s1}');
277  $texttoshow = str_replace('{s1}', $productLink, $texttoshow);
278  setEventMessages($texttoshow, null, 'errors');
279  } elseif ($ret < 0) {
280  $error++;
281  setEventMessages($object->error, $object->errors, 'errors');
282  }
283  }
284 
285  if (!$error) {
286  $supplier = new Fournisseur($db);
287  $result = $supplier->fetch($id_fourn);
288  if (GETPOSTISSET('ref_fourn_price_id')) {
289  $object->fetch_product_fournisseur_price(GETPOST('ref_fourn_price_id', 'int'));
290  }
291  $extralabels = $extrafields->fetch_name_optionals_label("product_fournisseur_price");
292  $extrafield_values = $extrafields->getOptionalsFromPost("product_fournisseur_price");
293 
294  $newprice = price2num(GETPOST("price", "alpha"));
295 
296  if (empty($packaging)) {
297  $packaging = 1;
298  }
299  /* We can have a puchase ref that need to buy 100 min for a given price and with a packaging of 50.
300  if ($packaging < $quantity) {
301  $packaging = $quantity;
302  }*/
303  $object->packaging = $packaging;
304 
305  if (!empty($conf->multicurrency->enabled)) {
306  $multicurrency_tx = price2num(GETPOST("multicurrency_tx", 'alpha'));
307  $multicurrency_price = price2num(GETPOST("multicurrency_price", 'alpha'));
308  $multicurrency_code = GETPOST("multicurrency_code", 'alpha');
309 
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);
311  } else {
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);
313  }
314  if ($ret < 0) {
315  $error++;
316  setEventMessages($object->error, $object->errors, 'errors');
317  } else {
318  if (!empty($conf->dynamicprices->enabled) && $price_expression !== '') {
319  //Check the expression validity by parsing it
320  $priceparser = new PriceParser($db);
321  $object->fk_supplier_price_expression = $price_expression;
322  $price_result = $priceparser->parseProductSupplier($object);
323  if ($price_result < 0) { //Expression is not valid
324  $error++;
325  setEventMessages($priceparser->translatedError(), null, 'errors');
326  }
327  }
328  if (!$error && !empty($conf->dynamicprices->enabled)) {
329  //Set the price expression for this supplier price
330  $ret = $object->setSupplierPriceExpression($price_expression);
331  if ($ret < 0) {
332  $error++;
333  setEventMessages($object->error, $object->errors, 'errors');
334  }
335  }
336  }
337  }
338 
339  if (!$error) {
340  $db->commit();
341  $action = '';
342  } else {
343  $db->rollback();
344  }
345  } else {
346  $action = 'add_price';
347  }
348  }
349 }
350 
351 
352 /*
353  * view
354  */
355 
356 $form = new Form($db);
357 
358 $title = $langs->trans('ProductServiceCard');
359 $helpurl = '';
360 $shortlabel = dol_trunc($object->label, 16);
361 if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) {
362  $title = $langs->trans('Product')." ".$shortlabel." - ".$langs->trans('BuyingPrices');
363  $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos|DE:Modul_Produkte';
364 }
365 if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) {
366  $title = $langs->trans('Service')." ".$shortlabel." - ".$langs->trans('BuyingPrices');
367  $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios|DE:Modul_Lesitungen';
368 }
369 
370 llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'classforhorizontalscrolloftabs');
371 
372 if ($id > 0 || $ref) {
373  if ($result) {
374  if ($action == 'ask_remove_pf') {
375  $form = new Form($db);
376  $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&rowid='.$rowid, $langs->trans('DeleteProductBuyPrice'), $langs->trans('ConfirmDeleteProductBuyPrice'), 'confirm_remove_pf', '', 0, 1);
377  echo $formconfirm;
378  }
379 
380  if ($action != 'edit' && $action != 're-edit') {
381  $head = product_prepare_head($object);
382  $titre = $langs->trans("CardProduct".$object->type);
383  $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product');
384 
385  print dol_get_fiche_head($head, 'suppliers', $titre, -1, $picto);
386 
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;
389 
390  $shownav = 1;
391  if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
392  $shownav = 0;
393  }
394 
395  dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
396 
397  print '<div class="fichecenter">';
398 
399  print '<div class="underbanner clearboth"></div>';
400  print '<table class="border tableforfield centpercent">';
401 
402  // Type
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');
407  print '</td><td>';
408  print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat);
409  print '</td></tr>';
410  }
411 
412  // Cost price. Can be used for margin module for option "calculate margin on explicit cost price
413  print '<tr><td>';
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');
418  print '</td><td>';
419  print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6');
420  print '</td></tr>';
421 
422  // PMP
423  $usercaneditpmp = 0;
424  if (!empty($conf->global->PRODUCT_CAN_EDIT_WAP)) {
425  $usercaneditpmp = $usercancreate;
426  }
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');
431  print '</td><td>';
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");
435  }
436  /*
437  .$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).'</td>';
438  print '<td>';
439  if ($object->pmp > 0) {
440  print price($object->pmp).' '.$langs->trans("HT");
441  }*/
442  print '</td>';
443  print '</tr>';
444 
445  // Best buying Price
446  print '<tr><td class="titlefieldcreate">'.$langs->trans("BuyingPriceMin").'</td>';
447  print '<td>';
448  $product_fourn = new ProductFournisseur($db);
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();
452  } else {
453  print $langs->trans("NotDefined");
454  }
455  }
456  print '</td></tr>';
457 
458  print '</table>';
459 
460  print '</div>';
461  print '<div style="clear:both"></div>';
462 
463  print dol_get_fiche_end();
464 
465 
466  // Form to add or update a price
467  if (($action == 'add_price' || $action == 'update_price') && $usercancreate) {
468  $langs->load("suppliers");
469 
470  print "<!-- form to add a supplier price -->\n";
471  print '<br>';
472 
473  if ($rowid) {
474  $object->fetch_product_fournisseur_price($rowid, 1); //Ignore the math expression when getting the price
475  print load_fiche_titre($langs->trans("ChangeSupplierPrice"));
476  } else {
477  print load_fiche_titre($langs->trans("AddSupplierPrice"));
478  }
479 
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">';
483 
484  print dol_get_fiche_head();
485 
486  print '<table class="border centpercent">';
487 
488  // Supplier
489  print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Supplier").'</td><td>';
490  if ($rowid) {
491  $supplier = new Fournisseur($db);
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.'">';
498  } else {
499  $events = array();
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);
502 
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"');
509  print '</a>';
510  }
511  }
512  }
513  print '</td></tr>';
514 
515  // Ref supplier
516  print '<tr><td class="fieldrequired">'.$langs->trans("SupplierRef").'</td><td>';
517  if ($rowid) {
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.'">';
520  } else {
521  print '<input class="flat width150" maxlength="128" name="ref_fourn" value="'.(GETPOST("ref_fourn") ? GETPOST("ref_fourn") : '').'">';
522  }
523  print '</td>';
524  print '</tr>';
525 
526  // Availability
527  if (getDolGlobalInt('FOURN_PRODUCT_AVAILABILITY')) {
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";
532  }
533 
534  // Qty min
535  print '<tr>';
536  print '<td class="fieldrequired">'.$langs->trans("QtyMin").'</td>';
537  print '<td>';
538  $quantity = GETPOSTISSET('qty') ? price2num(GETPOST('qty', 'alphanohtml'), 'MS') : "1";
539  if ($rowid) {
540  print '<input type="hidden" name="qty" value="'.$object->fourn_qty.'">';
541  print $object->fourn_qty;
542  } else {
543  print '<input class="flat" name="qty" size="5" value="'.$quantity.'">';
544  }
545  // Units
546  if (!empty($conf->global->PRODUCT_USE_UNITS)) {
547  $unit = $object->getLabelOfUnit();
548  if ($unit !== '') {
549  print '&nbsp;&nbsp;'.$langs->trans($unit);
550  }
551  }
552  print '</td></tr>';
553 
554  if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
555  // Packaging/Conditionnement
556  print '<tr>';
557 
558  print '<td class="fieldrequired">'.$form->textwithpicto($langs->trans("PackagingForThisProduct"), $langs->trans("PackagingForThisProductDesc")).'</td>';
559  print '<td>';
560  $packaging = GETPOSTISSET('packaging') ? price2num(GETPOST('packaging', 'alphanohtml'), 'MS') : ((empty($rowid)) ? "1" : price2num($object->packaging, 'MS'));
561  print '<input class="flat" name="packaging" size="5" value="'.$packaging.'">';
562 
563  // Units
564  if (!empty($conf->global->PRODUCT_USE_UNITS)) {
565  $unit = $object->getLabelOfUnit();
566  if ($unit !== '') {
567  print '&nbsp;&nbsp;'.$langs->trans($unit);
568  }
569  }
570  }
571  // Vat rate
572  $default_vat = '';
573 
574  // We don't have supplier, so we try to guess.
575  // For this we build a fictive supplier with same properties than user but using vat)
576  $mysoc2 = clone $mysoc;
577  $mysoc2->name = 'Fictive seller with same country';
578  $mysoc2->tva_assuj = 1;
579  $default_vat = get_default_tva($mysoc2, $mysoc, $object->id, 0);
580  $default_npr = get_default_npr($mysoc2, $mysoc, $object->id, 0);
581  if (empty($default_vat)) {
582  $default_npr = $default_vat;
583  }
584 
585  print '<tr><td class="fieldrequired">'.$langs->trans("VATRateForSupplierProduct").'</td>';
586  print '<td>';
587  //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
588  if (!empty($rowid)) { // If we have a supplier, it is an update, we must show the vat of current supplier price
589  $tmpproductsupplier = new ProductFournisseur($db);
590  $tmpproductsupplier->fetch_product_fournisseur_price($rowid, 1);
591  $default_vat = $tmpproductsupplier->fourn_tva_tx;
592  $default_npr = $tmpproductsupplier->fourn_tva_npr;
593  } else {
594  if (empty($default_vat)) {
595  $default_vat = $object->tva_tx;
596  }
597  }
598  $vattosuggest = (GETPOSTISSET("tva_tx") ? vatrate(GETPOST("tva_tx")) : ($default_vat != '' ?vatrate($default_vat) : ''));
599  $vattosuggest = preg_replace('/\s*\(.*\)$/', '', $vattosuggest);
600  print '<input type="text" class="flat" size="5" name="tva_tx" value="'.$vattosuggest.'">';
601  print '</td></tr>';
602 
603  if (!empty($conf->dynamicprices->enabled)) { //Only show price mode and expression selector if module is enabled
604  // Price mode selector
605  print '<tr><td class="fieldrequired">'.$langs->trans("PriceMode").'</td><td>';
606  $price_expression = new PriceExpression($db);
607  $price_expression_list = array(0 => $langs->trans("PriceNumeric")); //Put the numeric mode as first option
608  foreach ($price_expression->list_price_expression() as $entry) {
609  $price_expression_list[$entry->id] = $entry->title;
610  }
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 '&nbsp; <div id="expression_editor" class="button">'.$langs->trans("PriceExpressionEditor").'</div>';
614  print '</td></tr>';
615  // This code hides the numeric price input if is not selected, loads the editor page if editor button is pressed
616  print '<script type="text/javascript">
617  jQuery(document).ready(run);
618  function run() {
619  jQuery("#expression_editor").click(on_click);
620  jQuery("#eid").change(on_change);
621  on_change();
622  }
623  function on_click() {
624  window.location = "'.DOL_URL_ROOT.'/product/dynamic_price/editor.php?id='.$id.'&tab=fournisseurs&eid=" + $("#eid").val();
625  }
626  function on_change() {
627  if ($("#eid").val() == 0) {
628  jQuery("#price_numeric").show();
629  } else {
630  jQuery("#price_numeric").hide();
631  }
632  }
633  </script>';
634  }
635 
636  if (!empty($conf->multicurrency->enabled)) {
637  // Currency
638  print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
639  print '<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;
643  }
644  print $form->selectMultiCurrency($currencycodetouse, "multicurrency_code", 1);
645  print ' &nbsp; &nbsp; '.$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 : '')).'">';
647  print '</td>';
648  print '</tr>';
649 
650  // Currency price qty min
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).'">';
654  print '&nbsp;';
655  print $form->selectPriceBaseType((GETPOST('multicurrency_price_base_type') ?GETPOST('multicurrency_price_base_type') : 'HT'), "multicurrency_price_base_type"); // We keep 'HT' here, multicurrency_price_base_type is not yet supported for supplier prices
656  print '</td></tr>';
657 
658  // Price qty min
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="">';
663  print '&nbsp;';
664  print $form->selectPriceBaseType('', "disabled_price_base_type");
665  print '</td></tr>';
666 
667  $currencies = array();
668  $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."multicurrency WHERE entity = ".((int) $conf->entity);
669  $resql = $db->query($sql);
670  if ($resql) {
671  $currency = new MultiCurrency($db);
672  while ($obj = $db->fetch_object($resql)) {
673  $currency->fetch($obj->rowid);
674  $currencies[$currency->code] = ((float) $currency->rate->rate);
675  }
676  }
677  $currencies = json_encode($currencies);
678 
679  print <<<END
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);
689  } else {
690  $('input[name="price"]').val('');
691  $('input[name="disabled_price"]').val('');
692  }
693  }
694 
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();
699 
700  $('input[name="multicurrency_price"], input[name="multicurrency_tx"]').keyup(function () {
701  update_price_from_multicurrency();
702  });
703  $('input[name="multicurrency_price"], input[name="multicurrency_tx"]').change(function () {
704  update_price_from_multicurrency();
705  });
706  $('input[name="multicurrency_price"], input[name="multicurrency_tx"]').on('paste', function () {
707  update_price_from_multicurrency();
708  });
709 
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());
713  });
714 
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();
720  });
721  });
722  </script>
723 END;
724  } else {
725  // Price qty min
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) : '')).'">';
728  print '&nbsp;';
729  print $form->selectPriceBaseType((GETPOSTISSET('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
730  print '</td></tr>';
731  }
732 
733  // Discount qty min
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) : '')).'"> %';
736  print '</td>';
737  print '</tr>';
738 
739  // Delivery delay in days
740  print '<tr>';
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 : '').'">&nbsp;'.$langs->trans('days').'</td>';
743  print '</tr>';
744 
745  // Reputation
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);
748  print '</td></tr>';
749 
750  // Barcode
751  if (!empty($conf->barcode->enabled)) {
752  $formbarcode = new FormBarCode($db);
753 
754  // Barcode type
755  print '<tr>';
756  print '<td>'.$langs->trans('GencodBuyPrice').'</td>';
757  print '<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>';
761  print '</tr>';
762  }
763 
764  // Option to define a transport cost on supplier price
765  if (!empty($conf->global->PRODUCT_CHARGES)) {
766  if (!empty($conf->margin->enabled)) {
767  print '<tr>';
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) : '')).'">';
770  print '</td>';
771  print '</tr>';
772  }
773  }
774 
775  // Product description of the supplier
776  if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
777  //WYSIWYG Editor
778  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
779 
780  print '<tr>';
781  print '<td>'.$langs->trans('ProductSupplierDescription').'</td>';
782  print '<td>';
783 
784  $doleditor = new DolEditor('supplier_description', $object->desc_supplier, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%');
785  $doleditor->Create();
786 
787  print '</td>';
788  print '</tr>';
789  }
790 
791  // Extrafields
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)) {
796  if (empty($rowid)) {
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]);
801  }
802 
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]));
806  } else {
807  print $langs->trans($value);
808  }
809  print '</td><td>'.$extrafields->showInputField($key, GETPOSTISSET('options_'.$key) ? $extrafield_values['options_'.$key] : '', '', '', '', '', 0, 'product_fournisseur_price').'</td></tr>';
810  }
811  }
812  } else {
813  $sql = "SELECT";
814  $sql .= " fk_object";
815  foreach ($extralabels as $key => $value) {
816  $sql .= ", ".$key;
817  }
818  $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields";
819  $sql .= " WHERE fk_object = ".((int) $rowid);
820  $resql = $db->query($sql);
821  if ($resql) {
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]);
827  }
828 
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]));
832  } else {
833  print $langs->trans($value);
834  }
835  print '</td><td>'.$extrafields->showInputField($key, GETPOSTISSET('options_'.$key) ? $extrafield_values['options_'.$key] : $obj->{$key}, '', '', '', '', 0, 'product_fournisseur_price');
836 
837  print '</td></tr>';
838  }
839  }
840  $db->free($resql);
841  }
842  }
843  }
844 
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;
849  }
850 
851  print '</table>';
852 
853  print dol_get_fiche_end();
854 
855  print '<div class="center">';
856  print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
857  print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
858  print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
859  print '</div>';
860 
861  print '</form>'."\n";
862  }
863 
864 
865  // Actions buttons
866 
867  print '<div class="tabsAction">'."\n";
868 
869  if ($action != 'add_price' && $action != 'update_price') {
870  $parameters = array();
871  $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
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>';
876  }
877  }
878  }
879 
880  print "</div>\n";
881 
882  if ($user->rights->fournisseur->lire) { // Duplicate ? this check is already in the head of this file
883  $param = '';
884  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
885  $param .= '&contextpage='.urlencode($contextpage);
886  }
887  if ($limit > 0 && $limit != $conf->liste_limit) {
888  $param .= '&limit='.urlencode($limit);
889  }
890  $param .= '&ref='.urlencode($object->ref);
891 
892  $product_fourn = new ProductFournisseur($db);
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) {
898  $num++;
899  }
900 
901  print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1);
902 
903  // Definition of fields for lists
904  // Some fields are missing because they are not included in the database query
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),
918  );
919 
920  // fetch optionals attributes and labels
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'];
924 
925  if (!empty($extralabels)) {
926  foreach ($extralabels as $key => $value) {
927  // Show field if not hidden
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]);
934  }
935  }
936  }
937  }
938 
939  // Selection of new fields
940  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
941 
942  $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
943  $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
944 
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.'">';
951 
952  // Suppliers list title
953  print '<div class="div-table-responsive">';
954  print '<table class="liste centpercent">';
955 
956  $param = "&id=".$object->id;
957 
958  $nbfields = 0;
959 
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);
963  $nbfields++;
964  }
965  if (!empty($arrayfields['s.nom']['checked'])) {
966  print_liste_field_titre("Suppliers", $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder, '', '', 1);
967  $nbfields++;
968  }
969  print_liste_field_titre("SupplierRef", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder, '', '', 1);
970  $nbfields++;
971  if (!empty($arrayfields['pfp.fk_availability']['checked'])) {
972  print_liste_field_titre("Availability", $_SERVER["PHP_SELF"], "pfp.fk_availability", "", $param, "", $sortfield, $sortorder);
973  $nbfields++;
974  }
975  if (!empty($arrayfields['pfp.quantity']['checked'])) {
976  print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "pfp.quantity", "", $param, '', $sortfield, $sortorder, 'right ');
977  $nbfields++;
978  }
979  print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
980  $nbfields++;
981  print_liste_field_titre("PriceQtyMinHT", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
982  $nbfields++;
983  if (!empty($conf->multicurrency->enabled)) {
984  print_liste_field_titre("PriceQtyMinHTCurrency", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
985  $nbfields++;
986  }
987  if (!empty($arrayfields['pfp.unitprice']['checked'])) {
988  print_liste_field_titre("UnitPriceHT", $_SERVER["PHP_SELF"], "pfp.unitprice", "", $param, '', $sortfield, $sortorder, 'right ');
989  $nbfields++;
990  }
991  if (!empty($arrayfields['pfp.multicurrency_unitprice']['checked'])) {
992  print_liste_field_titre("UnitPriceHTCurrency", $_SERVER["PHP_SELF"], "pfp.multicurrency_unitprice", "", $param, '', $sortfield, $sortorder, 'right ');
993  $nbfields++;
994  }
995  if (!empty($conf->multicurrency->enabled)) {
996  print_liste_field_titre("Currency", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
997  $nbfields++;
998  }
999  print_liste_field_titre("DiscountQtyMin", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
1000  $nbfields++;
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 ');
1003  $nbfields++;
1004  }
1005  if (!empty($arrayfields['pfp.supplier_reputation']['checked'])) {
1006  print_liste_field_titre("ReputationForThisProduct", $_SERVER["PHP_SELF"], "pfp.supplier_reputation", "", $param, '', $sortfield, $sortorder, 'center ');
1007  $nbfields++;
1008  }
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 ');
1011  $nbfields++;
1012  }
1013  if (!empty($arrayfields['pfp.barcode']['checked'])) {
1014  print_liste_field_titre("BarcodeValue", $_SERVER["PHP_SELF"], "pfp.barcode", "", $param, '', $sortfield, $sortorder, 'center ');
1015  $nbfields++;
1016  }
1017  if (!empty($arrayfields['pfp.packaging']['checked'])) {
1018  print_liste_field_titre("PackagingForThisProduct", $_SERVER["PHP_SELF"], "pfp.packaging", "", $param, 'align="center"', $sortfield, $sortorder);
1019  $nbfields++;
1020  }
1021  if (!empty($arrayfields['pfp.tms']['checked'])) {
1022  print_liste_field_titre("DateModification", $_SERVER["PHP_SELF"], "pfp.tms", "", $param, '', $sortfield, $sortorder, 'right ', '', 1);
1023  $nbfields++;
1024  }
1025 
1026  // fetch optionals attributes and labels
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'];
1030 
1031  if (!empty($extralabels)) {
1032  foreach ($extralabels as $key => $value) {
1033  // Show field if not hidden
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]);
1037  }
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]));
1040  } else {
1041  $extratitle = $langs->trans($value);
1042  }
1043  if (!empty($arrayfields['ef.' . $key]['checked'])) {
1044  print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.' . $key, '', $param, '', $sortfield, $sortorder, 'right ');
1045  $nbfields++;
1046  }
1047  }
1048  }
1049  }
1050  }
1051 
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);
1055  }
1056  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
1057  $nbfields++;
1058  print "</tr>\n";
1059 
1060  if (is_array($product_fourn_list)) {
1061  foreach ($product_fourn_list as $productfourn) {
1062  print '<tr class="oddeven">';
1063 
1064  // Date from
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>';
1067  }
1068 
1069  // Supplier
1070  if (!empty($arrayfields['s.nom']['checked'])) {
1071  print '<td class="tdoverflowmax150">'.$productfourn->getSocNomUrl(1, 'supplier').'</td>';
1072  }
1073 
1074  // Supplier ref
1075  if ($usercancreate) { // change required right here
1076  print '<td class="tdoverflowmax150">'.$productfourn->getNomUrl().'</td>';
1077  } else {
1078  print '<td class="tdoverflowmax150">'.dol_escape_htmltag($productfourn->fourn_ref).'</td>';
1079  }
1080 
1081  // Availability
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>';
1086  }
1087 
1088  // Quantity
1089  if (!empty($arrayfields['pfp.quantity']['checked'])) {
1090  print '<td class="right">';
1091  print $productfourn->fourn_qty;
1092  // Units
1093  if (!empty($conf->global->PRODUCT_USE_UNITS)) {
1094  $unit = $object->getLabelOfUnit();
1095  if ($unit !== '') {
1096  print '&nbsp;&nbsp;'.$langs->trans($unit);
1097  }
1098  }
1099  print '</td>';
1100  }
1101 
1102  // VAT rate
1103  print '<td class="right">';
1104  print vatrate($productfourn->fourn_tva_tx, true);
1105  print '</td>';
1106 
1107  // Price for the quantity
1108  print '<td class="right">';
1109  print $productfourn->fourn_price ? '<span class="amount">'.price($productfourn->fourn_price).'</span>' : "";
1110  print '</td>';
1111 
1112  if (!empty($conf->multicurrency->enabled)) {
1113  // Price for the quantity in currency
1114  print '<td class="right">';
1115  print $productfourn->fourn_multicurrency_price ? '<span class="amount">'.price($productfourn->fourn_multicurrency_price).'</span>' : "";
1116  print '</td>';
1117  }
1118 
1119  // Unit price
1120  if (!empty($arrayfields['pfp.unitprice']['checked'])) {
1121  print '<td class="right">';
1122  print price($productfourn->fourn_unitprice);
1123  //print $objp->unitprice? price($objp->unitprice) : ($objp->quantity?price($objp->price/$objp->quantity):"&nbsp;");
1124  print '</td>';
1125  }
1126 
1127  // Unit price in currency
1128  if (!empty($arrayfields['pfp.multicurrency_unitprice']['checked'])) {
1129  print '<td class="right">';
1130  print price($productfourn->fourn_multicurrency_unitprice);
1131  print '</td>';
1132  }
1133 
1134  // Currency
1135  if (!empty($conf->multicurrency->enabled)) {
1136  print '<td class="right nowraponall">';
1137  print $productfourn->fourn_multicurrency_code ? currency_name($productfourn->fourn_multicurrency_code) : '';
1138  print '</td>';
1139  }
1140 
1141  // Discount
1142  print '<td class="right">';
1143  print price2num($productfourn->fourn_remise_percent).'%';
1144  print '</td>';
1145 
1146  // Delivery delay
1147  if (!empty($arrayfields['pfp.delivery_time_days']['checked'])) {
1148  print '<td class="right">';
1149  print $productfourn->delivery_time_days;
1150  print '</td>';
1151  }
1152 
1153  // Reputation
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];
1158  }
1159  print'</td>';
1160  }
1161 
1162  // Barcode type
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>' : '');
1168  print '</td>';
1169  }
1170 
1171  // Barcode
1172  if (!empty($arrayfields['pfp.barcode']['checked'])) {
1173  print '<td align="right">';
1174  print $productfourn->supplier_barcode;
1175  print '</td>';
1176  }
1177 
1178  // Packaging
1179  if (!empty($arrayfields['pfp.packaging']['checked'])) {
1180  print '<td align="center">';
1181  print price2num($productfourn->packaging);
1182  print '</td>';
1183  }
1184 
1185  // Date modification
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");
1189  print '</td>';
1190  }
1191 
1192  // Extrafields
1193  if (!empty($extralabels)) {
1194  $sql = "SELECT";
1195  $sql .= " fk_object";
1196  foreach ($extralabels as $key => $value) {
1197  $sql .= ", ".$key;
1198  }
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);
1202  if ($resql) {
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) {
1206  print "<td></td>";
1207  }
1208  }
1209  } else {
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>";
1214  }
1215  }
1216  }
1217  $db->free($resql);
1218  }
1219  }
1220 
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);
1224  }
1225 
1226  // Modify-Remove
1227  print '<td class="center nowraponall">';
1228 
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>";
1231  print ' &nbsp; ';
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>';
1233  }
1234 
1235  print '</td>';
1236 
1237  print '</tr>';
1238  }
1239 
1240  if (empty($product_fourn_list)) {
1241  print '<tr><td colspan="'.$nbfields.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
1242  }
1243  } else {
1244  dol_print_error($db);
1245  }
1246 
1247  print '</table>';
1248  print '</div>';
1249  print '</form>';
1250  }
1251  }
1252  }
1253 } else {
1254  print $langs->trans("ErrorUnknown");
1255 }
1256 
1257 // End of page
1258 llxFooter();
1259 $db->close();
dol_trunc
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
Definition: functions.lib.php:3805
restrictedArea
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
Definition: security.lib.php:234
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
PriceExpression
Class for accesing price expression table.
Definition: price_expression.class.php:30
FormBarCode
Class to manage barcode HTML.
Definition: html.formbarcode.class.php:30
ProductFournisseur
Class to manage predefined suppliers products.
Definition: fournisseur.product.class.php:41
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
dol_include_once
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
Definition: functions.lib.php:1033
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1062
product_prepare_head
product_prepare_head($object)
Prepare array with list of tabs.
Definition: product.lib.php:35
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
img_edit
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
Definition: functions.lib.php:4389
price2numjs
price2numjs(amount)
Function similar to PHP price2num()
Definition: lib_head.js.php:1222
dol_banner_tab
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
Definition: functions.lib.php:2046
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5661
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2514
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
PriceParser
Class to parse product price expressions.
Definition: price_parser.class.php:33
$formconfirm
$formconfirm
if ($action == 'delbookkeepingyear') {
Definition: listbyaccount.php:576
MultiCurrency
Class Currency.
Definition: multicurrency.class.php:39
get_default_npr
get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
Fonction qui renvoie si tva doit etre tva percue recuperable.
Definition: functions.lib.php:6405
currency_name
currency_name($code_iso, $withcode='', $outputlangs=null)
Return label of currency or code+label.
Definition: company.lib.php:639
Fournisseur
Class to manage suppliers.
Definition: fournisseur.class.php:34
print_barre_liste
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
Definition: functions.lib.php:5257
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
get_default_tva
get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
Function that return vat rate of a product line (according to seller, buyer and product vat rate) VAT...
Definition: functions.lib.php:6304
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:105
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:386
print_liste_field_titre
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
Definition: functions.lib.php:5026
ExtraFields
Class to manage standard extra fields.
Definition: extrafields.class.php:39
Product
Class to manage products or services.
Definition: product.class.php:46
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
price
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
Definition: functions.lib.php:5541
Product\TYPE_SERVICE
const TYPE_SERVICE
Service.
Definition: product.class.php:504
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
Product\TYPE_PRODUCT
const TYPE_PRODUCT
Regular product.
Definition: product.class.php:500
getDolGlobalInt
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
Definition: functions.lib.php:93
type
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition: repair.php:119
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59
DolEditor
Class to manage a WYSIWYG editor.
Definition: doleditor.class.php:30
vatrate
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0, $html=0)
Return a string with VAT rate label formated for view output Used into pdf and HTML pages.
Definition: functions.lib.php:5492
float
div float
Buy price without taxes.
Definition: style.css.php:809