RTR Reporting A10 done
This commit is contained in:
@@ -42,11 +42,16 @@ class Admin_RtrReporting {
|
||||
$rasterpunkte = [];
|
||||
foreach(BuildingModel::getAll() as $building) {
|
||||
$raster = $building->laea;
|
||||
if(!$raster) continue;
|
||||
|
||||
$prod_code = 14310;
|
||||
$bb = "1000,00"; // glas = 1000, funk = 50
|
||||
$user_count = TerminationModel::count(["building_id" => $building->id]);
|
||||
|
||||
//$user_count = TerminationModel::count(["building_id" => $building->id]);
|
||||
$rtr100m = Rtr100mRaster::getFirst(["raster" => $raster]);
|
||||
if(!$rtr100m) {
|
||||
die("RTR Raster fehlt ".$raster);
|
||||
}
|
||||
$user_count = $rtr100m->unit_count;
|
||||
|
||||
if(!array_key_exists($raster, $rasterpunkte)) {
|
||||
$rasterpunkte[$raster] = [];
|
||||
@@ -67,11 +72,12 @@ class Admin_RtrReporting {
|
||||
|
||||
$address = $contract->owner;
|
||||
if(!$address->gps_lat || !$address->gps_long || !$address->laea) {
|
||||
//$address->getCoords();
|
||||
$address->save();
|
||||
$address->save(); // gets gps and laea
|
||||
}
|
||||
|
||||
$raster = $address->laea;
|
||||
if(!$raster) continue;
|
||||
|
||||
$rtr_code = $contract->product->attributes["rtr_tech_code"]->value;
|
||||
if(substr($rtr_code, 0, 4) == 1431) {
|
||||
$prod_code = 14310;
|
||||
@@ -82,8 +88,6 @@ class Admin_RtrReporting {
|
||||
} else {
|
||||
continue; // incompatible product
|
||||
}
|
||||
$user_count = 1;
|
||||
// get laea
|
||||
|
||||
if(!array_key_exists($raster, $rasterpunkte)) {
|
||||
$rasterpunkte[$raster] = [];
|
||||
@@ -94,7 +98,14 @@ class Admin_RtrReporting {
|
||||
"user_count" => 0
|
||||
];
|
||||
}
|
||||
$rasterpunkte[$raster][$prod_code]["user_count"] += $user_count;
|
||||
|
||||
$rtr100m = Rtr100mRaster::getFirst(["raster" => $raster]);
|
||||
if(!$rtr100m) {
|
||||
$this->log->warn(__METHOD__.": RTR Raster fehlt ".$raster);
|
||||
continue;
|
||||
}
|
||||
|
||||
$rasterpunkte[$raster][$prod_code]["user_count"] += $rtr100m->unit_count;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user