Add paypal payments

This commit is contained in:
Deon George
2020-07-27 14:49:59 +10:00
parent 9887996da8
commit 1242dffa20
18 changed files with 1483 additions and 433 deletions

View File

@@ -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()