We have sales orders that we need to create 2 invo...
# general
l
We have sales orders that we need to create 2 invoices from at the same time but with different due dates. The first one is like a deposit invoice (30%) and the second one is for the remaining balance. The due date of the deposit invoice is 15 days from the invoice date while the balance invoice's due date is based on a date on a custom field of the sales order. Is there a way to automate this without scripting? I'm thinking about using billing schedules but I don't know how I can set the invoice dates to today's date in the billing schedule. For due dates, I can use a regular payment term for the deposit invoice and probably use a WF to set due date of the other invoice by sourcing the value from the custom field. But how can I distinguish the first invoice from the second invoice? I can fix the invoice date via a workflow I think and still be able to auto-email invoice upon creation with the right dates.
m
Make two checkboxes on the sales order 1 called invoice 1 created and 1 called invoice 2 created Make a workflow on the sales order that has first the transform record action then has a set field value to set the invoice 1 created = T Then a transition to state 2 when invoice 1= T Then in state 2 transform record into an invoice again and mark the invoice 2 created checkbox This could get messy with timing so I recommend 2 scheduled workflows 1 creates first invoice Another creates second invoice and use the two checkboxes to dicipher which workflow to run
You will also probably need a third workflow that runs on invoice that will set the line quantity to 0.3 so it only invoice 30% and the next invoice can invoice the remaining
l
Thank you. You're always amazing with this workflow stuff. I guess I can't use the Invoice Sales Orders page anymore with this approach, right?
m
No but you can make your own invoice sales order page by using a mass update to trigger workflow #1
If you save it as a saved mass update you can just recall it as a page like the invoice sales orders page
Then also you can add the initiate workflow action at the end of WF1 to trigger WF2
r
I will suggest using payment terms for due date. But create the invoice based on it. Keeping pending invoice in the system is not considered ideal in certain practices. Use a UE to create a billing schedule. With 2 line items, which will create the initial deposit invoice and the second line item to create the invoice 15 days prior to due date. Use custom date field from the SO to source your schedule date for the 2nd line.
l
@raghav thanks but wouldn't that mean we would have a lot of billing schedules in the system as we almost always need a new one every day?
@MGBC by saved mass update, is it where I would define criteria like in a saved search to pick the orders I want to invoice?
m
Kind of, first you define the criteria overall (like sales orders in pending billing status). Then it displays a screen of all orders with that criteria and checkbox next to each order. You check the box next to the order or orders you want to invoice and click submit. It runs the workflow on those orders but not the unchecked ones
l
Ohhh yeah. There's a screen where you can still tick or untick the boxes. It's not very intuitive but it may work for ua. Thanks a lot!
m
Oh sorry I thought your were trying to replicate the invoice sales orders screen. There are other way to initiate this but I thought you wanted the same concept as that native invoice sales orders screen What would be your preferred method of triggering this?
l
Yeah, you are right. Trying to mimic the invoice sales orders page. I was playing around with billing schedules and I was able to create one billing schedule that applies to all use cases and have a workflow auto-set the invoice date to today's date. It works fine except that I need to know the second invoice created so I can override the due date to delivery date. Hmmmm.
m
Doesn’t I have a quantity or amount that is 70% of the SO because the first invoice is for 30%. If so make a saved search condition in your workflow for this criteria and use it to set the due date
l
Thank you!