Function #15: Calculate shipping charges for an invoice created from multiple sales orders
When converting a sales order to an invoice, the shipping charges from the sales order will be automatically carried over to the invoice. However, this does not occur when linking one or multiple confirmed sales orders to an invoice directly from the invoice creation page. This can be resolved by utilizing today's custom function. When confirmed sales orders are linked to an invoice, the function will detect and sum up the shipping charges from each sales order, then display the combined total in the shipping charges field on the invoice.
Prerequisites:
1. To successfully execute the function, go to Settings > Developer Space -> Connections -> Pre Defined Connections -> View all -> System Connections -> Internal_zohobooks -> Connect. You can watch the GIF attached below to know how to reconnect the internal connection.
Custom function:
Navigate to Settings -> Automation -> Custom functions -> +New Custom Function > Add the function code from this
GitHub link.
Workflow Rule:
Go to Settings -> Automation -> Workflow Rules -> +New Workflow Rule and set up the workflow rule as shown below:-
In the final step of this workflow rule, associate the custom function you created and then hit Save.
We believe that today's custom function will be useful for you. If you need any assistance with setting up the function, please feel free to reach out to our support team at support[at]zohobooks[dot]com. We will be glad to assist you!
Regards,
Shireen Farhana S
Zoho Books