2
0
forked from Wavyzz/dolibarr

New regroup report bank tabs

This commit is contained in:
Hystepik
2024-12-09 11:41:18 +01:00
parent 8ca831ff88
commit a24f5d4f55
3 changed files with 34 additions and 7 deletions

View File

@@ -185,6 +185,8 @@ if (!empty($id)) {
print dol_get_fiche_end(); print dol_get_fiche_end();
$head = bank_report_prepare_head($object);
print dol_get_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), 0);
// Affiche tableau // Affiche tableau
print load_fiche_titre('', $link, ''); print load_fiche_titre('', $link, '');
@@ -487,6 +489,7 @@ if ($result < 0) {
print "\n</div><br>\n"; print "\n</div><br>\n";
print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@@ -772,7 +772,7 @@ if ($result < 0) {
// Onglets // Onglets
$head = bank_prepare_head($object); $head = bank_prepare_head($object);
print dol_get_fiche_head($head, 'graph', $langs->trans("FinancialAccount"), 0, 'account'); print dol_get_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), 0, 'account');
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
@@ -807,6 +807,8 @@ if ($account) {
print dol_get_fiche_end(); print dol_get_fiche_end();
$head = bank_report_prepare_head($object);
print dol_get_fiche_head($head, 'graph', $langs->trans("FinancialAccount"), 0);
print '<table class="notopnoleftnoright" width="100%">'; print '<table class="notopnoleftnoright" width="100%">';
@@ -882,6 +884,7 @@ if ($mode == 'showalltime') {
print '</div>'; print '</div>';
} }
print dol_get_fiche_end();
// End of page // End of page
llxFooter(); llxFooter();

View File

@@ -133,15 +133,10 @@ function bank_prepare_head(Account $object)
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/annuel.php?account=".$object->id; $head[$h][0] = DOL_URL_ROOT."/compta/bank/annuel.php?account=".$object->id;
$head[$h][1] = $langs->trans("IOMonthlyReporting"); $head[$h][1] = $langs->trans("Report");
$head[$h][2] = 'annual'; $head[$h][2] = 'annual';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/graph.php?account=".$object->id;
$head[$h][1] = $langs->trans("Graph");
$head[$h][2] = 'graph';
$h++;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/treso.php?account=".$object->id; $head[$h][0] = DOL_URL_ROOT."/compta/bank/treso.php?account=".$object->id;
$head[$h][1] = $langs->trans("PlannedTransactions"); $head[$h][1] = $langs->trans("PlannedTransactions");
$head[$h][2] = 'cash'; $head[$h][2] = 'cash';
@@ -162,6 +157,32 @@ function bank_prepare_head(Account $object)
return $head; return $head;
} }
/**
* Prepare array with list of tabs for bank report
*
* @param Account $object Object related to tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function bank_report_prepare_head(Account $object)
{
global $db, $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/compta/bank/annuel.php?account=".$object->id;
$head[$h][1] = $langs->trans("IOMonthlyReporting");
$head[$h][2] = 'annual';
$h++;
$head[$h][0] = DOL_URL_ROOT."/compta/bank/graph.php?account=".$object->id;
$head[$h][1] = $langs->trans("Graph");
$head[$h][2] = 'graph';
$h++;
return $head;
}
/** /**
* Prepare array with list of tabs * Prepare array with list of tabs
* *