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

@ -146,7 +146,7 @@ class Invoice extends Model
*/
public function setAmountAttribute($value)
{
$this->attributes['amount'] = (double) $value;
$this->attributes['amount'] = (double) money($value, $this->attributes['currency_code'])->getAmount();
}
/**

View File

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

View File

@ -60,7 +60,7 @@ class InvoicePayment extends Model
*/
public function setAmountAttribute($value)
{
$this->attributes['amount'] = (double) $value;
$this->attributes['amount'] = (double) money($value, $this->account->currency_code)->getAmount();
}
/**

View File

@ -39,7 +39,7 @@ class InvoiceTotal extends Model
*/
public function setAmountAttribute($value)
{
$this->attributes['amount'] = (double) $value;
$this->attributes['amount'] = (double) money($value, $this->invoice->currency_code)->getAmount();
}
/**

View File

@ -118,7 +118,7 @@ class Revenue extends Model
*/
public function setAmountAttribute($value)
{
$this->attributes['amount'] = (double) $value;
$this->attributes['amount'] = (double) money($value, $this->attributes['currency_code'])->getAmount();
}
/**