mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Transaction Model: explicitly cast decimal to string
Laravel defers to PDO & the underlying database as to what type decimals are cast as. When using sqlite text that match a float will be returned as a float, while mySql always returns a string for a decimal. This leads to crashes with sqlite while trying to import tranansactions. (It does not happen every transaction, only when the balance{before,after} coming from the database is floatable) `FireflyIII\Support\Models\AccountBalanceCalculator::getLatesBalance(): Return value must be of type string, float returned.` Fixes: #9458 Signed-off-by: yparitcher <y@paritcher.com>
This commit is contained in:
@@ -54,6 +54,8 @@ class Transaction extends Model
|
||||
'bill_name_encrypted' => 'boolean',
|
||||
'reconciled' => 'boolean',
|
||||
'balance_dirty' => 'boolean',
|
||||
'balance_before' => 'string'
|
||||
'balance_after' => 'string'
|
||||
'date' => 'datetime',
|
||||
];
|
||||
|
||||
|
Reference in New Issue
Block a user