Create an invoice from a Sale Point ticket

Rational

Generate an invoice from a point of sale ticket.

Proposal

Write the wizard that allows the creation of an invoice from a complete ticket. I did not consider the possibility of charging only part of the ticket.
I had a question about the payment of this invoice and @Cedric proposed here Using the Sale Point Module - #3 by ced to reuse the POS movements
@Cedric: you mean linked the payment of the ticket to the invoice directly?

The 1st version of my proposal is almost ready, as suggested I used the POS ‘account.move’ as invoice movement. This seems to work except in the case where the ticket is paid in several installments with several means of payment
In this case I don’t know what to put in the ‘account’ field of the invoice? A suggestion ?

It should be the receivable account of the party.

But I’m wondering if the fact that the POS move does not use a receivable account will not create issue for example if the invoice is refund or for the computation of the total from the move.
I’m wondering the account move should not be updated to add such line and/or cancel the move for a new one if it is already posted.

For French accounting, the accounts used are 511x and 53x to which I added the ‘receivable’ type. If I put all the lines with an account type receivable in the ‘lines to pay’ won’t that answer the question?
Reimbursement may take place by taking the total of lines with a receivable type account to put it on the receivable account of the party.

And add the payments to the invoice?
It seems simpler, for the rest of the treatments on the invoice if there are any

I doubt this is correct. You must use the receivable of the party.

Once it is an invoice, it must work with the credit workflow.

Probably.

After this exchange I think we have no choice, we must cancel (reverse) the cash entries corresponding to this ticket, and recreate a movement for the invoice with the receivable account.
The question remains with the payment, how to link the payment of the ticket to the invoice?

There are risks that the result will not be the same.
But also the POS Sale will be linked to a cancelled move which is strange.

It should be possible to reuse the existing move for the invoice.

So I’m missing an explanation, for a sale on the POS with several means of payment I have the following move lines:

account debit credit
5115 - CB 64,00 0,00
5311 - Caisse 50,00 0,00
441 - T.V.A. collectée 0,00 19,00
7072 - Marchandise 0,00 95,00

I can take it as a movement of the invoice, in this case what do I put in the receivable account of the invoice?

Well I used the default customer account, it remains to recover the payments of the ticket.

I took over the move of the ticket for my invoice. The amount of a posted invoice is taken from move.line by filtering on the account of the invoice.

  • Problem, my invoice does not have the same account as the move.line from the POS
  • Solution: extend the filter to the account that can receive money (in France: Plan de types de compte (France)\Actif\Actif circulant\Disponibilités)?

Why not? as you create the invoice from the POS you should be able to use the same accounts.
Which accounts are different for your case?

The accounts used in the POS payment method are different from customer account. In addition, it is possible to have several means of payment for the same ticket (eg credit card + cash). So when I resume the same movement I have different accounts. That said, your questions make me say that I may have made a shortcut in the configuration of my payment methods on the POS which is incompatible with the creation of an invoice from a ticket. I checked all that with an accountant.

This is what I propose, to be able to reuse the accounting movement of the receipt as the movement of the invoice (taking into account the various existing constraints)

POS Setup
Create a customer account accepting movements without third parties to use on the payment methods (on all the same to allow the creation of invoices)

End of day statement
Define an end-of-day statement that groups payments by their type and makes a movement with the payment hold account or the cash account (using account_statement?)

Bank reconciliation
Complete the operations by a bank reconciliation between the suspense account and the bank when the money has actually entered the bank

This will create 2 extra lines without value for each POS sale.
Indeed I think we need that extra lines only for sale that must be converted to invoice.
And I will see no problem to not be able to convert into invoice a sale that was posted.

I do not like to have more than 1 move per POS sale because in case of issue it is much more difficult to make the reconciliation.

Where ? I’ve set up multiple payment methods each with the same account, made a few sales and haven’t seen a worthless line.

It has often happened to us to have a customer who comes back a few minutes after having paid and taken his goods back, to ask for an invoice. We even have cases of people returning the next day.

If I have understood correctly, you suggest keeping the move with the cash account for all POS sale without an invoice, and for POS sale with an invoice replacing the cash account(s) with a customer account before posting them, that’s it ?

Because such account should always have an empty balance as all the POS sale are paid.

Then do not post sale before such delay.
And maybe it could be possible to create a wizard that will cancel the posted move and recreate a new one identical but to be used for an invoice. (A little bit like if the POS sale was reset to open and posted again).

Not replacing, adding because the customer has still pay.

For me, it makes sense to post the moves using a cron job on a fixed schedule and avoid the need of an extra click from the user.

But I agree that at some point we may need to cancel the posted move and recreate another for the invoice. The invoice wizard should take care of doing it in case of requesting an invoice for a sale that has been already posted.

Also once the sale point already has an invoice it should not cancel anything nor create another one.

Should the wizard post the invoice automatically or is the user who should post the invoice?

Indeed I’ve been thinking on how to create such move and those are my findings:

  • We need to use the same move on both sale_point and invoice, at least for the revenue amounts as we need to book them only once (otherwise the revenue balance will be double).
  • As the invoice module computes the amounts from the account move, the invoice move must have the receivable account, otherwise the amounts are not properly computed on the invoice.

So probably the best is:

  1. Let the invoice create the receivable, tax, and expenses accounts
  2. When an invoice is created the payment move will just include the payment moves and the receivable amounts. This way, we will be able to reconcile the sale point move with the invoice and mark the invoice as paid without duplicating the balances.

In case that an invoice needs to be created from a sale that has been already posted, we can just cancel such move and recreate the payment one to linkt to the invoice.

On POS this will most of the time be the case. Customer pays at the POS and go to reception office to ask for an invoice (because POS can not encode the required data to make an invoice).
So it will not be good that the paid move would be cancelled and recreated. It should be the same move.

How? A move that is already posted can not be modified. And once the sale is posted it’s move its already posted.

Even if someone delays the posting of a sale points (for example to post them only once the cash closing is finished) there may be the case that someone pays and comes back some days latter with the ticket to ask for an invoice (so he can deduce the taxes). So for me we can not avoid to cancel an recreate the move.