Skip to content
Snippets Groups Projects
Commit a5571b10 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

NEW Show a badge with number of withdraw requests done on the withdraw

tab of invoice.
parent 368b4c62
No related branches found
No related tags found
No related merge requests found
......@@ -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++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment