Daily at 1 AM, PREO runs a scheduled task to update the Invoiced Percentage data on the PREO Deal object. (This is where PREO gets it's Job Number)
PREO first filters all deals in the system with the following parameters:
Commission Paid in Full = False
Invoiced Percentage < 100
Last Invoice Check = empty or Last Invoice Check < Today
The intent is to retrieve a limited list of deals that have not yet invoiced in full. We need to update this data in PREO to assist the commission processing team on identifying deals ready for commission payout.
PREO will then run a SQL query against the E-Automate database to retrieve a summary of the GL Account. The query is:
select
gla.accountname as 'AccountName', SUM(fd.billamount) as 'Total'
from
SOfulfilldetails fd
join sofulfills f on f.fulfillid = fd.fulfillid
left join soorders o on o.soid=fd.soid
left join icitems it on it.itemid = fd.itemid
left join icsalescodes sc on sc.salescodeid = it.salescodeid
left join glaccounts gla on gla.AccountID = sc.salesglid
left join arcustomers c on c.customerid = o.customerid
left join icjobs j on j.jobid = o.jobid
where
f.void = 0 and
fd.billamount != 0 and
j.jobnumber = [Job Number]
group by gla.accountname
This query will return a list of GL Accounts and the invoiced totals. For example:
Eqpt Sales-Printer Color, 10,000
Eqpt Sales-Software Technology Solutions, 5,000
PREO will then lookup the GL Account > Commission Mapping table located in Global Admin tools > GL Account - Commission Mapping and create a list of entries attached to the deal. This helps with invoice history within PREO. Commission Administrators can view this data by opening the PREO Deal.
During this sync of EA data, PREO will update the "Invoiced Total" amount stored on the Deal. This amount, compared to the original PREO Proposal revenue amount, tells us the "Invoiced Percentage" amount that is used to release commission. This is an example of what the Commission Administrator sees when processing commission.
Note that we have the PREO Proposal Amount (as submitted by Sales), the Invoiced Total (that was synced on our daily update) and the Invoiced Percentage (a comparison of these values).