Ajout indicateurs remise chques sur tableau de bord
This commit is contained in:
parent
93cffc9640
commit
deadf929f7
@ -64,7 +64,7 @@ print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||
|
||||
$sql = "SELECT count(b.rowid)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= " WHERE b.fk_type = 'CHQ'AND b.fk_bordereau = 0";
|
||||
$sql.= " WHERE b.fk_type = 'CHQ' AND b.fk_bordereau = 0";
|
||||
$sql.= " AND b.amount > 0";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -335,6 +335,43 @@ class RemiseCheque
|
||||
return $this->errno;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge indicateurs this->nbtodo et this->nbtodolate de tableau de bord
|
||||
* \param user Objet user
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_board($user)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||
|
||||
$this->nbtodo=$this->nbtodolate=0;
|
||||
$sql = "SELECT b.rowid,".$this->db->pdate("b.datev")." as datefin";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= " WHERE b.fk_type = 'CHQ' AND b.fk_bordereau = 0";
|
||||
$sql.= " AND b.amount > 0";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nbtodo++;
|
||||
if ($obj->datefin < (time() - $conf->bank->cheque->warning_delay)) $this->nbtodolate++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Génère le fichier PDF
|
||||
\param model Nom du modele
|
||||
|
||||
@ -465,7 +465,7 @@ if ($conf->global->MAIN_SHOW_WORKBOARD == 1)
|
||||
$board->load_board($user);
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("MenuChequeDeposits"),"payment").'</td><td>'.$langs->trans("MenuChequeDeposits").'</td>';
|
||||
print '<tr '.$bc[$var].'><td width="16">'.img_object($langs->trans("BankChecksToReceipt"),"payment").'</td><td>'.$langs->trans("BankChecksToReceipt").'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=accountancy">'.$board->nbtodo.'</a></td>';
|
||||
print '<td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=accountancy">';
|
||||
|
||||
@ -1098,7 +1098,7 @@ class Societe
|
||||
* \param option Sur quoi pointe le lien
|
||||
* \return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='')
|
||||
function getNomUrl($withpicto=0,$option='',$maxlen=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -1127,7 +1127,7 @@ class Societe
|
||||
}
|
||||
|
||||
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany"),'company').$lienfin.' ');
|
||||
$result.=$lien.$this->nom.$lienfin;
|
||||
$result.=$lien.($maxlen?dolibarr_trunc($this->nom,$maxlen):$this->nom).$lienfin;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user