changed logic of unit count calculation based on internal tool type

This commit is contained in:
Luca Haid
2025-06-10 09:45:57 +02:00
parent 327d6686fb
commit 28546cf4d0
8 changed files with 135 additions and 678 deletions
@@ -200,6 +200,9 @@ class DashboardNewController extends mfBaseController {
$efh_connection_types = ["single-dwelling", "business"];
$mph_connection_types = ["apartment-building", "apartment", "multi-dwelling"];
$efh_connection_types = [0,1];
$mph_connection_types = [2];
$countFunction = function($params, $statusFlag = null) use ($campaign_ids, $gemeinde_ids) {
$baseParams = ["preordercampaign_id" => $campaign_ids, "gemeinde_id" => $gemeinde_ids];
@@ -254,15 +257,15 @@ class DashboardNewController extends mfBaseController {
'baufortschritt_140' => $countFunction([">status_code" => "139", "<status_code" => "899"]),
// MAYBE OVERWORK
'order_efh' => $countFunction(["connection_type" => $efh_connection_types]),
'installationspaket_erhalten' => $countFunction(["connection_type" => $efh_connection_types], 145),
'lehrrohr_im_haus' => $countFunction(["connection_type" => $efh_connection_types], 200),
'order_efh' => $countFunction(["tool_building_type" => $efh_connection_types]),
'installationspaket_erhalten' => $countFunction(["tool_building_type" => $efh_connection_types], 145),
'lehrrohr_im_haus' => $countFunction(["tool_building_type" => $efh_connection_types], 200),
//END MAYBE OVERWORK
'inhouse_kabel_verlegt_efh' => $inhouse_kabel_verlegt_efh,
'inhouse_kabel_verlegt_efh_magenta' => $countFunction([">status_code" => "243", "<status_code" => "899", "partner_id" => 4803]),
'inhouse_kabel_verlegt_efh_salzburg' => $countFunction([">status_code" => "243", "<status_code" => "899", "partner_id" => 5668]),
'order_mph' => $countFunction(["connection_type" => $mph_connection_types]),
'inhouse_kabel_verlegt_mph' => $countFunction(["connection_type" => $mph_connection_types], 242),
'order_mph' => $countFunction(["tool_building_type" => $mph_connection_types]),
'inhouse_kabel_verlegt_mph' => $countFunction(["tool_building_type" => $mph_connection_types], 242),
'timeline' => $this->getTimeline('weekly-orders', $campaign_ids, $gemeinde_ids),
'timeline_inhouse_kabel_verlegt_efh' => $timeline_inhouse_kabel_verlegt_efh,
@@ -311,17 +314,17 @@ class DashboardNewController extends mfBaseController {
'type' => 'default',
'order_max_home_addrdb' => $order_max_homes,
'order_actual_order' => $countFunction([]),
'order_efh' => $countFunction(["connection_type" => $efh_connection_types]),
'order_efh_vorsorge' => $countFunction(["connection_type" => $efh_connection_types, "type" => "provision"]),
'order_efh_vollanschluss' => $countFunction(["connection_type" => $efh_connection_types, "type" => "order"]),
'order_mph' => $countFunction(["connection_type" => $mph_connection_types]),
'order_mph_vorsorge' => $countFunction(["connection_type" => $mph_connection_types, "type" => "provision"]),
'order_mph_vollanschluss' => $countFunction(["connection_type" => $mph_connection_types, "type" => "order"]),
'order_efh' => $countFunction(["tool_building_type" => $efh_connection_types]),
'order_efh_vorsorge' => $countFunction(["tool_building_type" => $efh_connection_types, "type" => "provision"]),
'order_efh_vollanschluss' => $countFunction(["tool_building_type" => $efh_connection_types, "type" => "order"]),
'order_mph' => $countFunction(["tool_building_type" => $mph_connection_types]),
'order_mph_vorsorge' => $countFunction(["tool_building_type" => $mph_connection_types, "type" => "provision"]),
'order_mph_vollanschluss' => $countFunction(["tool_building_type" => $mph_connection_types, "type" => "order"]),
'baufortschritt_140' => $baufortschritt_140,
'installationspaket_erhalten' => $countFunction(["connection_type" => $efh_connection_types], 145),
'lehrrohr_im_haus' => $countFunction(["connection_type" => $efh_connection_types], 200),
'inhouse_kabel_verlegt_efh' => $countFunction(["connection_type" => $efh_connection_types], 242),
'inhouse_kabel_verlegt_mph' => $countFunction(["connection_type" => $mph_connection_types], 242),
'installationspaket_erhalten' => $countFunction(["tool_building_type" => $efh_connection_types], 145),
'lehrrohr_im_haus' => $countFunction(["tool_building_type" => $efh_connection_types], 200),
'inhouse_kabel_verlegt_efh' => $countFunction(["tool_building_type" => $efh_connection_types], 242),
'inhouse_kabel_verlegt_mph' => $countFunction(["tool_building_type" => $mph_connection_types], 242),
'installationsfortschritt_245' => $countFunction([">status_code" => "244", "<status_code" => "899"]),
'ont_installiert_300' => $ont_installiert_300,
'vollanschluss_dokumentiert_350' => $countFunction(["status_code" => ["350","500"], "type" => "order"]),
@@ -390,17 +393,17 @@ class DashboardNewController extends mfBaseController {
'type' => 'default',
'order_max_home_addrdb' => $order_max_homes,
'order_actual_order' => $countFunction([]),
'order_efh' => $countFunction(["connection_type" => $efh_connection_types]),
'order_efh_vorsorge' => $countFunction(["connection_type" => $efh_connection_types, "type" => "provision"]),
'order_efh_vollanschluss' => $countFunction(["connection_type" => $efh_connection_types, "type" => "order"]),
'order_mph' => $countFunction(["connection_type" => $mph_connection_types]),
'order_mph_vorsorge' => $countFunction(["connection_type" => $mph_connection_types, "type" => "provision"]),
'order_mph_vollanschluss' => $countFunction(["connection_type" => $mph_connection_types, "type" => "order"]),
'order_efh' => $countFunction(["tool_building_type" => $efh_connection_types]),
'order_efh_vorsorge' => $countFunction(["tool_building_type" => $efh_connection_types, "type" => "provision"]),
'order_efh_vollanschluss' => $countFunction(["tool_building_type" => $efh_connection_types, "type" => "order"]),
'order_mph' => $countFunction(["tool_building_type" => $mph_connection_types]),
'order_mph_vorsorge' => $countFunction(["tool_building_type" => $mph_connection_types, "type" => "provision"]),
'order_mph_vollanschluss' => $countFunction(["tool_building_type" => $mph_connection_types, "type" => "order"]),
'baufortschritt_140' => $baufortschritt_140,
'installationspaket_erhalten' => $countFunction(["connection_type" => $efh_connection_types], 145),
'lehrrohr_im_haus' => $countFunction(["connection_type" => $efh_connection_types], 200),
'inhouse_kabel_verlegt_efh' => $countFunction(["connection_type" => $efh_connection_types], 242),
'inhouse_kabel_verlegt_mph' => $countFunction(["connection_type" => $mph_connection_types], 242),
'installationspaket_erhalten' => $countFunction(["tool_building_type" => $efh_connection_types], 145),
'lehrrohr_im_haus' => $countFunction(["tool_building_type" => $efh_connection_types], 200),
'inhouse_kabel_verlegt_efh' => $countFunction(["tool_building_type" => $efh_connection_types], 242),
'inhouse_kabel_verlegt_mph' => $countFunction(["tool_building_type" => $mph_connection_types], 242),
'installationsfortschritt_245' => $countFunction([">status_code" => "244", "<status_code" => "899"]),
'ont_installiert_300' => $ont_installiert_300,
'vollanschluss_dokumentiert_350' => $countFunction(["status_code" => ["350","500"], "type" => "order"]),