34require
'../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/dashboard.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/product/dynamic_price/class/price_parser.class.php';
48$type =
GETPOST(
"type",
'intcomma');
49if ($type ==
'' && !$user->hasRight(
'produit',
'lire') && $user->hasRight(
'service',
'lire')) {
52if ($type ==
'' && !$user->hasRight(
'service',
'lire') && $user->hasRight(
'produit',
'lire')) {
57$langs->loadLangs(array(
'products',
'stocks'));
60$hookmanager->initHooks(array(
'productindex'));
63$product_static =
new Product($db);
68} elseif ($type ==
'1') {
71 $result =
restrictedArea($user,
'produit|service|expedition|reception');
78include DOL_DOCUMENT_ROOT.
'/core/actions_addbox.inc.php';
90$transAreaType = $langs->trans(
"ProductsAndServicesArea");
94 $transAreaType = $langs->trans(
"ProductsAndServicesArea");
95 $helpurl =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
98 $transAreaType = $langs->trans(
"ProductsArea");
99 $helpurl =
'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
102 $transAreaType = $langs->trans(
"ServicesArea");
103 $helpurl =
'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
106llxHeader(
"", $langs->trans(
"ProductsAndServices"), $helpurl,
'', 0, 0,
'',
'',
'',
'mod-product page-index');
108print
load_fiche_titre($transAreaType, $resultboxes[
'selectboxlist'],
'product');
112 $listofsearchfields = array();
115 if ((
isModEnabled(
"product") ||
isModEnabled(
"service")) && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
116 $listofsearchfields[
'search_product'] = array(
'text' =>
'ProductOrService');
119 if (count($listofsearchfields)) {
120 print
'<form method="post" action="'.DOL_URL_ROOT.
'/core/search.php">';
121 print
'<input type="hidden" name="token" value="'.newToken().
'">';
122 print
'<div class="div-table-responsive-no-min">';
123 print
'<table class="noborder nohover centpercent">';
125 foreach ($listofsearchfields as $key => $value) {
127 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Search").
'</td></tr>';
129 print
'<tr class="oddeven">';
130 print
'<td class="nowrap"><label for="'.$key.
'">'.$langs->trans($value[
"text"]).
'</label></td>';
131 print
'<td><input type="text" class="flat inputsearch" name="'.$key.
'" id="'.$key.
'" size="18"></td>';
133 print
'<td rowspan="'.count($listofsearchfields).
'"><input type="submit" value="'.$langs->trans(
"Search").
'" class="button"></td>';
149if ((
isModEnabled(
"product") ||
isModEnabled(
"service")) && ($user->hasRight(
"produit",
"lire") || $user->hasRight(
"service",
"lire"))) {
151 $prodser[0][0] = $prodser[0][1] = $prodser[0][2] = $prodser[0][3] = 0;
152 $prodser[0][
'sell'] = 0;
153 $prodser[0][
'buy'] = 0;
154 $prodser[0][
'none'] = 0;
155 $prodser[1][0] = $prodser[1][1] = $prodser[1][2] = $prodser[1][3] = 0;
156 $prodser[1][
'sell'] = 0;
157 $prodser[1][
'buy'] = 0;
158 $prodser[1][
'none'] = 0;
160 $sql =
"SELECT COUNT(p.rowid) as total, p.fk_product_type, p.tosell, p.tobuy";
161 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product as p";
162 $sql .=
' WHERE p.entity IN ('.getEntity($product_static->element, 1).
')';
164 $parameters = array();
165 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $product_static);
166 $sql .= $hookmanager->resPrint;
167 $sql .=
" GROUP BY p.fk_product_type, p.tosell, p.tobuy";
168 $result = $db->query($sql);
169 while ($objp = $db->fetch_object($result)) {
171 if (!$objp->tosell && !$objp->tobuy) {
174 if ($objp->tosell && !$objp->tobuy) {
177 if (!$objp->tosell && $objp->tobuy) {
180 $prodser[$objp->fk_product_type][$status] = $objp->total;
182 $prodser[$objp->fk_product_type][
'sell'] += $objp->total;
185 $prodser[$objp->fk_product_type][
'buy'] += $objp->total;
187 if (!$objp->tosell && !$objp->tobuy) {
188 $prodser[$objp->fk_product_type][
'none'] += $objp->total;
194 $series[] = array(
'label' => $langs->transnoentitiesnoconv(
"ProductsOnSale"),
'nb' => round($prodser[0][
'sell']));
195 $series[] = array(
'label' => $langs->transnoentitiesnoconv(
"ProductsOnPurchase"),
'nb' => round($prodser[0][
'buy']));
196 $series[] = array(
'label' => $langs->transnoentitiesnoconv(
"ProductsNotOnSell"),
'nb' => round($prodser[0][
'none']));
199 $series[] = array(
'label' => $langs->transnoentitiesnoconv(
"ServicesOnSale"),
'nb' => round($prodser[1][
'sell']));
200 $series[] = array(
'label' => $langs->transnoentitiesnoconv(
"ServicesOnPurchase"),
'nb' => round($prodser[1][
'buy']));
201 $series[] = array(
'label' => $langs->transnoentitiesnoconv(
"ServicesNotOnSell"),
'nb' => round($prodser[1][
'none']));
203 $graph .=
getStatusPieChart($langs->trans(
"Statistics").
' - '.$langs->trans(
"ProductStatus"), $series, array(
'showpercent' => 0,
'total' =>
false));
208 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
210 $graphcat .=
'<div class="div-table-responsive-no-min">';
211 $graphcat .=
'<table class="noborder centpercent">';
212 $graphcat .=
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"Categories").
'</th></tr>';
213 $graphcat .=
'<tr><td class="center" colspan="2">';
214 $sql =
"SELECT c.label, count(*) as nb";
215 $sql .=
" FROM ".MAIN_DB_PREFIX.
"categorie_product as cs";
216 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"categorie as c ON cs.fk_categorie = c.rowid";
217 $sql .=
" WHERE c.type = 0";
218 $sql .=
" AND c.entity IN (".getEntity(
'category').
")";
219 $sql .=
" GROUP BY c.label";
220 $sql .=
" ORDER BY nb desc";
222 $result = $db->query($sql);
224 $num = $db->num_rows($result);
226 if (!empty(
$conf->use_javascript_ajax)) {
227 $dataseries = array();
232 $obj = $db->fetch_object($result);
234 $dataseries[] = array($obj->label, round($obj->nb));
242 $dataseries[] = array($langs->transnoentitiesnoconv(
"Other"), round($rest));
244 include_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
246 $dolgraph->SetData($dataseries);
247 $dolgraph->setShowLegend(2);
248 $dolgraph->setShowPercent(1);
249 $dolgraph->SetType(array(
'pie'));
250 $dolgraph->setHeight(
'200');
251 $dolgraph->draw(
'idstatscategproduct');
252 $graphcat .= $dolgraph->show($total ? 0 : 1);
255 $obj = $db->fetch_object($result);
257 $graphcat .=
'<tr><td>'.$obj->label.
'</td><td>'.$obj->nb.
'</td></tr>';
263 $graphcat .=
'</td></tr>';
264 $graphcat .=
'<tr class="liste_total"><td>'.$langs->trans(
"Total").
'</td><td class="right">';
266 $graphcat .=
'</td></tr>';
267 $graphcat .=
'</table>';
268 $graphcat .=
'</div>';
277if ((
isModEnabled(
"product") ||
isModEnabled(
"service")) && ($user->hasRight(
"produit",
"lire") || $user->hasRight(
"service",
"lire"))) {
278 $sql =
"SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.tobatch, p.fk_price_expression,";
279 $sql .=
" p.entity,";
280 $sql .=
" GREATEST(p.tms, pef.tms) as datem";
281 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product as p";
282 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product_extrafields as pef ON pef.fk_object=p.rowid";
283 $sql .=
" WHERE p.entity IN (".getEntity($product_static->element, 1).
")";
287 if (!$user->hasRight(
"produit",
"lire")) {
290 if (!$user->hasRight(
"service",
"lire")) {
295 $parameters = array();
296 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $product_static);
297 $sql .= $hookmanager->resPrint;
298 $sql .= $db->order(
"datem",
"DESC");
299 $sql .= $db->plimit($max, 0);
302 $result = $db->query($sql);
304 $num = $db->num_rows($result);
309 $transRecordedType = $langs->trans(
"LastModifiedProductsAndServices", $max);
311 $transRecordedType = $langs->trans(
"LastRecordedProducts", $max);
314 $transRecordedType = $langs->trans(
"LastRecordedServices", $max);
317 $lastmodified .=
'<div class="div-table-responsive-no-min">';
318 $lastmodified .=
'<table class="noborder centpercent">';
325 $lastmodified .=
'<tr class="liste_titre"><th colspan="'.$colnb.
'">';
326 $lastmodified .= $transRecordedType;
327 $lastmodified .=
'<a href="'.DOL_URL_ROOT.
'/product/list.php?sortfield=p.tms&sortorder=DESC" title="'.$langs->trans(
"FullList").
'">';
328 $lastmodified .=
'<span class="badge marginleftonlyshort">...</span>';
329 $lastmodified .=
'</a>';
338 $lastmodified .=
'</th>';
339 $lastmodified .=
'<th>';
340 $lastmodified .=
'</th>';
341 $lastmodified .=
'<th>';
342 $lastmodified .=
'</th>';
343 $lastmodified .=
'<th>';
344 $lastmodified .=
'</th>';
345 $lastmodified .=
'</tr>';
348 $objp = $db->fetch_object($result);
350 $product_static->id = $objp->rowid;
351 $product_static->ref = $objp->ref;
352 $product_static->label = $objp->label;
353 $product_static->type = $objp->fk_product_type;
354 $product_static->entity = $objp->entity;
355 $product_static->status = $objp->tosell;
356 $product_static->status_buy = $objp->tobuy;
357 $product_static->status_batch = $objp->tobatch;
359 $usercancreadprice =
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') ? $user->hasRight(
'product',
'product_advance',
'read_prices') : $user->hasRight(
'product',
'read');
360 if ($product_static->isService()) {
361 $usercancreadprice =
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') ? $user->hasRight(
'service',
'service_advance',
'read_prices') : $user->hasRight(
'service',
'read');
366 $sql =
"SELECT label";
367 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product_lang";
368 $sql .=
" WHERE fk_product = ".((int) $objp->rowid);
369 $sql .=
" AND lang = '".$db->escape($langs->getDefaultLang()).
"'";
371 $resultd = $db->query($sql);
373 $objtp = $db->fetch_object($resultd);
374 if ($objtp && $objtp->label !=
'') {
375 $objp->label = $objtp->label;
381 $lastmodified .=
'<tr class="oddeven">';
382 $lastmodified .=
'<td class="nowraponall tdoverflowmax100">';
383 $lastmodified .= $product_static->getNomUrl(1);
384 $lastmodified .=
"</td>\n";
385 $lastmodified .=
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objp->label).
'">'.
dol_escape_htmltag($objp->label).
'</td>';
386 $lastmodified .=
'<td title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($db->jdate($objp->datem),
'dayhour',
'tzuserrel')).
'">';
387 $lastmodified .=
dol_print_date($db->jdate($objp->datem),
'day',
'tzuserrel');
388 $lastmodified .=
"</td>";
391 if (
isModEnabled(
'dynamicprices') && !empty($objp->fk_price_expression)) {
393 $product->fetch($objp->rowid);
395 require_once DOL_DOCUMENT_ROOT.
'/product/dynamic_price/class/price_parser.class.php';
397 $price_result = $priceparser->parseProduct($product);
398 if ($price_result >= 0) {
399 $objp->price = $price_result;
402 $lastmodified .=
'<td class="nowraponall amount right">';
403 if ($usercancreadprice) {
404 if (isset($objp->price_base_type) && $objp->price_base_type ==
'TTC') {
405 $lastmodified .=
price($objp->price_ttc).
' '.$langs->trans(
"TTC");
407 $lastmodified .=
price($objp->price).
' '.$langs->trans(
"HT");
410 $lastmodified .=
'</td>';
412 $lastmodified .=
'<td class="right nowrap width25"><span class="statusrefsell">';
413 $lastmodified .= $product_static->LibStatut($objp->tosell, 3, 0);
414 $lastmodified .=
"</span></td>";
415 $lastmodified .=
'<td class="right nowrap width25"><span class="statusrefbuy">';
416 $lastmodified .= $product_static->LibStatut($objp->tobuy, 3, 1);
417 $lastmodified .=
"</span></td>";
418 $lastmodified .=
"</tr>\n";
424 $lastmodified .=
"</table>";
425 $lastmodified .=
'</div>';
426 $lastmodified .=
'<br>';
429 dol_print_error($db);
434$latestwarehouse =
'';
435if (
isModEnabled(
'stock') && $user->hasRight(
'stock',
'read')) {
436 $sql =
"SELECT e.rowid, e.ref as label, e.lieu, e.statut as status";
437 $sql .=
" FROM ".MAIN_DB_PREFIX.
"entrepot as e";
439 $sql .=
" AND e.entity IN (".getEntity(
'stock').
")";
440 $sql .= $db->order(
'e.tms',
'DESC');
441 $sql .= $db->plimit($max + 1, 0);
443 $result = $db->query($sql);
446 $num = $db->num_rows($result);
448 $latestwarehouse .=
'<div class="div-table-responsive-no-min">';
449 $latestwarehouse .=
'<table class="noborder centpercent">';
450 $latestwarehouse .=
'<tr class="liste_titre">';
451 $latestwarehouse .=
'<th>';
452 $latestwarehouse .= $langs->trans(
"LatestModifiedWarehouses", $max);
457 $latestwarehouse .=
'<a href="'.DOL_URL_ROOT.
'/product/stock/list.php?sortfield=p.tms&sortorder=DESC" title="'.$langs->trans(
"FullList").
'">';
458 $latestwarehouse .=
'<span class="badge marginleftonlyshort">...</span>';
459 $latestwarehouse .=
'</a>';
460 $latestwarehouse .=
'</th><th class="right">';
461 $latestwarehouse .=
'</th>';
462 $latestwarehouse .=
'</tr>';
466 while ($i < min($max, $num)) {
467 $objp = $db->fetch_object($result);
469 $warehouse->id = $objp->rowid;
470 $warehouse->statut = $objp->status;
471 $warehouse->label = $objp->label;
472 $warehouse->lieu = $objp->lieu;
474 $latestwarehouse .=
'<tr class="oddeven">';
475 $latestwarehouse .=
'<td>';
476 $latestwarehouse .= $warehouse->getNomUrl(1);
477 $latestwarehouse .=
'</td>'.
"\n";
478 $latestwarehouse .=
'<td class="right">';
479 $latestwarehouse .= $warehouse->getLibStatut(5);
480 $latestwarehouse .=
'</td>';
481 $latestwarehouse .=
"</tr>\n";
486 $latestwarehouse .=
'<tr><td>'.$langs->trans(
"None").
'</td><td></td></tr>';
492 $latestwarehouse .=
"</table>";
493 $latestwarehouse .=
'</div>';
494 $latestwarehouse .=
'<br>';
496 dol_print_error($db);
502if (
isModEnabled(
'stock') && $user->hasRight(
'stock',
'mouvement',
'read')) {
503 include_once DOL_DOCUMENT_ROOT.
'/product/stock/class/mouvementstock.class.php';
505 $sql =
"SELECT p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.tobatch, p.tosell, p.tobuy,";
506 $sql .=
" e.ref as warehouse_ref, e.rowid as warehouse_id, e.ref as warehouse_label, e.lieu, e.statut as warehouse_status,";
507 $sql .=
" m.rowid as mid, m.label as mlabel, m.inventorycode as mcode, m.value as qty, m.datem, m.batch, m.eatby, m.sellby";
508 $sql .=
" FROM ".MAIN_DB_PREFIX.
"entrepot as e";
509 $sql .=
", ".MAIN_DB_PREFIX.
"stock_mouvement as m";
510 $sql .=
", ".MAIN_DB_PREFIX.
"product as p";
511 $sql .=
" WHERE m.fk_product = p.rowid";
512 $sql .=
" AND m.fk_entrepot = e.rowid";
513 $sql .=
" AND e.entity IN (".getEntity(
'stock').
")";
515 $sql .=
" AND p.fk_product_type = ".Product::TYPE_PRODUCT;
517 $sql .= $db->order(
"datem",
"DESC");
518 $sql .= $db->plimit($max, 0);
520 dol_syslog(
"Index:list stock movements", LOG_DEBUG);
522 $resql = $db->query($sql);
524 $num = $db->num_rows($resql);
526 $latestmovement .=
'<div class="div-table-responsive-no-min">';
527 $latestmovement .=
'<table class="noborder centpercent">';
528 $latestmovement .=
'<tr class="liste_titre">';
529 $latestmovement .=
'<th colspan="3">'.$langs->trans(
"LatestStockMovements", min($num, $max));
530 $latestmovement .=
'<a class="notasortlink" href="'.DOL_URL_ROOT.
'/product/stock/movement_list.php">';
531 $latestmovement .=
'<span class="badge marginleftonlyshort">...</span>';
533 $latestmovement .=
'</a>';
534 $latestmovement .=
'</th>';
536 $latestmovement .=
'<th></th>';
538 $latestmovement .=
'<th></th>';
539 $latestmovement .=
'<th class="right">';
540 $latestmovement .=
'</th>';
541 $latestmovement .=
"</tr>\n";
547 while ($i < min($num, $max)) {
548 $objp = $db->fetch_object($resql);
550 $tmpstockmovement->id = $objp->mid;
551 $tmpstockmovement->date = $db->jdate($objp->datem);
552 $tmpstockmovement->label = $objp->mlabel;
553 $tmpstockmovement->inventorycode = $objp->mcode;
554 $tmpstockmovement->qty = $objp->qty;
556 $producttmp->id = $objp->product_id;
557 $producttmp->ref = $objp->product_ref;
558 $producttmp->label = $objp->product_label;
559 $producttmp->status_batch = $objp->tobatch;
560 $producttmp->status_sell = $objp->tosell;
561 $producttmp->status_buy = $objp->tobuy;
563 $warehouse->id = $objp->warehouse_id;
564 $warehouse->ref = $objp->warehouse_ref;
565 $warehouse->statut = $objp->warehouse_status;
566 $warehouse->label = $objp->warehouse_label;
567 $warehouse->lieu = $objp->lieu;
569 $tmplotstatic->batch = $objp->batch;
570 $tmplotstatic->sellby = $objp->sellby;
571 $tmplotstatic->eatby = $objp->eatby;
573 $latestmovement .=
'<tr class="oddeven">';
574 $latestmovement .=
'<td class="nowraponall">';
575 $latestmovement .= $tmpstockmovement->getNomUrl(1);
577 $latestmovement .=
'</td>';
578 $latestmovement .=
'<td class="nowraponall">';
579 $latestmovement .=
dol_print_date($tmpstockmovement->date,
'dayhour',
'tzuserrel');
580 $latestmovement .=
"</td>\n";
581 $latestmovement .=
'<td class="tdoverflowmax150">';
582 $latestmovement .= $producttmp->getNomUrl(1);
583 $latestmovement .=
"</td>\n";
585 $latestmovement .=
'<td>';
586 $latestmovement .= $tmplotstatic->getNomUrl(0,
'nolink');
587 $latestmovement .=
'</td>';
595 $latestmovement .=
'<td class="tdoverflowmax150">';
596 $latestmovement .= $warehouse->getNomUrl(1);
597 $latestmovement .=
"</td>\n";
598 $latestmovement .=
'<td class="right">';
599 if ($objp->qty < 0) {
600 $latestmovement .=
'<span class="stockmovementexit">';
602 if ($objp->qty > 0) {
603 $latestmovement .=
'<span class="stockmovemententry">';
604 $latestmovement .=
'+';
606 $latestmovement .= $objp->qty;
607 $latestmovement .=
'</span>';
608 $latestmovement .=
'</td>';
609 $latestmovement .=
"</tr>\n";
619 $latestmovement .=
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
622 $latestmovement .=
"</table>";
623 $latestmovement .=
'</div>';
624 $latestmovement .=
'<br>';
626 dol_print_error($db);
647print
'<div class="clearboth"></div>';
648print
'<div class="fichecenter fichecenterbis">';
650$boxlist =
'<div class="twocolumns">';
652$boxlist .=
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
654$boxlist .= $graphcat;
655$boxlist .= $activity;
657$boxlist .= $resultboxes[
'boxlista'];
658$boxlist .=
"</div>\n";
660$boxlist .=
'<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
661$boxlist .= $lastmodified;
662$boxlist .= $latestwarehouse;
663$boxlist .= $latestmovement;
664$boxlist .= $resultboxes[
'boxlistb'];
665$boxlist .=
'</div>'.
"\n";
667$boxlist .=
"</div>\n";
673$parameters = array(
'type' => $type,
'user' => $user);
674$reshook = $hookmanager->executeHooks(
'dashboardProductsServices', $parameters, $product_static);
689 global
$conf, $langs, $db;
695 $sql =
"SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as mnttot";
696 $sql .=
" FROM ".MAIN_DB_PREFIX.
"facture as f, ".MAIN_DB_PREFIX.
"facturedet as fd";
697 $sql .=
" , ".MAIN_DB_PREFIX.
"paiement as p,".MAIN_DB_PREFIX.
"paiement_facture as pf";
698 $sql .=
" WHERE f.entity IN (".getEntity(
'invoice').
")";
699 $sql .=
" AND f.rowid = fd.fk_facture";
700 $sql .=
" AND pf.fk_facture = f.rowid";
701 $sql .=
" AND pf.fk_paiement = p.rowid";
702 $sql .=
" AND fd.product_type = ".((int) $product_type);
703 $sql .=
" AND p.datep >= '".$db->idate(
dol_get_first_day($yearofbegindate, 1)).
"'";
704 $sql .=
" GROUP BY annee, mois ";
705 $sql .=
" ORDER BY annee, mois ";
707 $result = $db->query($sql);
715 $num = $db->num_rows($result);
718 $out .=
'<div class="div-table-responsive-no-min">';
719 $out .=
'<table class="noborder" width="75%">';
721 if ($product_type == 0) {
722 $out .=
'<tr class="liste_titre"><td class=left>'.$langs->trans(
"ProductSellByQuarterHT").
'</td>';
724 $out .=
'<tr class="liste_titre"><td class=left>'.$langs->trans(
"ServiceSellByQuarterHT").
'</td>';
726 $out .=
'<td class=right>'.$langs->trans(
"Quarter1").
'</td>';
727 $out .=
'<td class=right>'.$langs->trans(
"Quarter2").
'</td>';
728 $out .=
'<td class=right>'.$langs->trans(
"Quarter3").
'</td>';
729 $out .=
'<td class=right>'.$langs->trans(
"Quarter4").
'</td>';
730 $out .=
'<td class=right>'.$langs->trans(
"Total").
'</td>';
736 $objp = $db->fetch_object($result);
737 if ($tmpyear != $objp->annee) {
738 if ($trim1 + $trim2 + $trim3 + $trim4 > 0) {
739 $out .=
'<tr class="oddeven"><td class=left>'.$tmpyear.
'</td>';
740 $out .=
'<td class="nowrap right">'.price($trim1).
'</td>';
741 $out .=
'<td class="nowrap right">'.price($trim2).
'</td>';
742 $out .=
'<td class="nowrap right">'.price($trim3).
'</td>';
743 $out .=
'<td class="nowrap right">'.price($trim4).
'</td>';
744 $out .=
'<td class="nowrap right">'.price($trim1 + $trim2 + $trim3 + $trim4).
'</td>';
749 $tmpyear = $objp->annee;
756 if ($objp->mois ==
"01" || $objp->mois ==
"02" || $objp->mois ==
"03") {
757 $trim1 += $objp->mnttot;
760 if ($objp->mois ==
"04" || $objp->mois ==
"05" || $objp->mois ==
"06") {
761 $trim2 += $objp->mnttot;
764 if ($objp->mois ==
"07" || $objp->mois ==
"08" || $objp->mois ==
"09") {
765 $trim3 += $objp->mnttot;
768 if ($objp->mois ==
"10" || $objp->mois ==
"11" || $objp->mois ==
"12") {
769 $trim4 += $objp->mnttot;
774 if ($trim1 + $trim2 + $trim3 + $trim4 > 0) {
775 $out .=
'<tr class="oddeven"><td class=left>'.$tmpyear.
'</td>';
776 $out .=
'<td class="nowrap right">'.price($trim1).
'</td>';
777 $out .=
'<td class="nowrap right">'.price($trim2).
'</td>';
778 $out .=
'<td class="nowrap right">'.price($trim3).
'</td>';
779 $out .=
'<td class="nowrap right">'.price($trim4).
'</td>';
780 $out .=
'<td class="nowrap right">'.price($trim1 + $trim2 + $trim3 + $trim4).
'</td>';
784 $out .=
'</table></div>';
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.
const STATUS_OPEN_ALL
Warehouse open and any operations are allowed (customer shipping, supplier dispatch,...
Class to manage stock movements.
Class to parse product price expressions.
Class to manage products or services.
const TYPE_PRODUCT
Regular product.
const TYPE_SERVICE
Service.
Class with list of lots and properties.
getStatusPieChart($title, $series, $options=array())
Return the HTML table with a pie chart of values by status, as shown on the home page of a module.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
dol_now($mode='gmt')
Return date for now.
getDolUserInt($key, $default=0, $tmpuser=null)
Return Dolibarr user constant int value.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
activitytrim($product_type)
Print html activity for product type.
print $langs trans('Date')." left Ref Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right Paid right PaymentTypeShortLIQ right SELECT p pos_change as p datep as date
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.