diff --git a/app/Services/MetricCalculators/PlanCalculator.php b/app/Services/MetricCalculators/PlanCalculator.php index bebe38e..ff45070 100644 --- a/app/Services/MetricCalculators/PlanCalculator.php +++ b/app/Services/MetricCalculators/PlanCalculator.php @@ -38,7 +38,7 @@ class PlanCalculator extends BaseMetricService implements MetricCalculatorInterf ->whereIn('r.rf_department_id', $departmentIds) ->where('mr.rf_metrika_item_id', self::getMetricId()) ->where('r.period_end', '>=', $startYear) // Используем >= - ->where('r.period_end', '<', $startPreviousMonth) // Используем < + ->where('r.period_end', '<=', $startPreviousMonth) // Используем < ->select('r.rf_department_id', DB::raw('SUM(CAST(mr.value AS DECIMAL)) as total')) ->groupBy('r.rf_department_id') ->get()