diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx index 77db1627272..bca1906fcea 100644 --- a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx +++ b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx @@ -1349,7 +1349,7 @@ const Transaction = memo(function Transaction(props) { ); }); -function TransactionError({ error, isDeposit, onAddSplit, style }) { +function TransactionError({ error, isDeposit, onAddSplit, onDistributeRemainder, style, canDistributeRemainder }) { switch (error.type) { case 'SplitTransactionError': if (error.version === 1) { @@ -1372,10 +1372,20 @@ function TransactionError({ error, isDeposit, onAddSplit, style }) { + @@ -1433,6 +1443,7 @@ function NewTransaction({ onSave, onAdd, onAddSplit, + onDistributeRemainder, onManagePayees, onCreatePayee, onNavigateToTransferAccount, @@ -1442,6 +1453,8 @@ function NewTransaction({ const error = transactions[0].error; const isDeposit = transactions[0].amount > 0; + const emptyChildTransactions = transactions.filter(t => t.parent_id === transactions[0].id && t.amount === 0) + return ( onAddSplit(transactions[0].id)} + onDistributeRemainder={() => onDistributeRemainder(transactions[0].id)} + canDistributeRemainder={emptyChildTransactions.length > 0} /> ) : (