Skip to content

Commit

Permalink
close #478 Fixed: Not able to create income/expense in older installa…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
cuneytsenturk committed Sep 6, 2018
1 parent 87ff31b commit a9fa249
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions app/Models/Setting/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,74 @@ public function setRateAttribute($value)
{
$this->attributes['rate'] = (double) $value;
}

/**
* Get the current precision.
*
* @return string
*/
public function getPrecisionAttribute($value)
{
if (empty($value)) {
return config('money.' . $this->code . '.precision');
}

return $value;
}

/**
* Get the current symbol.
*
* @return string
*/
public function getSymbolAttribute($value)
{
if (empty($value)) {
return config('money.' . $this->code . '.symbol');
}

return $value;
}

/**
* Get the current symbol_first.
*
* @return string
*/
public function getSymbolFirstAttribute($value)
{
if (empty($value)) {
return config('money.' . $this->code . '.symbol_first');
}

return $value;
}

/**
* Get the current decimal_mark.
*
* @return string
*/
public function getDecimalMarkAttribute($value)
{
if (empty($value)) {
return config('money.' . $this->code . '.decimal_mark');
}

return $value;
}

/**
* Get the current thousands_separator.
*
* @return string
*/
public function getThousandsSeparatorAttribute($value)
{
if (empty($value)) {
return config('money.' . $this->code . '.thousands_separator');
}

return $value;
}
}

0 comments on commit a9fa249

Please sign in to comment.