diff --git a/drcr/templates/journal/journal_edit_transaction.html b/drcr/templates/journal/journal_edit_transaction.html index 65bc9aa..f18849a 100644 --- a/drcr/templates/journal/journal_edit_transaction.html +++ b/drcr/templates/journal/journal_edit_transaction.html @@ -223,8 +223,10 @@ } function changeAmount(el) { + // Update linked postings if there are only 2 and the first is edited + // This allows changing the second posting independently by editing it (e.g. mixing commodities of equivalent total value) let amountInputs = document.querySelectorAll('#edit-transaction-form input[name="amount"]'); - if (amountInputs.length === 2) { + if (amountInputs.length === 2 && el === amountInputs[0]) { for (inp of amountInputs) { if (inp !== el) { // Update other input with amount