chrissharp123

Untitled

Feb 25th, 2026
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.32 KB | None | 0 0
  1. --- ./controllers/executiveReportGenerator.controller.php   2026-02-25 10:45:53.743494492 -0500
  2. +++ /home/opensrf/report-creator/controllers/executiveReportGenerator.controller.php    2026-02-25 10:45:54.839522259 -0500
  3. @@ -50,10 +50,11 @@
  4.             exit;
  5.         }
  6.  
  7. -       $buffer = '';
  8. -       $numReports = 0;
  9. -       $system     = NULL;
  10. -       $consortium = NULL;
  11. +       $buffer         = '';
  12. +       $numReports     = 0;
  13. +        $parentBranch   = NULL;
  14. +       $system         = NULL;
  15. +       $consortium     = NULL;
  16.        
  17.         $rowData = new stdClass();
  18.         $rowData->system = NULL;
  19. @@ -128,11 +129,23 @@
  20.             if (isset($alreadyProcessed[$row->org_unit.$row->year_month])) continue;
  21.    
  22.             $alreadyProcessed[$row->org_unit.$row->year_month] = true;
  23. -           if ($row->year_month == $yearMonthList) {
  24. -               if ($row->org_unit == $ouInfo->id)
  25. +           $yearMonthListExplode = explode(",", $yearMonthList, 3);
  26. +           if (in_array($row->year_month, $yearMonthListExplode)) {
  27. +                // This row is for our org, so process our own data
  28. +               if ($row->org_unit == $ouInfo->id) {
  29.                     $reportData->thisMonth = $row;
  30. -               elseif ($row->org_unit == $ouInfo->parent_ou && $ouInfo->ou_type == 3)
  31. +                }
  32. +                // Does our org match the system ou?
  33. +               elseif ($row->org_unit == $ouInfo->system) {
  34.                     $system = $row;
  35. +                    // Is the parent ou a system?
  36. +                    // if ($ouInfo->ou_type == 3)
  37. +                    //    $system = $row;
  38. +                    // elseif ($ouInfo->ou_type > 3)
  39. +                    //     // We are a sub-org, so, ideally, fold our numbers into our parent ou
  40. +                    //     // and into the system numbers
  41. +                    //     $parentBranch = $row;
  42. +                }
  43.                 else
  44.                     $consortium = $row;
  45.             }
  46. @@ -185,6 +198,7 @@
  47.             }
  48.  
  49.             //data may be numeric or an array of json objects for reports that have subreports (group by in sql)
  50. +           $dataParentBranch = (!isset($parentBranch->$reportID))      ? NULL : json_decode($parentBranch->$reportID, false);
  51.             $dataSystem     = (!isset($system->$reportID))      ? NULL : json_decode($system->$reportID, false);
  52.             $dataConsortium = (!isset($consortium->$reportID))  ? NULL : json_decode($consortium->$reportID, false);
  53.             $dataThisMonth  = (!isset($reportData->thisMonth->$reportID)) ? NULL : json_decode($reportData->thisMonth->$reportID, false);
  54.  
Advertisement
Add Comment
Please, Sign In to add comment