dolibarr 24.0.0-beta
annuel.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2013-2023 Charlene BENKE <charlene@patas-monkey.com>
6 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
7 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
29// Load Dolibarr environment
30require '../../main.inc.php';
38require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
39require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
40require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
41
42// Load translation files required by the page
43$langs->loadLangs(array('banks', 'categories'));
44
45$WIDTH = DolGraph::getDefaultGraphSizeForStats('width', '380'); // Large for one graph in a smarpthone.
46$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', '160');
47
48$id = GETPOST('account') ? GETPOST('account', 'alpha') : GETPOST('id');
49$ref = GETPOST('ref');
50
51// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
52$hookmanager->initHooks(array('bankannualreport', 'globalcard'));
53
54// Security check
55$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
56$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
57if ($user->socid) {
58 $socid = $user->socid;
59}
60$result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account&bank_account', '', '', $fieldtype);
61
62$year_start = GETPOST('year_start');
63//$year_current = strftime("%Y", time());
64$year_current = (int) dol_print_date(time(), "%Y");
65if (!$year_start) {
66 $year_start = $year_current - 2;
67 $year_end = $year_current;
68} else {
69 $year_end = $year_start + 2;
70}
71
72
73/*
74 * View
75 */
76$error = 0;
77
78// Get account information
79$object = new Account($db);
80if ($id > 0 && !preg_match('/,/', $id)) { // if for a particular account and not a list
81 $result = $object->fetch((int) $id);
82 $id = $object->id;
83}
84if (!empty($ref)) {
85 $result = $object->fetch(0, $ref);
86 $id = $object->id;
87}
88
89$annee = '';
90$totentrees = array();
91$totsorties = array();
92
93$title = $object->ref.' - '.$langs->trans("IOMonthlyReporting");
94$helpurl = "";
95llxHeader('', $title, $helpurl);
96
97// Ce rapport de tresorerie est base sur llx_bank (car doit inclure les transactions sans facture)
98// plutot que sur llx_paiement + llx_paiementfourn
99
100$sql = "SELECT SUM(b.amount)";
101$sql .= ", date_format(b.dateo,'%Y-%m') as dm";
102$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
103$sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
104$sql .= " WHERE b.fk_account = ba.rowid";
105$sql .= " AND ba.entity IN (".getEntity('bank_account').")";
106$sql .= " AND b.amount >= 0";
107if (!empty($id)) {
108 $sql .= " AND b.fk_account IN (".$db->sanitize($db->escape($id)).")";
109}
110$sql .= " GROUP BY dm";
111
112$resql = $db->query($sql);
113$encaiss = array();
114$decaiss = array();
115if ($resql) {
116 $num = $db->num_rows($resql);
117 $i = 0;
118 while ($i < $num) {
119 $row = $db->fetch_row($resql);
120 $encaiss[$row[1]] = $row[0];
121 $i++;
122 }
123} else {
125}
126
127$sql = "SELECT SUM(b.amount)";
128$sql .= ", date_format(b.dateo,'%Y-%m') as dm";
129$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
130$sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
131$sql .= " WHERE b.fk_account = ba.rowid";
132$sql .= " AND ba.entity IN (".getEntity('bank_account').")";
133$sql .= " AND b.amount <= 0";
134if (!empty($id)) {
135 $sql .= " AND b.fk_account IN (".$db->sanitize($db->escape($id)).")";
136}
137$sql .= " GROUP BY dm";
138
139$resql = $db->query($sql);
140if ($resql) {
141 $num = $db->num_rows($resql);
142 $i = 0;
143 while ($i < $num) {
144 $row = $db->fetch_row($resql);
145 $decaiss[$row[1]] = -$row[0];
146 $i++;
147 }
148} else {
150}
151
152
153// Tabs tab / graph
154$head = bank_prepare_head($object);
155print dol_get_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), 0, 'account');
156
157$title = $langs->trans("FinancialAccount")." : ".$object->label;
158$link = ($year_start ? '<a href="'.$_SERVER["PHP_SELF"].'?account='.$object->id.'&year_start='.($year_start - 1).'">'.img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year").' <a href="'.$_SERVER["PHP_SELF"].'?account='.$object->id.'&year_start='.($year_start + 1).'">'.img_next('', 'class="valignbottom"').'</a>' : '');
159
160$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
161
162$morehtmlref = '';
163
164if (!empty($id)) {
165 if (!preg_match('/,/', $id)) {
166 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
167 } else {
168 $bankaccount = new Account($db);
169 $listid = explode(',', $id);
170 foreach ($listid as $key => $aId) {
171 $bankaccount->fetch((int) $aId);
172 $bankaccount->label = $bankaccount->ref;
173 print $bankaccount->getNomUrl(1);
174 if ($key < (count($listid) - 1)) {
175 print ', ';
176 }
177 }
178 }
179} else {
180 print $langs->trans("AllAccounts");
181}
182
183print dol_get_fiche_end();
184
185$head = bank_report_prepare_head($object);
186print dol_get_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), -1);
187
188// Affiche tableau
189print load_fiche_titre('', $link, '');
190
191print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
192print '<table class="noborder centpercent">';
193
194print '<tr class="liste_titre"><td class="liste_titre borderrightlight">'.$langs->trans("Month").'</td>';
195for ($annee = $year_start; $annee <= $year_end; $annee++) {
196 print '<td width="20%" colspan="2" class="liste_titre borderrightlight center">'.$annee.'</td>';
197}
198print '</tr>';
199
200print '<tr class="liste_titre">';
201print '<td class="liste_titre borderrightlight">&nbsp;</td>';
202for ($annee = $year_start; $annee <= $year_end; $annee++) {
203 print '<td class="liste_titre center">'.$langs->trans("Debit").'</td><td class="liste_titre center borderrightlight">'.$langs->trans("Credit").'</td>';
204}
205print '</tr>';
206
207for ($annee = $year_start; $annee <= $year_end; $annee++) {
208 $totsorties[$annee] = 0;
209 $totentrees[$annee] = 0;
210}
211
212for ($mois = 1; $mois < 13; $mois++) {
213 print '<tr class="oddeven">';
214 print '<td class="borderrightlight">'.dol_print_date(dol_mktime(1, 1, 1, $mois, 1, 2000), "%B")."</td>";
215
216 for ($annee = $year_start; $annee <= $year_end; $annee++) {
217 $case = sprintf("%04d-%02d", $annee, $mois);
218
219 print '<td class="right" width="10%">&nbsp;';
220 if (isset($decaiss[$case]) && $decaiss[$case] > 0) {
221 print price($decaiss[$case]);
222 $totsorties[$annee] += $decaiss[$case];
223 }
224 print "</td>";
225
226 print '<td class="right borderrightlight" width="10%">&nbsp;';
227 if (isset($encaiss[$case]) && $encaiss[$case] > 0) {
228 print price($encaiss[$case]);
229 $totentrees[$annee] += $encaiss[$case];
230 }
231 print "</td>";
232 }
233 print '</tr>';
234}
235
236// Total debit-credit
237print '<tr class="liste_total"><td class="borderrightlight liste_total"><b>'.$langs->trans("Total")."</b></td>";
238for ($annee = $year_start; $annee <= $year_end; $annee++) {
239 print '<td class="right nowraponall liste_total"><b>'. (isset($totsorties[$annee]) ? price($totsorties[$annee]) : '') .'</b></td>';
240 print '<td class="right nowraponall liste_total borderrightlight"><b>'. (isset($totentrees[$annee]) ? price($totentrees[$annee]) : '') .'</b></td>';
241}
242print "</tr>\n";
243
244print "</table>";
245print "</div>";
246
247print '<br>';
248
249
250// Current balance
251$balance = 0;
252
253$sql = "SELECT SUM(b.amount) as total";
254$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
255$sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
256$sql .= " WHERE b.fk_account = ba.rowid";
257$sql .= " AND ba.entity IN (".getEntity('bank_account').")";
258if (!empty($id)) {
259 $sql .= " AND b.fk_account IN (".$db->sanitize($db->escape($id)).")";
260}
261
262$resql = $db->query($sql);
263if ($resql) {
264 $obj = $db->fetch_object($resql);
265 if ($obj) {
266 $balance = $obj->total;
267 }
268} else {
270}
271
272print '<table class="noborder centpercent">';
273
274$nbcol = '';
275print '<tr class="liste_total"><td><b>'.$langs->trans("CurrentBalance")."</b></td>";
276print '<td colspan="'.($nbcol).'" class="right">'.price($balance).'</td>';
277print "</tr>\n";
278
279print "</table>";
280
281// BUILDING GRAPHICS
282
283$year = $year_end;
284
285$result = dol_mkdir($conf->bank->dir_temp);
286if ($result < 0) {
287 $langs->load("errors");
288 $error++;
289 setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors');
290} else {
291 // Calcul de $min et $max
292 $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max";
293 $sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
294 $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
295 $sql .= " WHERE b.fk_account = ba.rowid";
296 $sql .= " AND ba.entity IN (".getEntity('bank_account').")";
297 if ($id && GETPOST("option") != 'all') {
298 $sql .= " AND b.fk_account IN (".$db->sanitize($id).")";
299 }
300
301 $resql = $db->query($sql);
302 if ($resql) {
303 $num = $db->num_rows($resql);
304 $obj = $db->fetch_object($resql);
305 $min = $db->jdate($obj->min);
306 $max = $db->jdate($obj->max);
307 $log = "graph.php: min=".$min." max=".$max;
308 dol_syslog($log);
309 } else {
311 }
312
313 // CRED PART
314 // Chargement du tableau des années
315 $tblyear = array();
316 '@phan-var-force array<array<string,int|float>> $tblyear';
317 $tblyear[0] = array();
318 $tblyear[1] = array();
319 $tblyear[2] = array();
320
321 for ($annee = 0; $annee < 3; $annee++) {
322 $sql = "SELECT date_format(b.datev, '%m')";
323 $sql .= ", SUM(b.amount)";
324 $sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
325 $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
326 $sql .= " WHERE b.fk_account = ba.rowid";
327 $sql .= " AND ba.entity IN (".getEntity('bank_account').")";
328 $sql .= " AND b.datev >= '".($year - $annee)."-01-01 00:00:00'";
329 $sql .= " AND b.datev <= '".($year - $annee)."-12-31 23:59:59'";
330 $sql .= " AND b.amount > 0";
331 if ($id && GETPOST("option") != 'all') {
332 $sql .= " AND b.fk_account IN (".$db->sanitize($id).")";
333 }
334 $sql .= " GROUP BY date_format(b.datev, '%m');";
335
336 $resql = $db->query($sql);
337 if ($resql) {
338 $num = $db->num_rows($resql);
339 $i = 0;
340 while ($i < $num) {
341 $row = $db->fetch_row($resql);
342 $tblyear[$annee][$row[0]] = $row[1];
343 $i++;
344 }
345 $db->free($resql);
346 } else {
348 }
349 }
350 // Chargement de labels et data_xxx pour tableau 4 Movements
351 $labels = array();
352 $data_year_0 = array();
353 $data_year_1 = array();
354 $data_year_2 = array();
355 $datamin = array();
356
357 for ($i = 0; $i < 12; $i++) {
358 $data_year_0[$i] = isset($tblyear[0][substr("0".($i + 1), -2)]) ? $tblyear[0][substr("0".($i + 1), -2)] : 0;
359 $data_year_1[$i] = isset($tblyear[1][substr("0".($i + 1), -2)]) ? $tblyear[1][substr("0".($i + 1), -2)] : 0;
360 $data_year_2[$i] = isset($tblyear[2][substr("0".($i + 1), -2)]) ? $tblyear[2][substr("0".($i + 1), -2)] : 0;
361 $labels[$i] = $langs->transnoentitiesnoconv("MonthVeryShort".sprintf("%02d", $i + 1));
362 $datamin[$i] = 0;
363 }
364
365 // Fabrication tableau 4b
366 $file = $conf->bank->dir_temp."/credmovement".$id."-".$year.".png";
367 $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='."/credmovement".$id."-".$year.".png";
368 $title = $langs->transnoentities("Credit").' - '.$langs->transnoentities("Year").': '.($year - 2).' - '.($year - 1)." - ".$year;
369 $graph_datas = array();
370 for ($i = 0; $i < 12; $i++) {
371 $graph_datas[$i] = array($labels[$i], $data_year_2[$i], $data_year_1[$i], $data_year_0[$i]);
372 }
373
374 $px1 = new DolGraph();
375 $px1->SetData($graph_datas);
376 $px1->SetLegend(array((string) ($year - 2), (string) ($year - 1), (string) $year));
377 $px1->SetLegendWidthMin(180);
378 $px1->SetMaxValue($px1->GetCeilMaxValue() < 0 ? 0 : $px1->GetCeilMaxValue());
379 $px1->SetMinValue($px1->GetFloorMinValue() > 0 ? 0 : $px1->GetFloorMinValue());
380 $px1->SetTitle($title);
381 $px1->SetWidth($WIDTH);
382 $px1->SetHeight($HEIGHT);
383 $px1->SetType(array('line', 'line', 'line'));
384 $px1->SetShading(3);
385 $px1->setBgColor('onglet');
386 $px1->setBgColorGrid(array(255, 255, 255));
387 $px1->SetHorizTickIncrement(1);
388 $px1->draw($file, $fileurl);
389
390 $show1 = $px1->show();
391
392 unset($graph_datas);
393 unset($px1);
394 unset($tblyear[0]);
395 unset($tblyear[1]);
396 unset($tblyear[2]);
397
398 // DEDBT PART
399 // Chargement du tableau des années
400 $tblyear[0] = array();
401 $tblyear[1] = array();
402 $tblyear[2] = array();
403
404 for ($annee = 0; $annee < 3; $annee++) {
405 $sql = "SELECT date_format(b.datev, '%m')";
406 $sql .= ", SUM(b.amount)";
407 $sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
408 $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
409 $sql .= " WHERE b.fk_account = ba.rowid";
410 $sql .= " AND ba.entity IN (".getEntity('bank_account').")";
411 $sql .= " AND b.datev >= '".($year - $annee)."-01-01 00:00:00'";
412 $sql .= " AND b.datev <= '".($year - $annee)."-12-31 23:59:59'";
413 $sql .= " AND b.amount < 0";
414 if ($id && GETPOST("option") != 'all') {
415 $sql .= " AND b.fk_account IN (".$db->sanitize($id).")";
416 }
417 $sql .= " GROUP BY date_format(b.datev, '%m');";
418
419 $resql = $db->query($sql);
420 if ($resql) {
421 $num = $db->num_rows($resql);
422 $i = 0;
423 while ($i < $num) {
424 $row = $db->fetch_row($resql);
425 $tblyear[$annee][$row[0]] = abs($row[1]);
426 $i++;
427 }
428 $db->free($resql);
429 } else {
431 }
432 }
433
434 // Chargement de labels et data_xxx pour tableau 4 Movements
435 $labels = array();
436 $data_year_0 = array();
437 $data_year_1 = array();
438 $data_year_2 = array();
439
440 for ($i = 0; $i < 12; $i++) {
441 $data_year_0[$i] = isset($tblyear[0][substr("0".($i + 1), -2)]) ? $tblyear[0][substr("0".($i + 1), -2)] : 0;
442 $data_year_1[$i] = isset($tblyear[1][substr("0".($i + 1), -2)]) ? $tblyear[1][substr("0".($i + 1), -2)] : 0;
443 $data_year_2[$i] = isset($tblyear[2][substr("0".($i + 1), -2)]) ? $tblyear[2][substr("0".($i + 1), -2)] : 0;
444 $labels[$i] = $langs->transnoentitiesnoconv("MonthVeryShort".sprintf("%02d", $i + 1));
445 $datamin[$i] = 0;
446 }
447
448 $file = $conf->bank->dir_temp."/debmovement".$id."-".$year.".png";
449 $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='."/debmovement".$id."-".$year.".png";
450 $title = $langs->transnoentities("Debit").' - '.$langs->transnoentities("Year").': '.($year - 2).' - '.($year - 1)." - ".$year;
451 $graph_datas = array();
452 for ($i = 0; $i < 12; $i++) {
453 $graph_datas[$i] = array($labels[$i], $data_year_2[$i], $data_year_1[$i], $data_year_0[$i]);
454 }
455
456 $px2 = new DolGraph();
457 $px2->SetData($graph_datas);
458 $px2->SetLegend(array((string) ($year - 2), (string) ($year - 1), (string) $year));
459 $px2->SetLegendWidthMin(180);
460 $px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue());
461 $px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue());
462 $px2->SetTitle($title);
463 $px2->SetWidth($WIDTH);
464 $px2->SetHeight($HEIGHT);
465 $px2->SetType(array('line', 'line', 'line'));
466 $px2->SetShading(3);
467 $px2->setBgColor('onglet');
468 $px2->setBgColorGrid(array(255, 255, 255));
469 $px2->SetHorizTickIncrement(1);
470 $px2->draw($file, $fileurl);
471
472 $show2 = $px2->show();
473
474 unset($graph_datas);
475 unset($px2);
476 unset($tblyear[0]);
477 unset($tblyear[1]);
478 unset($tblyear[2]);
479
480 print '<div class="fichecenter"><div class="fichehalfleft"><div align="center">'; // do not use class="center" here, it will have no effect for the js graph inside.
481 print $show2; // debit
482 print '</div></div><div class="fichehalfright"><div align="center">'; // do not use class="center" here, it will have no effect for the js graph inside.
483 print $show1; // credit
484 print '</div></div></div>';
485 print '<div class="clearboth"></div>';
486}
487
488
489print "\n</div><br>\n";
490print dol_get_fiche_end();
491
492// End of page
493llxFooter();
494$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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.
Definition wrapper.php:73
bank_report_prepare_head(Account $object)
Prepare array with list of tabs for bank report.
Definition bank.lib.php:176
bank_prepare_head(Account $object)
Prepare array with list of tabs.
Definition bank.lib.php:40
Class to manage bank accounts.
Class to build graphs.
static getDefaultGraphSizeForStats($direction, $defaultsize='')
getDefaultGraphSizeForStats
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
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.
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.
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).
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
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.