Prechádzať zdrojové kódy

fix: Include indicators with zero value in Overall Efficiency calculation

- Removed condition 'and indicator_value > 0' from Overall Efficiency calculation
- Now includes indicators with valid zero values in the weighted average
- Fixes issue where Time Tracking Efficiency (0%) was excluded from calculation
- Ensures all configured indicators are considered regardless of their value
root 5 mesiacov pred
rodič
commit
10438b06af
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      hr_efficiency/models/hr_efficiency.py

+ 2 - 2
hr_efficiency/models/hr_efficiency.py

@@ -293,8 +293,8 @@ class HrEfficiency(models.Model):
         for indicator in indicators:
             if indicator.weight > 0:
                 indicator_value = indicator.evaluate_formula(efficiency_data)
-                # Only count indicators with valid values (not None or 0 when there's data)
-                if indicator_value is not None and indicator_value > 0:
+                # Count indicators with valid values (including 0 when it's a valid result)
+                if indicator_value is not None:
                     weighted_sum += indicator_value * indicator.weight
                     total_weight += indicator.weight
                     valid_indicators += 1