I am trying to transform sales order into Item ful...
# suitescript
k
I am trying to transform sales order into Item fulfillment using a Map/Reduce Script. The script works perfectly fine the SO has one Location through out the line level, but it seems to run into issues when there is more than one Location. Is there a native suitescript way to tackle this or do I need to get the list of unique Locations from the SO and transform it as many time as required based on the number of locations?
s
I don't believe a single item fulfillment can span across multiple locations, so you would need an item fulfillment per location.
s
^this is also my understanding what's the error you're getting, does it prevent you creating the transforming or is it more of a data error of incomplete transform, or even wrong transforms in terms of the lines, in terms of what you generated from the MR? My other thought of asking this question is more like do you partially fulfill and what happens then?
k
Currently, when I loop through the SO first, get the unique list of locations and do a transformation for each of this location, creating unique Item Fulfillment per location, there is no issue. I was just wondering if there was a native way to optimize it, so that I dont need to loop through the scripts multiple times.
s
whilst i get what you're trying to do i have operational questions, like, are you invoicing before fulfilling, again are you partially fulfilling, are you using pick pack ship? how do you determine what to pick, what has packed, what's your proforma invoice, what is shipped? these would largely be able to redetermine your trigger points if it's not optimised, and rule out options if it doesn't fit the criteria if it's intended for one SO one fulfilment right now? then it's be more of an optimisation question or multiple so for same customer, how would it fulfil? from what you're saying per record it's fairly streamlined, unless there is stuff you do in UE that can be moved into a library called by such MR/SS anyway my 2cents
k
Thank you for your insight! My use case is for some legacy SO that we are bringing in NS for which certain line items have already been shipped from the legacy system. In order to recognize revenue for these line items, we need to create IFF and mark them as shipped. This is a one time script as there does not seem to be csv import available for item fulfillment records
s
have you imported the inventory also? the old inventory, if not the IF will take your current stock . Might be obvious just have seen a few cases that it was not done till way latter.
s
To recognize revenue for these you need to invoice them, not mark them shipped. You could prob just create standalone invoices and skip the SO/IF part.
s
Not if you want the correct cost of goods sold , meaning the net profit