Add paypal payments
This commit is contained in:
@@ -94,7 +94,18 @@ class Invoice extends Model
|
||||
|
||||
public function getPaidAttribute()
|
||||
{
|
||||
return $this->currency()->round($this->paymentitems->sum('alloc_amt'));
|
||||
return $this->currency()->round(
|
||||
$this->paymentitems
|
||||
->filter(function($item) { return ! $item->payment->pending_status; })
|
||||
->sum('alloc_amt'));
|
||||
}
|
||||
|
||||
public function getPendingPaidAttribute()
|
||||
{
|
||||
return $this->currency()->round(
|
||||
$this->paymentitems
|
||||
->filter(function($item) { return $item->payment->pending_status; })
|
||||
->sum('alloc_amt'));
|
||||
}
|
||||
|
||||
public function getSubTotalAttribute()
|
||||
|
Reference in New Issue
Block a user