This commit is contained in:
lmarcouiller 2020-12-03 11:00:29 +01:00
parent 7fc050e3ce
commit e08f6aeb2b
2 changed files with 9 additions and 5 deletions

View File

@ -104,6 +104,9 @@ class box_funnel_of_prospection extends ModeleBoxes
case 'NEGO': case 'NEGO':
$colorseriesstat[$objp->rowid] = $badgeStatus4; $colorseriesstat[$objp->rowid] = $badgeStatus4;
break; break;
case 'WON':
$colorseriesstat[$objp->rowid] = $badgeStatus6;
break;
default: default:
$colorseriesstat[$objp->rowid] = $badgeStatus2; $colorseriesstat[$objp->rowid] = $badgeStatus2;
break; break;
@ -127,7 +130,7 @@ class box_funnel_of_prospection extends ModeleBoxes
$sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; $sql .= " WHERE p.entity IN (" . getEntity('project') . ")";
$sql .= " AND p.fk_opp_status = cls.rowid"; $sql .= " AND p.fk_opp_status = cls.rowid";
$sql .= " AND p.fk_statut = 1"; // Opend projects only $sql .= " AND p.fk_statut = 1"; // Opend projects only
$sql .= " AND cls.code NOT IN ('WON', 'LOST')"; $sql .= " AND cls.code NOT IN ('LOST')";
$sql .= " GROUP BY p.fk_opp_status, cls.code"; $sql .= " GROUP BY p.fk_opp_status, cls.code";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
@ -151,8 +154,10 @@ class box_funnel_of_prospection extends ModeleBoxes
$valsamount[$obj->opp_status] = $obj->opp_amount; $valsamount[$obj->opp_status] = $obj->opp_amount;
$totalnb += $obj->nb; $totalnb += $obj->nb;
if ($obj->opp_status) $totaloppnb += $obj->nb; if ($obj->opp_status) $totaloppnb += $obj->nb;
$totalamount += $obj->opp_amount; if (!in_array($obj->code, array('WON', 'LOST'))) {
$ponderated_opp_amount += $obj->ponderated_opp_amount; $totalamount += $obj->opp_amount;
$ponderated_opp_amount += $obj->ponderated_opp_amount;
}
} }
$i++; $i++;
} }
@ -164,7 +169,7 @@ class box_funnel_of_prospection extends ModeleBoxes
$listofstatus = array_keys($listofoppstatus); $listofstatus = array_keys($listofoppstatus);
foreach ($listofstatus as $status) { foreach ($listofstatus as $status) {
$labelStatus = ''; $labelStatus = '';
if ($status != 7 && $status != 6) { if ($status != 7) {
$code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code'); $code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code');
if ($code) $labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code); if ($code) $labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code);
if (empty($labelStatus)) $labelStatus = $listofopplabel[$status]; if (empty($labelStatus)) $labelStatus = $listofopplabel[$status];

View File

@ -544,7 +544,6 @@ CREATE TABLE llx_session(
INSERT INTO llx_boxes_def(file,entity) VALUES ('box_funnel_of_prospection.php',1); INSERT INTO llx_boxes_def(file,entity) VALUES ('box_funnel_of_prospection.php',1);
INSERT INTO llx_boxes (box_id, position, box_order, maxline, params) VALUES ((SELECT b.rowid FROM llx_boxes_def as b WHERE file = 'box_funnel_of_prospection.php'), 0, 0, NULL, NULL);
INSERT INTO llx_boxes_def(file, entity) VALUES ('box_customers_outstanding_bill_reached.php', 1); INSERT INTO llx_boxes_def(file, entity) VALUES ('box_customers_outstanding_bill_reached.php', 1);