can we `record.transform` an item fulfillment to a...
# suitescript
s
can we
record.transform
an item fulfillment to an invoice? I didn't see it in the list of supported transformations but it sounds like a logical way to invoice [only] the portion of an order that has been fulfilled?
c
Not supported as a transform. You'll have to script it once the order has been fulfilled. Unless you can do something with the SO to transform it to an invoice which is valid.
s
yeah, I'm thinking perhaps transform SO->Invoice then remove lines based on what the IF has, in order to invoice only the stuff that is actually on the IF. Ugh,.
that sounds safer than coding the invoice from scratch, no?
c
I mean doesn't the IF just set the Sales Order status and you still bill from the Sales Order? (Bill button) What I was saying was capture the status change (if you can) and automatically do the transform there from SO -> INV
Going from an IF to an INV isn't a thing that I am aware of
s
as long as partial fulfillments are easily taken into consideration I suppose it makes sense to drive it from the SO
b
We have scripts that create an invoice from an IF, but it’s not a trivial thing, when you take item groups, discounts, Subtotals, etc into account. You have to be very careful. NS won’t do it for you.
s
yes, this sort of thing is exactly why I prefer a transformation when possible.
b
@stalbert when implementing the SO to IN transform and removing lines that are not on the IF there may be gotchas to keep in mind. Depending on how you find and remove lines using the IF as a reference, it can be difficult to identify the correct item in the list if only one should be removed. You may only have the item name and internal id as a reference. The line ids will not match...
s
thanks Brendan. Yes, I'm aware of the lack of connection between lines on different NS transactions, and we have a simple solution for that we can apply if needed.... but that's another example of why I prefer transformation over hand-crafting transactions when possible.
👍 1