In our ongoing series, we previously shared a
custom function that automates the application of unused credits to your invoices. We've been listening to your feedback, and many of you have asked for a similar function to be applied to bills. And here we are today, sharing the function to automatically
apply unused credits to bills. This function is executed after you create and save a bill. It automatically detects the unused credits of the vendor and applies them to offset the bill amount.
Here's a quick tip: If you want to use this function for specific bills, you can create a Check Box-type custom field that will act as a trigger to execute the function. When you create a bill, just tick this field, and the function will then be applied to that particular bill. This approach gives you the flexibility to choose when the function should be executed.