29require
'../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
43$langs->loadLangs(array(
'banks',
'categories'));
49$hookmanager->initHooks(array(
'bankstats',
'globalcard'));
55$fieldid =
GETPOST(
'ref') ?
'ref' :
'rowid';
57 $socid = $user->socid;
59$result =
restrictedArea($user,
'banque',
$id,
'bank_account&bank_account',
'',
'', $fieldid);
63if (
GETPOST(
"mode") ==
'showalltime') {
64 $mode =
'showalltime';
97$title =
$object->ref.
' - '.$langs->trans(
"Graph");
108$result =
dol_mkdir($conf->bank->dir_temp);
110 $langs->load(
"errors");
115 $sql =
"SELECT MIN(b.datev) as min, MAX(b.datev) as max";
116 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
117 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
118 $sql .=
" WHERE b.fk_account = ba.rowid";
119 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
120 if ($account &&
GETPOST(
"option") !=
'all') {
121 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
124 $resql = $db->query($sql);
126 $num = $db->num_rows($resql);
127 $obj = $db->fetch_object($resql);
137 $log =
"graph.php: min=".$min.
" max=".$max;
143 if ($mode ==
'standard') {
147 $monthnext = (int) $month + 1;
148 $yearnext = (int) $year;
149 if ($monthnext > 12) {
153 $monthnext = sprintf(
'%02d', $monthnext);
154 $yearnext = sprintf(
'%04d', $yearnext);
156 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
157 $sql .=
", SUM(b.amount)";
158 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
159 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
160 $sql .=
" WHERE b.fk_account = ba.rowid";
161 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
162 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
163 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
164 if ($account &&
GETPOST(
"option") !=
'all') {
165 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
167 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
169 $resql = $db->query($sql);
171 $num = $db->num_rows($resql);
174 $row = $db->fetch_row($resql);
175 $amounts[$row[0]] = $row[1];
186 $sql =
"SELECT SUM(b.amount)";
187 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
188 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
189 $sql .=
" WHERE b.fk_account = ba.rowid";
190 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
191 $sql .=
" AND b.datev < '".$db->escape($year).
"-".sprintf(
"%02s", $month).
"-01'";
192 if ($account &&
GETPOST(
"option") !=
'all') {
193 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
196 $resql = $db->query($sql);
198 $row = $db->fetch_row($resql);
211 $day =
dol_mktime(12, 0, 0, (
int) $month, 1, (
int) $year);
214 $xyear = substr($textdate, 0, 4);
215 $xday = substr($textdate, 6, 2);
216 $xmonth = substr($textdate, 4, 2);
220 while ($xmonth == $month) {
221 $subtotal += (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
222 if ($day > $nowlasthourmidday) {
225 $datas[$i] = $solde + $subtotal;
227 $datamin[$i] =
$object->min_desired;
228 $dataall[$i] =
$object->min_allowed;
236 $xyear = substr($textdate, 0, 4);
237 $xday = substr($textdate, 6, 2);
238 $xmonth = substr($textdate, 4, 2);
250 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.$month.
".png";
251 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.$month.
".png";
252 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
253 $graph_datas = array();
254 foreach ($datas as $i => $val) {
255 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
257 array_push($graph_datas[$i], $datamin[$i]);
260 array_push($graph_datas[$i], $dataall[$i]);
266 $px1->datacolor = array(array(120, 130, 250), array(160, 160, 180), array(190, 190, 220));
268 $px1->SetData($graph_datas);
269 $arraylegends = array($langs->transnoentities(
"Balance"));
271 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
274 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
276 $px1->SetLegend($arraylegends);
277 $px1->SetLegendWidthMin(180);
278 $px1->SetMaxValue($px1->GetCeilMaxValue() < 0 ? 0 : $px1->GetCeilMaxValue());
279 $px1->SetMinValue($px1->GetFloorMinValue() > 0 ? 0 : $px1->GetFloorMinValue());
280 $px1->SetTitle($title);
281 $px1->SetWidth($WIDTH);
282 $px1->SetHeight($HEIGHT);
283 $px1->SetType(array(
'lines',
'lines',
'lines'));
284 $px1->setBgColor(
'onglet');
285 $px1->setBgColorGrid(array(255, 255, 255));
286 $px1->SetHorizTickIncrement(1);
287 $px1->draw($file, $fileurl);
289 $show1 = $px1->show();
302 if ($mode ==
'standard') {
305 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
306 $sql .=
", SUM(b.amount)";
307 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
308 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
309 $sql .=
" WHERE b.fk_account = ba.rowid";
310 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
311 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
312 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
313 if ($account &&
GETPOST(
"option") !=
'all') {
314 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
316 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
318 $resql = $db->query($sql);
320 $num = $db->num_rows($resql);
323 $row = $db->fetch_row($resql);
324 $amounts[$row[0]] = $row[1];
335 $sql =
"SELECT SUM(b.amount)";
336 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
337 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
338 $sql .=
" WHERE b.fk_account = ba.rowid";
339 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
340 $sql .=
" AND b.datev < '".$db->escape($year).
"-01-01'";
341 if ($account &&
GETPOST(
"option") !=
'all') {
342 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
345 $resql = $db->query($sql);
347 $row = $db->fetch_row($resql);
362 $day =
dol_mktime(12, 0, 0, 1, 1, (
int) $year);
365 $xyear = substr($textdate, 0, 4);
366 $xday = substr($textdate, 6, 2);
369 while ($xyear == $year && $day <= $nowlasthourmidday) {
370 $subtotal += (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
372 $datas[$i] = $solde + $subtotal;
374 $datamin[$i] =
$object->min_desired;
375 $dataall[$i] =
$object->min_allowed;
382 $xyear = substr($textdate, 0, 4);
383 $xday = substr($textdate, 6, 2);
389 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.
".png";
390 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.
".png";
391 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Year").
': '.$year;
392 $graph_datas = array();
393 foreach ($datas as $i => $val) {
394 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
396 array_push($graph_datas[$i], $datamin[$i]);
399 array_push($graph_datas[$i], $dataall[$i]);
404 $px2->datacolor = array(array(120, 130, 250), array(160, 160, 180), array(190, 190, 220));
406 $px2->SetData($graph_datas);
407 $arraylegends = array($langs->transnoentities(
"Balance"));
409 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
412 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
414 $px2->SetLegend($arraylegends);
415 $px2->SetLegendWidthMin(180);
416 $px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue());
417 $px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue());
418 $px2->SetTitle($title);
419 $px2->SetWidth($WIDTH);
420 $px2->SetHeight($HEIGHT);
421 $px2->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
422 $px2->setBgColor(
'onglet');
423 $px2->setBgColorGrid(array(255, 255, 255));
424 $px2->SetHideXGrid(
true);
426 $px2->draw($file, $fileurl);
428 $show2 = $px2->show();
441 if ($mode ==
'showalltime') {
445 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
446 $sql .=
", SUM(b.amount)";
447 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
448 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
449 $sql .=
" WHERE b.fk_account = ba.rowid";
450 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
451 if ($account &&
GETPOST(
"option") !=
'all') {
452 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
454 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
456 $resql = $db->query($sql);
458 $num = $db->num_rows($resql);
462 $row = $db->fetch_row($resql);
463 $amounts[$row[0]] = $row[1];
486 while ($day <= ($max + 86400)) {
487 $subtotal += (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
489 if ($day > ($max + 86400)) {
492 $datas[$i] = $solde + $subtotal;
494 $datamin[$i] =
$object->min_desired;
495 $dataall[$i] =
$object->min_allowed;
500 $labels[$i] = substr($textdate, 0, 6);
509 $file = $conf->bank->dir_temp.
"/balance".$account.
".png";
510 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
".png";
511 $title = $langs->transnoentities(
"Balance").
" - ".$langs->transnoentities(
"AllTime");
512 $graph_datas = array();
513 foreach ($datas as $i => $val) {
514 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
516 array_push($graph_datas[$i], $datamin[$i]);
519 array_push($graph_datas[$i], $dataall[$i]);
525 $px3->datacolor = array(array(120, 130, 250), array(160, 160, 180), array(190, 190, 220));
527 $px3->SetData($graph_datas);
528 $arraylegends = array($langs->transnoentities(
"Balance"));
530 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
533 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
535 $px3->SetLegend($arraylegends);
536 $px3->SetLegendWidthMin(180);
537 $px3->SetMaxValue($px3->GetCeilMaxValue() < 0 ? 0 : $px3->GetCeilMaxValue());
538 $px3->SetMinValue($px3->GetFloorMinValue() > 0 ? 0 : $px3->GetFloorMinValue());
539 $px3->SetTitle($title);
540 $px3->SetWidth($WIDTH);
541 $px3->SetHeight($HEIGHT);
542 $px3->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
543 $px3->setBgColor(
'onglet');
544 $px3->setBgColorGrid(array(255, 255, 255));
545 $px3->draw($file, $fileurl);
547 $show3 = $px3->show();
560 if ($mode ==
'standard') {
565 $monthnext = (int) $month + 1;
566 $yearnext = (int) $year;
567 if ($monthnext > 12) {
571 $monthnext = sprintf(
'%02d', $monthnext);
572 $yearnext = sprintf(
'%04d', $yearnext);
574 $sql =
"SELECT date_format(b.datev,'%d')";
575 $sql .=
", SUM(b.amount)";
576 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
577 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
578 $sql .=
" WHERE b.fk_account = ba.rowid";
579 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
580 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
581 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
582 $sql .=
" AND b.amount > 0";
583 if ($account &&
GETPOST(
"option") !=
'all') {
584 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
586 $sql .=
" GROUP BY date_format(b.datev,'%d')";
588 $resql = $db->query($sql);
590 $num = $db->num_rows($resql);
593 $row = $db->fetch_row($resql);
594 $credits[$row[0]] = $row[1];
602 $monthnext = (int) $month + 1;
603 $yearnext = (int) $year;
604 if ($monthnext > 12) {
608 $monthnext = sprintf(
'%02d', $monthnext);
609 $yearnext = sprintf(
'%04d', $yearnext);
611 $sql =
"SELECT date_format(b.datev,'%d')";
612 $sql .=
", SUM(b.amount)";
613 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
614 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
615 $sql .=
" WHERE b.fk_account = ba.rowid";
616 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
617 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
618 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
619 $sql .=
" AND b.amount < 0";
620 if ($account &&
GETPOST(
"option") !=
'all') {
621 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
623 $sql .=
" GROUP BY date_format(b.datev,'%d')";
625 $resql = $db->query($sql);
627 while ($row = $db->fetch_row($resql)) {
628 $debits[$row[0]] = abs($row[1]);
638 $data_credit = array();
639 $data_debit = array();
640 for ($i = 0; $i < 31; $i++) {
641 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
642 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
643 $labels[$i] = sprintf(
"%02d", $i + 1);
644 $datamin[$i] =
$object->min_desired;
648 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.$month.
".png";
649 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.$month.
".png";
650 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
651 $graph_datas = array();
652 foreach ($data_credit as $i => $val) {
653 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
656 $px4->SetData($graph_datas);
657 $px4->SetLegend(array($langs->transnoentities(
"Credit").
' ('.$langs->transnoentities(
"Input").
')', $langs->transnoentities(
"Debit").
' ('.$langs->transnoentities(
"Output").
')'));
658 $px4->SetLegendWidthMin(180);
659 $px4->SetMaxValue($px4->GetCeilMaxValue() < 0 ? 0 : $px4->GetCeilMaxValue());
660 $px4->SetMinValue($px4->GetFloorMinValue() > 0 ? 0 : $px4->GetFloorMinValue());
661 $px4->SetTitle($title);
662 $px4->SetWidth($WIDTH);
663 $px4->SetHeight($HEIGHT);
664 $px4->SetType(array(
'bars',
'bars'));
666 $px4->setBgColor(
'onglet');
667 $px4->setBgColorGrid(array(255, 255, 255));
668 $px4->SetHorizTickIncrement(1);
669 $px4->draw($file, $fileurl);
671 $show4 = $px4->show();
681 if ($mode ==
'standard') {
685 $sql =
"SELECT date_format(b.datev,'%m')";
686 $sql .=
", SUM(b.amount)";
687 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
688 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
689 $sql .=
" WHERE b.fk_account = ba.rowid";
690 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
691 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
692 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
693 $sql .=
" AND b.amount > 0";
694 if ($account &&
GETPOST(
"option") !=
'all') {
695 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
697 $sql .=
" GROUP BY date_format(b.datev,'%m');";
699 $resql = $db->query($sql);
701 $num = $db->num_rows($resql);
704 $row = $db->fetch_row($resql);
705 $credits[$row[0]] = $row[1];
712 $sql =
"SELECT date_format(b.datev,'%m')";
713 $sql .=
", SUM(b.amount)";
714 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
715 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
716 $sql .=
" WHERE b.fk_account = ba.rowid";
717 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
718 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
719 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
720 $sql .=
" AND b.amount < 0";
721 if ($account &&
GETPOST(
"option") !=
'all') {
722 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
724 $sql .=
" GROUP BY date_format(b.datev,'%m')";
726 $resql = $db->query($sql);
728 while ($row = $db->fetch_row($resql)) {
729 $debits[$row[0]] = abs($row[1]);
739 $data_credit = array();
740 $data_debit = array();
741 for ($i = 0; $i < 12; $i++) {
742 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
743 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
745 $datamin[$i] =
$object->min_desired;
749 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.
".png";
750 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.
".png";
751 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Year").
': '.$year;
752 $graph_datas = array();
753 foreach ($data_credit as $i => $val) {
754 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
757 $px5->SetData($graph_datas);
758 $px5->SetLegend(array($langs->transnoentities(
"Credit").
' ('.$langs->transnoentities(
"Input").
')', $langs->transnoentities(
"Debit").
' ('.$langs->transnoentities(
"Output").
')'));
759 $px5->SetLegendWidthMin(180);
760 $px5->SetMaxValue($px5->GetCeilMaxValue() < 0 ? 0 : $px5->GetCeilMaxValue());
761 $px5->SetMinValue($px5->GetFloorMinValue() > 0 ? 0 : $px5->GetFloorMinValue());
762 $px5->SetTitle($title);
763 $px5->SetWidth($WIDTH);
764 $px5->SetHeight($HEIGHT);
765 $px5->SetType(array(
'bars',
'bars'));
767 $px5->setBgColor(
'onglet');
768 $px5->setBgColorGrid(array(255, 255, 255));
769 $px5->SetHorizTickIncrement(1);
770 $px5->draw($file, $fileurl);
772 $show5 = $px5->show();
784print
dol_get_fiche_head($head,
'annual', $langs->trans(
"FinancialAccount"), 0,
'account');
787$linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
790 if (!preg_match(
'/,/', $account)) {
791 $moreparam =
'&month='.$month.
'&year='.$year.($mode ==
'showalltime' ?
'&mode=showalltime' :
'');
793 if (
GETPOST(
"option") !=
'all') {
794 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.
'&option=all'.$moreparam.
'">'.$langs->trans(
"ShowAllAccounts").
'</a>';
795 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref',
'', $moreparam, 0,
'',
'', 1);
797 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.$moreparam.
'">'.$langs->trans(
"BackToAccount").
'</a>';
798 print $langs->trans(
"AllAccounts");
802 $bankaccount =
new Account($db);
803 $listid = explode(
',', $account);
804 foreach ($listid as $key =>
$id) {
805 $bankaccount->fetch((
int)
$id);
806 $bankaccount->label = $bankaccount->ref;
807 print $bankaccount->getNomUrl(1);
808 if ($key < (count($listid) - 1)) {
814 print $langs->trans(
"AllAccounts");
822print
'<table class="notopnoleftnoright centerpercent">';
825print
'<tr><td class="right">'.$morehtml.
' ';
826if ($mode ==
'showalltime') {
827 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
828 print $langs->trans(
"GoBack");
831 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?mode=showalltime&account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
832 print $langs->trans(
"ShowAllTimeBalance");
835print
'<br><br></td></tr>';
841if ($mode ==
'standard') {
842 $prevyear = (int) $year;
843 $nextyear = (int) $year;
844 $prevmonth = (int) $month - 1;
845 $nextmonth = (int) $month + 1;
846 if ($prevmonth < 1) {
850 if ($nextmonth > 12) {
854 $nextmonth = sprintf(
'%02d', $nextmonth);
855 $prevmonth = sprintf(
'%02d', $prevmonth);
856 $nextyear = sprintf(
'%04d', $nextyear);
857 $prevyear = sprintf(
'%04d', $prevyear);
860 $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>";
861 print
'<div class="right clearboth">'.$link.
'</div>';
863 print
'<div class="center clearboth margintoponly">';
864 $file =
"movement".$account.
"-".$year.$month.
".png";
868 print
'<div class="center clearboth margintoponly">';
875 $prevyear = (int) $year - 1;
876 $nextyear = (int) $year + 1;
877 $nextyear = sprintf(
'%04d', $nextyear);
878 $prevyear = sprintf(
'%04d', $prevyear);
879 $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>";
881 print
'<div class="right clearboth margintoponly">'.$link.
'</div>';
883 print
'<div class="center clearboth margintoponly">';
887 print
'<div class="center clearboth margintoponly">';
892if ($mode ==
'showalltime') {
893 print
'<div class="center clearboth margintoponly">';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
bank_report_prepare_head(Account $object)
Prepare array with list of tabs for bank report.
bank_prepare_head(Account $object)
Prepare array with list of tabs.
Class to manage bank accounts.
static getDefaultGraphSizeForStats($direction, $defaultsize='')
getDefaultGraphSizeForStats
dol_get_first_hour($date, $gm='tzserver')
Return GMT time for first hour of a given GMT date (it removes hours, min and second part)
dol_get_last_hour($date, $gm='tzserver')
Return GMT time for last hour of a given GMT date (it replaces hours, min and second part to 23:59:59...
dol_now($mode='gmt')
Return date for now.
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.
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, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
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.