Validate title, fix running balance display

This commit is contained in:
James Cole
2025-12-13 06:36:20 +01:00
parent b6c4253d76
commit d747ac237b
2 changed files with 12 additions and 5 deletions

View File

@@ -339,6 +339,9 @@ class UpdateRequest extends FormRequest
// if more than one, verify that there are journal ID's present.
$this->validateJournalIds($validator, $transactionGroup);
// if more than one split, needs group title
$this->validateGroupDescription($validator);
// all transaction types must be equal:
$this->validateTransactionTypesForUpdate($validator);

View File

@@ -277,26 +277,30 @@
{% endif %}
{% elseif transaction.transaction_type_type == 'Withdrawal' %}
{# withdrawal into a liability #}
{% if 'Loan' == transaction.destination_account_type or 'Mortgage' == transaction.destination_account_type or 'Debt' == transaction.destination_account_type %}
{% if currency.id == transaction.currency_id %}
{% if account.id == transaction.source_account_id %}
{{ formatAmountBySymbol(transaction.source_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% endif %}
{% if account.id == transaction.destination_account_id %}
{% elseif account.id == transaction.destination_account_id %}
{{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% else %}
-
{% endif %}
{% endif %}
{% if currency.id == transaction.foreign_currency_id and null != transaction.destination_balance_after and null != transaction.destination_balance_after %}
{{ formatAmountBySymbol(transaction.destination_balance_after, transaction.foreign_currency_symbol ?? transaction.currency_symbol, transaction.foreign_currency_decimal_places ?? transaction.currency_decimal_places) }}
{% endif %}
{# withdrawal into an expense account #}
{% else %}
{% if account.id == transaction.source_account_id %}
{{ formatAmountBySymbol(transaction.source_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% endif %}
{% if account.id == transaction.destination_account_id %}
{% elseif account.id == transaction.destination_account_id %}
{{ formatAmountBySymbol(transaction.destination_balance_after, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% else %}
-
{% endif %}
{% endif %}
{% elseif transaction.transaction_type_type == 'Opening balance' %}
{% if transaction.source_account_type == 'Initial balance account' %}