28require
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
34$langs->loadLangs(array(
'banks',
'categories'));
40$hookmanager->initHooks(array(
'bankstats',
'globalcard'));
46$fieldid =
GETPOST(
'ref') ?
'ref' :
'rowid';
48 $socid = $user->socid;
50$result =
restrictedArea($user,
'banque', $id,
'bank_account&bank_account',
'',
'', $fieldid);
54if (
GETPOST(
"mode") ==
'showalltime') {
55 $mode =
'showalltime';
86$title =
$object->ref.
' - '.$langs->trans(
"Graph");
90$result =
dol_mkdir($conf->bank->dir_temp);
92 $langs->load(
"errors");
97 $sql =
"SELECT MIN(b.datev) as min, MAX(b.datev) as max";
98 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
99 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
100 $sql .=
" WHERE b.fk_account = ba.rowid";
101 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
102 if ($account &&
GETPOST(
"option") !=
'all') {
103 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
106 $resql = $db->query($sql);
108 $num = $db->num_rows($resql);
109 $obj = $db->fetch_object($resql);
110 $min = $db->jdate($obj->min);
111 $max = $db->jdate($obj->max);
119 $log =
"graph.php: min=".$min.
" max=".$max;
125 if ($mode ==
'standard') {
129 $monthnext = (int) $month + 1;
130 $yearnext = (int) $year;
131 if ($monthnext > 12) {
135 $monthnext = sprintf(
'%02d', $monthnext);
136 $yearnext = sprintf(
'%04d', $yearnext);
138 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
139 $sql .=
", SUM(b.amount)";
140 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
141 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
142 $sql .=
" WHERE b.fk_account = ba.rowid";
143 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
144 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
145 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
146 if ($account &&
GETPOST(
"option") !=
'all') {
147 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
149 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
151 $resql = $db->query($sql);
153 $num = $db->num_rows($resql);
156 $row = $db->fetch_row($resql);
157 $amounts[$row[0]] = $row[1];
168 $sql =
"SELECT SUM(b.amount)";
169 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
170 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
171 $sql .=
" WHERE b.fk_account = ba.rowid";
172 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
173 $sql .=
" AND b.datev < '".$db->escape($year).
"-".sprintf(
"%02s", $month).
"-01'";
174 if ($account &&
GETPOST(
"option") !=
'all') {
175 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
178 $resql = $db->query($sql);
180 $row = $db->fetch_row($resql);
193 $day =
dol_mktime(12, 0, 0, $month, 1, $year);
196 $xyear = substr($textdate, 0, 4);
197 $xday = substr($textdate, 6, 2);
198 $xmonth = substr($textdate, 4, 2);
202 while ($xmonth == $month) {
203 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
207 $datas[$i] = $solde + $subtotal;
209 $datamin[$i] =
$object->min_desired;
210 $dataall[$i] =
$object->min_allowed;
217 $xyear = substr($textdate, 0, 4);
218 $xday = substr($textdate, 6, 2);
219 $xmonth = substr($textdate, 4, 2);
231 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.$month.
".png";
232 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.$month.
".png";
233 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
234 $graph_datas = array();
235 foreach ($datas as $i => $val) {
236 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
238 array_push($graph_datas[$i], $datamin[$i]);
241 array_push($graph_datas[$i], $dataall[$i]);
246 $px1->SetData($graph_datas);
247 $arraylegends = array($langs->transnoentities(
"Balance"));
249 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
252 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
254 $px1->SetLegend($arraylegends);
255 $px1->SetLegendWidthMin(180);
256 $px1->SetMaxValue($px1->GetCeilMaxValue() < 0 ? 0 : $px1->GetCeilMaxValue());
257 $px1->SetMinValue($px1->GetFloorMinValue() > 0 ? 0 : $px1->GetFloorMinValue());
258 $px1->SetTitle($title);
259 $px1->SetWidth($WIDTH);
260 $px1->SetHeight($HEIGHT);
261 $px1->SetType(array(
'lines',
'lines',
'lines'));
262 $px1->setBgColor(
'onglet');
263 $px1->setBgColorGrid(array(255, 255, 255));
264 $px1->SetHorizTickIncrement(1);
265 $px1->draw($file, $fileurl);
267 $show1 = $px1->show();
280 if ($mode ==
'standard') {
283 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
284 $sql .=
", SUM(b.amount)";
285 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
286 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
287 $sql .=
" WHERE b.fk_account = ba.rowid";
288 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
289 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
290 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
291 if ($account &&
GETPOST(
"option") !=
'all') {
292 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
294 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
296 $resql = $db->query($sql);
298 $num = $db->num_rows($resql);
301 $row = $db->fetch_row($resql);
302 $amounts[$row[0]] = $row[1];
313 $sql =
"SELECT SUM(b.amount)";
314 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
315 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
316 $sql .=
" WHERE b.fk_account = ba.rowid";
317 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
318 $sql .=
" AND b.datev < '".$db->escape($year).
"-01-01'";
319 if ($account &&
GETPOST(
"option") !=
'all') {
320 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
323 $resql = $db->query($sql);
325 $row = $db->fetch_row($resql);
343 $xyear = substr($textdate, 0, 4);
344 $xday = substr($textdate, 6, 2);
347 while ($xyear == $year && $day <= $datetime) {
348 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
352 $datas[$i] = $solde + $subtotal;
354 $datamin[$i] =
$object->min_desired;
355 $dataall[$i] =
$object->min_allowed;
364 $xyear = substr($textdate, 0, 4);
365 $xday = substr($textdate, 6, 2);
370 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.
".png";
371 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.
".png";
372 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Year").
': '.$year;
373 $graph_datas = array();
374 foreach ($datas as $i => $val) {
375 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
377 array_push($graph_datas[$i], $datamin[$i]);
380 array_push($graph_datas[$i], $dataall[$i]);
384 $px2->SetData($graph_datas);
385 $arraylegends = array($langs->transnoentities(
"Balance"));
387 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
390 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
392 $px2->SetLegend($arraylegends);
393 $px2->SetLegendWidthMin(180);
394 $px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue());
395 $px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue());
396 $px2->SetTitle($title);
397 $px2->SetWidth($WIDTH);
398 $px2->SetHeight($HEIGHT);
399 $px2->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
400 $px2->setBgColor(
'onglet');
401 $px2->setBgColorGrid(array(255, 255, 255));
402 $px2->SetHideXGrid(
true);
404 $px2->draw($file, $fileurl);
406 $show2 = $px2->show();
419 if ($mode ==
'showalltime') {
423 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
424 $sql .=
", SUM(b.amount)";
425 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
426 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
427 $sql .=
" WHERE b.fk_account = ba.rowid";
428 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
429 if ($account &&
GETPOST(
"option") !=
'all') {
430 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
432 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
434 $resql = $db->query($sql);
436 $num = $db->num_rows($resql);
440 $row = $db->fetch_row($resql);
441 $amounts[$row[0]] = $row[1];
464 while ($day <= ($max + 86400)) {
465 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
467 if ($day > ($max + 86400)) {
470 $datas[$i] = $solde + $subtotal;
472 $datamin[$i] =
$object->min_desired;
473 $dataall[$i] =
$object->min_allowed;
478 $labels[$i] = substr($textdate, 0, 6);
487 $file = $conf->bank->dir_temp.
"/balance".$account.
".png";
488 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
".png";
489 $title = $langs->transnoentities(
"Balance").
" - ".$langs->transnoentities(
"AllTime");
490 $graph_datas = array();
491 foreach ($datas as $i => $val) {
492 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
494 array_push($graph_datas[$i], $datamin[$i]);
497 array_push($graph_datas[$i], $dataall[$i]);
502 $px3->SetData($graph_datas);
503 $arraylegends = array($langs->transnoentities(
"Balance"));
505 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
508 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
510 $px3->SetLegend($arraylegends);
511 $px3->SetLegendWidthMin(180);
512 $px3->SetMaxValue($px3->GetCeilMaxValue() < 0 ? 0 : $px3->GetCeilMaxValue());
513 $px3->SetMinValue($px3->GetFloorMinValue() > 0 ? 0 : $px3->GetFloorMinValue());
514 $px3->SetTitle($title);
515 $px3->SetWidth($WIDTH);
516 $px3->SetHeight($HEIGHT);
517 $px3->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
518 $px3->setBgColor(
'onglet');
519 $px3->setBgColorGrid(array(255, 255, 255));
520 $px3->draw($file, $fileurl);
522 $show3 = $px3->show();
535 if ($mode ==
'standard') {
540 $monthnext = (int) $month + 1;
541 $yearnext = (int) $year;
542 if ($monthnext > 12) {
546 $monthnext = sprintf(
'%02d', $monthnext);
547 $yearnext = sprintf(
'%04d', $yearnext);
549 $sql =
"SELECT date_format(b.datev,'%d')";
550 $sql .=
", SUM(b.amount)";
551 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
552 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
553 $sql .=
" WHERE b.fk_account = ba.rowid";
554 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
555 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
556 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
557 $sql .=
" AND b.amount > 0";
558 if ($account &&
GETPOST(
"option") !=
'all') {
559 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
561 $sql .=
" GROUP BY date_format(b.datev,'%d')";
563 $resql = $db->query($sql);
565 $num = $db->num_rows($resql);
568 $row = $db->fetch_row($resql);
569 $credits[$row[0]] = $row[1];
577 $monthnext = (int) $month + 1;
578 $yearnext = (int) $year;
579 if ($monthnext > 12) {
583 $monthnext = sprintf(
'%02d', $monthnext);
584 $yearnext = sprintf(
'%04d', $yearnext);
586 $sql =
"SELECT date_format(b.datev,'%d')";
587 $sql .=
", SUM(b.amount)";
588 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
589 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
590 $sql .=
" WHERE b.fk_account = ba.rowid";
591 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
592 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
593 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
594 $sql .=
" AND b.amount < 0";
595 if ($account &&
GETPOST(
"option") !=
'all') {
596 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
598 $sql .=
" GROUP BY date_format(b.datev,'%d')";
600 $resql = $db->query($sql);
602 while ($row = $db->fetch_row($resql)) {
603 $debits[$row[0]] = abs($row[1]);
613 $data_credit = array();
614 $data_debit = array();
615 for ($i = 0; $i < 31; $i++) {
616 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
617 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
618 $labels[$i] = sprintf(
"%02d", $i + 1);
619 $datamin[$i] =
$object->min_desired;
623 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.$month.
".png";
624 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.$month.
".png";
625 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
626 $graph_datas = array();
627 foreach ($data_credit as $i => $val) {
628 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
631 $px4->SetData($graph_datas);
632 $px4->SetLegend(array($langs->transnoentities(
"Credit"), $langs->transnoentities(
"Debit")));
633 $px4->SetLegendWidthMin(180);
634 $px4->SetMaxValue($px4->GetCeilMaxValue() < 0 ? 0 : $px4->GetCeilMaxValue());
635 $px4->SetMinValue($px4->GetFloorMinValue() > 0 ? 0 : $px4->GetFloorMinValue());
636 $px4->SetTitle($title);
637 $px4->SetWidth($WIDTH);
638 $px4->SetHeight($HEIGHT);
639 $px4->SetType(array(
'bars',
'bars'));
641 $px4->setBgColor(
'onglet');
642 $px4->setBgColorGrid(array(255, 255, 255));
643 $px4->SetHorizTickIncrement(1);
644 $px4->draw($file, $fileurl);
646 $show4 = $px4->show();
656 if ($mode ==
'standard') {
660 $sql =
"SELECT date_format(b.datev,'%m')";
661 $sql .=
", SUM(b.amount)";
662 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
663 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
664 $sql .=
" WHERE b.fk_account = ba.rowid";
665 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
666 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
667 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
668 $sql .=
" AND b.amount > 0";
669 if ($account &&
GETPOST(
"option") !=
'all') {
670 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
672 $sql .=
" GROUP BY date_format(b.datev,'%m');";
674 $resql = $db->query($sql);
676 $num = $db->num_rows($resql);
679 $row = $db->fetch_row($resql);
680 $credits[$row[0]] = $row[1];
687 $sql =
"SELECT date_format(b.datev,'%m')";
688 $sql .=
", SUM(b.amount)";
689 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
690 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
691 $sql .=
" WHERE b.fk_account = ba.rowid";
692 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
693 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
694 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
695 $sql .=
" AND b.amount < 0";
696 if ($account &&
GETPOST(
"option") !=
'all') {
697 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
699 $sql .=
" GROUP BY date_format(b.datev,'%m')";
701 $resql = $db->query($sql);
703 while ($row = $db->fetch_row($resql)) {
704 $debits[$row[0]] = abs($row[1]);
714 $data_credit = array();
715 $data_debit = array();
716 for ($i = 0; $i < 12; $i++) {
717 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
718 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
720 $datamin[$i] =
$object->min_desired;
724 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.
".png";
725 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.
".png";
726 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Year").
': '.$year;
727 $graph_datas = array();
728 foreach ($data_credit as $i => $val) {
729 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
732 $px5->SetData($graph_datas);
733 $px5->SetLegend(array($langs->transnoentities(
"Credit"), $langs->transnoentities(
"Debit")));
734 $px5->SetLegendWidthMin(180);
735 $px5->SetMaxValue($px5->GetCeilMaxValue() < 0 ? 0 : $px5->GetCeilMaxValue());
736 $px5->SetMinValue($px5->GetFloorMinValue() > 0 ? 0 : $px5->GetFloorMinValue());
737 $px5->SetTitle($title);
738 $px5->SetWidth($WIDTH);
739 $px5->SetHeight($HEIGHT);
740 $px5->SetType(array(
'bars',
'bars'));
742 $px5->setBgColor(
'onglet');
743 $px5->setBgColorGrid(array(255, 255, 255));
744 $px5->SetHorizTickIncrement(1);
745 $px5->draw($file, $fileurl);
747 $show5 = $px5->show();
759print
dol_get_fiche_head($head,
'graph', $langs->trans(
"FinancialAccount"), 0,
'account');
762$linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
765 if (!preg_match(
'/,/', $account)) {
766 $moreparam =
'&month='.$month.
'&year='.$year.($mode ==
'showalltime' ?
'&mode=showalltime' :
'');
768 if (
GETPOST(
"option") !=
'all') {
769 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.
'&option=all'.$moreparam.
'">'.$langs->trans(
"ShowAllAccounts").
'</a>';
770 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref',
'', $moreparam, 0,
'',
'', 1);
772 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.$moreparam.
'">'.$langs->trans(
"BackToAccount").
'</a>';
773 print $langs->trans(
"AllAccounts");
777 $bankaccount =
new Account($db);
778 $listid = explode(
',', $account);
779 foreach ($listid as $key => $id) {
780 $bankaccount->fetch($id);
781 $bankaccount->label = $bankaccount->ref;
782 print $bankaccount->getNomUrl(1);
783 if ($key < (count($listid) - 1)) {
789 print $langs->trans(
"AllAccounts");
795print
'<table class="notopnoleftnoright" width="100%">';
798print
'<tr><td class="right">'.$morehtml.
' ';
799if ($mode ==
'showalltime') {
800 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
801 print $langs->trans(
"GoBack");
804 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?mode=showalltime&account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
805 print $langs->trans(
"ShowAllTimeBalance");
808print
'<br><br></td></tr>';
814if ($mode ==
'standard') {
815 $prevyear = (int) $year;
816 $nextyear = (int) $year;
817 $prevmonth = (int) $month - 1;
818 $nextmonth = (int) $month + 1;
819 if ($prevmonth < 1) {
823 if ($nextmonth > 12) {
827 $nextmonth = sprintf(
'%02d', $nextmonth);
828 $prevmonth = sprintf(
'%02d', $prevmonth);
829 $nextyear = sprintf(
'%04d', $nextyear);
830 $prevyear = sprintf(
'%04d', $prevyear);
833 $link =
"<a href='".$_SERVER[
"PHP_SELF"].
"?account=".$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
"&year=".$prevyear.
"&month=".$prevmonth.
"'>".
img_previous(
'',
'class="valignbottom"').
"</a> ".$langs->trans(
"Month").
" <a href='".$_SERVER[
"PHP_SELF"].
"?account=".$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
"&year=".$nextyear.
"&month=".$nextmonth.
"'>".
img_next(
'',
'class="valignbottom"').
"</a>";
834 print
'<div class="right clearboth">'.$link.
'</div>';
836 print
'<div class="center clearboth margintoponly">';
837 $file =
"movement".$account.
"-".$year.$month.
".png";
841 print
'<div class="center clearboth margintoponly">';
846 $prevyear = (int) $year - 1;
847 $nextyear = (int) $year + 1;
848 $nextyear = sprintf(
'%04d', $nextyear);
849 $prevyear = sprintf(
'%04d', $prevyear);
850 $link =
"<a href='".$_SERVER[
"PHP_SELF"].
"?account=".$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
"&year=".($prevyear).
"'>".
img_previous(
'',
'class="valignbottom"').
"</a> ".$langs->trans(
"Year").
" <a href='".$_SERVER[
"PHP_SELF"].
"?account=".$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
"&year=".($nextyear).
"'>".
img_next(
'',
'class="valignbottom"').
"</a>";
852 print
'<div class="right clearboth margintoponly">'.$link.
'</div>';
854 print
'<div class="center clearboth margintoponly">';
858 print
'<div class="center clearboth margintoponly">';
863if ($mode ==
'showalltime') {
864 print
'<div class="center clearboth margintoponly">';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
bank_prepare_head(Account $object)
Prepare array with list of tabs.
Class to manage bank accounts.
static getDefaultGraphSizeForStats($direction, $defaultsize='')
getDefaultGraphSizeForStats
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...
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)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_now($mode='auto')
Return date for now.
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).
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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.
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.