Payment means of Invoice

Rational

With the usage of Peppol in Belgium, we see that some companies are expecting the PaymentMeans to be filled (even if it is optional). And we expect that this needs will increase overtime when more countries will switch to electronic invoice.

Proposal

On the invoice we add a One2Many pointing to a new Model account.invoice.payment_mean. This model has a Reference field which can point to a company bank account or a SEPA mandate (can be extended in the future).
In the accounting configuration we add an entry to define rules to fill payment means. The criteria are the company, the currency, the country and if the party has a reception direct debit. When validating or posting an invoice without any payment means, they are filled with all the matching entry of the rules. If there is a reception direct debit defined for the party, then the SEPA mandate is added also.

When a line is paid using the “Pay Line” wizard and this line is linked to an invoice with payment means, the payment journal is checked to match at least on payment mean otherwise a warning is raised.

For UBL invoice, the payment means are used to fill the <cac:PaymentMeans/> and the tag is also parsed to store the values when receiving an invoice.
When receiving an invoice with a bank account for a new supplier, then it is created also. But if the supplier already exist, we raise a user error to let the user verify the information by an other mean for security.

For UNECEFACT invoice, the payment means are used to fill the <ram:SpecifiedTradeSettlementPaymentMeans/>.

Implementation

2 Likes