new:bankline_prepare_head for bank lines
This commit is contained in:
parent
236c9bf1d2
commit
9662c4110a
@ -32,6 +32,7 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other'));
|
||||
@ -246,16 +247,7 @@ foreach ($cats as $cat) {
|
||||
$arrayselected[] = $cat->id;
|
||||
}
|
||||
|
||||
$tabs = array(
|
||||
array(
|
||||
DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$rowid,
|
||||
$langs->trans('BankTransaction')
|
||||
),
|
||||
array(
|
||||
DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$rowid,
|
||||
$langs->trans('Info')
|
||||
)
|
||||
);
|
||||
$head = bankline_prepare_head($rowid);
|
||||
|
||||
|
||||
$sql = "SELECT b.rowid,b.dateo as do,b.datev as dv, b.amount, b.label, b.rappro,";
|
||||
@ -296,7 +288,7 @@ if ($result)
|
||||
print '<input type="hidden" name="orig_account" value="'.$orig_account.'">';
|
||||
print '<input type="hidden" name="id" value="'.$acct->id.'">';
|
||||
|
||||
dol_fiche_head($tabs, 0, $langs->trans('LineRecord'), 0, 'accountline', 0);
|
||||
dol_fiche_head($head, 'bankline', $langs->trans('LineRecord'), 0, 'account', 0);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/**
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Abbes Bahfir <bafbes@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -28,15 +29,15 @@
|
||||
function payment_prepare_head(Paiement $object)
|
||||
{
|
||||
|
||||
global $langs, $conf;
|
||||
global $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Payment");
|
||||
$head[$h][2] = 'payment';
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Payment");
|
||||
$head[$h][2] = 'payment';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
@ -44,14 +45,50 @@ function payment_prepare_head(Paiement $object)
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/info.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/info.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment', 'remove');
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment', 'remove');
|
||||
|
||||
return $head;
|
||||
return $head;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array with the tabs for the "Bannkline" section
|
||||
* It loads tabs from modules looking for the entity payment
|
||||
*
|
||||
* @param Bankline $object Current payment object
|
||||
* @return array Tabs for the Bankline section
|
||||
*/
|
||||
function bankline_prepare_head($id)
|
||||
{
|
||||
|
||||
global $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$id;
|
||||
$head[$h][1] = $langs->trans('BankTransaction');
|
||||
$head[$h][2] = 'bankline';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'bankline');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'bankline', 'remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user