FoodStuff eXchange Integration

This document summarizes the scope and dependencies related to FoodStuff eXchange Integration in NetSuite

 

AHNZ-67 : FoodStuff eXchange Integration

Target Personas

 

Aim: Fetch Purchase Order from FoodStuff eXchange and create it as a Sales Order in NetSuite and send the Order Message, ASN and INV XML to the site.

Process/Steps :

  1. From NetSuite, we will fetch a Purchase Order from FoodStuff eXchange as XML.
  2. If there is no Purchase Order, then stops further execution
  3. If there is Purchase Order, then proceed further
  4. Store the XML on the Custom Record ‘AHNZ-67 JJ FoodStuff Integration’.
  5. Parse the XML into JSON
  6. If successful, proceed to Step 3
  7. If failure, attach the XML as a file in the custom record and goto Step 1
  8. We will use the STORE_OWNER_CODE from FoodStuff eXchange XML and match it with ‘FOODSTUFFS STORE ID’ of customers to determine the customer in NetSuite.
  9. If the customer is found in NetSuite, proceed to Step 4.
  10. If no such customer is present, we will create the customer in NetSuite with the information available from foodstuff eXchange XML. The value of the parent customer will be based on the EAN_Prefix value in the eXchange XML.
  11. When we create the customer in NetSuite, then
  12. STORE_OWNER_CODE from XML will be a unique identifier for the customer and will be set in FOODSTUFFS STORE ID in NetSuite
  13. The Customer : Company : Street Address in XML will be Ship Address in Customer
  14. The Order Header : Bill to : Company : Postal Address in XML will be Bill Address in Customer
  15. Proceed to Create Customer
  16. If successful, proceed to Step 4
  17. If failure, store the failure reason on custom record and got to Step 1
  18. After the customer is identified/created, we will store the customer reference on the custom record and will proceed to create Sales Order for the customer
  19. ORDER_NUM from XML will be a unique identifier for Sales Order and will be set in the field PO #
  20. Location will be BLENHEIM
  21. Currency will be NZD
  22. SUPPLIER_PRODUCT from FoodStuff eXchange XML will match with GTIN Code (UPC CODE) on NetSuite Item Record, used as Item Unique Identifier
  23. If all the Items from FoodStuff eXchange cannot be mapped successfully to NetSuite, flag this in Custom Record as Partial Sales Order.
  24. The ORDER_HEADER : BUYER should be prepend as Attention on Shipping Address
  25. Proceed to create Sales Order
  26. If successful, proceed to Step 5
  27. If failure, store the failure reason on custom record and got to Step 5
  28. After the successful creation of the Sales order , then the order message XML (sales order creation acknowledgment) has been sent to the FoodStuff eXchange
  29. A custom field has been created in the custom record to save the order message xml.
  30. The order message xml has been created and send to the site
  31. The script will take all the Item Fulfilments for the created sales orders based on the search of the custom record and the script will send the ASN Message XML to the Foodstuff eXchange site. The script will not take the Item fulfillments of the sales order whose Partial Sales Order field is checked.
  32. The custom field “Item Fulfillment” has been created in the custom record and the related item fulfillment of the sales order will be set in the field.
  33. The script will take each item fulfillment and create a ASN XML request and send it to the Foodstuff eXchange site.
  34. A custom field is created for saving the ASN XML request message.
  35. If an error is encountered, we will save the error message in a field.
  36. The response also has been saved to a custom field.
  37. The script will take all the Invoice for the created sales orders based on the search of the custom record and the script will send the INV Message XML to the Foodstuff eXchange site. The script will not take the Invoices of the sales order whose Partial Sales Order field is checked.
  38. The custom field “Invoice” has been created in the custom record and the related invoice of the sales order will be set in the field.
  39. The script will take each invoice and create an INV XMLrequest and send it to the Foodstuff eXchange site.
  40. A custom field is created for saving the INV XML request message.
  41. If an error is encountered, we will save the error message in a field.
  42. The response also has been saved to a custom field.
  43. Go to Step 1

  JJ SS FoodStuff eXchange AHNZ-67

–       Script Type : Scheduled Script

–       ID : customscript_jj_sl_ahnz67_foodstuff_inte

–       This will initiate a call to FoodStuff eXchange and fetch the Purchase Order and Process it. The response, as well as processing output, is stored in Custom Record ‘AHNZ-67 JJ FoodStuff Integration’

 

AHNZ-67 JJ FoodStuff Integration

–       Type : Custom Record

–       ID : customrecord_ahnz67_jj_foodstuffexchange

–       Store the Instance of FoodStuff eXchange Response as well as processing outcome. The Customer and Sales Order will be linked to it as well

AHNZ-67 FoodStuff eXchange Integration

–       Parent Folder in File Cabinet

–       This contains all the dependencies

–       Dependent Scripts

–       JJ ASN-XML Shipping Acknowledge AHNZ-78.js

–       JJ INV-XML Invoice Message.js

–       JJ XML Parser AHNZ-67.js

AHNZ-67 JJ FoodStuff – New Customers

–       Type : Saved Search

–       ID : customsearch_ahnz67_jj_foodstuff_newcust

–       Saved Search to filter out the customers created by the Integration and notify the user via Email

AHNZ-67 JJ FoodStuff – Partial Sales Order

–       Type : Saved Search

–       ID : customsearch_ahnz67_jj_partial_so

–       Saved Search to filter out the sales order which is partially created by the Integration and notify the user via Email

 AHNZ-67 JJ FoodStuff – Error on Sales Order Creation

–       Type : Saved Search

–       ID : customsearch_ahnz67_jj_error_on_so_creat

–       Saved Search to filter out the FoodStuff eXchange orders that cannot be created by the Integration and notify the user via Email

AHNZ-67 JJ FoodStuff – Partial Invoice

–       Type : Saved Search

–       ID : customsearch_ahnz67_jj_partial_inv

–       Saved Search to filter out the partial invoices which are created in NetSuite for FoodStuff eXchange orders that will not be handled by the Integration and notify the user via Email

Data Backup Requirements

No backups as it is an independent task

Rollback Instructions

Remove the script deployment of the scripts :

●     JJ SS FoodStuff eXchange AHNZ-67

 

Leave a comment

Your email address will not be published. Required fields are marked *