Page 1 of 1

XML PO Import

PostPosted: Thu May 07, 2015 1:01 pm
by 2can2
Hi, Have you done a conversion for 3rd party PO's to our import format to use in the data bridge. I am looking for something similar to use for Masters PO's which are pretty verbose so if it has been done before it would be great. Sample attached.
Cheers

Re: XML PO Import

PostPosted: Thu May 07, 2015 1:03 pm
by 2can2
Sorry, should have mentioned their PO needs to import as our SO! Cheers

Re: XML PO Import

PostPosted: Thu May 07, 2015 2:43 pm
by Mike.Sheen
Hi Doug,

We've not done this specific conversion before, but have done others.

There are a couple of ways to do this - you can come up with an XSLT which converts the incoming XML to the Jiwa Sales Order XML. I've done this before with a Jiwa PO to a Jiwa SO, and whilst it was simple enough, it was a laborious process and learning XSLT is probably not something you want to do.

The way I'd do it is to get hold of the XSD for that document (the header suggests there is one available) - and use the Microsoft xsd.exe tool or similar to generate the class files to code. Then, in a plugin you can read the XML into objects and map by doing something like his :

Code: Select all
// Read the PO from XML file
XmlSerializer serializer = new XmlSerializer(typeof(enece.StandardBusinessDocument));
StreamReader reader = new StreamReader("C:\\Users\\mikes\\Downloads\\Purchase Order Change_51784753.xml");
enece.StandardBusinessDocument purchaseOrder = new enece.StandardBusinessDocument();
purchaseOrder = (enece.StandardBusinessDocument)serializer.Deserialize(reader);
reader.Close();

// Create a new sales order
JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder salesOrder = JiwaFinancials.Jiwa.JiwaApplication.BusinessLogicFactory.Instance.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder>(null);
salesOrder.CreateNew(JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder.NewSalesOrderTypes.e_NewSalesOrder, "1001", false);

// Put the PO fields into our sales order
salesOrder.OrderNo = purchaseOrder.message.transaction.command.documentCommand.documentCommandOperand.order.orderIdentification.orderIdentificationuniqueCreatorIdentification;
// map rest of fields here

// Save the sales order
salesOrder.Save();


We could do this for you - open a case with our support department and we can get it quoted for you.

Mike

Re: XML PO Import

PostPosted: Fri May 08, 2015 2:07 pm
by 2can2
Hi Mike, thanks for the reply. Masters apparently won't give out the layout info as they say it is in Webforms which is a standard product. I presume we would still need to go the custom route so will put in a support request. Cheers

Re: XML PO Import  Topic is solved

PostPosted: Fri May 08, 2015 3:35 pm
by Mike.Sheen
2can2 wrote:Hi Mike, thanks for the reply. Masters apparently won't give out the layout info as they say it is in Webforms which is a standard product. I presume we would still need to go the custom route so will put in a support request. Cheers


I could be wrong, but from what I can tell that document sample you supplied is a GS1 standard.

EDIT: some more details which might be relevant: here.