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);
191 $textdate = strftime(
"%Y%m%d", $day);
192 $xyear = substr($textdate, 0, 4);
193 $xday = substr($textdate, 6, 2);
194 $xmonth = substr($textdate, 4, 2);
197 while ($xmonth == $month) {
198 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
202 $datas[$i] = $solde + $subtotal;
204 $datamin[$i] = $object->min_desired;
205 $dataall[$i] = $object->min_allowed;
210 $textdate = strftime(
"%Y%m%d", $day);
211 $xyear = substr($textdate, 0, 4);
212 $xday = substr($textdate, 6, 2);
213 $xmonth = substr($textdate, 4, 2);
225 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.$month.
".png";
226 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.$month.
".png";
227 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
228 $graph_datas = array();
229 foreach ($datas as $i => $val) {
230 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
231 if ($object->min_desired) {
232 array_push($graph_datas[$i], $datamin[$i]);
234 if ($object->min_allowed) {
235 array_push($graph_datas[$i], $dataall[$i]);
240 $px1->SetData($graph_datas);
241 $arraylegends = array($langs->transnoentities(
"Balance"));
242 if ($object->min_desired) {
243 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
245 if ($object->min_allowed) {
246 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
248 $px1->SetLegend($arraylegends);
249 $px1->SetLegendWidthMin(180);
250 $px1->SetMaxValue($px1->GetCeilMaxValue() < 0 ? 0 : $px1->GetCeilMaxValue());
251 $px1->SetMinValue($px1->GetFloorMinValue() > 0 ? 0 : $px1->GetFloorMinValue());
252 $px1->SetTitle($title);
253 $px1->SetWidth($WIDTH);
254 $px1->SetHeight($HEIGHT);
255 $px1->SetType(array(
'lines',
'lines',
'lines'));
256 $px1->setBgColor(
'onglet');
257 $px1->setBgColorGrid(array(255, 255, 255));
258 $px1->SetHorizTickIncrement(1);
259 $px1->draw($file, $fileurl);
261 $show1 = $px1->show();
274 if ($mode ==
'standard') {
277 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
278 $sql .=
", SUM(b.amount)";
279 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
280 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
281 $sql .=
" WHERE b.fk_account = ba.rowid";
282 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
283 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
284 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
285 if ($account &&
GETPOST(
"option") !=
'all') {
286 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
288 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
290 $resql = $db->query($sql);
292 $num = $db->num_rows($resql);
295 $row = $db->fetch_row($resql);
296 $amounts[$row[0]] = $row[1];
307 $sql =
"SELECT SUM(b.amount)";
308 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
309 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
310 $sql .=
" WHERE b.fk_account = ba.rowid";
311 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
312 $sql .=
" AND b.datev < '".$db->escape($year).
"-01-01'";
313 if ($account &&
GETPOST(
"option") !=
'all') {
314 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
317 $resql = $db->query($sql);
319 $row = $db->fetch_row($resql);
335 $textdate = strftime(
"%Y%m%d", $day);
336 $xyear = substr($textdate, 0, 4);
337 $xday = substr($textdate, 6, 2);
340 while ($xyear == $year && $day <= $datetime) {
341 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
345 $datas[$i] = $solde + $subtotal;
347 $datamin[$i] = $object->min_desired;
348 $dataall[$i] = $object->min_allowed;
355 $textdate = strftime(
"%Y%m%d", $day);
356 $xyear = substr($textdate, 0, 4);
357 $xday = substr($textdate, 6, 2);
362 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.
".png";
363 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.
".png";
364 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Year").
': '.$year;
365 $graph_datas = array();
366 foreach ($datas as $i => $val) {
367 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
368 if ($object->min_desired) {
369 array_push($graph_datas[$i], $datamin[$i]);
371 if ($object->min_allowed) {
372 array_push($graph_datas[$i], $dataall[$i]);
376 $px2->SetData($graph_datas);
377 $arraylegends = array($langs->transnoentities(
"Balance"));
378 if ($object->min_desired) {
379 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
381 if ($object->min_allowed) {
382 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
384 $px2->SetLegend($arraylegends);
385 $px2->SetLegendWidthMin(180);
386 $px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue());
387 $px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue());
388 $px2->SetTitle($title);
389 $px2->SetWidth($WIDTH);
390 $px2->SetHeight($HEIGHT);
391 $px2->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
392 $px2->setBgColor(
'onglet');
393 $px2->setBgColorGrid(array(255, 255, 255));
394 $px2->SetHideXGrid(
true);
396 $px2->draw($file, $fileurl);
398 $show2 = $px2->show();
411 if ($mode ==
'showalltime') {
415 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
416 $sql .=
", SUM(b.amount)";
417 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
418 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
419 $sql .=
" WHERE b.fk_account = ba.rowid";
420 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
421 if ($account &&
GETPOST(
"option") !=
'all') {
422 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
424 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
426 $resql = $db->query($sql);
428 $num = $db->num_rows($resql);
432 $row = $db->fetch_row($resql);
433 $amounts[$row[0]] = $row[1];
452 $textdate = strftime(
"%Y%m%d", $day);
455 while ($day <= ($max + 86400)) {
456 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
458 if ($day > ($max + 86400)) {
461 $datas[$i] = $solde + $subtotal;
463 $datamin[$i] = $object->min_desired;
464 $dataall[$i] = $object->min_allowed;
469 $labels[$i] = substr($textdate, 0, 6);
472 $textdate = strftime(
"%Y%m%d", $day);
477 $file = $conf->bank->dir_temp.
"/balance".$account.
".png";
478 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
".png";
479 $title = $langs->transnoentities(
"Balance").
" - ".$langs->transnoentities(
"AllTime");
480 $graph_datas = array();
481 foreach ($datas as $i => $val) {
482 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
483 if ($object->min_desired) {
484 array_push($graph_datas[$i], $datamin[$i]);
486 if ($object->min_allowed) {
487 array_push($graph_datas[$i], $dataall[$i]);
492 $px3->SetData($graph_datas);
493 $arraylegends = array($langs->transnoentities(
"Balance"));
494 if ($object->min_desired) {
495 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
497 if ($object->min_allowed) {
498 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
500 $px3->SetLegend($arraylegends);
501 $px3->SetLegendWidthMin(180);
502 $px3->SetMaxValue($px3->GetCeilMaxValue() < 0 ? 0 : $px3->GetCeilMaxValue());
503 $px3->SetMinValue($px3->GetFloorMinValue() > 0 ? 0 : $px3->GetFloorMinValue());
504 $px3->SetTitle($title);
505 $px3->SetWidth($WIDTH);
506 $px3->SetHeight($HEIGHT);
507 $px3->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
508 $px3->setBgColor(
'onglet');
509 $px3->setBgColorGrid(array(255, 255, 255));
510 $px3->draw($file, $fileurl);
512 $show3 = $px3->show();
525 if ($mode ==
'standard') {
530 $monthnext = $month + 1;
532 if ($monthnext > 12) {
537 $sql =
"SELECT date_format(b.datev,'%d')";
538 $sql .=
", SUM(b.amount)";
539 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
540 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
541 $sql .=
" WHERE b.fk_account = ba.rowid";
542 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
543 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
544 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
545 $sql .=
" AND b.amount > 0";
546 if ($account &&
GETPOST(
"option") !=
'all') {
547 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
549 $sql .=
" GROUP BY date_format(b.datev,'%d')";
551 $resql = $db->query($sql);
553 $num = $db->num_rows($resql);
556 $row = $db->fetch_row($resql);
557 $credits[$row[0]] = $row[1];
565 $monthnext = $month + 1;
567 if ($monthnext > 12) {
572 $sql =
"SELECT date_format(b.datev,'%d')";
573 $sql .=
", SUM(b.amount)";
574 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
575 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
576 $sql .=
" WHERE b.fk_account = ba.rowid";
577 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
578 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
579 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
580 $sql .=
" AND b.amount < 0";
581 if ($account &&
GETPOST(
"option") !=
'all') {
582 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
584 $sql .=
" GROUP BY date_format(b.datev,'%d')";
586 $resql = $db->query($sql);
588 while ($row = $db->fetch_row($resql)) {
589 $debits[$row[0]] = abs($row[1]);
599 $data_credit = array();
600 $data_debit = array();
601 for ($i = 0; $i < 31; $i++) {
602 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
603 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
604 $labels[$i] = sprintf(
"%02d", $i + 1);
605 $datamin[$i] = $object->min_desired;
609 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.$month.
".png";
610 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.$month.
".png";
611 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
612 $graph_datas = array();
613 foreach ($data_credit as $i => $val) {
614 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
617 $px4->SetData($graph_datas);
618 $px4->SetLegend(array($langs->transnoentities(
"Credit"), $langs->transnoentities(
"Debit")));
619 $px4->SetLegendWidthMin(180);
620 $px4->SetMaxValue($px4->GetCeilMaxValue() < 0 ? 0 : $px4->GetCeilMaxValue());
621 $px4->SetMinValue($px4->GetFloorMinValue() > 0 ? 0 : $px4->GetFloorMinValue());
622 $px4->SetTitle($title);
623 $px4->SetWidth($WIDTH);
624 $px4->SetHeight($HEIGHT);
625 $px4->SetType(array(
'bars',
'bars'));
627 $px4->setBgColor(
'onglet');
628 $px4->setBgColorGrid(array(255, 255, 255));
629 $px4->SetHorizTickIncrement(1);
630 $px4->draw($file, $fileurl);
632 $show4 = $px4->show();
642 if ($mode ==
'standard') {
646 $sql =
"SELECT date_format(b.datev,'%m')";
647 $sql .=
", SUM(b.amount)";
648 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
649 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
650 $sql .=
" WHERE b.fk_account = ba.rowid";
651 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
652 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
653 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
654 $sql .=
" AND b.amount > 0";
655 if ($account &&
GETPOST(
"option") !=
'all') {
656 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
658 $sql .=
" GROUP BY date_format(b.datev,'%m');";
660 $resql = $db->query($sql);
662 $num = $db->num_rows($resql);
665 $row = $db->fetch_row($resql);
666 $credits[$row[0]] = $row[1];
673 $sql =
"SELECT date_format(b.datev,'%m')";
674 $sql .=
", SUM(b.amount)";
675 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
676 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
677 $sql .=
" WHERE b.fk_account = ba.rowid";
678 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
679 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
680 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
681 $sql .=
" AND b.amount < 0";
682 if ($account &&
GETPOST(
"option") !=
'all') {
683 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
685 $sql .=
" GROUP BY date_format(b.datev,'%m')";
687 $resql = $db->query($sql);
689 while ($row = $db->fetch_row($resql)) {
690 $debits[$row[0]] = abs($row[1]);
700 $data_credit = array();
701 $data_debit = array();
702 for ($i = 0; $i < 12; $i++) {
703 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
704 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
706 $datamin[$i] = $object->min_desired;
710 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.
".png";
711 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.
".png";
712 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Year").
': '.$year;
713 $graph_datas = array();
714 foreach ($data_credit as $i => $val) {
715 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
718 $px5->SetData($graph_datas);
719 $px5->SetLegend(array($langs->transnoentities(
"Credit"), $langs->transnoentities(
"Debit")));
720 $px5->SetLegendWidthMin(180);
721 $px5->SetMaxValue($px5->GetCeilMaxValue() < 0 ? 0 : $px5->GetCeilMaxValue());
722 $px5->SetMinValue($px5->GetFloorMinValue() > 0 ? 0 : $px5->GetFloorMinValue());
723 $px5->SetTitle($title);
724 $px5->SetWidth($WIDTH);
725 $px5->SetHeight($HEIGHT);
726 $px5->SetType(array(
'bars',
'bars'));
728 $px5->setBgColor(
'onglet');
729 $px5->setBgColorGrid(array(255, 255, 255));
730 $px5->SetHorizTickIncrement(1);
731 $px5->draw($file, $fileurl);
733 $show5 = $px5->show();
745print
dol_get_fiche_head($head,
'graph', $langs->trans(
"FinancialAccount"), 0,
'account');
748$linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
751 if (!preg_match(
'/,/', $account)) {
752 $moreparam =
'&month='.$month.
'&year='.$year.($mode ==
'showalltime' ?
'&mode=showalltime' :
'');
754 if (
GETPOST(
"option") !=
'all') {
755 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.
'&option=all'.$moreparam.
'">'.$langs->trans(
"ShowAllAccounts").
'</a>';
756 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref',
'', $moreparam, 0,
'',
'', 1);
758 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.$moreparam.
'">'.$langs->trans(
"BackToAccount").
'</a>';
759 print $langs->trans(
"AllAccounts");
763 $bankaccount =
new Account($db);
764 $listid = explode(
',', $account);
765 foreach ($listid as $key => $id) {
766 $bankaccount->fetch($id);
767 $bankaccount->label = $bankaccount->ref;
768 print $bankaccount->getNomUrl(1);
769 if ($key < (count($listid) - 1)) {
775 print $langs->trans(
"AllAccounts");
781print
'<table class="notopnoleftnoright" width="100%">';
784print
'<tr><td class="right">'.$morehtml.
' ';
785if ($mode ==
'showalltime') {
786 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
787 print $langs->trans(
"GoBack");
790 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?mode=showalltime&account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
791 print $langs->trans(
"ShowAllTimeBalance");
794print
'<br><br></td></tr>';
800if ($mode ==
'standard') {
803 $prevmonth = $month - 1;
804 $nextmonth = $month + 1;
805 if ($prevmonth < 1) {
809 if ($nextmonth > 12) {
815 $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>";
816 print
'<div class="right clearboth">'.$link.
'</div>';
818 print
'<div class="center clearboth margintoponly">';
819 $file =
"movement".$account.
"-".$year.$month.
".png";
823 print
'<div class="center clearboth margintoponly">';
828 $prevyear = $year - 1;
829 $nextyear = $year + 1;
830 $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>";
832 print
'<div class="right clearboth margintoponly">'.$link.
'</div>';
834 print
'<div class="center clearboth margintoponly">';
838 print
'<div class="center clearboth margintoponly">';
843if ($mode ==
'showalltime') {
844 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.