close #412 Fixed: Invoice add payment problem
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user