Home >
VTAP Platform
> Server Scripts Example - Calculate Organization Outstanding Invoice Amount
Articles in this section
Server Scripts & Jobs Overview
Using Custom Server Scripts in Processes, Workflows, and Approvals
Running Custom Background Tasks with Vtiger Server Jobs
Writing Code for Server Scripts and Jobs
Helper Method for Server Scripts and Jobs - Debugging
Helper Method for Server Scripts and Jobs - HTTP Request
Helper Methods for Server Scripts and Jobs - Vtiger REST API
Server Scripts Example - Contact Email Validation and Data Enrichment
Server Scripts Example - Update Credit Score of a Contact
Server Scripts Example - Set Case SLA by Created Day
Server Jobs Example - Importing Daily Leads from a File
Server Jobs Example - Update Stocks Weekly in Warehouse System
Server Side Scripts & Jobs User Guide
Server Scripts Example - Calculate Organization Outstanding Invoice Amount
This article gives you an example of how you can calculate Organization outstanding invoice amount using Service Scripts.
A
Abdul Sameer
19 Apr, 2024 - Updated
8 months ago
Table of Contents
Organization Outstanding Invoice Amoun
Consider CompanyX provides marketing services to multiple organizations. They regularly get marketing projects from their client companies. To manage marketing invoices, they use CRM.
They have a certain set of fixed clients for whom they do marketing campaigns regularly. For each campaign, they generate an invoice for the client. At any point in time, they want to see for each client what is the outstanding invoice amount.
To achieve this, you must create a custom currency field in the Organization to store overdue invoice amounts. Next, they create a workflow to update this amount whenever the Invoice amount is changed or the status is changed.
Explanation
- From invoice getting organization ID.
- For that organization, getting all related invoices using the rest API method retrieve_related.
- Summing the balance amount of each invoice.
- Using the rest API revise method, the overdue amount of all related invoices is updated to the organization's custom currency field.
Was this article helpful?
0
out of
0
found this helpful.
Comments 0
Be the first to comment