mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 14:12:15 +00:00
Remove encrypted amounts because it stinks.
This commit is contained in:
@@ -96,11 +96,11 @@ class PiggyBank extends Model
|
||||
*/
|
||||
public function getTargetamountAttribute($value)
|
||||
{
|
||||
if (is_null($this->targetamount_encrypted)) {
|
||||
return $value;
|
||||
}
|
||||
$value = intval(Crypt::decrypt($this->targetamount_encrypted));
|
||||
$value = $value / 100;
|
||||
// if (is_null($this->targetamount_encrypted)) {
|
||||
// return $value;
|
||||
// }
|
||||
// $value = intval(Crypt::decrypt($this->targetamount_encrypted));
|
||||
// $value = $value / 100;
|
||||
|
||||
return $value;
|
||||
}
|
||||
@@ -137,8 +137,9 @@ class PiggyBank extends Model
|
||||
public function setTargetamountAttribute($value)
|
||||
{
|
||||
// save in cents:
|
||||
$value = intval($value * 100);
|
||||
$this->attributes['targetamount_encrypted'] = Crypt::encrypt($value);
|
||||
$this->attributes['targetamount'] = ($value / 100);
|
||||
// $value = intval($value * 100);
|
||||
// $this->attributes['targetamount_encrypted'] = Crypt::encrypt($value);
|
||||
// $this->attributes['targetamount'] = ($value / 100);
|
||||
$this->attributes['targetamount'] = round($value, 2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user