mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Don't multiply transactions.
This commit is contained in:
parent
9e050fb059
commit
601fe68346
@ -45,8 +45,7 @@ class Transaction extends Model
|
|||||||
if (is_null($this->amount_encrypted)) {
|
if (is_null($this->amount_encrypted)) {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
$value = intval(Crypt::decrypt($this->amount_encrypted));
|
$value = floatval(Crypt::decrypt($this->amount_encrypted));
|
||||||
$value = $value / 100;
|
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
@ -87,9 +86,8 @@ class Transaction extends Model
|
|||||||
public function setAmountAttribute($value)
|
public function setAmountAttribute($value)
|
||||||
{
|
{
|
||||||
// save in cents:
|
// save in cents:
|
||||||
$value = intval($value * 100);
|
|
||||||
$this->attributes['amount_encrypted'] = Crypt::encrypt($value);
|
$this->attributes['amount_encrypted'] = Crypt::encrypt($value);
|
||||||
$this->attributes['amount'] = ($value / 100);
|
$this->attributes['amount'] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user