moved methods to trait
This commit is contained in:
parent
bbb34ab50a
commit
2f00c96ab3
@ -81,16 +81,6 @@ class Item extends Model
|
|||||||
$this->attributes['purchase_price'] = (float) $value;
|
$this->attributes['purchase_price'] = (float) $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConvertedAmount($format = false)
|
|
||||||
{
|
|
||||||
return $this->convert($this->amount, $this->currency_code, $this->currency_rate, $format);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getReverseConvertedAmount($format = false)
|
|
||||||
{
|
|
||||||
return $this->reverseConvert($this->amount, $this->currency_code, $this->currency_rate, $format);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function canDelete()
|
public function canDelete()
|
||||||
{
|
{
|
||||||
$error = false;
|
$error = false;
|
||||||
|
@ -54,6 +54,11 @@ trait Currencies
|
|||||||
return $this->convert($this->amount, $this->currency_code, $this->currency_rate, $format);
|
return $this->convert($this->amount, $this->currency_code, $this->currency_rate, $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getReverseConvertedAmount($format = false)
|
||||||
|
{
|
||||||
|
return $this->reverseConvert($this->amount, $this->currency_code, $this->currency_rate, $format);
|
||||||
|
}
|
||||||
|
|
||||||
public function getDynamicConvertedAmount($format = false)
|
public function getDynamicConvertedAmount($format = false)
|
||||||
{
|
{
|
||||||
return $this->dynamicConvert($this->default_currency_code, $this->amount, $this->currency_code, $this->currency_rate, $format);
|
return $this->dynamicConvert($this->default_currency_code, $this->amount, $this->currency_code, $this->currency_rate, $format);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user