mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +00:00
Fixed some math.
This commit is contained in:
@@ -15,22 +15,6 @@ class PiggyBankEvent extends Model
|
||||
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];
|
||||
protected $hidden = ['amount_encrypted'];
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
*
|
||||
* @return float|int
|
||||
*/
|
||||
public function getAmountAttribute($value)
|
||||
{
|
||||
// if (is_null($this->amount_encrypted)) {
|
||||
// return $value;
|
||||
// }
|
||||
// $value = intval(Crypt::decrypt($this->amount_encrypted));
|
||||
// $value = $value / 100;
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -52,11 +36,7 @@ class PiggyBankEvent extends Model
|
||||
*/
|
||||
public function setAmountAttribute($value)
|
||||
{
|
||||
// save in cents:
|
||||
// $value = intval($value * 100);
|
||||
// $this->attributes['amount_encrypted'] = Crypt::encrypt($value);
|
||||
// $this->attributes['amount'] = ($value / 100);
|
||||
$this->attributes['amount'] = round($value, 2);
|
||||
$this->attributes['amount'] = strval(round($value, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user