Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Revenue Schedule Adjustment

New Custom Fields.


A.
B. Work Order --> Created by program (consider only which work orders have true this
field) - We consider only those work orders for revenue calculation where this field is
true. [idea is to exempt those work orders which are created manually because we don’t
want to pay them amount if work is pan over multiple days. I am assuming that work
orders will be created manually when this is going to happen.]
C. Make sure that this is considering only those work orders which were created
automatically.
D. We need to show a warning message one someone is trying to create a work order for
the job which is recurring and has pro-rate enabled. This message will tell that there will
not be any revenue implication.
E. Program run if Opportunity frequency not “1x Only” Stage Name “Closed Won”.
F. Opportunity’s Account have true value of Auto-prorate.
G. Opportunity should have OpportunityLineItem( Opportunity product), Opportunity
Revenue schedule.
H. Billed Amount is filled on Opportunity.
I. Trigger point of this development is
a. When Work order is marked incomplete
b. When work order is marked cancelled
c. When Opportunity is cancelled
d. When frequency on the Opportunity is changed
e. When Billed Amount on Opportunity is changed

This is basically used to auto populate Work order information on opportunity ( Total number
of work orders in current year, total work orders in current month, Cost of Each service based
on one year)
When any work order cancels then work order, name will be filled in revenue Comment. ( we
can’t create a custom field on Revenue line item schedule, so we are using comment field to
put our information)
Case 1. For partners.
All Information about work orders will be available on Opportunity.
Such as
1. Total number of work orders in current year.
2. Total number of work orders in current month.
3. One Service cost of work order.
4. Billed Amount.

Billing is always done on last date of month so if any work orders is canceled then an
OpportunityLineItemSchedule( Revenue ) will be created of amount equal to “one service cost”
where Schedule Date will be same as service date of work order but amount will be a negative
value.
now, you can easily calculate current month amount.
Example. Opportunity frequency is 2x week,
Then total no. Of work orders in current year 96,
current month workorders 8,
Billed Amount $1600
one service cost $200.
Case a. All work orders are successfully worked then nothing odd is happening so program will
not create any revenue with negative amount. Total bill $1600.
Test Opportunity --> https://ruevac--part.cs25.my.salesforce.com/0061b000004q29e
Case b. All work order cancelled then Revenue will be created with negative amount and
Scheduled date will be Service date of work order. Total to bill for that month will be zero as we
will be creating new revenue schedule with amount -$1600 for that month. Amount can also
into negative as we are considering per service cost based on entire month. We will inform this
to partners.
Test Opportunity -->https://ruevac--part.cs25.my.salesforce.com/00k1b000004VjWZ
Case c. If there are 4 work orders with service incomplete and other 4 work orders service have
been complete. Then four revenue created with the date in Service date of work orders. So, you
can easily verify which work order is canceled and along with in the revenue comment work
order name will be mentioned.
Test Opportunity --> https://ruevac--part.cs25.my.salesforce.com/0061b000004q29y
Case d. If Total no of work orders is 8. If 2 work orders with service complete and 2 work orders
with service incomplete and After two-weeks of Job (Opportunity) is canceled. Then Two work
order which have service incomplete will have revenue with Negative amount. But now as job is
cancelled, So, in this case Two revenue which have negative amount will be same. But
remaining 4 work orders which service neither completed nor incomplete. So, in case a revenue
created which amount is (4 * per Service cost) with description ‘Credit for Work Order after
cancel date’.
Test Opportunity --> https://ruevac--part.cs25.my.salesforce.com/0061b000004q2AN
Case e. when an opportunity has cancelled true then all future revenue will be deleted
according to requirement https://app.asana.com/0/654056432979915/818276000757914 and
recreated by uncheck cancelled field. This requirement has been completed in this
development.
Case f. (This case cover into next three case g,h and I ).What will happen if frequency is
changed. - When change opportunity frequency then automatically update current year
number of work order, current month work order and service cost of each work order. (Not
working)
Example – Present frequency is 2x Week that means total number of work order in month is 8
and let’s assume cost per service is 10$ (Billed Amount = 80$). Now in Middle of month
frequency is changed to 4x Week this means that 4 new work orders will be added so total
number of work order after this change will become 8 again. Assuming that new Billed amount
is 160, new cost per service will become 10$.
A new revenue line item will be added which will do the following
= Subtract value of Remaining work orders before change is done and add value of remaining
number of work order after the change is done.
= - (4 * 10) + (8 * 10) = 40$ = So a new revenue line item will be added with value 40$
Test Opportunity --> https://ruevac--part.cs30.my.salesforce.com/006n0000008NM2s
Case g. Billed Amount change --> When Billed Amount change then a revenue is created
according to “Billed Amount” value and along description “Adjustment due to change in billed
amount”.
Test Opportunity --> https://ruevac--part.cs25.my.salesforce.com/0061b000004q2B6
Case h. Frequency change --> When Opportunity frequency changes then there will be a new
Revenue Schedule added with negative and positive value based on calculation and description
will be "Adjustment due to change in frequency”.
Test Opportunity --> https://ruevac--part.cs25.my.salesforce.com/0061b000004q2C6
Case I. Billed Amount and Frequency changed --> When Opportunity frequency and Billed
Amount both are changed then a Revenue Schedule will be created with negative and positive
value based on calculation and Revenue Schedule Description will be “Adjustment due to
frequency and billed amount”;
Test Opportunity --> https://ruevac--part.cs25.my.salesforce.com/0061b000004q2CL

