Support direct debit based on balance
For now a direct debit are created for each unpaid line but it may not be wanted for cases with a lot of lines. In such case the company may want to make a single direct debit for the total amount.
So I propose to have an option to define if a reception of direct debit is based on lines or balance. For each party of a payable line which does not match a reception for line but match for balance, we search for all payable/receivable lines of the same currency and sum the payment amount and we deduce the pending payments without lines. Then we create a payment for the remaining amount using the party receivable account.
We can expect that account_receivable_rule
will be configured on the receivable account to distribute the amount for reconciliation.