[WIP] Claim Encounters
This commit is contained in:
@@ -149,6 +149,16 @@ class Claim extends Model
|
||||
return $this->belongsTo(Member::class, 'member_id');
|
||||
}
|
||||
|
||||
public function encounters()
|
||||
{
|
||||
return $this->belongsToMany(Encounter::class, 'claim_encounter');
|
||||
}
|
||||
|
||||
public function finalEncounter()
|
||||
{
|
||||
return $this->belongsTo(Encounter::class, 'final_encounter_id');
|
||||
}
|
||||
|
||||
public function diagnoses()
|
||||
{
|
||||
return $this->hasMany(ClaimDiagnosis::class, 'claim_id');
|
||||
@@ -185,5 +195,10 @@ class Claim extends Model
|
||||
->whereIn('status', ['approved', 'paid']);
|
||||
// ->whereBetween('requested_at', [$startDate, $endDate]);
|
||||
}
|
||||
|
||||
public function getTotalTagihanAttribute()
|
||||
{
|
||||
return $this->items->sum('nominal_ditagihkan');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user