Following One Payment for multiple Invoices
For now, a payment is linked to a single accounting line.
But sometimes to preserve the cash flow of a company, it is better to make a single payment which deduce existing receivable lines. (Or vice versa).
We add a new wizard on the move lines (similar to the reconciliation wizard). It runs only with lines from the same party and on receivable or payable lines. It creates a new account move with counterparts lines for the selected lines and a new line with the sum on a selected receivable or payable (according to the sum sign) account (by default the one from the selected lines). The move date is today by the maturity date of the new line is the smallest maturity date of selected lines.
The wizard reconciles the selected lines with the counterpart lines but it should not mark the linked invoices as paid. So we add on the reconciliation model a field which delegate the reconciliation state to the linked line. This means that the invoice should not be considered as paid as long as this delegated lines is not also reconciled. The wizard will fill this field with the line with the sum.
The wizard is mainly usable from the view “Payable/Receivable Lines” from party. But in order to help the user, the “Pay Lines” wizard raises an warning when the user pays a line for a party which has also an opposite line that could be grouped. The warning key will be based on the party ID like that the user could skip the warning for the party only this time or always. If multiple lines for different parties are used, the wizard must raise a warning for each party.