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