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'));
56$fieldid =
GETPOST(
'ref') ?
'ref' :
'rowid';
58 $socid = $user->socid;
60$result =
restrictedArea($user,
'banque', $id,
'bank_account&bank_account',
'',
'', $fieldid);
64if (
GETPOST(
"mode") ==
'showalltime') {
65 $mode =
'showalltime';
98$title =
$object->ref.
' - '.$langs->trans(
"Graph");
111 $langs->load(
"errors");
116 $sql =
"SELECT MIN(b.datev) as min, MAX(b.datev) as max";
117 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
118 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
119 $sql .=
" WHERE b.fk_account = ba.rowid";
120 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
121 if ($account &&
GETPOST(
"option") !=
'all') {
122 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
125 $resql =
$db->query($sql);
129 $min = $max - 3600 * 24;
132 $num =
$db->num_rows($resql);
133 $obj =
$db->fetch_object($resql);
140 $log =
"graph.php: min=".$min.
" max=".$max;
146 if ($mode ==
'standard') {
150 $monthnext = (int) $month + 1;
151 $yearnext = (int) $year;
152 if ($monthnext > 12) {
156 $monthnext = sprintf(
'%02d', $monthnext);
157 $yearnext = sprintf(
'%04d', $yearnext);
159 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
160 $sql .=
", SUM(b.amount)";
161 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
162 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
163 $sql .=
" WHERE b.fk_account = ba.rowid";
164 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
165 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".
$db->escape($month).
"-01 00:00:00'";
166 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".
$db->escape($monthnext).
"-01 00:00:00'";
167 if ($account &&
GETPOST(
"option") !=
'all') {
168 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
170 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
172 $resql =
$db->query($sql);
174 $num =
$db->num_rows($resql);
177 $row =
$db->fetch_row($resql);
178 $amounts[$row[0]] = $row[1];
189 $sql =
"SELECT SUM(b.amount)";
190 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
191 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
192 $sql .=
" WHERE b.fk_account = ba.rowid";
193 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
194 $sql .=
" AND b.datev < '".$db->escape($year).
"-".sprintf(
"%02s", $month).
"-01'";
195 if ($account &&
GETPOST(
"option") !=
'all') {
196 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
199 $resql =
$db->query($sql);
201 $row =
$db->fetch_row($resql);
214 $day =
dol_mktime(12, 0, 0, (
int) $month, 1, (
int) $year);
217 $xyear = substr($textdate, 0, 4);
218 $xday = substr($textdate, 6, 2);
219 $xmonth = substr($textdate, 4, 2);
223 while ($xmonth == $month) {
224 $subtotal += (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
225 if ($day > $nowlasthourmidday) {
228 $datas[$i] = $solde + $subtotal;
230 $datamin[$i] =
$object->min_desired;
231 $dataall[$i] =
$object->min_allowed;
239 $xyear = substr($textdate, 0, 4);
240 $xday = substr($textdate, 6, 2);
241 $xmonth = substr($textdate, 4, 2);
253 $file =
$conf->bank->dir_temp.
"/balance".$account.
"-".$year.$month.
".png";
254 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.$month.
".png";
255 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
256 $graph_datas = array();
257 foreach ($datas as $i => $val) {
258 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
260 array_push($graph_datas[$i], $datamin[$i]);
263 array_push($graph_datas[$i], $dataall[$i]);
269 $px1->datacolor = array(array(120, 130, 250), array(160, 160, 180), array(190, 190, 220));
271 $px1->SetData($graph_datas);
272 $arraylegends = array($langs->transnoentities(
"Balance"));
274 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
277 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
279 $px1->SetLegend($arraylegends);
280 $px1->SetLegendWidthMin(180);
281 $px1->SetMaxValue($px1->GetCeilMaxValue() < 0 ? 0 : $px1->GetCeilMaxValue());
282 $px1->SetMinValue($px1->GetFloorMinValue() > 0 ? 0 : $px1->GetFloorMinValue());
283 $px1->SetTitle($title);
284 $px1->SetWidth($WIDTH);
285 $px1->SetHeight($HEIGHT);
286 $px1->SetType(array(
'lines',
'lines',
'lines'));
287 $px1->setBgColor(
'onglet');
288 $px1->setBgColorGrid(array(255, 255, 255));
289 $px1->SetHorizTickIncrement(1);
290 $px1->draw($file, $fileurl);
292 $show1 = $px1->show();
305 if ($mode ==
'standard') {
308 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
309 $sql .=
", 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 00:00:00'";
315 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
316 if ($account &&
GETPOST(
"option") !=
'all') {
317 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
319 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
321 $resql =
$db->query($sql);
323 $num =
$db->num_rows($resql);
326 $row =
$db->fetch_row($resql);
327 $amounts[$row[0]] = $row[1];
338 $sql =
"SELECT SUM(b.amount)";
339 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
340 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
341 $sql .=
" WHERE b.fk_account = ba.rowid";
342 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
343 $sql .=
" AND b.datev < '".$db->escape($year).
"-01-01'";
344 if ($account &&
GETPOST(
"option") !=
'all') {
345 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
348 $resql =
$db->query($sql);
350 $row =
$db->fetch_row($resql);
365 $day =
dol_mktime(12, 0, 0, 1, 1, (
int) $year);
368 $xyear = substr($textdate, 0, 4);
369 $xday = substr($textdate, 6, 2);
372 while ($xyear == $year && $day <= $nowlasthourmidday) {
373 $subtotal += (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
375 $datas[$i] = $solde + $subtotal;
377 $datamin[$i] =
$object->min_desired;
378 $dataall[$i] =
$object->min_allowed;
385 $xyear = substr($textdate, 0, 4);
386 $xday = substr($textdate, 6, 2);
392 $file =
$conf->bank->dir_temp.
"/balance".$account.
"-".$year.
".png";
393 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.
".png";
394 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Year").
': '.$year;
395 $graph_datas = array();
396 foreach ($datas as $i => $val) {
397 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
399 array_push($graph_datas[$i], $datamin[$i]);
402 array_push($graph_datas[$i], $dataall[$i]);
407 $px2->datacolor = array(array(120, 130, 250), array(160, 160, 180), array(190, 190, 220));
409 $px2->SetData($graph_datas);
410 $arraylegends = array($langs->transnoentities(
"Balance"));
412 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
415 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
417 $px2->SetLegend($arraylegends);
418 $px2->SetLegendWidthMin(180);
419 $px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue());
420 $px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue());
421 $px2->SetTitle($title);
422 $px2->SetWidth($WIDTH);
423 $px2->SetHeight($HEIGHT);
424 $px2->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
425 $px2->setBgColor(
'onglet');
426 $px2->setBgColorGrid(array(255, 255, 255));
427 $px2->SetHideXGrid(
true);
429 $px2->draw($file, $fileurl);
431 $show2 = $px2->show();
444 if ($mode ==
'showalltime') {
448 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
449 $sql .=
", SUM(b.amount)";
450 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
451 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
452 $sql .=
" WHERE b.fk_account = ba.rowid";
453 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
454 if ($account &&
GETPOST(
"option") !=
'all') {
455 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
457 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
459 $resql =
$db->query($sql);
461 $num =
$db->num_rows($resql);
465 $row =
$db->fetch_row($resql);
466 $amounts[$row[0]] = $row[1];
489 while ($day <= ($max + 86400)) {
490 $subtotal += (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
492 if ($day > ($max + 86400)) {
495 $datas[$i] = $solde + $subtotal;
497 $datamin[$i] =
$object->min_desired;
498 $dataall[$i] =
$object->min_allowed;
503 $labels[$i] = substr($textdate, 0, 6);
512 $file =
$conf->bank->dir_temp.
"/balance".$account.
".png";
513 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
".png";
514 $title = $langs->transnoentities(
"Balance").
" - ".$langs->transnoentities(
"AllTime");
515 $graph_datas = array();
516 foreach ($datas as $i => $val) {
517 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
519 array_push($graph_datas[$i], $datamin[$i]);
522 array_push($graph_datas[$i], $dataall[$i]);
528 $px3->datacolor = array(array(120, 130, 250), array(160, 160, 180), array(190, 190, 220));
530 $px3->SetData($graph_datas);
531 $arraylegends = array($langs->transnoentities(
"Balance"));
533 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
536 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
538 $px3->SetLegend($arraylegends);
539 $px3->SetLegendWidthMin(180);
540 $px3->SetMaxValue($px3->GetCeilMaxValue() < 0 ? 0 : $px3->GetCeilMaxValue());
541 $px3->SetMinValue($px3->GetFloorMinValue() > 0 ? 0 : $px3->GetFloorMinValue());
542 $px3->SetTitle($title);
543 $px3->SetWidth($WIDTH);
544 $px3->SetHeight($HEIGHT);
545 $px3->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
546 $px3->setBgColor(
'onglet');
547 $px3->setBgColorGrid(array(255, 255, 255));
548 $px3->draw($file, $fileurl);
550 $show3 = $px3->show();
563 if ($mode ==
'standard') {
568 $monthnext = (int) $month + 1;
569 $yearnext = (int) $year;
570 if ($monthnext > 12) {
574 $monthnext = sprintf(
'%02d', $monthnext);
575 $yearnext = sprintf(
'%04d', $yearnext);
577 $sql =
"SELECT date_format(b.datev,'%d')";
578 $sql .=
", SUM(b.amount)";
579 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
580 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
581 $sql .=
" WHERE b.fk_account = ba.rowid";
582 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
583 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".
$db->escape($month).
"-01 00:00:00'";
584 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".
$db->escape($monthnext).
"-01 00:00:00'";
585 $sql .=
" AND b.amount > 0";
586 if ($account &&
GETPOST(
"option") !=
'all') {
587 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
589 $sql .=
" GROUP BY date_format(b.datev,'%d')";
591 $resql =
$db->query($sql);
593 $num =
$db->num_rows($resql);
596 $row =
$db->fetch_row($resql);
597 $credits[$row[0]] = $row[1];
605 $monthnext = (int) $month + 1;
606 $yearnext = (int) $year;
607 if ($monthnext > 12) {
611 $monthnext = sprintf(
'%02d', $monthnext);
612 $yearnext = sprintf(
'%04d', $yearnext);
614 $sql =
"SELECT date_format(b.datev,'%d')";
615 $sql .=
", SUM(b.amount)";
616 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
617 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
618 $sql .=
" WHERE b.fk_account = ba.rowid";
619 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
620 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".
$db->escape($month).
"-01 00:00:00'";
621 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".
$db->escape($monthnext).
"-01 00:00:00'";
622 $sql .=
" AND b.amount < 0";
623 if ($account &&
GETPOST(
"option") !=
'all') {
624 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
626 $sql .=
" GROUP BY date_format(b.datev,'%d')";
628 $resql =
$db->query($sql);
630 while ($row =
$db->fetch_row($resql)) {
631 $debits[$row[0]] = abs($row[1]);
641 $data_credit = array();
642 $data_debit = array();
643 for ($i = 0; $i < 31; $i++) {
644 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
645 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
646 $labels[$i] = sprintf(
"%02d", $i + 1);
647 $datamin[$i] =
$object->min_desired;
651 $file =
$conf->bank->dir_temp.
"/movement".$account.
"-".$year.$month.
".png";
652 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.$month.
".png";
653 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
654 $graph_datas = array();
655 foreach ($data_credit as $i => $val) {
656 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
659 $px4->SetData($graph_datas);
660 $px4->SetLegend(array($langs->transnoentities(
"Credit").
' ('.$langs->transnoentities(
"Input").
')', $langs->transnoentities(
"Debit").
' ('.$langs->transnoentities(
"Output").
')'));
661 $px4->SetLegendWidthMin(180);
662 $px4->SetMaxValue($px4->GetCeilMaxValue() < 0 ? 0 : $px4->GetCeilMaxValue());
663 $px4->SetMinValue($px4->GetFloorMinValue() > 0 ? 0 : $px4->GetFloorMinValue());
664 $px4->SetTitle($title);
665 $px4->SetWidth($WIDTH);
666 $px4->SetHeight($HEIGHT);
667 $px4->SetType(array(
'bars',
'bars'));
669 $px4->setBgColor(
'onglet');
670 $px4->setBgColorGrid(array(255, 255, 255));
671 $px4->SetHorizTickIncrement(1);
672 $px4->draw($file, $fileurl);
674 $show4 = $px4->show();
684 if ($mode ==
'standard') {
688 $sql =
"SELECT date_format(b.datev,'%m')";
689 $sql .=
", SUM(b.amount)";
690 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
691 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
692 $sql .=
" WHERE b.fk_account = ba.rowid";
693 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
694 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
695 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
696 $sql .=
" AND b.amount > 0";
697 if ($account &&
GETPOST(
"option") !=
'all') {
698 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
700 $sql .=
" GROUP BY date_format(b.datev,'%m');";
702 $resql =
$db->query($sql);
704 $num =
$db->num_rows($resql);
707 $row =
$db->fetch_row($resql);
708 $credits[$row[0]] = $row[1];
715 $sql =
"SELECT date_format(b.datev,'%m')";
716 $sql .=
", SUM(b.amount)";
717 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
718 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
719 $sql .=
" WHERE b.fk_account = ba.rowid";
720 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
721 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
722 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
723 $sql .=
" AND b.amount < 0";
724 if ($account &&
GETPOST(
"option") !=
'all') {
725 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
727 $sql .=
" GROUP BY date_format(b.datev,'%m')";
729 $resql =
$db->query($sql);
731 while ($row =
$db->fetch_row($resql)) {
732 $debits[$row[0]] = abs($row[1]);
742 $data_credit = array();
743 $data_debit = array();
744 for ($i = 0; $i < 12; $i++) {
745 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
746 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
748 $datamin[$i] =
$object->min_desired;
752 $file =
$conf->bank->dir_temp.
"/movement".$account.
"-".$year.
".png";
753 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.
".png";
754 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Year").
': '.$year;
755 $graph_datas = array();
756 foreach ($data_credit as $i => $val) {
757 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
760 $px5->SetData($graph_datas);
761 $px5->SetLegend(array($langs->transnoentities(
"Credit").
' ('.$langs->transnoentities(
"Input").
')', $langs->transnoentities(
"Debit").
' ('.$langs->transnoentities(
"Output").
')'));
762 $px5->SetLegendWidthMin(180);
763 $px5->SetMaxValue($px5->GetCeilMaxValue() < 0 ? 0 : $px5->GetCeilMaxValue());
764 $px5->SetMinValue($px5->GetFloorMinValue() > 0 ? 0 : $px5->GetFloorMinValue());
765 $px5->SetTitle($title);
766 $px5->SetWidth($WIDTH);
767 $px5->SetHeight($HEIGHT);
768 $px5->SetType(array(
'bars',
'bars'));
770 $px5->setBgColor(
'onglet');
771 $px5->setBgColorGrid(array(255, 255, 255));
772 $px5->SetHorizTickIncrement(1);
773 $px5->draw($file, $fileurl);
775 $show5 = $px5->show();
787print
dol_get_fiche_head($head,
'annual', $langs->trans(
"FinancialAccount"), 0,
'account');
790$linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
793 if (!preg_match(
'/,/', $account)) {
794 $moreparam =
'&month='.$month.
'&year='.$year.($mode ==
'showalltime' ?
'&mode=showalltime' :
'');
796 if (
GETPOST(
"option") !=
'all') {
797 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.
'&option=all'.$moreparam.
'">'.$langs->trans(
"ShowAllAccounts").
'</a>';
798 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref',
'', $moreparam, 0,
'',
'', 1);
800 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.$moreparam.
'">'.$langs->trans(
"BackToAccount").
'</a>';
801 print $langs->trans(
"AllAccounts");
806 $listid = explode(
',', $account);
807 foreach ($listid as $key => $id) {
808 $bankaccount->fetch((
int) $id);
809 $bankaccount->label = $bankaccount->ref;
810 print $bankaccount->getNomUrl(1);
811 if ($key < (count($listid) - 1)) {
817 print $langs->trans(
"AllAccounts");
825print
'<table class="notopnoleftnoright centerpercent">';
828print
'<tr><td class="right">'.$morehtml.
' ';
829if ($mode ==
'showalltime') {
830 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
831 print $langs->trans(
"GoBack");
834 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?mode=showalltime&account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
835 print $langs->trans(
"ShowAllTimeBalance");
838print
'<br><br></td></tr>';
844if ($mode ==
'standard') {
845 $prevyear = (int) $year;
846 $nextyear = (int) $year;
847 $prevmonth = (int) $month - 1;
848 $nextmonth = (int) $month + 1;
849 if ($prevmonth < 1) {
853 if ($nextmonth > 12) {
857 $nextmonth = sprintf(
'%02d', $nextmonth);
858 $prevmonth = sprintf(
'%02d', $prevmonth);
859 $nextyear = sprintf(
'%04d', $nextyear);
860 $prevyear = sprintf(
'%04d', $prevyear);
863 $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>";
864 print
'<div class="right clearboth">'.$link.
'</div>';
866 print
'<div class="center clearboth margintoponly">';
867 $file =
"movement".$account.
"-".$year.$month.
".png";
871 print
'<div class="center clearboth margintoponly">';
878 $prevyear = (int) $year - 1;
879 $nextyear = (int) $year + 1;
880 $nextyear = sprintf(
'%04d', $nextyear);
881 $prevyear = sprintf(
'%04d', $prevyear);
882 $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>";
884 print
'<div class="right clearboth margintoponly">'.$link.
'</div>';
886 print
'<div class="center clearboth margintoponly">';
890 print
'<div class="center clearboth margintoponly">';
895if ($mode ==
'showalltime') {
896 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.