How to enter one payment for multiple invoices

Hi everyone,

I have a question on how to manage multiple invoices being paid by a single payment.
For example, let’s say I have 3 posted invoices of ID 1, 2 and 3 for a single client.
invoice 1 : 100€
invoice 2 : 50€
invoice 3 : 70€
The client makes a first payment of 100€ to pay the first invoice. I can go to the invoice list, select the posted invoice 1, and click on pay invoice. After entering my password, I can see a popup allowing me to enter payment detail (date, payment method…etc). When I validate, the invoice is marked as paid, and an accounting move is created for the payment. So far so good.

Now the client makes a second payment of 120€ to pay the last two invoices. Ideally I would like to select the invoices to pay in the invoices list, and click on “pay” just like I did for the first invoice. But I can’t seems to find a way to do it.
I could mark the two invoices as paid one by one, like for the first invoice, but that would create two accounting moves and would not accurately represent the payment. Plus it would not be practical if there is lots of invoices paid at the same time, which can happen for us quite often (some clients are paying all the invoices of the month in one time).

So after searching the forum for a solution to this, I installed the modules named account_payment and account_payment_clearing to try to manage those payments. After some digging on how to use those modules, I ended up with what seems to be a working solution. But it requires 10 different steps to enter the payment and I am really not sure it is the right way to do it. Below is a description of the steps I have done :

1 - Go to the window Financial > Payments > Lines to pay : There I can select all the lines corresponding to the paid invoices. Then in action menu, I can click on “regroup lines”.

2 - A popup is then displayed, allowing me to enter information to regroup the lines :
- I choose an accounting journal
- I add a description and then click on "group"

3 - This creates a grouped accounting move, displayed in a new window. I can then “post” this new accouting move after entering my password.

4 - Now I can go back to the window “Lines to pay”, and after reloading, I can see a new line with the total amount to pay. I can now select the line, and in action menu, click on “Pay lines”.

5 - A new popup appears where I can enter the payment date and validate with button “pay”.

6 - I then have to choose a payment journal, and validate.

7 - This creates a new payment, visible in Financial > Payments > Payments. I can select the payment and click on “approve”.

8 - In the action menu, I can then click on “Process payment”.

9 - This creates a new “group”, displayed in a new window. I can click on the “switch” button to see the details of the group, and then click on the “succeed” button.

10 - Finally a new accounting move is created (clearing move I think), I can select this accounting move and “post” it.

After all those steps the invoices are automatically marked as paid but :

  • I have never selected a payment method
  • The accounting move created are linked to the clearing account, not to the payment method account.

As I said, I’m really not sure this is the way to go, this seems very complicated and I’m not even sure the accounting move are entirely correct from an accounting point of view.

Can anybody tell me if this method using account_payment and account_payment_clearing is the way to go ? Or is there a simpler way to do it ?

Thanks to everyone who took the time to read this long message.

I will sugest using the account_statement module to encode all bank moves of the company.
From there you will be able to link a single payment line with multiple invoices without the need of grouping. After validating the statement the account moves will be created automatically and the invoices mark as paid.

Another option is to just create the account move manually and reconcile the lines once everything is paid. But its easier to just use the statement module as it also helps to track all the cash moves and for example account expenses that are not linked to any invoice.

Thank you for this response. I will try the account_statement module

I have installed account_statement module and played with it a little. I did some configuration like creating an accounting journal of type statement, and then creating 4 payment journals, one for each payment method used. I was then able to create a new statement for a payment, enter one line for each invoice paid, fill the other required information and “post” the statement.

As you said, invoices were automatically marked as paid and the accounting moves have also been created. This is much simpler than using account_payment module and it could work in my case I think. Thank you for this solution.

However, there are few things that makes it kind of annoying to use in my case :

  • I need to enter the end balance, which I must calculate by adding the paid amount to the start balance. (I thought it would be calculated automatically with the lines, but It does not seem to be the case).
  • I have to repeat the payment date and the party on each line.
  • I must manually enter the amount of each invoice before being able to select it. If I try to select the invoice before entering the amount in the line, nothing happens. This requires navigating between tab to see the amount of the invoice, then enter this amount and select the invoice.

So, while I think this could be a solution If I don’t find anything else, I feel like this is not the scenario where account_statement was intended to be used. From what I understand I should be using it for real statement. Like for example bank statements for a bank account. I would receive a paper statement at the end of each month. I would then create one statement in tryton for each month, and one statement line for each payment. This would allow me to follow the current amount in the bank account. (Do I understand correctly ?)

But In my case, I’m creating one statement for each payment, and one statement line for each Invoice paid. Maybe it is why I need to enter extra info and do some calculations ?

Since my goal was to find a solution that was like the “pay invoice” wizard but for multiple invoice, I have tried one other solution. I have implemented a new wizard which act kind of like “pay invoice”, but for multiple invoice. I have copied parts of the code of “pay invoice” wizard, and added a loop to pay each selected invoice instead of only one. It is far from complete :

  • currently I can only use it to pay the total amount of the selected invoices. I don’t manage partial payment or overpayment.
  • I also don’t manage currencies. Invoices must have the same currency and the payment must use that same currency.

I think this can be sufficient in my case, and it allows me to have a simple interface, similar to the one used when paying only one invoice.

I will try both solutions (account_statement and custom wizard) with my client and see what works best for him.

Also If anyone is interested I can share my code for the custom wizard.

Why not just use the existing wizard and launch it once on each invoice. This calculation of the distribution between invoices should any way be entered no matter the tool.

Now you could also just create a move template to record cash payment (without any link to any invoice). Then you can use the reconciliation wizard to check if you can reconcile some lines together.

Yes, this is the main usage of the statment module. You may notice that we have some extra modules that add formats to import the information from the bank, which avoids the need of entering all the lines and amounts manually.

For example, in spain we use the AEB43 format to download a file from the bank and import it in Tryton. Then the user just needs to distribute the amounts to each invoice. We have a youtube video (sorry in spanish) that shows the full workflow. Maybe this is useful.

Why not just use the existing wizard and launch it once on each invoice. This calculation of the distribution between invoices should any way be entered no matter the tool.

Yes, that would work. In fact this resembles what my custom wizard is doing. But my client often receive payments that correspond to multiple invoices, it can be 10 invoices or more sometimes. So he would have to display the details of each invoice, pay it, go back to the list, display the new invoice, pay it…etc. This is less practical, and since my client has been pretty demanding on anything that would make him lose time, I was trying to find a more direct way to enter the payment and link it to multiple invoices.

I should precise that my client is not doing all its accounting in tryton. He only cares about managing his client invoices, and exporting the corresponding accounting move into a specific format to do the accounting in an external software. Payment moves are not exported, and entering the payments is done only to keep track of which invoices have been paid or not. My first message was misleading cause I don’t need to have only one payment move for each payment like I first tought. This means all the solutions mentioned in this thread (paying invoices one by one, using account_payment or account statement) can work, and I just need to find the more practical one.

Now you could also just create a move template to record cash payment (without any link to any invoice). Then you can use the reconciliation wizard to check if you can reconcile some lines together.

I had not tested move template and reconciliation wizard before, but It looks like a viable solution. I will give it a try.

@pokoli I have seen the extra modules. I don’t think we will have to import bank statement in this current project. But your videos explains how to use it really well, and it looks like a powerfull way to automate part of the accounting.

Thank you both for your help.