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'));
38 if (isset($_GET[
"account"]) || isset($_GET[
"ref"]))
40 $id = isset($_GET[
"account"]) ? $_GET[
"account"] : (isset($_GET[
"ref"]) ? $_GET[
"ref"] :
'');
42 $fieldid = isset($_GET[
"ref"]) ?
'ref' :
'rowid';
43 if ($user->socid) $socid = $user->socid;
44 $result =
restrictedArea($user,
'banque', $id,
'bank_account&bank_account',
'',
'', $fieldid);
48 if (
GETPOST(
"mode") ==
'showalltime') $mode =
'showalltime';
56 $title = $langs->trans(
"FinancialAccount").
' - '.$langs->trans(
"Graph");
60 $form =
new Form($db);
71 if ($_GET[
"account"] && !preg_match(
'/,/', $_GET[
"account"]))
73 $result = $object->fetch(
GETPOST(
"account",
"int"));
77 $result = $object->fetch(0,
GETPOST(
"ref"));
78 $account = $object->id;
81 $result =
dol_mkdir($conf->bank->dir_temp);
84 $langs->load(
"errors");
89 $sql =
"SELECT MIN(b.datev) as min, MAX(b.datev) as max";
90 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
91 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
92 $sql .=
" WHERE b.fk_account = ba.rowid";
93 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
94 if ($account && $_GET[
"option"] !=
'all') $sql .=
" AND b.fk_account IN (".$account.
")";
99 $num = $db->num_rows(
$resql);
100 $obj = $db->fetch_object(
$resql);
101 $min = $db->jdate($obj->min);
102 $max = $db->jdate($obj->max);
106 if (empty($min)) $min =
dol_now() - 3600 * 24;
108 $log =
"graph.php: min=".$min.
" max=".$max;
114 if ($mode ==
'standard')
119 $monthnext = $month + 1;
127 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
128 $sql .=
", SUM(b.amount)";
129 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
130 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
131 $sql .=
" WHERE b.fk_account = ba.rowid";
132 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
133 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
134 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
135 if ($account && $_GET[
"option"] !=
'all') $sql .=
" AND b.fk_account IN (".$account.
")";
136 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
138 $resql = $db->query($sql);
141 $num = $db->num_rows(
$resql);
145 $row = $db->fetch_row(
$resql);
146 $amounts[$row[0]] = $row[1];
157 $sql =
"SELECT 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).
"-".sprintf(
"%02s", $month).
"-01'";
163 if ($account && $_GET[
"option"] !=
'all') $sql .=
" AND b.fk_account IN (".$account.
")";
165 $resql = $db->query($sql);
168 $row = $db->fetch_row(
$resql);
181 $day =
dol_mktime(12, 0, 0, $month, 1, $year);
182 $textdate = strftime(
"%Y%m%d", $day);
183 $xyear = substr($textdate, 0, 4);
184 $xday = substr($textdate, 6, 2);
185 $xmonth = substr($textdate, 4, 2);
188 while ($xmonth == $month)
190 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
195 $datas[$i] = $solde + $subtotal;
197 $datamin[$i] = $object->min_desired;
198 $dataall[$i] = $object->min_allowed;
203 $textdate = strftime(
"%Y%m%d", $day);
204 $xyear = substr($textdate, 0, 4);
205 $xday = substr($textdate, 6, 2);
206 $xmonth = substr($textdate, 4, 2);
218 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.$month.
".png";
219 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.$month.
".png";
220 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
221 $graph_datas = array();
222 foreach ($datas as $i => $val)
224 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
225 if ($object->min_desired) array_push($graph_datas[$i], $datamin[$i]);
226 if ($object->min_allowed) array_push($graph_datas[$i], $dataall[$i]);
230 $px1->SetData($graph_datas);
231 $arraylegends = array($langs->transnoentities(
"Balance"));
232 if ($object->min_desired) array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
233 if ($object->min_allowed) array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
234 $px1->SetLegend($arraylegends);
235 $px1->SetLegendWidthMin(180);
236 $px1->SetMaxValue($px1->GetCeilMaxValue() < 0 ? 0 : $px1->GetCeilMaxValue());
237 $px1->SetMinValue($px1->GetFloorMinValue() > 0 ? 0 : $px1->GetFloorMinValue());
238 $px1->SetTitle($title);
239 $px1->SetWidth($WIDTH);
240 $px1->SetHeight($HEIGHT);
241 $px1->SetType(array(
'lines',
'lines',
'lines'));
242 $px1->setBgColor(
'onglet');
243 $px1->setBgColorGrid(array(255, 255, 255));
244 $px1->SetHorizTickIncrement(1);
245 $px1->draw($file, $fileurl);
247 $show1 = $px1->show();
260 if ($mode ==
'standard')
264 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
265 $sql .=
", SUM(b.amount)";
266 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
267 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
268 $sql .=
" WHERE b.fk_account = ba.rowid";
269 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
270 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
271 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
272 if ($account && $_GET[
"option"] !=
'all') $sql .=
" AND b.fk_account IN (".$account.
")";
273 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
275 $resql = $db->query($sql);
278 $num = $db->num_rows(
$resql);
282 $row = $db->fetch_row(
$resql);
283 $amounts[$row[0]] = $row[1];
294 $sql =
"SELECT SUM(b.amount)";
295 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
296 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
297 $sql .=
" WHERE b.fk_account = ba.rowid";
298 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
299 $sql .=
" AND b.datev < '".$db->escape($year).
"-01-01'";
300 if ($account && $_GET[
"option"] !=
'all') $sql .=
" AND b.fk_account IN (".$account.
")";
302 $resql = $db->query($sql);
305 $row = $db->fetch_row(
$resql);
321 $textdate = strftime(
"%Y%m%d", $day);
322 $xyear = substr($textdate, 0, 4);
323 $xday = substr($textdate, 6, 2);
326 while ($xyear == $year && $day <= $datetime)
328 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
333 $datas[$i] = $solde + $subtotal;
335 $datamin[$i] = $object->min_desired;
336 $dataall[$i] = $object->min_allowed;
343 $textdate = strftime(
"%Y%m%d", $day);
344 $xyear = substr($textdate, 0, 4);
345 $xday = substr($textdate, 6, 2);
350 $file = $conf->bank->dir_temp.
"/balance".$account.
"-".$year.
".png";
351 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
"-".$year.
".png";
352 $title = $langs->transnoentities(
"Balance").
' - '.$langs->transnoentities(
"Year").
': '.$year;
353 $graph_datas = array();
354 foreach ($datas as $i => $val)
356 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
357 if ($object->min_desired) array_push($graph_datas[$i], $datamin[$i]);
358 if ($object->min_allowed) array_push($graph_datas[$i], $dataall[$i]);
361 $px2->SetData($graph_datas);
362 $arraylegends = array($langs->transnoentities(
"Balance"));
363 if ($object->min_desired) array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
364 if ($object->min_allowed) array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
365 $px2->SetLegend($arraylegends);
366 $px2->SetLegendWidthMin(180);
367 $px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue());
368 $px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue());
369 $px2->SetTitle($title);
370 $px2->SetWidth($WIDTH);
371 $px2->SetHeight($HEIGHT);
372 $px2->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
373 $px2->setBgColor(
'onglet');
374 $px2->setBgColorGrid(array(255, 255, 255));
375 $px2->SetHideXGrid(
true);
377 $px2->draw($file, $fileurl);
379 $show2 = $px2->show();
392 if ($mode ==
'showalltime')
397 $sql =
"SELECT date_format(b.datev,'%Y%m%d')";
398 $sql .=
", SUM(b.amount)";
399 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
400 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
401 $sql .=
" WHERE b.fk_account = ba.rowid";
402 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
403 if ($account && $_GET[
"option"] !=
'all') $sql .=
" AND b.fk_account IN (".$account.
")";
404 $sql .=
" GROUP BY date_format(b.datev,'%Y%m%d')";
406 $resql = $db->query($sql);
409 $num = $db->num_rows(
$resql);
414 $row = $db->fetch_row(
$resql);
415 $amounts[$row[0]] = $row[1];
434 $textdate = strftime(
"%Y%m%d", $day);
437 while ($day <= ($max + 86400))
439 $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0);
441 if ($day > ($max + 86400))
445 $datas[$i] = 0 + $solde + $subtotal;
447 $datamin[$i] = $object->min_desired;
448 $dataall[$i] = $object->min_allowed;
453 $labels[$i] = substr($textdate, 0, 6);
456 $textdate = strftime(
"%Y%m%d", $day);
461 $file = $conf->bank->dir_temp.
"/balance".$account.
".png";
462 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/balance".$account.
".png";
463 $title = $langs->transnoentities(
"Balance").
" - ".$langs->transnoentities(
"AllTime");
464 $graph_datas = array();
465 foreach ($datas as $i => $val)
467 $graph_datas[$i] = array(isset($labels[$i]) ? $labels[$i] :
'', $datas[$i]);
468 if ($object->min_desired) array_push($graph_datas[$i], $datamin[$i]);
469 if ($object->min_allowed) array_push($graph_datas[$i], $dataall[$i]);
473 $px3->SetData($graph_datas);
474 $arraylegends = array($langs->transnoentities(
"Balance"));
475 if ($object->min_desired) array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalDesired"));
476 if ($object->min_allowed) array_push($arraylegends, $langs->transnoentities(
"BalanceMinimalAllowed"));
477 $px3->SetLegend($arraylegends);
478 $px3->SetLegendWidthMin(180);
479 $px3->SetMaxValue($px3->GetCeilMaxValue() < 0 ? 0 : $px3->GetCeilMaxValue());
480 $px3->SetMinValue($px3->GetFloorMinValue() > 0 ? 0 : $px3->GetFloorMinValue());
481 $px3->SetTitle($title);
482 $px3->SetWidth($WIDTH);
483 $px3->SetHeight($HEIGHT);
484 $px3->SetType(array(
'linesnopoint',
'linesnopoint',
'linesnopoint'));
485 $px3->setBgColor(
'onglet');
486 $px3->setBgColorGrid(array(255, 255, 255));
487 $px3->draw($file, $fileurl);
489 $show3 = $px3->show();
502 if ($mode ==
'standard')
508 $monthnext = $month + 1;
516 $sql =
"SELECT date_format(b.datev,'%d')";
517 $sql .=
", SUM(b.amount)";
518 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
519 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
520 $sql .=
" WHERE b.fk_account = ba.rowid";
521 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
522 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
523 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
524 $sql .=
" AND b.amount > 0";
525 if ($account && $_GET[
"option"] !=
'all') $sql .=
" AND b.fk_account IN (".$account.
")";
526 $sql .=
" GROUP BY date_format(b.datev,'%d')";
528 $resql = $db->query($sql);
531 $num = $db->num_rows(
$resql);
535 $row = $db->fetch_row(
$resql);
536 $credits[$row[0]] = $row[1];
544 $monthnext = $month + 1;
552 $sql =
"SELECT date_format(b.datev,'%d')";
553 $sql .=
", SUM(b.amount)";
554 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
555 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
556 $sql .=
" WHERE b.fk_account = ba.rowid";
557 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
558 $sql .=
" AND b.datev >= '".$db->escape($year).
"-".$db->escape($month).
"-01 00:00:00'";
559 $sql .=
" AND b.datev < '".$db->escape($yearnext).
"-".$db->escape($monthnext).
"-01 00:00:00'";
560 $sql .=
" AND b.amount < 0";
561 if ($account && $_GET[
"option"] !=
'all') $sql .=
" AND b.fk_account IN (".$account.
")";
562 $sql .=
" GROUP BY date_format(b.datev,'%d')";
564 $resql = $db->query($sql);
567 while ($row = $db->fetch_row(
$resql))
569 $debits[$row[0]] = abs($row[1]);
579 $data_credit = array();
580 $data_debit = array();
581 for ($i = 0; $i < 31; $i++)
583 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
584 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
585 $labels[$i] = sprintf(
"%02d", $i + 1);
586 $datamin[$i] = $object->min_desired;
590 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.$month.
".png";
591 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.$month.
".png";
592 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Month").
': '.$month.
' '.$langs->transnoentities(
"Year").
': '.$year;
593 $graph_datas = array();
594 foreach ($data_credit as $i => $val)
596 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
599 $px4->SetData($graph_datas);
600 $px4->SetLegend(array($langs->transnoentities(
"Credit"), $langs->transnoentities(
"Debit")));
601 $px4->SetLegendWidthMin(180);
602 $px4->SetMaxValue($px4->GetCeilMaxValue() < 0 ? 0 : $px4->GetCeilMaxValue());
603 $px4->SetMinValue($px4->GetFloorMinValue() > 0 ? 0 : $px4->GetFloorMinValue());
604 $px4->SetTitle($title);
605 $px4->SetWidth($WIDTH);
606 $px4->SetHeight($HEIGHT);
607 $px4->SetType(array(
'bars',
'bars'));
609 $px4->setBgColor(
'onglet');
610 $px4->setBgColorGrid(array(255, 255, 255));
611 $px4->SetHorizTickIncrement(1);
612 $px4->draw($file, $fileurl);
614 $show4 = $px4->show();
624 if ($mode ==
'standard')
629 $sql =
"SELECT date_format(b.datev,'%m')";
630 $sql .=
", SUM(b.amount)";
631 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
632 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
633 $sql .=
" WHERE b.fk_account = ba.rowid";
634 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
635 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
636 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
637 $sql .=
" AND b.amount > 0";
638 if ($account && $_GET[
"option"] !=
'all') $sql .=
" AND b.fk_account IN (".$account.
")";
639 $sql .=
" GROUP BY date_format(b.datev,'%m');";
641 $resql = $db->query($sql);
644 $num = $db->num_rows(
$resql);
648 $row = $db->fetch_row(
$resql);
649 $credits[$row[0]] = $row[1];
656 $sql =
"SELECT date_format(b.datev,'%m')";
657 $sql .=
", SUM(b.amount)";
658 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
659 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
660 $sql .=
" WHERE b.fk_account = ba.rowid";
661 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
662 $sql .=
" AND b.datev >= '".$db->escape($year).
"-01-01 00:00:00'";
663 $sql .=
" AND b.datev <= '".$db->escape($year).
"-12-31 23:59:59'";
664 $sql .=
" AND b.amount < 0";
665 if ($account && $_GET[
"option"] !=
'all') $sql .=
" AND b.fk_account IN (".$account.
")";
666 $sql .=
" GROUP BY date_format(b.datev,'%m')";
668 $resql = $db->query($sql);
671 while ($row = $db->fetch_row(
$resql))
673 $debits[$row[0]] = abs($row[1]);
683 $data_credit = array();
684 $data_debit = array();
685 for ($i = 0; $i < 12; $i++)
687 $data_credit[$i] = isset($credits[substr(
"0".($i + 1), -2)]) ? $credits[substr(
"0".($i + 1), -2)] : 0;
688 $data_debit[$i] = isset($debits[substr(
"0".($i + 1), -2)]) ? $debits[substr(
"0".($i + 1), -2)] : 0;
690 $datamin[$i] = $object->min_desired;
694 $file = $conf->bank->dir_temp.
"/movement".$account.
"-".$year.
".png";
695 $fileurl = DOL_URL_ROOT.
'/viewimage.php?modulepart=banque_temp&file='.
"/movement".$account.
"-".$year.
".png";
696 $title = $langs->transnoentities(
"BankMovements").
' - '.$langs->transnoentities(
"Year").
': '.$year;
697 $graph_datas = array();
698 foreach ($data_credit as $i => $val)
700 $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
703 $px5->SetData($graph_datas);
704 $px5->SetLegend(array($langs->transnoentities(
"Credit"), $langs->transnoentities(
"Debit")));
705 $px5->SetLegendWidthMin(180);
706 $px5->SetMaxValue($px5->GetCeilMaxValue() < 0 ? 0 : $px5->GetCeilMaxValue());
707 $px5->SetMinValue($px5->GetFloorMinValue() > 0 ? 0 : $px5->GetFloorMinValue());
708 $px5->SetTitle($title);
709 $px5->SetWidth($WIDTH);
710 $px5->SetHeight($HEIGHT);
711 $px5->SetType(array(
'bars',
'bars'));
713 $px5->setBgColor(
'onglet');
714 $px5->setBgColorGrid(array(255, 255, 255));
715 $px5->SetHorizTickIncrement(1);
716 $px5->draw($file, $fileurl);
718 $show5 = $px5->show();
733 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
737 if (!preg_match(
'/,/', $account))
739 $moreparam =
'&month='.$month.
'&year='.$year.($mode ==
'showalltime' ?
'&mode=showalltime' :
'');
741 if ($_GET[
"option"] !=
'all')
743 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.
'&option=all'.$moreparam.
'">'.$langs->trans(
"ShowAllAccounts").
'</a>';
744 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref',
'', $moreparam, 0,
'',
'', 1);
746 $morehtml =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.$moreparam.
'">'.$langs->trans(
"BackToAccount").
'</a>';
747 print $langs->trans(
"AllAccounts");
751 $bankaccount =
new Account($db);
752 $listid = explode(
',', $account);
753 foreach ($listid as $key => $id)
755 $bankaccount->fetch($id);
756 $bankaccount->label = $bankaccount->ref;
757 print $bankaccount->getNomUrl(1);
758 if ($key < (count($listid) - 1))
print ', ';
762 print $langs->trans(
"AllAccounts");
768 print '<table class="notopnoleftnoright" width="100%">';
771 print '<tr><td class="right">'.$morehtml.
' ';
772 if ($mode ==
'showalltime')
774 print '<a href="'.$_SERVER[
"PHP_SELF"].
'?account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
775 print $langs->trans(
"GoBack");
778 print '<a href="'.$_SERVER[
"PHP_SELF"].
'?mode=showalltime&account='.$account.(GETPOST(
"option") !=
'all' ?
'' :
'&option=all').
'">';
779 print $langs->trans(
"ShowAllTimeBalance");
782 print '<br><br></td></tr>';
788 if ($mode ==
'standard')
790 $prevyear = $year; $nextyear = $year;
791 $prevmonth = $month - 1; $nextmonth = $month + 1;
792 if ($prevmonth < 1) { $prevmonth = 12; $prevyear--; }
793 if ($nextmonth > 12) { $nextmonth = 1; $nextyear++; }
796 $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>";
797 print '<div class="right clearboth">'.$link.
'</div>';
799 print '<div class="center clearboth margintoponly">';
800 $file =
"movement".$account.
"-".$year.$month.
".png";
804 print '<div class="center clearboth margintoponly">';
809 $prevyear = $year - 1; $nextyear = $year + 1;
810 $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>";
812 print '<div class="right clearboth margintoponly">'.$link.
'</div>';
814 print '<div class="center clearboth margintoponly">';
818 print '<div class="center clearboth margintoponly">';
823 if ($mode ==
'showalltime')
825 print '<div class="center clearboth margintoponly">';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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...
bank_prepare_head(Account $object)
Prepare array with list of tabs.
dol_now($mode= 'auto')
Return date for now.
Class to manage bank accounts.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
print $_SERVER["PHP_SELF"]
Edit parameters.
img_next($titlealt= 'default', $moreatt= '')
Show next logo.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
img_previous($titlealt= 'default', $moreatt= '')
Show previous logo.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
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.
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_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)