close #412 Fixed: Invoice add payment problem

This commit is contained in:
cuneytsenturk
2018-07-10 18:30:03 +03:00
parent 7641d7e315
commit 6405aafef9
13 changed files with 64 additions and 16 deletions

View File

@ -42,7 +42,7 @@ class BillItem extends Model
*/
public function setPriceAttribute($value)
{
$this->attributes['price'] = (double) $value;
$this->attributes['price'] = (double) money($value, $this->bill->currency_code)->getAmount();
}
/**
@ -53,6 +53,17 @@ class BillItem extends Model
*/
public function setTotalAttribute($value)
{
$this->attributes['total'] = (double) $value;
$this->attributes['total'] = (double) money($value, $this->bill->currency_code)->getAmount();
}
/**
* Convert tax to double.
*
* @param string $value
* @return void
*/
public function setTaxAttribute($value)
{
$this->attributes['tax'] = (double) money($value, $this->bill->currency_code)->getAmount();
}
}