26 require
'../../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
32 $langs->loadLangs(array(
'banks',
'categories'));
41 $fieldid =
GETPOST(
'ref') ?
'ref' :
'rowid';
43 $socid = $user->socid;
45 $result =
restrictedArea($user,
'banque', $id,
'bank_account&bank_account',
'',
'', $fieldid);
49 if (
GETPOST(
"mode") ==
'showalltime') {
50 $mode =
'showalltime';
59 $title = $langs->trans(
"FinancialAccount").
' - '.$langs->trans(
"Graph");
70 $year = sprintf(
"%04d",
GETPOST(
"year",
'int'));
73 $month = sprintf(
"%02d",
GETPOST(
"month",
'int'));
78 if (
GETPOST(
'account') && !preg_match(
'/,/',
GETPOST(
'account'))) {
79 $result = $object->fetch(
GETPOST(
'account',
'int'));
82 $result = $object->fetch(0,
GETPOST(
"ref"));
83 $account = $object->id;
86 $result =
dol_mkdir($conf->bank->dir_temp);
88 $langs->load(
"errors");
93 $sql =
"SELECT MIN(b.datev) as min, MAX(b.datev) as max";
94 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
95 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
96 $sql .=
" WHERE b.fk_account = ba.rowid";
97 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
98 if ($account &&
GETPOST(
"option") !=
'all') {
99 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
102 $resql = $db->query($sql);
104 $num = $db->num_rows(
$resql);
105 $obj = $db->fetch_object(
$resql);
106 $min = $db->jdate($obj->min);
107 $max = $db->jdate($obj->max);
115 $log =
"graph.php: min=".$min.
" max=".$max;
121 if ($mode ==
'standard') {
125 $monthnext = $month + 1;
127 if ($monthnext > 12) {
132 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
133 $sql .=
", SUM(b.amount)";
134 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
135 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
136 $sql .=
" WHERE b.fk_account = ba.rowid";
137 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
138 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
139 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
140 if ($account &&
GETPOST(
"option") !=
'all') {
141 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
143 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
145 $resql = $db->query($sql);
147 $num = $db->num_rows(
$resql);
150 $row = $db->fetch_row(
$resql);
151 $amounts[$row[0]] = $row[1];
162 $sql =
"SELECT SUM(b.amount)";
163 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
164 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
165 $sql .=
" WHERE b.fk_account = ba.rowid";
166 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
167 $sql .=
" AND b.datev < '".$db->escape($year).
"-".sprintf(
"%02s", $month).
"-01'";
168 if ($account &&
GETPOST(
"option") !=
'all') {
169 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
172 $resql = $db->query($sql);
174 $row = $db->fetch_row(
$resql);
187 $day =
dol_mktime(12, 0, 0, $month, 1, $year);
188 $textdate = strftime(
"%Y%m%d", $day);
189 $xyear = substr($textdate, 0, 4);
190 $xday = substr($textdate, 6, 2);
191 $xmonth = substr($textdate, 4, 2);
194 while ($xmonth == $month) {
195 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
199 $datas[$i] = $solde + $subtotal;
201 $datamin[$i] = $object->min_desired;
202 $dataall[$i] = $object->min_allowed;
207 $textdate = strftime(
"%Y%m%d", $day);
208 $xyear = substr($textdate, 0, 4);
209 $xday = substr($textdate, 6, 2);
210 $xmonth = substr($textdate, 4, 2);
222 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.$month.
".png";
223 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.$month.
".png";
224 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
225 $graph_datas = array();
226 foreach ($datas as $i => $val) {
227 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
228 if ($object->min_desired) {
229 array_push($graph_datas[$i], $datamin[$i]);
231 if ($object->min_allowed) {
232 array_push($graph_datas[$i], $dataall[$i]);
237 $px1->SetData($graph_datas);
238 $arraylegends = array($langs->transnoentities(
"Balance"));
239 if ($object->min_desired) {
240 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
242 if ($object->min_allowed) {
243 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
245 $px1->SetLegend($arraylegends);
246 $px1->SetLegendWidthMin(180);
247 $px1->SetMaxValue($px1->GetCeilMaxValue() < 0 ? 0 : $px1->GetCeilMaxValue());
248 $px1->SetMinValue($px1->GetFloorMinValue() > 0 ? 0 : $px1->GetFloorMinValue());
249 $px1->SetTitle($title);
250 $px1->SetWidth($WIDTH);
251 $px1->SetHeight($HEIGHT);
252 $px1->SetType(array(
'lines',
'lines',
'lines'));
253 $px1->setBgColor(
'onglet');
254 $px1->setBgColorGrid(array(255, 255, 255));
255 $px1->SetHorizTickIncrement(1);
256 $px1->draw($file, $fileurl);
258 $show1 = $px1->show();
271 if ($mode ==
'standard') {
274 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
275 $sql .=
", SUM(b.amount)";
276 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
277 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
278 $sql .=
" WHERE b.fk_account = ba.rowid";
279 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
280 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
281 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
282 if ($account &&
GETPOST(
"option") !=
'all') {
283 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
285 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
287 $resql = $db->query($sql);
289 $num = $db->num_rows(
$resql);
292 $row = $db->fetch_row(
$resql);
293 $amounts[$row[0]] = $row[1];
304 $sql =
"SELECT SUM(b.amount)";
305 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
306 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
307 $sql .=
" WHERE b.fk_account = ba.rowid";
308 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
309 $sql .=
" AND b.datev < '".$db->escape($year).
"-01-01'";
310 if ($account &&
GETPOST(
"option") !=
'all') {
311 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
314 $resql = $db->query($sql);
316 $row = $db->fetch_row(
$resql);
332 $textdate = strftime(
"%Y%m%d", $day);
333 $xyear = substr($textdate, 0, 4);
334 $xday = substr($textdate, 6, 2);
337 while ($xyear == $year && $day <= $datetime) {
338 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
342 $datas[$i] = $solde + $subtotal;
344 $datamin[$i] = $object->min_desired;
345 $dataall[$i] = $object->min_allowed;
352 $textdate = strftime(
"%Y%m%d", $day);
353 $xyear = substr($textdate, 0, 4);
354 $xday = substr($textdate, 6, 2);
359 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.
".png";
360 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.
".png";
361 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Year").
': '.$year;
362 $graph_datas = array();
363 foreach ($datas as $i => $val) {
364 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
365 if ($object->min_desired) {
366 array_push($graph_datas[$i], $datamin[$i]);
368 if ($object->min_allowed) {
369 array_push($graph_datas[$i], $dataall[$i]);
373 $px2->SetData($graph_datas);
374 $arraylegends = array($langs->transnoentities(
"Balance"));
375 if ($object->min_desired) {
376 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
378 if ($object->min_allowed) {
379 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
381 $px2->SetLegend($arraylegends);
382 $px2->SetLegendWidthMin(180);
383 $px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue());
384 $px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue());
385 $px2->SetTitle($title);
386 $px2->SetWidth($WIDTH);
387 $px2->SetHeight($HEIGHT);
388 $px2->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
389 $px2->setBgColor(
'onglet');
390 $px2->setBgColorGrid(array(255, 255, 255));
391 $px2->SetHideXGrid(
true);
393 $px2->draw($file, $fileurl);
395 $show2 = $px2->show();
408 if ($mode ==
'showalltime') {
412 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
413 $sql .=
", SUM(b.amount)";
414 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
415 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
416 $sql .=
" WHERE b.fk_account = ba.rowid";
417 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
418 if ($account &&
GETPOST(
"option") !=
'all') {
419 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
421 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
423 $resql = $db->query($sql);
425 $num = $db->num_rows(
$resql);
429 $row = $db->fetch_row(
$resql);
430 $amounts[$row[0]] = $row[1];
449 $textdate = strftime(
"%Y%m%d", $day);
452 while ($day <= ($max + 86400)) {
453 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
455 if ($day > ($max + 86400)) {
458 $datas[$i] = 0 + $solde + $subtotal;
460 $datamin[$i] = $object->min_desired;
461 $dataall[$i] = $object->min_allowed;
466 $labels[$i] = substr($textdate, 0, 6);
469 $textdate = strftime(
"%Y%m%d", $day);
474 $file = $conf->bank->dir_temp.
"/balance".$account.
".png";
475 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
".png";
476 $title = $langs->transnoentities(
"Balance").
" - ".$langs->transnoentities(
"AllTime");
477 $graph_datas = array();
478 foreach ($datas as $i => $val) {
479 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
480 if ($object->min_desired) {
481 array_push($graph_datas[$i], $datamin[$i]);
483 if ($object->min_allowed) {
484 array_push($graph_datas[$i], $dataall[$i]);
489 $px3->SetData($graph_datas);
490 $arraylegends = array($langs->transnoentities(
"Balance"));
491 if ($object->min_desired) {
492 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
494 if ($object->min_allowed) {
495 array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
497 $px3->SetLegend($arraylegends);
498 $px3->SetLegendWidthMin(180);
499 $px3->SetMaxValue($px3->GetCeilMaxValue() < 0 ? 0 : $px3->GetCeilMaxValue());
500 $px3->SetMinValue($px3->GetFloorMinValue() > 0 ? 0 : $px3->GetFloorMinValue());
501 $px3->SetTitle($title);
502 $px3->SetWidth($WIDTH);
503 $px3->SetHeight($HEIGHT);
504 $px3->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
505 $px3->setBgColor(
'onglet');
506 $px3->setBgColorGrid(array(255, 255, 255));
507 $px3->draw($file, $fileurl);
509 $show3 = $px3->show();
522 if ($mode ==
'standard') {
527 $monthnext = $month + 1;
529 if ($monthnext > 12) {
534 $sql =
"SELECT date_format(b.datev,'%d')";
535 $sql .=
", SUM(b.amount)";
536 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
537 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
538 $sql .=
" WHERE b.fk_account = ba.rowid";
539 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
540 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
541 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
542 $sql .=
" AND b.amount > 0";
543 if ($account &&
GETPOST(
"option") !=
'all') {
544 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
546 $sql .=
" GROUP BY date_format(b.datev,'%d')";
548 $resql = $db->query($sql);
550 $num = $db->num_rows(
$resql);
553 $row = $db->fetch_row(
$resql);
554 $credits[$row[0]] = $row[1];
562 $monthnext = $month + 1;
564 if ($monthnext > 12) {
569 $sql =
"SELECT date_format(b.datev,'%d')";
570 $sql .=
", SUM(b.amount)";
571 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
572 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
573 $sql .=
" WHERE b.fk_account = ba.rowid";
574 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
575 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
576 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
577 $sql .=
" AND b.amount < 0";
578 if ($account &&
GETPOST(
"option") !=
'all') {
579 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
581 $sql .=
" GROUP BY date_format(b.datev,'%d')";
583 $resql = $db->query($sql);
585 while ($row = $db->fetch_row(
$resql)) {
586 $debits[$row[0]] = abs($row[1]);
596 $data_credit = array();
597 $data_debit = array();
598 for ($i = 0; $i < 31; $i++) {
599 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
600 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
601 $labels[$i] = sprintf(
"%02d", $i + 1);
602 $datamin[$i] = $object->min_desired;
606 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.$month.
".png";
607 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.$month.
".png";
608 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
609 $graph_datas = array();
610 foreach ($data_credit as $i => $val) {
611 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
614 $px4->SetData($graph_datas);
615 $px4->SetLegend(array($langs->transnoentities(
"Credit"), $langs->transnoentities(
"Debit")));
616 $px4->SetLegendWidthMin(180);
617 $px4->SetMaxValue($px4->GetCeilMaxValue() < 0 ? 0 : $px4->GetCeilMaxValue());
618 $px4->SetMinValue($px4->GetFloorMinValue() > 0 ? 0 : $px4->GetFloorMinValue());
619 $px4->SetTitle($title);
620 $px4->SetWidth($WIDTH);
621 $px4->SetHeight($HEIGHT);
622 $px4->SetType(array(
'bars',
'bars'));
624 $px4->setBgColor(
'onglet');
625 $px4->setBgColorGrid(array(255, 255, 255));
626 $px4->SetHorizTickIncrement(1);
627 $px4->draw($file, $fileurl);
629 $show4 = $px4->show();
639 if ($mode ==
'standard') {
643 $sql =
"SELECT date_format(b.datev,'%m')";
644 $sql .=
", SUM(b.amount)";
645 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
646 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
647 $sql .=
" WHERE b.fk_account = ba.rowid";
648 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
649 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
650 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
651 $sql .=
" AND b.amount > 0";
652 if ($account &&
GETPOST(
"option") !=
'all') {
653 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
655 $sql .=
" GROUP BY date_format(b.datev,'%m');";
657 $resql = $db->query($sql);
659 $num = $db->num_rows(
$resql);
662 $row = $db->fetch_row(
$resql);
663 $credits[$row[0]] = $row[1];
670 $sql =
"SELECT date_format(b.datev,'%m')";
671 $sql .=
", SUM(b.amount)";
672 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
673 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
674 $sql .=
" WHERE b.fk_account = ba.rowid";
675 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
676 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
677 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
678 $sql .=
" AND b.amount < 0";
679 if ($account &&
GETPOST(
"option") !=
'all') {
680 $sql .=
" AND b.fk_account IN (".$db->sanitize($account).
")";
682 $sql .=
" GROUP BY date_format(b.datev,'%m')";
684 $resql = $db->query($sql);
686 while ($row = $db->fetch_row(
$resql)) {
687 $debits[$row[0]] = abs($row[1]);
697 $data_credit = array();
698 $data_debit = array();
699 for ($i = 0; $i < 12; $i++) {
700 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
701 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
703 $datamin[$i] = $object->min_desired;
707 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.
".png";
708 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.
".png";
709 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Year").
': '.$year;
710 $graph_datas = array();
711 foreach ($data_credit as $i => $val) {
712 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
715 $px5->SetData($graph_datas);
716 $px5->SetLegend(array($langs->transnoentities(
"Credit"), $langs->transnoentities(
"Debit")));
717 $px5->SetLegendWidthMin(180);
718 $px5->SetMaxValue($px5->GetCeilMaxValue() < 0 ? 0 : $px5->GetCeilMaxValue());
719 $px5->SetMinValue($px5->GetFloorMinValue() > 0 ? 0 : $px5->GetFloorMinValue());
720 $px5->SetTitle($title);
721 $px5->SetWidth($WIDTH);
722 $px5->SetHeight($HEIGHT);
723 $px5->SetType(array(
'bars',
'bars'));
725 $px5->setBgColor(
'onglet');
726 $px5->setBgColorGrid(array(255, 255, 255));
727 $px5->SetHorizTickIncrement(1);
728 $px5->draw($file, $fileurl);
730 $show5 = $px5->show();
742 print
dol_get_fiche_head($head,
'graph', $langs->trans(
"FinancialAccount"), 0,
'account');
745 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
748 if (!preg_match(
'/,/', $account)) {
749 $moreparam =
'&month='.$month.
'&year='.$year.($mode ==
'showalltime' ?
'&mode=showalltime' :
'');
751 if (
GETPOST(
"option") !=
'all') {
752 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.
'&option=all'.$moreparam.
'">'.$langs->trans(
"ShowAllAccounts").
'</a>';
753 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref',
'', $moreparam, 0,
'',
'', 1);
755 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.$moreparam.
'">'.$langs->trans(
"BackToAccount").
'</a>';
756 print $langs->trans(
"AllAccounts");
760 $bankaccount =
new Account($db);
761 $listid = explode(
',', $account);
762 foreach ($listid as $key => $id) {
763 $bankaccount->fetch($id);
764 $bankaccount->label = $bankaccount->ref;
765 print $bankaccount->getNomUrl(1);
766 if ($key < (count($listid) - 1)) {
772 print $langs->trans(
"AllAccounts");
778 print
'<table class="notopnoleftnoright" width="100%">';
781 print
'<tr><td class="right">'.$morehtml.
' ';
782 if ($mode ==
'showalltime') {
783 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
784 print $langs->trans(
"GoBack");
787 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?mode=showalltime&account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
788 print $langs->trans(
"ShowAllTimeBalance");
791 print
'<br><br></td></tr>';
797 if ($mode ==
'standard') {
800 $prevmonth = $month - 1;
801 $nextmonth = $month + 1;
802 if ($prevmonth < 1) {
806 if ($nextmonth > 12) {
812 $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>";
813 print
'<div class="right clearboth">'.$link.
'</div>';
815 print
'<div class="center clearboth margintoponly">';
816 $file =
"movement".$account.
"-".$year.$month.
".png";
820 print
'<div class="center clearboth margintoponly">';
825 $prevyear = $year - 1;
826 $nextyear = $year + 1;
827 $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>";
829 print
'<div class="right clearboth margintoponly">'.$link.
'</div>';
831 print
'<div class="center clearboth margintoponly">';
835 print
'<div class="center clearboth margintoponly">';
840 if ($mode ==
'showalltime') {
841 print
'<div class="center clearboth margintoponly">';