NEW Show a badge with number of withdraw requests done on the withdraw
tab of invoice.
This commit is contained in:
parent
368b4c621f
commit
a5571b1040
@ -454,7 +454,7 @@ if ($object->id > 0)
|
||||
|
||||
|
||||
/*
|
||||
* Withdrawal request
|
||||
* Withdrawal opened requests
|
||||
*/
|
||||
|
||||
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande as date_demande";
|
||||
@ -564,6 +564,8 @@ if ($object->id > 0)
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// Closed requests
|
||||
|
||||
$sql = "SELECT pfd.rowid, pfd.traite, pfd.date_demande,";
|
||||
$sql.= " pfd.date_traite, pfd.fk_prelevement_bons, pfd.amount,";
|
||||
$sql.= " pb.ref,";
|
||||
|
||||
@ -64,8 +64,20 @@ function facture_prepare_head($object)
|
||||
//if ($fac->mode_reglement_code == 'PRE')
|
||||
if (! empty($conf->prelevement->enabled))
|
||||
{
|
||||
$nbStandingOrders=0;
|
||||
$sql = "SELECT COUNT(pfd.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql .= " WHERE pfd.fk_facture = ".$object->id;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
if ($obj) $nbStandingOrders = $obj->nb;
|
||||
}
|
||||
else dol_print_error($db);
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id;
|
||||
$head[$h][1] = $langs->trans('StandingOrders');
|
||||
if ($nbStandingOrders > 0) $head[$h][1].= ' <span class="badge">'.$nbStandingOrders.'</span>';
|
||||
$head[$h][2] = 'standingorders';
|
||||
$h++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user