dolibarr  20.0.0-beta
supplier_turnover_by_prodserv.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2020 Maxime Kohlhaas <maxime@atm-consulting.fr>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
23 // Load Dolibarr environment
24 require '../../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
30 
31 // Load translation files required by the page
32 $langs->loadLangs(array("products", "categories", "errors", 'accountancy'));
33 
34 // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
35 $modecompta = getDolGlobalString('ACCOUNTING_MODE');
36 if (GETPOST("modecompta")) {
37  $modecompta = GETPOST("modecompta");
38 }
39 
40 $sortorder = GETPOST("sortorder", 'aZ09comma');
41 $sortfield = GETPOST("sortfield", 'aZ09comma');
42 if (!$sortorder) {
43  $sortorder = "asc";
44 }
45 if (!$sortfield) {
46  $sortfield = "ref";
47 }
48 
49 // Category
50 $selected_cat = GETPOSTINT('search_categ');
51 $selected_soc = GETPOSTINT('search_soc');
52 $subcat = false;
53 if (GETPOST('subcat', 'alpha') === 'yes') {
54  $subcat = true;
55 }
56 // product/service
57 $selected_type = GETPOST('search_type', "intcomma");
58 if ($selected_type == '') {
59  $selected_type = -1;
60 }
61 
62 // Hook
63 $hookmanager->initHooks(array('supplierturnoverbyprodservlist'));
64 
65 // Date range
66 $year = GETPOST("year");
67 $month = GETPOST("month");
68 $date_startyear = GETPOST("date_startyear");
69 $date_startmonth = GETPOST("date_startmonth");
70 $date_startday = GETPOST("date_startday");
71 $date_endyear = GETPOST("date_endyear");
72 $date_endmonth = GETPOST("date_endmonth");
73 $date_endday = GETPOST("date_endday");
74 if (empty($year)) {
75  $year_current = dol_print_date(dol_now(), '%Y');
76  $month_current = dol_print_date(dol_now(), '%m');
77  $year_start = $year_current;
78 } else {
79  $year_current = $year;
80  $month_current = dol_print_date(dol_now(), '%m');
81  $year_start = $year;
82 }
83 $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
84 $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
85 // Quarter
86 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
87  $q = GETPOSTINT("q");
88  if (empty($q)) {
89  // We define date_start and date_end
90  $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
91  $year_end = $year_start;
92  $month_end = $month_start;
93  if (!GETPOST("month")) { // If month not forced
94  if (!GETPOST('year') && $month_start > $month_current) {
95  $year_start--;
96  $year_end--;
97  }
98  $month_end = $month_start - 1;
99  if ($month_end < 1) {
100  $month_end = 12;
101  } else {
102  $year_end++;
103  }
104  }
105  $date_start = dol_get_first_day($year_start, $month_start, false);
106  $date_end = dol_get_last_day($year_end, $month_end, false);
107  } else {
108  if ($q == 1) {
109  $date_start = dol_get_first_day($year_start, 1, false);
110  $date_end = dol_get_last_day($year_start, 3, false);
111  }
112  if ($q == 2) {
113  $date_start = dol_get_first_day($year_start, 4, false);
114  $date_end = dol_get_last_day($year_start, 6, false);
115  }
116  if ($q == 3) {
117  $date_start = dol_get_first_day($year_start, 7, false);
118  $date_end = dol_get_last_day($year_start, 9, false);
119  }
120  if ($q == 4) {
121  $date_start = dol_get_first_day($year_start, 10, false);
122  $date_end = dol_get_last_day($year_start, 12, false);
123  }
124  }
125 } else {
126  // TODO We define q
127 }
128 
129 // $date_start and $date_end are defined. We force $year_start and $nbofyear
130 $tmps = dol_getdate($date_start);
131 $year_start = $tmps['year'];
132 $tmpe = dol_getdate($date_end);
133 $year_end = $tmpe['year'];
134 $nbofyear = ($year_end - $year_start) + 1;
135 
136 $commonparams = array();
137 if (!empty($modecompta)) {
138  $commonparams['modecompta'] = $modecompta;
139 }
140 if (!empty($sortorder)) {
141  $commonparams['sortorder'] = $sortorder;
142 }
143 if (!empty($sortfield)) {
144  $commonparams['sortfield'] = $sortfield;
145 }
146 
147 $headerparams = array();
148 if (!empty($date_startyear)) {
149  $headerparams['date_startyear'] = $date_startyear;
150 }
151 if (!empty($date_startmonth)) {
152  $headerparams['date_startmonth'] = $date_startmonth;
153 }
154 if (!empty($date_startday)) {
155  $headerparams['date_startday'] = $date_startday;
156 }
157 if (!empty($date_endyear)) {
158  $headerparams['date_endyear'] = $date_endyear;
159 }
160 if (!empty($date_endmonth)) {
161  $headerparams['date_endmonth'] = $date_endmonth;
162 }
163 if (!empty($date_endday)) {
164  $headerparams['date_endday'] = $date_endday;
165 }
166 if (!empty($year)) {
167  $headerparams['year'] = $year;
168 }
169 if (!empty($month)) {
170  $headerparams['month'] = $month;
171 }
172 $headerparams['q'] = $q;
173 
174 $tableparams = array();
175 if (!empty($selected_cat)) {
176  $tableparams['search_categ'] = $selected_cat;
177 }
178 if (!empty($selected_soc)) {
179  $tableparams['search_soc'] = $selected_soc;
180 }
181 if (!empty($selected_type)) {
182  $tableparams['search_type'] = $selected_type;
183 }
184 $tableparams['subcat'] = ($subcat === true) ? 'yes' : '';
185 
186 // Adding common parameters
187 $allparams = array_merge($commonparams, $headerparams, $tableparams);
188 $headerparams = array_merge($commonparams, $headerparams);
189 $tableparams = array_merge($commonparams, $tableparams);
190 
191 $paramslink = '';
192 foreach ($allparams as $key => $value) {
193  $paramslink .= '&'.$key.'='.$value;
194 }
195 
196 // Security pack (data & check)
197 $socid = GETPOSTINT('socid');
198 
199 if ($user->socid > 0) {
200  $socid = $user->socid;
201 }
202 if (isModEnabled('comptabilite')) {
203  $result = restrictedArea($user, 'compta', '', '', 'resultat');
204 }
205 if (isModEnabled('accounting')) {
206  $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
207 }
208 
209 
210 /*
211  * View
212  */
213 
214 llxHeader();
215 
216 $form = new Form($db);
217 $formother = new FormOther($db);
218 
219 // TODO Report from bookkeeping not yet available, so we switch on report on business events
220 if ($modecompta == "BOOKKEEPING") {
221  $modecompta = "CREANCES-DETTES";
222 }
223 if ($modecompta == "BOOKKEEPINGCOLLECTED") {
224  $modecompta = "RECETTES-DEPENSES";
225 }
226 
227 // Show report header
228 if ($modecompta == "CREANCES-DETTES") {
229  $name = $langs->trans("PurchaseTurnover").', '.$langs->trans("ByProductsAndServices");
230  $calcmode = $langs->trans("CalcModeDebt");
231  //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
232 
233  $description = $langs->trans("RulesPurchaseTurnoverDue");
234  $builddate = dol_now();
235 } elseif ($modecompta == "RECETTES-DEPENSES") {
236  $name = $langs->trans("PurchaseTurnoverCollected").', '.$langs->trans("ByProductsAndServices");
237  $calcmode = $langs->trans("CalcModePayment");
238  //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
239  $description = $langs->trans("RulesPurchaseTurnoverIn");
240 
241  $builddate = dol_now();
242 } elseif ($modecompta == "BOOKKEEPING") {
243 } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
244 }
245 
246 $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
247 $period .= ' - ';
248 $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
249 if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
250  $periodlink = '<a href="'.$_SERVER["PHP_SELF"].'?year='.($year_start - 1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year_start + 1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
251 } else {
252  $periodlink = '';
253 }
254 
255 $exportlink = '';
256 
257 report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
258 
259 if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
260  print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
261 }
262 
263 
264 
265 $name = array();
266 $amount = array();
267 $amount_ht = array();
268 $qty = array();
269 
270 // SQL request
271 $catotal = 0;
272 $catotal_ht = 0;
273 $qtytotal = 0;
274 
275 if ($modecompta == 'CREANCES-DETTES') {
276  $sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label, p.fk_product_type as product_type,";
277  $sql .= " SUM(l.total_ht) as amount, SUM(l.total_ttc) as amount_ttc,";
278  $sql .= " SUM(CASE WHEN f.type = 2 THEN -l.qty ELSE l.qty END) as qty";
279  $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
280  if ($selected_soc > 0) {
281  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc ON (soc.rowid = f.fk_soc)";
282  }
283  $sql .= ",".MAIN_DB_PREFIX."facture_fourn_det as l";
284  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid";
285  if ($selected_cat === -2) { // Without any category
286  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
287  } elseif ($selected_cat) { // Into a specific category
288  $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp";
289  }
290  $sql .= " WHERE l.fk_facture_fourn = f.rowid";
291  $sql .= " AND f.fk_statut in (1,2)";
292  $sql .= " AND f.type IN (0,2)";
293 
294  if ($date_start && $date_end) {
295  $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
296  }
297  if ($selected_type >= 0) {
298  $sql .= " AND l.product_type = ".((int) $selected_type);
299  }
300  if ($selected_cat === -2) { // Without any category
301  $sql .= " AND cp.fk_product is null";
302  } elseif ($selected_cat) { // Into a specific category
303  $sql .= " AND (c.rowid = ".((int) $selected_cat);
304  if ($subcat) {
305  $sql .= " OR c.fk_parent = ".((int) $selected_cat);
306  }
307  $sql .= ")";
308  $sql .= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
309  }
310  if ($selected_soc > 0) {
311  $sql .= " AND soc.rowid=".((int) $selected_soc);
312  }
313  $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")";
314  $sql .= " GROUP BY p.rowid, p.ref, p.label, p.fk_product_type";
315  $sql .= $db->order($sortfield, $sortorder);
316 
317  dol_syslog("supplier_turnover_by_prodserv", LOG_DEBUG);
318  $resql = $db->query($sql);
319  if ($resql) {
320  $num = $db->num_rows($resql);
321  $i = 0;
322  while ($i < $num) {
323  $obj = $db->fetch_object($resql);
324 
325  $amount_ht[$obj->rowid] = $obj->amount;
326  $amount[$obj->rowid] = $obj->amount_ttc;
327  $qty[$obj->rowid] = $obj->qty;
328  $name[$obj->rowid] = $obj->ref.'&nbsp;-&nbsp;'.$obj->label;
329  $type[$obj->rowid] = $obj->product_type;
330 
331  $catotal_ht += $obj->amount;
332  $catotal += $obj->amount_ttc;
333  $qtytotal += $obj->qty;
334 
335  $i++;
336  }
337  } else {
338  dol_print_error($db);
339  }
340 
341  // Show Array
342  $i = 0;
343  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
344  print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
345  // Extra parameters management
346  foreach ($headerparams as $key => $value) {
347  print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
348  }
349 
350  $moreforfilter = '';
351 
352  print '<div class="div-table-responsive">';
353  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
354 
355  // Category filter
356  print '<tr class="liste_titre">';
357  print '<td>';
358  print img_picto('', 'category', 'class="paddingrightonly"');
359  print $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', 0, $langs->trans("Category"));
360  print ' ';
361  print $langs->trans("SubCats").'? ';
362  print '<input type="checkbox" name="subcat" value="yes"';
363  if ($subcat) {
364  print ' checked';
365  }
366  print '>';
367  // type filter (produit/service)
368  print ' ';
369  print $langs->trans("Type").': ';
370  $form->select_type_of_lines(isset($selected_type) ? $selected_type : -1, 'search_type', 1, 1, 1);
371 
372  //select thirdparty
373  print '</br>';
374  print img_picto('', 'company', 'class="paddingrightonly"');
375  print $form->select_thirdparty_list($selected_soc, 'search_soc', '', $langs->trans("ThirdParty"));
376  print '</td>';
377 
378  print '<td colspan="5" class="right">';
379  print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
380  print '</td></tr>';
381 
382  // Array header
383  print '<tr class="liste_titre">';
385  $langs->trans("Product"),
386  $_SERVER["PHP_SELF"],
387  "ref",
388  "",
389  $paramslink,
390  "",
391  $sortfield,
392  $sortorder
393  );
395  $langs->trans('Quantity'),
396  $_SERVER["PHP_SELF"],
397  "qty",
398  "",
399  $paramslink,
400  'class="right"',
401  $sortfield,
402  $sortorder
403  );
405  $langs->trans("Percentage"),
406  $_SERVER["PHP_SELF"],
407  "qty",
408  "",
409  $paramslink,
410  'class="right"',
411  $sortfield,
412  $sortorder
413  );
415  $langs->trans('AmountHT'),
416  $_SERVER["PHP_SELF"],
417  "amount",
418  "",
419  $paramslink,
420  'class="right"',
421  $sortfield,
422  $sortorder
423  );
425  $langs->trans("AmountTTC"),
426  $_SERVER["PHP_SELF"],
427  "amount_ttc",
428  "",
429  $paramslink,
430  'class="right"',
431  $sortfield,
432  $sortorder
433  );
435  $langs->trans("Percentage"),
436  $_SERVER["PHP_SELF"],
437  "amount_ttc",
438  "",
439  $paramslink,
440  'class="right"',
441  $sortfield,
442  $sortorder
443  );
444  print "</tr>\n";
445 
446  if (count($name)) {
447  foreach ($name as $key => $value) {
448  print '<tr class="oddeven">';
449 
450  // Product
451  print "<td>";
452  $fullname = $name[$key];
453  if ($key > 0) {
454  $linkname = '<a href="'.DOL_URL_ROOT.'/product/card.php?id='.$key.'">'.img_object($langs->trans("ShowProduct"), $type[$key] == 0 ? 'product' : 'service').' '.$fullname.'</a>';
455  } else {
456  $linkname = $langs->trans("PaymentsNotLinkedToProduct");
457  }
458  print $linkname;
459  print "</td>\n";
460 
461  // Quantity
462  print '<td class="right">';
463  print $qty[$key];
464  print '</td>';
465 
466  // Percent;
467  print '<td class="right">'.($qtytotal > 0 ? round(100 * $qty[$key] / $qtytotal, 2).'%' : '&nbsp;').'</td>';
468 
469  // Amount w/o VAT
470  print '<td class="right">';
471  print price($amount_ht[$key]);
472  //print '</a>';
473  print '</td>';
474 
475  // Amount with VAT
476  print '<td class="right">';
477  print price($amount[$key]);
478  //print '</a>';
479  print '</td>';
480 
481  // Percent;
482  print '<td class="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : '&nbsp;').'</td>';
483 
484  // TODO: statistics?
485 
486  print "</tr>\n";
487  $i++;
488  }
489 
490  // Total
491  print '<tr class="liste_total">';
492  print '<td>'.$langs->trans("Total").'</td>';
493  print '<td class="right">'.$qtytotal.'</td>';
494  print '<td class="right">100%</td>';
495  print '<td class="right">'.price($catotal_ht).'</td>';
496  print '<td class="right">'.price($catotal).'</td>';
497  print '<td class="right">100%</td>';
498  print '</tr>';
499 
500  $db->free($result);
501  }
502  print "</table>";
503  print '</div>';
504 
505  print '</form>';
506 } else {
507  // $modecompta != 'CREANCES-DETTES'
508  // "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an
509  // invoice with 2 product (product A for 10 euros and product B for 20 euros), what is part of paiment for product A and part of paiment for product B ?
510  // Because there is no way to know this, this report is not relevant.
511  print '<br>'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant").'<br>';
512 }
513 
514 // End of page
515 llxFooter();
516 $db->close();
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:55
llxFooter()
Empty footer.
Definition: wrapper.php:69
Class to manage generation of HTML components Only common components must be here.
Class permettant la generation de composants html autre Only common components are here.
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
Definition: index.php:745
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:595
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition: date.lib.php:124
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:614
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
img_previous($titlealt='default', $moreatt='')
Show previous logo.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information in HTML for admin users or standard users.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_next($titlealt='default', $moreatt='')
Show next logo.
getDolGlobalString($key, $default='')
Return 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.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
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...
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
Definition: report.lib.php:41
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.