dolibarr  16.0.5
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2014-2016 Charlie BENKE <charlie@patas-monkey.com>
6  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
7  * Copyright (C) 2019 Pierre Ardoin <mapiolca@me.com>
8  * Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
9  * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see <https://www.gnu.org/licenses/>.
23  */
24 
31 require '../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
35 
36 $type = GETPOST("type", 'int');
37 if ($type == '' && empty($user->rights->produit->lire)) {
38  $type = '1'; // Force global page on service page only
39 }
40 if ($type == '' && empty($user->rights->service->lire)) {
41  $type = '0'; // Force global page on product page only
42 }
43 
44 // Load translation files required by the page
45 $langs->loadLangs(array('products', 'stocks'));
46 
47 // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
48 $hookmanager->initHooks(array('productindex'));
49 
50 $product_static = new Product($db);
51 
52 // Security check
53 if ($type == '0') {
54  $result = restrictedArea($user, 'produit');
55 } elseif ($type == '1') {
56  $result = restrictedArea($user, 'service');
57 } else {
58  $result = restrictedArea($user, 'produit|service|expedition');
59 }
60 
61 
62 /*
63  * View
64  */
65 
66 $transAreaType = $langs->trans("ProductsAndServicesArea");
67 
68 $helpurl = '';
69 if (!isset($_GET["type"])) {
70  $transAreaType = $langs->trans("ProductsAndServicesArea");
71  $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
72 }
73 if ((isset($_GET["type"]) && $_GET["type"] == 0) || empty($conf->service->enabled)) {
74  $transAreaType = $langs->trans("ProductsArea");
75  $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
76 }
77 if ((isset($_GET["type"]) && $_GET["type"] == 1) || empty($conf->product->enabled)) {
78  $transAreaType = $langs->trans("ServicesArea");
79  $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
80 }
81 
82 llxHeader("", $langs->trans("ProductsAndServices"), $helpurl);
83 
84 $linkback = "";
85 print load_fiche_titre($transAreaType, $linkback, 'product');
86 
87 
88 print '<div class="fichecenter"><div class="fichethirdleft">';
89 
90 
91 if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be useless due to the global search combo
92  // Search contract
93  if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) {
94  $listofsearchfields['search_product'] = array('text'=>'ProductOrService');
95  }
96 
97  if (count($listofsearchfields)) {
98  print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
99  print '<input type="hidden" name="token" value="'.newToken().'">';
100  print '<div class="div-table-responsive-no-min">';
101  print '<table class="noborder nohover centpercent">';
102  $i = 0;
103  foreach ($listofsearchfields as $key => $value) {
104  if ($i == 0) {
105  print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
106  }
107  print '<tr class="oddeven">';
108  print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td>';
109  print '<td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
110  if ($i == 0) {
111  print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
112  }
113  print '</tr>';
114  $i++;
115  }
116  print '</table>';
117  print '</div>';
118  print '</form>';
119  print '<br>';
120  }
121 }
122 
123 /*
124  * Number of products and/or services
125  */
126 if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) {
127  $prodser = array();
128  $prodser[0][0] = $prodser[0][1] = $prodser[0][2] = $prodser[0][3] = 0;
129  $prodser[0]['sell'] = 0;
130  $prodser[0]['buy'] = 0;
131  $prodser[0]['none'] = 0;
132  $prodser[1][0] = $prodser[1][1] = $prodser[1][2] = $prodser[1][3] = 0;
133  $prodser[1]['sell'] = 0;
134  $prodser[1]['buy'] = 0;
135  $prodser[1]['none'] = 0;
136 
137  $sql = "SELECT COUNT(p.rowid) as total, p.fk_product_type, p.tosell, p.tobuy";
138  $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
139  $sql .= ' WHERE p.entity IN ('.getEntity($product_static->element, 1).')';
140  // Add where from hooks
141  $parameters = array();
142  $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $product_static); // Note that $action and $object may have been modified by hook
143  $sql .= $hookmanager->resPrint;
144  $sql .= " GROUP BY p.fk_product_type, p.tosell, p.tobuy";
145  $result = $db->query($sql);
146  while ($objp = $db->fetch_object($result)) {
147  $status = 3; // On sale + On purchase
148  if (!$objp->tosell && !$objp->tobuy) {
149  $status = 0; // Not on sale, not on purchase
150  }
151  if ($objp->tosell && !$objp->tobuy) {
152  $status = 1; // On sale only
153  }
154  if (!$objp->tosell && $objp->tobuy) {
155  $status = 2; // On purchase only
156  }
157  $prodser[$objp->fk_product_type][$status] = $objp->total;
158  if ($objp->tosell) {
159  $prodser[$objp->fk_product_type]['sell'] += $objp->total;
160  }
161  if ($objp->tobuy) {
162  $prodser[$objp->fk_product_type]['buy'] += $objp->total;
163  }
164  if (!$objp->tosell && !$objp->tobuy) {
165  $prodser[$objp->fk_product_type]['none'] += $objp->total;
166  }
167  }
168 
169  if ($conf->use_javascript_ajax) {
170  print '<div class="div-table-responsive-no-min">';
171  print '<table class="noborder centpercent">';
172  print '<tr class="liste_titre"><th>'.$langs->trans("Statistics").'</th></tr>';
173  print '<tr><td class="center nopaddingleftimp nopaddingrightimp">';
174 
175  $SommeA = $prodser[0]['sell'];
176  $SommeB = $prodser[0]['buy'];
177  $SommeC = $prodser[0]['none'];
178  $SommeD = $prodser[1]['sell'];
179  $SommeE = $prodser[1]['buy'];
180  $SommeF = $prodser[1]['none'];
181  $total = 0;
182  $dataval = array();
183  $datalabels = array();
184  $i = 0;
185 
186  $total = $SommeA + $SommeB + $SommeC + $SommeD + $SommeE + $SommeF;
187  $dataseries = array();
188  if (!empty($conf->product->enabled)) {
189  $dataseries[] = array($langs->transnoentitiesnoconv("ProductsOnSale"), round($SommeA));
190  $dataseries[] = array($langs->transnoentitiesnoconv("ProductsOnPurchase"), round($SommeB));
191  $dataseries[] = array($langs->transnoentitiesnoconv("ProductsNotOnSell"), round($SommeC));
192  }
193  if (!empty($conf->service->enabled)) {
194  $dataseries[] = array($langs->transnoentitiesnoconv("ServicesOnSale"), round($SommeD));
195  $dataseries[] = array($langs->transnoentitiesnoconv("ServicesOnPurchase"), round($SommeE));
196  $dataseries[] = array($langs->transnoentitiesnoconv("ServicesNotOnSell"), round($SommeF));
197  }
198  include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
199  $dolgraph = new DolGraph();
200  $dolgraph->SetData($dataseries);
201  $dolgraph->setShowLegend(2);
202  $dolgraph->setShowPercent(0);
203  $dolgraph->SetType(array('pie'));
204  $dolgraph->setHeight('200');
205  $dolgraph->draw('idgraphstatus');
206  print $dolgraph->show($total ? 0 : 1);
207 
208  print '</td></tr>';
209  print '</table>';
210  print '</div>';
211  }
212 }
213 
214 
215 if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_PRODUCTS)) {
216  require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
217  print '<br>';
218  print '<div class="div-table-responsive-no-min">';
219  print '<table class="noborder centpercent">';
220  print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>';
221  print '<tr><td class="center" colspan="2">';
222  $sql = "SELECT c.label, count(*) as nb";
223  $sql .= " FROM ".MAIN_DB_PREFIX."categorie_product as cs";
224  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
225  $sql .= " WHERE c.type = 0";
226  $sql .= " AND c.entity IN (".getEntity('category').")";
227  $sql .= " GROUP BY c.label";
228  $sql .= " ORDER BY nb desc";
229  $total = 0;
230  $result = $db->query($sql);
231  if ($result) {
232  $num = $db->num_rows($result);
233  $i = 0;
234  if (!empty($conf->use_javascript_ajax)) {
235  $dataseries = array();
236  $rest = 0;
237  $nbmax = 10;
238  while ($i < $num) {
239  $obj = $db->fetch_object($result);
240  if ($i < $nbmax) {
241  $dataseries[] = array($obj->label, round($obj->nb));
242  } else {
243  $rest += $obj->nb;
244  }
245  $total += $obj->nb;
246  $i++;
247  }
248  if ($i > $nbmax) {
249  $dataseries[] = array($langs->trans("Other"), round($rest));
250  }
251 
252  include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
253  $dolgraph = new DolGraph();
254  $dolgraph->SetData($dataseries);
255  $dolgraph->setShowLegend(2);
256  $dolgraph->setShowPercent(1);
257  $dolgraph->SetType(array('pie'));
258  $dolgraph->setHeight('200');
259  $dolgraph->draw('idstatscategproduct');
260  print $dolgraph->show($total ? 0 : 1);
261  } else {
262  while ($i < $num) {
263  $obj = $db->fetch_object($result);
264 
265  print '<tr><td>'.$obj->label.'</td><td>'.$obj->nb.'</td></tr>';
266  $total += $obj->nb;
267  $i++;
268  }
269  }
270  }
271  print '</td></tr>';
272  print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
273  print $total;
274  print '</td></tr>';
275  print '</table>';
276  print '</div>';
277 }
278 print '</div><div class="fichetwothirdright">';
279 
280 
281 /*
282  * Latest modified products
283  */
284 if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) {
285  $max = 15;
286  $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.tobatch, p.fk_price_expression,";
287  $sql .= " p.entity,";
288  $sql .= " p.tms as datem";
289  $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
290  $sql .= " WHERE p.entity IN (".getEntity($product_static->element, 1).")";
291  if ($type != '') {
292  $sql .= " AND p.fk_product_type = ".((int) $type);
293  }
294  // Add where from hooks
295  $parameters = array();
296  $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $product_static); // Note that $action and $object may have been modified by hook
297  $sql .= $hookmanager->resPrint;
298  $sql .= $db->order("p.tms", "DESC");
299  $sql .= $db->plimit($max, 0);
300 
301  //print $sql;
302  $result = $db->query($sql);
303  if ($result) {
304  $num = $db->num_rows($result);
305 
306  $i = 0;
307 
308  if ($num > 0) {
309  $transRecordedType = $langs->trans("LastModifiedProductsAndServices", $max);
310  if (isset($_GET["type"]) && $_GET["type"] == 0) {
311  $transRecordedType = $langs->trans("LastRecordedProducts", $max);
312  }
313  if (isset($_GET["type"]) && $_GET["type"] == 1) {
314  $transRecordedType = $langs->trans("LastRecordedServices", $max);
315  }
316 
317  print '<div class="div-table-responsive-no-min">';
318  print '<table class="noborder centpercent">';
319 
320  $colnb = 2;
321  if (empty($conf->global->PRODUIT_MULTIPRICES)) {
322  $colnb++;
323  }
324 
325  print '<tr class="liste_titre"><th colspan="'.$colnb.'">'.$transRecordedType.'</th>';
326  print '<th class="right" colspan="3"><a href="'.DOL_URL_ROOT.'/product/list.php?sortfield=p.tms&sortorder=DESC">'.$langs->trans("FullList").'</td>';
327  print '</tr>';
328 
329  while ($i < $num) {
330  $objp = $db->fetch_object($result);
331 
332  $product_static->id = $objp->rowid;
333  $product_static->ref = $objp->ref;
334  $product_static->label = $objp->label;
335  $product_static->type = $objp->fk_product_type;
336  $product_static->entity = $objp->entity;
337  $product_static->status = $objp->tosell;
338  $product_static->status_buy = $objp->tobuy;
339  $product_static->status_batch = $objp->tobatch;
340 
341  // Multilangs
342  if (!empty($conf->global->MAIN_MULTILANGS)) {
343  $sql = "SELECT label";
344  $sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
345  $sql .= " WHERE fk_product = ".((int) $objp->rowid);
346  $sql .= " AND lang = '".$db->escape($langs->getDefaultLang())."'";
347 
348  $resultd = $db->query($sql);
349  if ($resultd) {
350  $objtp = $db->fetch_object($resultd);
351  if ($objtp && $objtp->label != '') {
352  $objp->label = $objtp->label;
353  }
354  }
355  }
356 
357 
358  print '<tr class="oddeven">';
359  print '<td class="nowraponall tdoverflowmax100">';
360  print $product_static->getNomUrl(1, '', 16);
361  print "</td>\n";
362  print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objp->label).'">'.dol_escape_htmltag($objp->label).'</td>';
363  print '<td title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($db->jdate($objp->datem), 'dayhour', 'tzuserrel')).'">';
364  print dol_print_date($db->jdate($objp->datem), 'day', 'tzuserrel');
365  print "</td>";
366  // Sell price
367  if (empty($conf->global->PRODUIT_MULTIPRICES)) {
368  if (!empty($conf->dynamicprices->enabled) && !empty($objp->fk_price_expression)) {
369  $product = new Product($db);
370  $product->fetch($objp->rowid);
371  $priceparser = new PriceParser($db);
372  $price_result = $priceparser->parseProduct($product);
373  if ($price_result >= 0) {
374  $objp->price = $price_result;
375  }
376  }
377  print '<td class="nowraponall amount right">';
378  if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') {
379  print price($objp->price_ttc).' '.$langs->trans("TTC");
380  } else {
381  print price($objp->price).' '.$langs->trans("HT");
382  }
383  print '</td>';
384  }
385  print '<td class="right nowrap width25"><span class="statusrefsell">';
386  print $product_static->LibStatut($objp->tosell, 3, 0);
387  print "</span></td>";
388  print '<td class="right nowrap width25"><span class="statusrefbuy">';
389  print $product_static->LibStatut($objp->tobuy, 3, 1);
390  print "</span></td>";
391  print "</tr>\n";
392  $i++;
393  }
394 
395  $db->free($result);
396 
397  print "</table>";
398  print '</div>';
399  print '<br>';
400  }
401  } else {
402  dol_print_error($db);
403  }
404 }
405 
406 
407 // TODO Move this into a page that should be available into menu "accountancy - report - turnover - per quarter"
408 // Also method used for counting must provide the 2 possible methods like done by all other reports into menu "accountancy - report - turnover":
409 // "commitment engagment" method and "cash accounting" method
410 if (!empty($conf->global->MAIN_SHOW_PRODUCT_ACTIVITY_TRIM)) {
411  if (!empty($conf->product->enabled)) {
412  activitytrim(0);
413  }
414  if (!empty($conf->service->enabled)) {
415  activitytrim(1);
416  }
417 }
418 
419 
420 print '</div></div>';
421 
422 $parameters = array('type' => $type, 'user' => $user);
423 $reshook = $hookmanager->executeHooks('dashboardProductsServices', $parameters, $product_static); // Note that $action and $object may have been modified by hook
424 
425 // End of page
426 llxFooter();
427 $db->close();
428 
429 
436 function activitytrim($product_type)
437 {
438  global $conf, $langs, $db;
439 
440  // We display the last 3 years
441  $yearofbegindate = date('Y', dol_time_plus_duree(time(), -3, "y"));
442 
443  // breakdown by quarter
444  $sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as Mnttot";
445  $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd";
446  $sql .= " , ".MAIN_DB_PREFIX."paiement as p,".MAIN_DB_PREFIX."paiement_facture as pf";
447  $sql .= " WHERE f.entity IN (".getEntity('invoice').")";
448  $sql .= " AND f.rowid = fd.fk_facture";
449  $sql .= " AND pf.fk_facture = f.rowid";
450  $sql .= " AND pf.fk_paiement = p.rowid";
451  $sql .= " AND fd.product_type = ".((int) $product_type);
452  $sql .= " AND p.datep >= '".$db->idate(dol_get_first_day($yearofbegindate), 1)."'";
453  $sql .= " GROUP BY annee, mois ";
454  $sql .= " ORDER BY annee, mois ";
455 
456  $result = $db->query($sql);
457  if ($result) {
458  $tmpyear = 0;
459  $trim1 = 0;
460  $trim2 = 0;
461  $trim3 = 0;
462  $trim4 = 0;
463  $lgn = 0;
464  $num = $db->num_rows($result);
465 
466  if ($num > 0) {
467  print '<div class="div-table-responsive-no-min">';
468  print '<table class="noborder" width="75%">';
469 
470  if ($product_type == 0) {
471  print '<tr class="liste_titre"><td class=left>'.$langs->trans("ProductSellByQuarterHT").'</td>';
472  } else {
473  print '<tr class="liste_titre"><td class=left>'.$langs->trans("ServiceSellByQuarterHT").'</td>';
474  }
475  print '<td class=right>'.$langs->trans("Quarter1").'</td>';
476  print '<td class=right>'.$langs->trans("Quarter2").'</td>';
477  print '<td class=right>'.$langs->trans("Quarter3").'</td>';
478  print '<td class=right>'.$langs->trans("Quarter4").'</td>';
479  print '<td class=right>'.$langs->trans("Total").'</td>';
480  print '</tr>';
481  }
482  $i = 0;
483 
484  while ($i < $num) {
485  $objp = $db->fetch_object($result);
486  if ($tmpyear != $objp->annee) {
487  if ($trim1 + $trim2 + $trim3 + $trim4 > 0) {
488  print '<tr class="oddeven"><td class=left>'.$tmpyear.'</td>';
489  print '<td class="nowrap right">'.price($trim1).'</td>';
490  print '<td class="nowrap right">'.price($trim2).'</td>';
491  print '<td class="nowrap right">'.price($trim3).'</td>';
492  print '<td class="nowrap right">'.price($trim4).'</td>';
493  print '<td class="nowrap right">'.price($trim1 + $trim2 + $trim3 + $trim4).'</td>';
494  print '</tr>';
495  $lgn++;
496  }
497  // We go to the following year
498  $tmpyear = $objp->annee;
499  $trim1 = 0;
500  $trim2 = 0;
501  $trim3 = 0;
502  $trim4 = 0;
503  }
504 
505  if ($objp->mois == "01" || $objp->mois == "02" || $objp->mois == "03") {
506  $trim1 += $objp->Mnttot;
507  }
508 
509  if ($objp->mois == "04" || $objp->mois == "05" || $objp->mois == "06") {
510  $trim2 += $objp->Mnttot;
511  }
512 
513  if ($objp->mois == "07" || $objp->mois == "08" || $objp->mois == "09") {
514  $trim3 += $objp->Mnttot;
515  }
516 
517  if ($objp->mois == "10" || $objp->mois == "11" || $objp->mois == "12") {
518  $trim4 += $objp->Mnttot;
519  }
520 
521  $i++;
522  }
523  if ($trim1 + $trim2 + $trim3 + $trim4 > 0) {
524  print '<tr class="oddeven"><td class=left>'.$tmpyear.'</td>';
525  print '<td class="nowrap right">'.price($trim1).'</td>';
526  print '<td class="nowrap right">'.price($trim2).'</td>';
527  print '<td class="nowrap right">'.price($trim3).'</td>';
528  print '<td class="nowrap right">'.price($trim4).'</td>';
529  print '<td class="nowrap right">'.price($trim1 + $trim2 + $trim3 + $trim4).'</td>';
530  print '</tr>';
531  }
532  if ($num > 0) {
533  print '</table></div>';
534  }
535  }
536 }
dol_escape_htmltag
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
Definition: functions.lib.php:1468
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
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
DolGraph
Class to build graphs.
Definition: dolgraph.class.php:40
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
llxFooter
llxFooter()
Footer empty.
Definition: index.php:71
PriceParser
Class to parse product price expressions.
Definition: price_parser.class.php:33
dol_get_first_day
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:551
llxHeader
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
Definition: index.php:63
dol_time_plus_duree
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition: date.lib.php:121
Product
Class to manage products or services.
Definition: product.class.php:46
activitytrim
activitytrim($product_type)
Print html activity for product type.
Definition: index.php:436
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