a Hello, We have a Custom Transaction (Sales) that...
# suitescript
s
a Hello, We have a Custom Transaction (Sales) that has posting enabled; however, when we transform the line items to an Invoice via workflow, and then pay the invoice, items on the custom transaction aren't being closed. In other words, I can continue to bill the same line item to an invoice over and over. Any suggestions for how to handle this via script? Looking for behavior similar to a Sales Order. (edited)
k
how are you handling through workflow ? with search ?
If then, make it as sales order type with Fulfilled, Invoiced Qty, Close. As soon as Invoice being created, Use User event script to close lines on Sales order after setting up Invoiced quantity if necessary
Then filter by close or invoiced quantity in search that workflow uses.
s
Thank you! The workflow performs a simple "transform record" action to grab the line items from the custom transaction, and create an invoice. No search currently involved. I'm not sure how to set the Invoice to a Sales Order Type (Fulfilled, Invoiced QTY, Close) via workflow? I don't see any of these options in the workflow. I'm okay with the rest of the solution: i.e. Simply use an after submit event (on create) to close the lines? Then, use a Search to filter out the closed items.
@Kevin Update: I wrote script that loops through the line items and closes them out after the transformation, but after I add another item to custom transaction, all the line items revert back to false (not closed). Also, all of our items are service for sale, so inventory isn't part of the equation.
k
Why are you adding lines to Sales that already invoiced ?
s
@Kevin I understand where you're coming from, but these are a "service for sale" items. Additional "Services" may be necessary after original Invoice is created/paid.