Calculate Fund Amount using Accrual Rules

As administrators, use accrual rules to calculate fund amount for accrual budgets and accrual funds. Use SOAP web services to import fund amount. Fund amount for accrual budgets and accrual funds is based on value of orders and shipments.

Calculate the fund amount for each accrual budget and accrual fund outside Oracle CX Sales using your organization specific integration. You can calculate the fund amount using accrual rules which are based on the value the product associated with the accrual budget or the accrual fund. The product value for calculation fund amount is dependent on the value of the total orders and shipments.

Calculate and update the fund amount in accrual budget and accrual fund records. Use the following algorithm to import the fund amount using the SOAP web services:

For each Fund F of an Accrual Budget
    Set fundAmount = 0;
    For each Accrual Rule R of the Accrual Budget,
        For each Product P of rule R,
            Set count = 0;
            Set amount = 0;
            
            Get Order Line Rollups of the Account of the fund F,
                where Order Line product = rule product P 
                and creation date of Order is with in the Start Date and End Date of the rule R
                
            For each order line rollups fetched
                count = count + order line quantity
                amount = amount + order line price * order line quantity
                
            If Basis on rule R is Cases
                fundAmount = fundAmount + count * RateNumber in rule R
            else
                fundAmount = fundAmount + amount * RatePercent in rule R
            
    Update Fund F,
        set Fund Initial Amount = fundAmount