fixed #695
This commit is contained in:
@ -23,7 +23,7 @@ class Bill extends Model
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $appends = ['attachment', 'discount', 'paid'];
|
||||
protected $appends = ['attachment', 'amount_without_tax', 'discount', 'paid'];
|
||||
|
||||
protected $dates = ['deleted_at', 'billed_at', 'due_at'];
|
||||
|
||||
@ -201,6 +201,22 @@ class Bill extends Model
|
||||
return $percent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount without tax.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAmountWithoutTaxAttribute()
|
||||
{
|
||||
$amount = $this->amount;
|
||||
|
||||
$this->totals()->where('code', 'tax')->each(function ($tax) use(&$amount) {
|
||||
$amount -= $tax->amount;
|
||||
});
|
||||
|
||||
return $amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the paid amount.
|
||||
*
|
||||
|
Reference in New Issue
Block a user