27require
'../../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
33$langs->loadLangs(array(
'banks',
'categories'));
39$hookmanager->initHooks(array(
'bankstats',
'globalcard'));
45$fieldid =
GETPOST(
'ref') ?
'ref' :
'rowid';
47 $socid = $user->socid;
49$result =
restrictedArea($user,
'banque', $id,
'bank_account&bank_account',
'',
'', $fieldid);
53if (
GETPOST(
"mode") ==
'showalltime') {
54 $mode =
'showalltime';
69 $year = sprintf(
"%04d",
GETPOST(
"year",
'int'));
72 $month = sprintf(
"%02d",
GETPOST(
"month",
'int'));
78 $result = $object->fetch(
GETPOST(
'account',
'int'));
81 $result = $object->fetch(0,
GETPOST(
"ref"));
82 $account = $object->id;
85$title = $object->ref.
' - '.$langs->trans(
"Graph");
89$result =
dol_mkdir($conf->bank->dir_temp);
91 $langs->load(
"errors");
96 $sql =
"SELECT MIN(b.datev) as min, MAX(b.datev) as max";
97 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
98 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
99 $sql .=
" WHERE b.fk_account = ba.rowid";
100 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
101 if ($account &&
GETPOST(
"option") !=
'all') {
102 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
105 $resql = $db->query($sql);
107 $num = $db->num_rows($resql);
108 $obj = $db->fetch_object($resql);
109 $min = $db->jdate($obj->min);
110 $max = $db->jdate($obj->max);
118 $log =
"graph.php: min=".$min.
" max=".$max;
124 if ($mode ==
'standard') {
128 $monthnext = $month + 1;
130 if ($monthnext > 12) {
135 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
136 $sql .=
", SUM(b.amount)";
137 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
138 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
139 $sql .=
" WHERE b.fk_account = ba.rowid";
140 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
141 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
142 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
143 if ($account &&
GETPOST(
"option") !=
'all') {
144 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
146 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
148 $resql = $db->query($sql);
150 $num = $db->num_rows($resql);
153 $row = $db->fetch_row($resql);
154 $amounts[$row[0]] = $row[1];
165 $sql =
"SELECT SUM(b.amount)";
166 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
167 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
168 $sql .=
" WHERE b.fk_account = ba.rowid";
169 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
170 $sql .=
" AND b.datev < '".$db->escape($year).
"-".sprintf(
"%02s", $month).
"-01'";
171 if ($account &&
GETPOST(
"option") !=
'all') {
172 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
175 $resql = $db->query($sql);
177 $row = $db->fetch_row($resql);
190 $day =
dol_mktime(12, 0, 0, $month, 1, $year);
193 $xyear = substr($textdate, 0, 4);
194 $xday = substr($textdate, 6, 2);
195 $xmonth = substr($textdate, 4, 2);
198 while ($xmonth == $month) {
199 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
203 $datas[$i] = $solde + $subtotal;
205 $datamin[$i] = $object->min_desired;
206 $dataall[$i] = $object->min_allowed;
213 $xyear = substr($textdate, 0, 4);
214 $xday = substr($textdate, 6, 2);
215 $xmonth = substr($textdate, 4, 2);
227 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.$month.
".png";
228 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.$month.
".png";
229 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
230 $graph_datas = array();
231 foreach ($datas as $i => $val) {
232 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
233 if ($object->min_desired) {
234 array_push($graph_datas[$i], $datamin[$i]);
236 if ($object->min_allowed) {
237 array_push($graph_datas[$i], $dataall[$i]);
242 $px1->SetData($graph_datas);
243 $arraylegends = array($langs->transnoentities(
"Balance"));
244 if ($object->min_desired) {
245 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
247 if ($object->min_allowed) {
248 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
250 $px1->SetLegend($arraylegends);
251 $px1->SetLegendWidthMin(180);
252 $px1->SetMaxValue($px1->GetCeilMaxValue() < 0 ? 0 : $px1->GetCeilMaxValue());
253 $px1->SetMinValue($px1->GetFloorMinValue() > 0 ? 0 : $px1->GetFloorMinValue());
254 $px1->SetTitle($title);
255 $px1->SetWidth($WIDTH);
256 $px1->SetHeight($HEIGHT);
257 $px1->SetType(array(
'lines',
'lines',
'lines'));
258 $px1->setBgColor(
'onglet');
259 $px1->setBgColorGrid(array(255, 255, 255));
260 $px1->SetHorizTickIncrement(1);
261 $px1->draw($file, $fileurl);
263 $show1 = $px1->show();
276 if ($mode ==
'standard') {
279 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
280 $sql .=
", SUM(b.amount)";
281 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
282 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
283 $sql .=
" WHERE b.fk_account = ba.rowid";
284 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
285 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
286 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
287 if ($account &&
GETPOST(
"option") !=
'all') {
288 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
290 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
292 $resql = $db->query($sql);
294 $num = $db->num_rows($resql);
297 $row = $db->fetch_row($resql);
298 $amounts[$row[0]] = $row[1];
309 $sql =
"SELECT SUM(b.amount)";
310 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
311 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
312 $sql .=
" WHERE b.fk_account = ba.rowid";
313 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
314 $sql .=
" AND b.datev < '".$db->escape($year).
"-01-01'";
315 if ($account &&
GETPOST(
"option") !=
'all') {
316 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
319 $resql = $db->query($sql);
321 $row = $db->fetch_row($resql);
339 $xyear = substr($textdate, 0, 4);
340 $xday = substr($textdate, 6, 2);
343 while ($xyear == $year && $day <= $datetime) {
344 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
348 $datas[$i] = $solde + $subtotal;
350 $datamin[$i] = $object->min_desired;
351 $dataall[$i] = $object->min_allowed;
360 $xyear = substr($textdate, 0, 4);
361 $xday = substr($textdate, 6, 2);
366 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.
".png";
367 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.
".png";
368 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Year").
': '.$year;
369 $graph_datas = array();
370 foreach ($datas as $i => $val) {
371 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
372 if ($object->min_desired) {
373 array_push($graph_datas[$i], $datamin[$i]);
375 if ($object->min_allowed) {
376 array_push($graph_datas[$i], $dataall[$i]);
380 $px2->SetData($graph_datas);
381 $arraylegends = array($langs->transnoentities(
"Balance"));
382 if ($object->min_desired) {
383 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
385 if ($object->min_allowed) {
386 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
388 $px2->SetLegend($arraylegends);
389 $px2->SetLegendWidthMin(180);
390 $px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue());
391 $px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue());
392 $px2->SetTitle($title);
393 $px2->SetWidth($WIDTH);
394 $px2->SetHeight($HEIGHT);
395 $px2->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
396 $px2->setBgColor(
'onglet');
397 $px2->setBgColorGrid(array(255, 255, 255));
398 $px2->SetHideXGrid(
true);
400 $px2->draw($file, $fileurl);
402 $show2 = $px2->show();
415 if ($mode ==
'showalltime') {
419 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
420 $sql .=
", SUM(b.amount)";
421 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
422 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
423 $sql .=
" WHERE b.fk_account = ba.rowid";
424 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
425 if ($account &&
GETPOST(
"option") !=
'all') {
426 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
428 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
430 $resql = $db->query($sql);
432 $num = $db->num_rows($resql);
436 $row = $db->fetch_row($resql);
437 $amounts[$row[0]] = $row[1];
460 while ($day <= ($max + 86400)) {
461 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
463 if ($day > ($max + 86400)) {
466 $datas[$i] = $solde + $subtotal;
468 $datamin[$i] = $object->min_desired;
469 $dataall[$i] = $object->min_allowed;
474 $labels[$i] = substr($textdate, 0, 6);
483 $file = $conf->bank->dir_temp.
"/balance".$account.
".png";
484 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
".png";
485 $title = $langs->transnoentities(
"Balance").
" - ".$langs->transnoentities(
"AllTime");
486 $graph_datas = array();
487 foreach ($datas as $i => $val) {
488 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
489 if ($object->min_desired) {
490 array_push($graph_datas[$i], $datamin[$i]);
492 if ($object->min_allowed) {
493 array_push($graph_datas[$i], $dataall[$i]);
498 $px3->SetData($graph_datas);
499 $arraylegends = array($langs->transnoentities(
"Balance"));
500 if ($object->min_desired) {
501 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
503 if ($object->min_allowed) {
504 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
506 $px3->SetLegend($arraylegends);
507 $px3->SetLegendWidthMin(180);
508 $px3->SetMaxValue($px3->GetCeilMaxValue() < 0 ? 0 : $px3->GetCeilMaxValue());
509 $px3->SetMinValue($px3->GetFloorMinValue() > 0 ? 0 : $px3->GetFloorMinValue());
510 $px3->SetTitle($title);
511 $px3->SetWidth($WIDTH);
512 $px3->SetHeight($HEIGHT);
513 $px3->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
514 $px3->setBgColor(
'onglet');
515 $px3->setBgColorGrid(array(255, 255, 255));
516 $px3->draw($file, $fileurl);
518 $show3 = $px3->show();
531 if ($mode ==
'standard') {
536 $monthnext = $month + 1;
538 if ($monthnext > 12) {
543 $sql =
"SELECT date_format(b.datev,'%d')";
544 $sql .=
", SUM(b.amount)";
545 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
546 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
547 $sql .=
" WHERE b.fk_account = ba.rowid";
548 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
549 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
550 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
551 $sql .=
" AND b.amount > 0";
552 if ($account &&
GETPOST(
"option") !=
'all') {
553 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
555 $sql .=
" GROUP BY date_format(b.datev,'%d')";
557 $resql = $db->query($sql);
559 $num = $db->num_rows($resql);
562 $row = $db->fetch_row($resql);
563 $credits[$row[0]] = $row[1];
571 $monthnext = $month + 1;
573 if ($monthnext > 12) {
578 $sql =
"SELECT date_format(b.datev,'%d')";
579 $sql .=
", SUM(b.amount)";
580 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
581 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
582 $sql .=
" WHERE b.fk_account = ba.rowid";
583 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
584 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
585 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
586 $sql .=
" AND b.amount < 0";
587 if ($account &&
GETPOST(
"option") !=
'all') {
588 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
590 $sql .=
" GROUP BY date_format(b.datev,'%d')";
592 $resql = $db->query($sql);
594 while ($row = $db->fetch_row($resql)) {
595 $debits[$row[0]] = abs($row[1]);
605 $data_credit = array();
606 $data_debit = array();
607 for ($i = 0; $i < 31; $i++) {
608 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
609 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
610 $labels[$i] = sprintf(
"%02d", $i + 1);
611 $datamin[$i] = $object->min_desired;
615 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.$month.
".png";
616 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.$month.
".png";
617 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
618 $graph_datas = array();
619 foreach ($data_credit as $i => $val) {
620 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
623 $px4->SetData($graph_datas);
624 $px4->SetLegend(array($langs->transnoentities(
"Credit"), $langs->transnoentities(
"Debit")));
625 $px4->SetLegendWidthMin(180);
626 $px4->SetMaxValue($px4->GetCeilMaxValue() < 0 ? 0 : $px4->GetCeilMaxValue());
627 $px4->SetMinValue($px4->GetFloorMinValue() > 0 ? 0 : $px4->GetFloorMinValue());
628 $px4->SetTitle($title);
629 $px4->SetWidth($WIDTH);
630 $px4->SetHeight($HEIGHT);
631 $px4->SetType(array(
'bars',
'bars'));
633 $px4->setBgColor(
'onglet');
634 $px4->setBgColorGrid(array(255, 255, 255));
635 $px4->SetHorizTickIncrement(1);
636 $px4->draw($file, $fileurl);
638 $show4 = $px4->show();
648 if ($mode ==
'standard') {
652 $sql =
"SELECT date_format(b.datev,'%m')";
653 $sql .=
", SUM(b.amount)";
654 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
655 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
656 $sql .=
" WHERE b.fk_account = ba.rowid";
657 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
658 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
659 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
660 $sql .=
" AND b.amount > 0";
661 if ($account &&
GETPOST(
"option") !=
'all') {
662 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
664 $sql .=
" GROUP BY date_format(b.datev,'%m');";
666 $resql = $db->query($sql);
668 $num = $db->num_rows($resql);
671 $row = $db->fetch_row($resql);
672 $credits[$row[0]] = $row[1];
679 $sql =
"SELECT date_format(b.datev,'%m')";
680 $sql .=
", SUM(b.amount)";
681 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
682 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
683 $sql .=
" WHERE b.fk_account = ba.rowid";
684 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
685 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
686 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
687 $sql .=
" AND b.amount < 0";
688 if ($account &&
GETPOST(
"option") !=
'all') {
689 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
691 $sql .=
" GROUP BY date_format(b.datev,'%m')";
693 $resql = $db->query($sql);
695 while ($row = $db->fetch_row($resql)) {
696 $debits[$row[0]] = abs($row[1]);
706 $data_credit = array();
707 $data_debit = array();
708 for ($i = 0; $i < 12; $i++) {
709 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
710 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
712 $datamin[$i] = $object->min_desired;
716 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.
".png";
717 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.
".png";
718 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Year").
': '.$year;
719 $graph_datas = array();
720 foreach ($data_credit as $i => $val) {
721 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
724 $px5->SetData($graph_datas);
725 $px5->SetLegend(array($langs->transnoentities(
"Credit"), $langs->transnoentities(
"Debit")));
726 $px5->SetLegendWidthMin(180);
727 $px5->SetMaxValue($px5->GetCeilMaxValue() < 0 ? 0 : $px5->GetCeilMaxValue());
728 $px5->SetMinValue($px5->GetFloorMinValue() > 0 ? 0 : $px5->GetFloorMinValue());
729 $px5->SetTitle($title);
730 $px5->SetWidth($WIDTH);
731 $px5->SetHeight($HEIGHT);
732 $px5->SetType(array(
'bars',
'bars'));
734 $px5->setBgColor(
'onglet');
735 $px5->setBgColorGrid(array(255, 255, 255));
736 $px5->SetHorizTickIncrement(1);
737 $px5->draw($file, $fileurl);
739 $show5 = $px5->show();
751print
dol_get_fiche_head($head,
'graph', $langs->trans(
"FinancialAccount"), 0,
'account');
754$linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
757 if (!preg_match(
'/,/', $account)) {
758 $moreparam =
'&month='.$month.
'&year='.$year.($mode ==
'showalltime' ?
'&mode=showalltime' :
'');
760 if (
GETPOST(
"option") !=
'all') {
761 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.
'&option=all'.$moreparam.
'">'.$langs->trans(
"ShowAllAccounts").
'</a>';
762 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref',
'', $moreparam, 0,
'',
'', 1);
764 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.$moreparam.
'">'.$langs->trans(
"BackToAccount").
'</a>';
765 print $langs->trans(
"AllAccounts");
769 $bankaccount =
new Account($db);
770 $listid = explode(
',', $account);
771 foreach ($listid as $key => $id) {
772 $bankaccount->fetch($id);
773 $bankaccount->label = $bankaccount->ref;
774 print $bankaccount->getNomUrl(1);
775 if ($key < (count($listid) - 1)) {
781 print $langs->trans(
"AllAccounts");
787print
'<table class="notopnoleftnoright" width="100%">';
790print
'<tr><td class="right">'.$morehtml.
' ';
791if ($mode ==
'showalltime') {
792 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
793 print $langs->trans(
"GoBack");
796 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?mode=showalltime&account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
797 print $langs->trans(
"ShowAllTimeBalance");
800print
'<br><br></td></tr>';
806if ($mode ==
'standard') {
809 $prevmonth = $month - 1;
810 $nextmonth = $month + 1;
811 if ($prevmonth < 1) {
815 if ($nextmonth > 12) {
821 $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>";
822 print
'<div class="right clearboth">'.$link.
'</div>';
824 print
'<div class="center clearboth margintoponly">';
825 $file =
"movement".$account.
"-".$year.$month.
".png";
829 print
'<div class="center clearboth margintoponly">';
834 $prevyear = $year - 1;
835 $nextyear = $year + 1;
836 $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>";
838 print
'<div class="right clearboth margintoponly">'.$link.
'</div>';
840 print
'<div class="center clearboth margintoponly">';
844 print
'<div class="center clearboth margintoponly">';
849if ($mode ==
'showalltime') {
850 print
'<div class="center clearboth margintoponly">';
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_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
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_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
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.
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.