Case 2. For Principal (Customer)


All custom fields and work order details on opportunity have similar information for principal
opportunity.
Billing is always done either 1st or 15th date of current month. So, in case when any work order
is incomplete then a revenue schedule will be created with negative amount and schedule date
will be “service date + 1 Month”.
Case A. Billing Day on Account is “1st E-Mail”.
if account have Billing Day is “1st E-mail” then if any work order mark incompleted service
then a revenue schedule will be created which have schedule date “service date + 1 month”.
Because in this case billing has been done, so we can adjust billing only into next month.
Case a. All Work Order completed successfully in case does not create any revenue schedule
with negative amount.
Case b. If all work orders have been marked incomplete then revenue created according to
schedule date and schedule date is “service date + 1 Month”.
Test Opportunity --> https://ruevac--part.cs25.my.salesforce.com/0061b000004q2D9
Case c. if job has 9 work orders and 2 work orders are completed and other 2 work order
incomplete. Then we will create 2 revenue schedules with negative amount which have
schedule date “service date +1 month”. Now after 2-week job is canceled the a revenue
schedule will be created which will have value (5*one service cost) with negative amount along
with another 2 revenue which have created next month sift into same month.
Test Opportunity --> https://ruevac--part.cs30.my.salesforce.com/006n0000008NMgm

Before the job cancel schedule date into next month. Now if job is cancel then all of these 3
revenue shift into same month and a complete revenue create of remaining work orders.

Case B. Billing day on Account is “15th E-Mail”.( Now Ignore this case because in both case
revenue sift service date +1 month)
In this Case billing is done on 15th in month and any work order is cancelled before 15 date of
month then a revenue created in current month which have schedule date “service date + 15
days.
And after 15 date if work order cancelled then revenue schedule date will be “service date +1
month”.
I have sifted revenue in next month because if billing is completed then you can easily adjust
bill in either in next month or send replacement invoice.
In same case if job cancel then all negative revenue of next month will be deleted and a
complete revenue created based on incomplete service.
When opportunity frequency change then automatically “total no. Of work order” filed update
on opportunity.

Open questions:
1. Are we not adding production on the opportunity automatically?
--> Looks like there is a job which runs every evening to create revenue
schedule. And this jobs must be adding the products too.
2. We have not made change in the way we are creating revenue schedule. It
is still getting created for next few years. This needs to be changed.

You might also like