trigger a draft invoice creation

trigger a draft invoice creation

Hello,

Context: 

Zoho Inventory is used to manage orders, invoices and payments. 
Sales channels are:
-Zoho Form that triggers unpaid sales orders creation in Zoho Inventory
-Zoho Commerce that triggers paid sales orders creation in Zoho Inventory
-Manual order creation that triggers unpaid sales orders creation in Zoho Inventory

At the exact moment an unconfirmed or draft order is created in Zoho Inventory, I need an draft invoice to be created as well in order to replicate the sales order number in the invoice number field. I just add an "F" in front of the number. *

*Seems to me that this is easily doable through Zoho Flow. ( "F" + ${trigger.salesorder_number} )

This way, sales order numbers are always the same as invoice number. Makes operations and follow-ups easier. 

Problem:

I can't find a way to trigger invoice creation WHEN THE SALES ORDER IS DRAFT OR UNCONFIRMED. 
At first, I did found a way to almost reach my goal. I found the Sales Order Cycle settings to get an invoice automatically created when a new (confirmed) sales order is created. I tough this option with similar transaction number series could do the trick but I was wrong. In this business context, there could be invoice duplication or creation alone... without sales order, so this make the transaction number series desynchronize quickly or just broke the ascending order for transaction number series. (or maybe I resolve this part by blocking all invoice creation alone? Always go through sales order for any type of transactions?...)

I could decide to make sales order confirmation triggered each time a new sales order is created... but the draft sales order is an important step because we can add items, transport fees and update other stuff (in both invoice and sales order) when the sales order is unconfirmed or draft... but this is not possible when the sales order is confirmed.  

So, to summarize the main goal is: 

-For every sales order created, it need to stay draft or unconfirmed, then trigger a draft invoice creation with the modified invoice number based on sales order number. 

Do you have any magic trick for me? 

Thanks! 

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now