AR 2025 converting Order to Invoice via API
Hi Folks
I have just, yesterday, been asked to add another component to my integrator (web - integrator - myob file ).
I think I know the answer i.e. the API doesn't permit patch updates but there might be a component I haven't forseen.
My integrator takes Orders from a web cart - processes them and sends them to MYOB as a double component.
- Sales order - either on an account or paid for by a guest account by credit card.
- An order which uses the components from the inventory system ( an in house admin component) - if there aren't enough inventory it will create a B Order - and will check inventory before each new orders to see if any B Orders can be filled - if so it DELETES the B Order and lodges a Sales invoice for the in house - component use. ( complex - but it works beautifully)
This was all set in place because human admin staff were dropping the ball in the factory and Orders/BOrders/inventory was a shambles.
The latest ask - is again because human staff majorly DROPPING THE BALL.
When an order is completed - the SALES ORDER for the client - which are mostly account customers - needs to be converted to an invoice and sent out to the customer - last month $170,000 of completed work NOT invoiced - yep!!!!
I have been asked to add feature to do this.
Questions
- I don't think there is a simple way via an API endpoint to convert an order to an invoice - I think I need to DELETE the ORDER and resend as an INVOICE ?? - no matter - I do this for a B Order anyway.
- You cannot DELETE an Order if a payment has been applied to that Order - ?? (MYOB has an awful way of applying a payment to an order that completely jams it so even if you delete the payment you cannot delete the order - the only way around this appears to be NEVER APPLY A PAYMENT to an ORDER - ( have done this successfully for another client this method) - you put the monies into a liability account ( or asset - doesn't matter - naming it correctly so it can be traced) - when an order is filled you convert the Order to a Sale - THEN apply payment as the ORDER has a NB: line - payment has been received etc.
Thoughts, ideas?
The Doc