Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- ./controllers/executiveReportGenerator.controller.php 2026-02-25 10:45:53.743494492 -0500
- +++ /home/opensrf/report-creator/controllers/executiveReportGenerator.controller.php 2026-02-25 10:45:54.839522259 -0500
- @@ -50,10 +50,11 @@
- exit;
- }
- - $buffer = '';
- - $numReports = 0;
- - $system = NULL;
- - $consortium = NULL;
- + $buffer = '';
- + $numReports = 0;
- + $parentBranch = NULL;
- + $system = NULL;
- + $consortium = NULL;
- $rowData = new stdClass();
- $rowData->system = NULL;
- @@ -128,11 +129,23 @@
- if (isset($alreadyProcessed[$row->org_unit.$row->year_month])) continue;
- $alreadyProcessed[$row->org_unit.$row->year_month] = true;
- - if ($row->year_month == $yearMonthList) {
- - if ($row->org_unit == $ouInfo->id)
- + $yearMonthListExplode = explode(",", $yearMonthList, 3);
- + if (in_array($row->year_month, $yearMonthListExplode)) {
- + // This row is for our org, so process our own data
- + if ($row->org_unit == $ouInfo->id) {
- $reportData->thisMonth = $row;
- - elseif ($row->org_unit == $ouInfo->parent_ou && $ouInfo->ou_type == 3)
- + }
- + // Does our org match the system ou?
- + elseif ($row->org_unit == $ouInfo->system) {
- $system = $row;
- + // Is the parent ou a system?
- + // if ($ouInfo->ou_type == 3)
- + // $system = $row;
- + // elseif ($ouInfo->ou_type > 3)
- + // // We are a sub-org, so, ideally, fold our numbers into our parent ou
- + // // and into the system numbers
- + // $parentBranch = $row;
- + }
- else
- $consortium = $row;
- }
- @@ -185,6 +198,7 @@
- }
- //data may be numeric or an array of json objects for reports that have subreports (group by in sql)
- + $dataParentBranch = (!isset($parentBranch->$reportID)) ? NULL : json_decode($parentBranch->$reportID, false);
- $dataSystem = (!isset($system->$reportID)) ? NULL : json_decode($system->$reportID, false);
- $dataConsortium = (!isset($consortium->$reportID)) ? NULL : json_decode($consortium->$reportID, false);
- $dataThisMonth = (!isset($reportData->thisMonth->$reportID)) ? NULL : json_decode($reportData->thisMonth->$reportID, false);
Advertisement
Add Comment
Please, Sign In to add comment