display count extrafields in invoice admin
This commit is contained in:
parent
60cf6437e0
commit
a9031505f1
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2017 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2017 Charlie Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2017 ATM-CONSULTING <contact@atm-consulting.fr>
|
* Copyright (C) 2017 ATM-CONSULTING <contact@atm-consulting.fr>
|
||||||
*
|
*
|
||||||
@ -137,7 +137,13 @@ function facture_prepare_head($object)
|
|||||||
*/
|
*/
|
||||||
function invoice_admin_prepare_head()
|
function invoice_admin_prepare_head()
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user, $db;
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$extrafields->fetch_name_optionals_label('facture');
|
||||||
|
$extrafields->fetch_name_optionals_label('facturedet');
|
||||||
|
$extrafields->fetch_name_optionals_label('facture_rec');
|
||||||
|
$extrafields->fetch_name_optionals_label('facturedet_rec');
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
@ -160,25 +166,41 @@ function invoice_admin_prepare_head()
|
|||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices");
|
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices");
|
||||||
|
$nbExtrafields = $extrafields->attributes['facture']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributes';
|
$head[$h][2] = 'attributes';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||||
|
$nbExtrafields = $extrafields->attributes['facturedet']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributeslines';
|
$head[$h][2] = 'attributeslines';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec");
|
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec");
|
||||||
|
$nbExtrafields = $extrafields->attributes['facture_rec']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributesrec';
|
$head[$h][2] = 'attributesrec';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsLinesRec");
|
$head[$h][1] = $langs->trans("ExtraFieldsLinesRec");
|
||||||
|
$nbExtrafields = $extrafields->attributes['facturedet_rec']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributeslinesrec';
|
$head[$h][2] = 'attributeslinesrec';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ($conf->global->INVOICE_USE_SITUATION) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable
|
if (!empty($conf->global->INVOICE_USE_SITUATION)) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
|
$head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
|
||||||
$head[$h][1] = $langs->trans("InvoiceSituation");
|
$head[$h][1] = $langs->trans("InvoiceSituation");
|
||||||
$head[$h][2] = 'situation';
|
$head[$h][2] = 'situation';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user