34require
'../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
48$langs->loadLangs(array(
'bills',
'products',
'stocks'));
52$action =
GETPOST(
'action',
'aZ09');
53$confirm =
GETPOST(
'confirm',
'alpha');
54$cancel =
GETPOST(
'cancel',
'alpha');
59if (!empty($user->socid)) {
60 $socid = $user->socid;
62$fieldvalue = (!empty($id) ?
$id : (!empty($ref) ? $ref :
''));
63$fieldtype = (!empty($ref) ?
'ref' :
'rowid');
66$hookmanager->initHooks(array(
'productcompositioncard',
'globalcard'));
70if ($id > 0 || !empty($ref)) {
71 $result =
$object->fetch($id, $ref);
76$result =
restrictedArea($user,
'produit|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
79 if (
$object->type == $object::TYPE_PRODUCT) {
82 if (
$object->type == $object::TYPE_SERVICE) {
86 restrictedArea($user,
'produit|service', $fieldvalue,
'product&product',
'',
'', $fieldtype);
101$reshook = $hookmanager->executeHooks(
'doActions', [], $object, $action);
106if (empty($reshook)) {
108 if ($action ==
'add_prod' && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
112 for ($i = 0; $i < $maxprod; $i++) {
121 if (
$object->error ==
"isFatherOfThis") {
122 setEventMessages($langs->trans(
"ErrorAssociationIsFatherOfThis"),
null,
'errors');
139 header(
"Location: " . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id);
142 } elseif ($action ===
'save_composed_product') {
143 $TProduct =
GETPOST(
'TProduct',
'array');
144 if (!empty($TProduct)) {
145 foreach ($TProduct as $id_product => $row) {
146 if ($row[
'qty'] > 0) {
147 $object->update_sousproduit($id, $id_product, $row[
'qty'], isset($row[
'incdec']) ? 1 : 0);
149 $object->del_sousproduit($id, $id_product);
155 header(
"Location: " . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id);
170if ($action ==
'search') {
171 $current_lang = $langs->getDefaultLang();
173 $sql =
'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type as type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
174 $sql .=
' p.fk_product_type, p.tms as datem, p.tobatch';
175 $sql .=
', p.tosell as status, p.tobuy as status_buy';
177 $sql .=
', pl.label as labelm, pl.description as descriptionm';
180 $parameters = array();
181 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
182 $sql .= $hookmanager->resPrint;
184 $sql .=
' FROM '.MAIN_DB_PREFIX.
'product as p';
185 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'categorie_product as cp ON p.rowid = cp.fk_product';
187 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product_lang as pl ON pl.fk_product = p.rowid AND lang='".($current_lang).
"'";
189 $sql .=
' WHERE p.entity IN ('.getEntity(
'product').
')';
191 $parameters = array();
192 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
193 $sql .= $hookmanager->resPrint;
197 $params = array(
'p.ref',
'p.label',
'p.description',
'p.note');
200 $params[] =
'pl.label';
201 $params[] =
'pl.description';
202 $params[] =
'pl.note';
205 $params[] =
'p.barcode';
209 if (
isModEnabled(
'category') && !empty($parent) && $parent != -1) {
210 $sql .=
" AND cp.fk_categorie ='".$db->escape($parent).
"'";
212 $sql .=
" ORDER BY p.ref ASC";
214 $resql =
$db->query($sql);
217$title = $langs->trans(
'ProductServiceCard');
221 $title = $langs->trans(
'Product').
" ".$shortlabel.
" - ".$langs->trans(
'AssociatedProducts');
222 $help_url =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos|DE:Modul_Produkte';
225 $title = $langs->trans(
'Service').
" ".$shortlabel.
" - ".$langs->trans(
'AssociatedProducts');
226 $help_url =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Leistungen';
229llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-product page-composition_card');
233$titre = $langs->trans(
"CardProduct".
$object->type);
239if ($id > 0 || !empty($ref)) {
244 $iskit =
$object->hasFatherOrChild(1);
246 if ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire')) {
247 $linkback =
'<a href="'.DOL_URL_ROOT.
'/product/list.php?restore_lastsearch_values=1&type='.
$object->type.
'">'.$langs->trans(
"BackToList").
'</a>';
250 if ($user->socid && !in_array(
'product', explode(
',',
getDolGlobalString(
'MAIN_MODULES_FOR_EXTERNAL')))) {
254 dol_banner_tab($object,
'ref', $linkback, $shownav,
'ref',
'');
257 print
'<div class="fichecenter">';
258 print
'<div class="fichehalfleft">';
259 print
'<div class="underbanner clearboth"></div>';
261 print
'<table class="border centpercent tableforfield">';
265 $typeformat =
'select;0:'.$langs->trans(
"Product").
',1:'.$langs->trans(
"Service");
266 print
'<tr><td class="titlefieldmiddle">';
267 print (!
getDolGlobalString(
'PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey(
"Type",
'fk_product_type', (
string)
$object->type, $object, 0, $typeformat) : $langs->trans(
'Type');
269 print $form->editfieldval(
"Type",
'fk_product_type',
$object->type, $object, 0, $typeformat);
275 print
'<tr><td>' . $form->textwithpicto($langs->trans(
"StockableProduct"), $langs->trans(
'StockableProductDescription')) .
'</td>';
278 print
'<input type="checkbox" readonly disabled> <span class="opacitymedium">' . $langs->trans(
"NotSupportedOnKits").
'</span>';
280 print
'<input type="checkbox" readonly disabled '.($object->stockable_product == 1 ?
'checked' :
'').
'>';
284 if (
$object->isStockManaged() && !$iskit) {
286 $warehouse->fetch(
$object->fk_default_warehouse);
288 print
'<tr><td>'.$langs->trans(
"DefaultWarehouse").
'</td><td>';
289 print(!empty($warehouse->id) ? $warehouse->getNomUrl(1) :
'');
296 print
'</div><div class="fichehalfright">';
297 print
'<div class="underbanner clearboth"></div>';
299 print
'<table class="border centpercent tableforfield">';
304 print
'<tr><td>'.$form->textwithpicto($langs->trans(
"NatureOfProductShort"), $langs->trans(
"NatureOfProductDesc")).
'</td><td>';
305 print
$object->getLibFinished();
313 print
'<tr><td class="titlefield">'.$langs->trans(
"SellingPrice").
'</td><td>';
314 if (
$object->price_base_type ==
'TTC') {
322 print
'<tr><td>'.$langs->trans(
"MinPrice").
'</td><td>';
323 if (
$object->price_base_type ==
'TTC') {
338 print
'<div class="clearboth"></div>';
340 print
'<div class="clearboth"></div><br>';
343 $prodsfather =
$object->getFather();
344 $object->get_sousproduits_arbo();
345 $parent_label =
$object->label;
346 $prods_arbo =
$object->get_arbo_each_prod();
349 if (!empty(
$conf->use_javascript_ajax)) {
350 $nboflines = $prods_arbo;
351 $table_element_line =
'product_association';
353 include DOL_DOCUMENT_ROOT .
'/core/tpl/ajaxrow.tpl.php';
357 $nbofsubsubproducts = count($prods_arbo);
358 $prodschild =
$object->getChildsArbo($id, 1);
359 $nbofsubproducts = count($prodschild);
362 print
'<div class="fichecenter">';
366 print
'<table class="liste noborder">';
367 print
'<tr class="liste_titre">';
368 print
'<th>'.$langs->trans(
'ParentProducts').
'</th>';
369 print
'<th>'.$langs->trans(
'Label').
'</th>';
370 print
'<th class="right">'.$langs->trans(
'Qty').
'</th>';
372 if (count($prodsfather) > 0) {
373 foreach ($prodsfather as $value) {
374 $idprod = $value[
"id"];
375 $productstatic->id = $idprod;
376 $productstatic->type = $value[
"fk_product_type"];
377 $productstatic->ref = $value[
'ref'];
378 $productstatic->label = $value[
'label'];
379 $productstatic->entity = $value[
'entity'];
380 $productstatic->status = $value[
'status'];
381 $productstatic->status_buy = $value[
'status_buy'];
383 print
'<tr class="oddeven">';
384 print
'<td>'.$productstatic->getNomUrl(1,
'composition').
'</td>';
385 print
'<td>'.dol_escape_htmltag($productstatic->label).
'</td>';
386 print
'<td class="right">'.dol_escape_htmltag((
string) $value[
'qty']).
'</td>';
390 print
'<tr class="oddeven">';
391 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
401 print
'<div class="fichecenter">';
403 $atleastonenotdefined = 0;
405 $tmpurlforbutton =
'javascript:void(0);';
408 'onclick' =>
'console.log("click to add a product in kit");jQuery(".formtoaddinkit").toggle();return false;',
411 $morehtmlright = dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', $tmpurlforbutton,
'', $usercancreate ? 1 : 0, $newButtonParams);
413 print
load_fiche_titre($langs->trans(
"ProductAssociationList"), $morehtmlright,
'');
417 if ((empty($action) || $action ==
'view' || $action ==
'edit' || $action ==
'search' || $action ==
're-edit') && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
425 print
'<form action="'.DOL_URL_ROOT.
'/product/composition/card.php?id='.
$id.
'" method="POST" class="formtoaddinkit'.($action !=
'search' ?
' hideobject' :
'').
'" name="formtoaddinkit" id="formtoaddinkit">';
426 print
'<input type="hidden" name="token" value="'.newToken().
'">';
427 print
'<input type="hidden" name="action" value="search">';
428 print
'<input type="hidden" name="id" value="'.$id.
'">';
430 print
'<div class="inline-block">';
431 print $langs->trans(
"KeywordFilter").
': ';
432 print
'<input type="text" name="key" value="'.$key.
'"> ';
435 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
436 print
'<div class="inline-block">'.$langs->trans(
"CategoryFilter").
': ';
437 print $form->select_all_categories(Categorie::TYPE_PRODUCT, $parent,
'parent').
' </div>';
440 print
'<div class="inline-block">';
441 print
'<input type="submit" class="button small" value="'.$langs->trans(
"Search").
'">';
442 print
'</div><br><br>';
449 if ($action ==
'search') {
450 print
'<form action="'.DOL_URL_ROOT.
'/product/composition/card.php?id='.
$id.
'" method="post" class="formtoaddinkit">';
451 print
'<input type="hidden" name="token" value="'.newToken().
'">';
452 print
'<input type="hidden" name="action" value="add_prod">';
453 print
'<input type="hidden" name="id" value="'.$id.
'">';
455 print
'<table class="noborder centpercent">';
456 print
'<tr class="liste_titre">';
457 print
'<th class="liste_titre">'.$langs->trans(
"ComposedProduct").
'</td>';
458 print
'<th class="liste_titre">'.$langs->trans(
"Label").
'</td>';
460 print
'<th class="liste_titre right">'.$langs->trans(
"Qty").
'</td>';
461 print
'<th class="center">'.$langs->trans(
'ComposedProductIncDecStock').
'</th>';
466 $num =
$db->num_rows($resql);
469 print
'<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"NoMatchFound").
'</span></td></tr>';
474 while ($i < min($num, $MAX)) {
475 $objp =
$db->fetch_object($resql);
476 if ($objp->rowid != $id) {
479 $prod_arbo->id = $objp->rowid;
482 if ($prod_arbo->type == 2 || $prod_arbo->type == 3) {
484 $prod_arbo->get_sousproduits_arbo();
486 $prods_arbo = $prod_arbo->get_arbo_each_prod();
487 if (count($prods_arbo) > 0) {
488 foreach ($prods_arbo as $key => $value) {
490 if ($value[1] == $id) {
503 print
'<tr class="oddeven">';
505 $productstatic->id = $objp->rowid;
506 $productstatic->ref = $objp->ref;
507 $productstatic->label = $objp->label;
508 $productstatic->type = $objp->type;
509 $productstatic->entity = $objp->entity;
510 $productstatic->status = $objp->status;
511 $productstatic->status_buy = $objp->status_buy;
512 $productstatic->status_batch = $objp->tobatch;
514 print
'<td>'.$productstatic->getNomUrl(1,
'', 24).
'</td>';
515 $labeltoshow = $objp->label;
517 $labeltoshow = $objp->labelm;
520 print
'<td>'.$labeltoshow.
'</td>';
523 if (
$object->is_sousproduit($id, $objp->rowid)) {
525 $qty =
$object->is_sousproduit_qty;
526 $incdec =
$object->is_sousproduit_incdec;
536 print
'<td class="right"><input type="hidden" name="prod_id_'.$i.
'" value="'.$objp->rowid.
'"><input type="text" size="2" name="prod_qty_'.$i.
'" value="'.($qty ? $qty :
'').
'"></td>';
539 print
'<td class="center">';
541 print
'<input type="checkbox" name="prod_incdec_'.$i.
'" value="1" '.($incdec ?
'checked' :
'').
'>';
544 print
'<input type="checkbox" name="prod_incdec_'.$i.
'" value="1" checked>';
554 print
'<tr class="oddeven">';
555 print
'<td><span class="opacitymedium">'.$langs->trans(
"More").
'...</span></td>';
565 print
'<input type="hidden" name="max_prod" value="'.$i.
'">';
568 print
'<div class="center">';
569 print
'<input type="submit" class="button button-save" name="save" value="'.$langs->trans(
"Add").
'/'.$langs->trans(
"Update").
'">';
570 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
571 print
'</div><br><br>';
579 print
'<form name="formComposedProduct" action="'.$_SERVER[
'PHP_SELF'].
'" method="post">';
580 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
581 print
'<input type="hidden" name="action" value="save_composed_product" />';
582 print
'<input type="hidden" name="id" value="'.$id.
'" />';
584 print
'<div class="div-table-responsive-no-min">';
585 print
'<table id="tablelines" class="ui-sortable liste noborder nobottom">';
587 print
'<tr class="liste_titre nodrag nodrop">';
589 print
'<th>'.$langs->trans(
'Position').
'</th>';
591 print
'<th>'.$langs->trans(
'ComposedProduct').
'</th>';
593 print
'<th>'.$langs->trans(
'Label').
'</th>';
595 print
'<th class="right" colspan="2">'.$langs->trans(
'MinSupplierPrice').
'</th>';
597 print
'<th class="right" colspan="2">'.$langs->trans(
'MinCustomerPrice').
'</th>';
600 print
'<th class="right">'.$langs->trans(
'Stock').
'</th>';
603 $parameters = array();
604 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
605 print $hookmanager->resPrint;
607 print
'<th class="right">'.$langs->trans(
'Qty').
'</th>';
609 print
'<th class="center">'.$langs->trans(
'ComposedProductIncDecStock').
'</th>';
611 print
'<th class="linecolmove" style="width: 10px"></th>';
616 if (count($prods_arbo)) {
617 foreach ($prods_arbo as $value) {
618 $productstatic->fetch($value[
'id']);
620 if ($value[
'level'] <= 1) {
621 print
'<tr id="'.$object->sousprods[$parent_label][$value[
'id']][6].
'" class="drag drop oddeven level1">';
624 print
'<td>'.$object->sousprods[$parent_label][$value[
'id']][7].
'</td>';
627 $nb_of_subproduct = $value[
'nb'];
630 print
'<td>'.$productstatic->getNomUrl(1,
'composition').
'</td>';
633 print
'<td title="'.dol_escape_htmltag($productstatic->label).
'" class="tdoverflowmax150">'.
dol_escape_htmltag($productstatic->label).
'</td>';
636 print
'<td class="right"><span class="small">';
637 if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0) {
638 print $langs->trans(
"BuyingPriceMinShort").
': ';
639 if ($product_fourn->product_fourn_price_id > 0) {
640 print $product_fourn->display_price_product_fournisseur(0, 0);
642 print $langs->trans(
"NotDefined");
644 $atleastonenotdefined++;
651 $fourn_unitprice = (!empty($product_fourn->fourn_unitprice) ? $product_fourn->fourn_unitprice : 0);
652 $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent) ? $product_fourn->fourn_remise_percent : 0);
653 $fourn_remise = (!empty($product_fourn->fourn_remise) ? $product_fourn->fourn_remise : 0);
655 $unitline =
price2num(($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise),
'MU');
656 $totalline =
price2num($value[
'nb'] * ($fourn_unitprice * (1 - ($fourn_remise_percent / 100)) - $fourn_remise),
'MT');
657 $total += $totalline;
659 print
'<td class="right nowraponall">';
660 print($notdefined ?
'' : ($value[
'nb'] > 1 ? $value[
'nb'].
'x ' :
'').
'<span class="amount">'.
price($unitline, 0,
'', 0, 0, -1,
$conf->currency)).
'</span>';
664 $pricesell = $productstatic->price;
666 $pricesell =
'Variable';
668 $totallinesell =
price2num($value[
'nb'] * ($pricesell),
'MT');
669 $totalsell += $totallinesell;
671 print
'<td class="right" colspan="2">';
672 print($notdefined ?
'' : ($value[
'nb'] > 1 ? $value[
'nb'].
'x ' :
''));
673 if (is_numeric($pricesell)) {
674 print
'<span class="amount">'.price($pricesell, 0,
'', 0, 0, -1,
$conf->currency).
'</span>';
676 print
'<span class="opacitymedium">'.$langs->trans($pricesell).
'</span>';
682 print
'<td class="right">'.$value[
'stock'].
'</td>';
686 $parameters = array();
687 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $productstatic);
688 print $hookmanager->resPrint;
691 if ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer')) {
692 print
'<td class="center"><input type="text" value="'.$nb_of_subproduct.
'" name="TProduct['.$productstatic->id.
'][qty]" class="right width40" /></td>';
693 print
'<td class="center"><input type="checkbox" name="TProduct['.$productstatic->id.
'][incdec]" value="1" '.($value[
'incdec'] == 1 ?
'checked' :
'').
' /></td>';
695 print
'<td>'.$nb_of_subproduct.
'</td>';
696 print
'<td>'.($value[
'incdec'] == 1 ?
'x' :
'').
'</td>';
700 print
'<td class="linecolmove tdlineupdown center"></td>';
706 $hide =
' hideobject';
709 print
'<tr class="oddeven'.$hide.
'" id="sub-'.$value[
'id_parent'].
'" data-ignoreidfordnd=1>';
712 $productstatic->ref = $value[
'ref'];
719 for ($i = 0; $i < $value[
'level']; $i++) {
720 print
' ';
722 print $productstatic->getNomUrl(1,
'composition');
726 print
'<td>'.dol_escape_htmltag($productstatic->label).
'</td>';
729 print
'<td> </td>';
730 print
'<td> </td>';
732 print
'<td> </td>';
733 print
'<td> </td>';
741 $parameters = array();
742 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $productstatic);
743 print $hookmanager->resPrint;
746 print
'<td class="right">'.dol_escape_htmltag((
string) $value[
'nb']).
'</td>';
749 print
'<td> </td>';
752 print
'<td> </td>';
761 print
'<tr class="liste_total">';
767 print
'<td class="liste_total"></td>';
770 print
'<td class="liste_total"></td>';
773 print
'<td class="liste_total right">';
774 print $langs->trans(
"TotalBuyingPriceMinShort");
777 print
'<td class="liste_total right">';
778 if ($atleastonenotdefined) {
779 print $langs->trans(
"Unknown").
' ('.$langs->trans(
"SomeSubProductHaveNoPrices").
')';
781 print($atleastonenotdefined ?
'' :
price($total, 0,
'', 0, 0, -1,
$conf->currency));
785 print
'<td class="liste_total right">';
786 print $langs->trans(
"TotalSellingPriceMinShort");
789 print
'<td class="liste_total right">';
790 if ($atleastonenotdefined) {
791 print $langs->trans(
"Unknown").
' ('.$langs->trans(
"SomeSubProductHaveNoPrices").
')';
793 print($atleastonenotdefined ?
'' :
price($totalsell, 0,
'', 0, 0, -1,
$conf->currency));
798 print
'<td class="liste_total right"> </td>';
803 print
'<td class="center">';
804 if ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer')) {
805 print
'<input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'">';
818 print
'<tr class="oddeven">';
819 print
'<td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage warehouses.
Class to manage predefined suppliers products.
Class to manage products or services.
const TYPE_PRODUCT
Regular product.
const TYPE_SERVICE
Service.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
product_prepare_head($object)
Prepare array with list of tabs.
restrictedArea(User $user, $features, $object=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.