Fix links
This commit is contained in:
parent
9079d2890c
commit
ccb5344d32
@ -97,267 +97,6 @@ class box_activity extends ModeleBoxes
|
|||||||
|
|
||||||
$cumuldata = array();
|
$cumuldata = array();
|
||||||
|
|
||||||
// list the summary of the bills
|
|
||||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|
||||||
{
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|
||||||
$facturestatic=new Facture($db);
|
|
||||||
|
|
||||||
// part 1
|
|
||||||
$cachedir = DOL_DATA_ROOT.'/facture/temp';
|
|
||||||
$filename = '/boxactivity-invoice'.$fileid;
|
|
||||||
|
|
||||||
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
|
|
||||||
$data = array();
|
|
||||||
if ($refresh)
|
|
||||||
{
|
|
||||||
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
|
|
||||||
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
|
||||||
$sql.= ")";
|
|
||||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
|
||||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
|
||||||
$sql.= " AND f.fk_soc = s.rowid";
|
|
||||||
$sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1";
|
|
||||||
$sql.= " GROUP BY f.fk_statut";
|
|
||||||
$sql.= " ORDER BY f.fk_statut DESC";
|
|
||||||
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if ($result) {
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$j=0;
|
|
||||||
while ($j < $num) {
|
|
||||||
$data[$j]=$db->fetch_object($result);
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
|
||||||
dol_filecache($cachedir, $filename, $data);
|
|
||||||
}
|
|
||||||
$db->free($result);
|
|
||||||
} else {
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$data = dol_readcachefile($cachedir, $filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
$cumuldata=array_merge($cumuldata, $data);
|
|
||||||
if (! empty($data)) {
|
|
||||||
$j=0;
|
|
||||||
while ($line < count($cumuldata)) {
|
|
||||||
$billurl="viewstatut=2&paye=1&year=".$data[$j]->annee;
|
|
||||||
$this->info_box_contents[$line][0] = array(
|
|
||||||
'td' => 'align="left" width="16"',
|
|
||||||
'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
|
|
||||||
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
|
||||||
'logo' => 'bill',
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->info_box_contents[$line][1] = array(
|
|
||||||
'td' => '',
|
|
||||||
'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee,
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->info_box_contents[$line][2] = array(
|
|
||||||
'td' => 'class="right"',
|
|
||||||
'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
|
|
||||||
'text' => $data[$j]->nb,
|
|
||||||
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->info_box_contents[$line][3] = array(
|
|
||||||
'td' => 'class="right"',
|
|
||||||
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency)
|
|
||||||
);
|
|
||||||
|
|
||||||
// We add only for the current year
|
|
||||||
if ($data[$j]->annee == date("Y")) {
|
|
||||||
$totalnb += $data[$j]->nb;
|
|
||||||
$totalMnt += $data[$j]->Mnttot;
|
|
||||||
}
|
|
||||||
$this->info_box_contents[$line][4] = array(
|
|
||||||
'td' => 'align="right" width="18"',
|
|
||||||
'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3),
|
|
||||||
);
|
|
||||||
$line++;
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
if (count($data)==0)
|
|
||||||
$this->info_box_contents[$line][0] = array(
|
|
||||||
'td' => 'align="center"',
|
|
||||||
'text'=>$langs->trans("NoRecordedInvoices"),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// part 2
|
|
||||||
$cachedir = DOL_DATA_ROOT.'/facture/temp';
|
|
||||||
$filename = '/boxactivity-invoice2'.$fileid;
|
|
||||||
|
|
||||||
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
|
|
||||||
|
|
||||||
if ($refresh) {
|
|
||||||
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
|
||||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
|
||||||
$sql.= " AND f.fk_soc = s.rowid";
|
|
||||||
$sql.= " AND paye=0";
|
|
||||||
$sql.= " GROUP BY f.fk_statut";
|
|
||||||
$sql.= " ORDER BY f.fk_statut DESC";
|
|
||||||
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if ($result) {
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$j=0;
|
|
||||||
while ($j < $num) {
|
|
||||||
$data[$j]=$db->fetch_object($result);
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
|
||||||
dol_filecache($cachedir, $filename, $data);
|
|
||||||
}
|
|
||||||
$db->free($result);
|
|
||||||
} else {
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$data = dol_readcachefile($cachedir, $filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
$cumuldata=array_merge($cumuldata, $data);
|
|
||||||
if (! empty($data)) {
|
|
||||||
$j=0;
|
|
||||||
|
|
||||||
while ($line < count($cumuldata)) {
|
|
||||||
$billurl="viewstatut=".$data[$j]->fk_statut."&paye=0";
|
|
||||||
$this->info_box_contents[$line][0] = array(
|
|
||||||
'td' => 'align="left" width="16"',
|
|
||||||
'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
|
|
||||||
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
|
||||||
'logo' => 'bill',
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->info_box_contents[$line][1] = array(
|
|
||||||
'td' => '',
|
|
||||||
'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->info_box_contents[$line][2] = array(
|
|
||||||
'td' => 'class="right"',
|
|
||||||
'text' => $data[$j]->nb,
|
|
||||||
'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
|
|
||||||
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
|
||||||
);
|
|
||||||
$totalnb += $data[$j]->nb;
|
|
||||||
$this->info_box_contents[$line][3] = array(
|
|
||||||
'td' => 'class="right"',
|
|
||||||
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
|
|
||||||
);
|
|
||||||
$totalMnt += $objp->Mnttot;
|
|
||||||
$this->info_box_contents[$line][4] = array(
|
|
||||||
'td' => 'align="right" width="18"',
|
|
||||||
'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3),
|
|
||||||
);
|
|
||||||
$line++;
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
if ($num==0)
|
|
||||||
$this->info_box_contents[$line][0] = array(
|
|
||||||
'td' => 'align="center"',
|
|
||||||
'text'=>$langs->trans("NoRecordedInvoices"),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$this->info_box_contents[0][0] = array(
|
|
||||||
'td' => '',
|
|
||||||
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// list the summary of the orders
|
|
||||||
if (! empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
|
||||||
$commandestatic=new Commande($db);
|
|
||||||
|
|
||||||
$cachedir = DOL_DATA_ROOT.'/commande/temp';
|
|
||||||
$filename = '/boxactivity-order'.$fileid;
|
|
||||||
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
|
|
||||||
$data = array();
|
|
||||||
|
|
||||||
if ($refresh) {
|
|
||||||
|
|
||||||
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
|
|
||||||
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
|
||||||
$sql.= ")";
|
|
||||||
$sql.= " WHERE c.entity = ".$conf->entity;
|
|
||||||
$sql.= " AND c.fk_soc = s.rowid";
|
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
|
||||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
|
||||||
$sql.= " AND c.date_commande >= '".$db->idate($tmpdate)."'";
|
|
||||||
$sql.= " AND c.facture=0";
|
|
||||||
$sql.= " GROUP BY c.fk_statut";
|
|
||||||
$sql.= " ORDER BY c.fk_statut DESC";
|
|
||||||
|
|
||||||
$result = $db->query($sql);
|
|
||||||
|
|
||||||
if ($result) {
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$j=0;
|
|
||||||
while ($j < $num) {
|
|
||||||
$data[$j]=$db->fetch_object($result);
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
|
||||||
dol_filecache($cachedir, $filename, $data);
|
|
||||||
}
|
|
||||||
$db->free($result);
|
|
||||||
} else {
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$data = dol_readcachefile($cachedir, $filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
$cumuldata=array_merge($cumuldata, $data);
|
|
||||||
if (! empty($data)) {
|
|
||||||
$j=0;
|
|
||||||
while ($line < count($cumuldata)) {
|
|
||||||
$this->info_box_contents[$line][0] = array(
|
|
||||||
'td' => 'align="left" width="16"',
|
|
||||||
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$data[$j]->fk_statut,
|
|
||||||
'tooltip' => $langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
|
|
||||||
'logo' => 'object_order',
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->info_box_contents[$line][1] = array(
|
|
||||||
'td' => '',
|
|
||||||
'text' =>$langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->info_box_contents[$line][2] = array(
|
|
||||||
'td' => 'class="right"',
|
|
||||||
'text' => $data[$j]->nb,
|
|
||||||
'tooltip' => $langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
|
|
||||||
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$data[$j]->fk_statut,
|
|
||||||
);
|
|
||||||
$totalnb += $data[$j]->nb;
|
|
||||||
|
|
||||||
$this->info_box_contents[$line][3] = array(
|
|
||||||
'td' => 'class="right"',
|
|
||||||
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
|
|
||||||
);
|
|
||||||
$totalMnt += $data[$j]->Mnttot;
|
|
||||||
$this->info_box_contents[$line][4] = array(
|
|
||||||
'td' => 'align="right" width="18"',
|
|
||||||
'text' => $commandestatic->LibStatut($data[$j]->fk_statut,0,3),
|
|
||||||
);
|
|
||||||
|
|
||||||
$line++;
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// list the summary of the propals
|
// list the summary of the propals
|
||||||
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||||
@ -449,6 +188,267 @@ class box_activity extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// list the summary of the orders
|
||||||
|
if (! empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||||
|
$commandestatic=new Commande($db);
|
||||||
|
|
||||||
|
$cachedir = DOL_DATA_ROOT.'/commande/temp';
|
||||||
|
$filename = '/boxactivity-order'.$fileid;
|
||||||
|
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
|
||||||
|
$data = array();
|
||||||
|
|
||||||
|
if ($refresh) {
|
||||||
|
|
||||||
|
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
|
||||||
|
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
||||||
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql.= ")";
|
||||||
|
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||||
|
$sql.= " AND c.fk_soc = s.rowid";
|
||||||
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||||
|
$sql.= " AND c.date_commande >= '".$db->idate($tmpdate)."'";
|
||||||
|
$sql.= " GROUP BY c.fk_statut";
|
||||||
|
$sql.= " ORDER BY c.fk_statut DESC";
|
||||||
|
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if ($result) {
|
||||||
|
$num = $db->num_rows($result);
|
||||||
|
$j=0;
|
||||||
|
while ($j < $num) {
|
||||||
|
$data[$j]=$db->fetch_object($result);
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
||||||
|
dol_filecache($cachedir, $filename, $data);
|
||||||
|
}
|
||||||
|
$db->free($result);
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$data = dol_readcachefile($cachedir, $filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
$cumuldata=array_merge($cumuldata, $data);
|
||||||
|
if (! empty($data)) {
|
||||||
|
$j=0;
|
||||||
|
while ($line < count($cumuldata)) {
|
||||||
|
$this->info_box_contents[$line][0] = array(
|
||||||
|
'td' => 'align="left" width="16"',
|
||||||
|
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$data[$j]->fk_statut,
|
||||||
|
'tooltip' => $langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
|
||||||
|
'logo' => 'object_order',
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->info_box_contents[$line][1] = array(
|
||||||
|
'td' => '',
|
||||||
|
'text' =>$langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->info_box_contents[$line][2] = array(
|
||||||
|
'td' => 'class="right"',
|
||||||
|
'text' => $data[$j]->nb,
|
||||||
|
'tooltip' => $langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
|
||||||
|
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$data[$j]->fk_statut,
|
||||||
|
);
|
||||||
|
$totalnb += $data[$j]->nb;
|
||||||
|
|
||||||
|
$this->info_box_contents[$line][3] = array(
|
||||||
|
'td' => 'class="right"',
|
||||||
|
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
|
||||||
|
);
|
||||||
|
$totalMnt += $data[$j]->Mnttot;
|
||||||
|
$this->info_box_contents[$line][4] = array(
|
||||||
|
'td' => 'align="right" width="18"',
|
||||||
|
'text' => $commandestatic->LibStatut($data[$j]->fk_statut,0,3),
|
||||||
|
);
|
||||||
|
|
||||||
|
$line++;
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// list the summary of the bills
|
||||||
|
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
$facturestatic=new Facture($db);
|
||||||
|
|
||||||
|
// part 1
|
||||||
|
$cachedir = DOL_DATA_ROOT.'/facture/temp';
|
||||||
|
$filename = '/boxactivity-invoice'.$fileid;
|
||||||
|
|
||||||
|
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
|
||||||
|
$data = array();
|
||||||
|
if ($refresh)
|
||||||
|
{
|
||||||
|
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
|
||||||
|
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||||
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql.= ")";
|
||||||
|
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||||
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||||
|
$sql.= " AND f.fk_soc = s.rowid";
|
||||||
|
$sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1";
|
||||||
|
$sql.= " GROUP BY f.fk_statut";
|
||||||
|
$sql.= " ORDER BY f.fk_statut DESC";
|
||||||
|
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if ($result) {
|
||||||
|
$num = $db->num_rows($result);
|
||||||
|
$j=0;
|
||||||
|
while ($j < $num) {
|
||||||
|
$data[$j]=$db->fetch_object($result);
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
||||||
|
dol_filecache($cachedir, $filename, $data);
|
||||||
|
}
|
||||||
|
$db->free($result);
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$data = dol_readcachefile($cachedir, $filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
$cumuldata=array_merge($cumuldata, $data);
|
||||||
|
if (! empty($data)) {
|
||||||
|
$j=0;
|
||||||
|
while ($line < count($cumuldata)) {
|
||||||
|
$billurl="search_status=2&paye=1&year=".$data[$j]->annee;
|
||||||
|
$this->info_box_contents[$line][0] = array(
|
||||||
|
'td' => 'align="left" width="16"',
|
||||||
|
'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
|
||||||
|
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
||||||
|
'logo' => 'bill',
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->info_box_contents[$line][1] = array(
|
||||||
|
'td' => '',
|
||||||
|
'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee,
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->info_box_contents[$line][2] = array(
|
||||||
|
'td' => 'class="right"',
|
||||||
|
'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
|
||||||
|
'text' => $data[$j]->nb,
|
||||||
|
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->info_box_contents[$line][3] = array(
|
||||||
|
'td' => 'class="right"',
|
||||||
|
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency)
|
||||||
|
);
|
||||||
|
|
||||||
|
// We add only for the current year
|
||||||
|
if ($data[$j]->annee == date("Y")) {
|
||||||
|
$totalnb += $data[$j]->nb;
|
||||||
|
$totalMnt += $data[$j]->Mnttot;
|
||||||
|
}
|
||||||
|
$this->info_box_contents[$line][4] = array(
|
||||||
|
'td' => 'align="right" width="18"',
|
||||||
|
'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3),
|
||||||
|
);
|
||||||
|
$line++;
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
if (count($data)==0)
|
||||||
|
$this->info_box_contents[$line][0] = array(
|
||||||
|
'td' => 'align="center"',
|
||||||
|
'text'=>$langs->trans("NoRecordedInvoices"),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// part 2
|
||||||
|
$cachedir = DOL_DATA_ROOT.'/facture/temp';
|
||||||
|
$filename = '/boxactivity-invoice2'.$fileid;
|
||||||
|
|
||||||
|
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
|
||||||
|
|
||||||
|
if ($refresh) {
|
||||||
|
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||||
|
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||||
|
$sql.= " AND f.fk_soc = s.rowid";
|
||||||
|
$sql.= " AND paye=0";
|
||||||
|
$sql.= " GROUP BY f.fk_statut";
|
||||||
|
$sql.= " ORDER BY f.fk_statut DESC";
|
||||||
|
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if ($result) {
|
||||||
|
$num = $db->num_rows($result);
|
||||||
|
$j=0;
|
||||||
|
while ($j < $num) {
|
||||||
|
$data[$j]=$db->fetch_object($result);
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
||||||
|
dol_filecache($cachedir, $filename, $data);
|
||||||
|
}
|
||||||
|
$db->free($result);
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$data = dol_readcachefile($cachedir, $filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
$cumuldata=array_merge($cumuldata, $data);
|
||||||
|
if (! empty($data)) {
|
||||||
|
$j=0;
|
||||||
|
|
||||||
|
while ($line < count($cumuldata)) {
|
||||||
|
$billurl="search_status=".$data[$j]->fk_statut."&paye=0";
|
||||||
|
$this->info_box_contents[$line][0] = array(
|
||||||
|
'td' => 'align="left" width="16"',
|
||||||
|
'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
|
||||||
|
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
||||||
|
'logo' => 'bill',
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->info_box_contents[$line][1] = array(
|
||||||
|
'td' => '',
|
||||||
|
'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->info_box_contents[$line][2] = array(
|
||||||
|
'td' => 'class="right"',
|
||||||
|
'text' => $data[$j]->nb,
|
||||||
|
'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
|
||||||
|
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
||||||
|
);
|
||||||
|
$totalnb += $data[$j]->nb;
|
||||||
|
$this->info_box_contents[$line][3] = array(
|
||||||
|
'td' => 'class="right"',
|
||||||
|
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
|
||||||
|
);
|
||||||
|
$totalMnt += $objp->Mnttot;
|
||||||
|
$this->info_box_contents[$line][4] = array(
|
||||||
|
'td' => 'align="right" width="18"',
|
||||||
|
'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3),
|
||||||
|
);
|
||||||
|
$line++;
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
if ($num==0)
|
||||||
|
$this->info_box_contents[$line][0] = array(
|
||||||
|
'td' => 'align="center"',
|
||||||
|
'text'=>$langs->trans("NoRecordedInvoices"),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->info_box_contents[0][0] = array(
|
||||||
|
'td' => '',
|
||||||
|
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add the sum in the bottom of the boxes
|
// Add the sum in the bottom of the boxes
|
||||||
$this->info_box_contents[$line][0] = array('tr' => 'class="liste_total"');
|
$this->info_box_contents[$line][0] = array('tr' => 'class="liste_total"');
|
||||||
$this->info_box_contents[$line][1] = array('td' => 'align="left" class="liste_total" ', 'text' => $langs->trans("Total")." ".$textHead);
|
$this->info_box_contents[$line][1] = array('td' => 'align="left" class="liste_total" ', 'text' => $langs->trans("Total")." ".$textHead);
|
||||||
|
|||||||
@ -154,7 +154,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VEF'
|
|||||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VND', '[8363]', 1, 'Viet Nam Dong');
|
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VND', '[8363]', 1, 'Viet Nam Dong');
|
||||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XAF', NULL, 1, 'Communaute Financiere Africaine (BEAC) CFA Franc');
|
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XAF', NULL, 1, 'Communaute Financiere Africaine (BEAC) CFA Franc');
|
||||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XOF', NULL, 1, 'Communaute Financiere Africaine (BCEAO) Franc');
|
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XOF', NULL, 1, 'Communaute Financiere Africaine (BCEAO) Franc');
|
||||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XPF', '[70]', 1, 'Franc pacifique (XPF)');
|
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XPF', '[70]', 1, 'Franc CFP');
|
||||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'YER', '[65020]', 1, 'Yemen Rial');
|
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'YER', '[65020]', 1, 'Yemen Rial');
|
||||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ZWD', '[90,36]', 1, 'Zimbabwe Dollar');
|
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ZWD', '[90,36]', 1, 'Zimbabwe Dollar');
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user