Skip to content

Commit

Permalink
moved methods to trait
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Oct 3, 2017
1 parent bbb34ab commit 2f00c96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 0 additions & 10 deletions app/Models/Item/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ public function setPurchasePriceAttribute($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()
{
$error = false;
Expand Down
5 changes: 5 additions & 0 deletions app/Traits/Currencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ 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 getDynamicConvertedAmount($format = false)
{
return $this->dynamicConvert($this->default_currency_code, $this->amount, $this->currency_code, $this->currency_rate, $format);
Expand Down

0 comments on commit 2f00c96

Please sign in to comment.