Closed cpintofonseca closed 4 months ago
Hi @dreispt, some modules you are maintaining are being modified, check this out!
I believe this is a workflow need, and not a InvX connector need. When creating the invoice, a separate Credit Note document should be also created for the down payment. Both document will eventually need to be sent to InvX, but no change in the connector will be needed for that.
See #104 for a proof of concept of what I think the the right solution.
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.
The goal of this PR is to allow to deduct down payments on an invoice using InvoiceXpress.
First problem:
Second problem: We can't register a payment on a credit note. When we finalize a credit note in InvoiceXpress (the equivalent of posting a credit note in Odoo) it automatically changes the state to paid.
Solution to first problem: When we post an invoice, we will look for down payments with negative amounts. Before the post, we will delete those negative lines from the invoice and delete the down payment section. After the post we will create, post and reconcile a new credit note linked with the invoice, using the deleted lines.
Solution to second problem: We will prevent in Odoo the registration of a payment in the credit note, forcing a reconciliation in the source invoice instead. We will also prevent the registration of a payment in the source invoice, if the source invoice has outstanding credits.