mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-16 10:14:58 -06:00
Add a title to the table, so multiple balances per account are possible.
This commit is contained in:
parent
4b3eb6dace
commit
fc5143337a
@ -40,7 +40,7 @@ class CorrectAccountBalance extends Command
|
||||
$sum = $entry->amount_sum;
|
||||
|
||||
AccountBalance::updateOrCreate(
|
||||
['account_id' => $account, 'transaction_currency_id' => $currency],
|
||||
['title' => 'balance', 'account_id' => $account, 'transaction_currency_id' => $currency],
|
||||
['balance' => $sum]
|
||||
);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class TransactionObserver
|
||||
$currency = (int) $result->transaction_currency_id;
|
||||
$sum = $result->amount_sum;
|
||||
|
||||
AccountBalance::updateOrCreate(['account_id' => $account, 'transaction_currency_id' => $currency], ['balance' => $sum]);
|
||||
AccountBalance::updateOrCreate(['title' => 'balance', 'account_id' => $account, 'transaction_currency_id' => $currency], ['balance' => $sum]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ return new class extends Migration
|
||||
Schema::create('account_balances', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
$table->string('title',100)->nullable();
|
||||
$table->integer('account_id', false, true);
|
||||
$table->integer('transaction_currency_id', false, true);
|
||||
$table->decimal('balance', 32, 12);
|
||||
|
Loading…
Reference in New Issue
Block a user