Skip to content

Commit

Permalink
Merge pull request #599 from wri/fix/TM-1539-hbf-reports
Browse files Browse the repository at this point in the history
[TM-1539] Fix the underlying issue with workdays
  • Loading branch information
roguenet authored Dec 4, 2024
2 parents f03515d + b10e5ac commit fa239e4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ public function toArray($request)
'people_knowledge_skills_increased' => $this->people_knowledge_skills_increased,
'indirect_beneficiaries' => $this->indirect_beneficiaries,
'indirect_beneficiaries_description' => $this->indirect_beneficiaries_description,
'workdays_direct_total' => $this->workdays_direct,
'workdays_convergence_total' => $this->workdays_convergence,
'workdays_direct_total' => $this->workdays_direct_total,
'workdays_convergence_total' => $this->workdays_convergence_total,
'non_tree_total' => $this->non_tree_total,
'total_community_partners' => $this->total_community_partners,
];
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Traits/HasWorkdays.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public function getWorkdaysVolunteerAttribute(): int
return $this->sumTotalWorkdaysAmounts(self::WORKDAY_COLLECTIONS['volunteer']);
}

public function getWorkdaysDirectAttribute(): int
public function getWorkdaysDirectTotalAttribute(): int
{
return $this->sumTotalWorkdaysAmounts(self::WORKDAY_COLLECTIONS['direct']);
}

public function getWorkdaysConvergenceAttribute(): int
public function getWorkdaysConvergenceTotalAttribute(): int
{
return $this->sumTotalWorkdaysAmounts(self::WORKDAY_COLLECTIONS['convergence']);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Traits/UsesLinkedFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private function mapValue($model, string $property, array $linkedFieldInfo)
if (empty($resource)) {
return $model->$relation;
}
if (empty($model->$relation) || ! is_iterable($model->$relation)) {
if (empty($model->$relation)) {
return [];
}

Expand Down

0 comments on commit fa239e4

Please sign in to comment.