FIX Calculation in the activity box

This commit is contained in:
Laurent Destailleur 2017-09-17 20:17:51 +02:00
parent 41e19e723b
commit 9dbd88f0ba
2 changed files with 18 additions and 16 deletions

View File

@ -376,7 +376,7 @@ class box_activity extends ModeleBoxes
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= " WHERE f.entity = ".$conf->entity; $sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND paye=0"; $sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=0";
$sql.= " GROUP BY f.fk_statut"; $sql.= " GROUP BY f.fk_statut";
$sql.= " ORDER BY f.fk_statut DESC"; $sql.= " ORDER BY f.fk_statut DESC";
@ -403,6 +403,8 @@ class box_activity extends ModeleBoxes
if (! empty($data)) { if (! empty($data)) {
$j=0; $j=0;
$alreadypaid=-1;
while ($line < count($cumuldata)) { while ($line < count($cumuldata)) {
$billurl="search_status=".$data[$j]->fk_statut."&amp;paye=0"; $billurl="search_status=".$data[$j]->fk_statut."&amp;paye=0";
$this->info_box_contents[$line][0] = array( $this->info_box_contents[$line][0] = array(
@ -431,7 +433,7 @@ class box_activity extends ModeleBoxes
$totalMnt += $objp->Mnttot; $totalMnt += $objp->Mnttot;
$this->info_box_contents[$line][4] = array( $this->info_box_contents[$line][4] = array(
'td' => 'align="right" width="18"', 'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3), 'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3, $alreadypaid),
); );
$line++; $line++;
$j++; $j++;

View File

@ -309,7 +309,7 @@ abstract class CommonInvoice extends CommonObject
* @param int $paye Status field paye * @param int $paye Status field paye
* @param int $status Id status * @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=long label + picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=long label + picto
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, -1 otherwise)
* @param int $type Type invoice * @param int $type Type invoice
* @return string Libelle du statut * @return string Libelle du statut
*/ */