Custom Development / Custom Orders Export for HerritageParts - Meyle

Custom Orders Export for HerritageParts - Meyle

Version Created by Date Notes
1.0 Hristiyan Georgiev 01/27/2025 First Publish
1.1
Milen Markov 02/19/2025 Added rounding to some price fields
1.2 Milen Markov 02/24/2025 Changed the ‘PurchaseOrderReference’ field mapping
1.3 Milen Markov 03/06/2025 AddressLine4 field change
1.4 Milen Markov 03/18/2025 Set a maximum field length

The purpose of this page is to detail the custom Order export we need to create for one of Herritage Parts’ sellers which is Meyle.

We want to use our currently built functionality for Custom Exports by selecting “Custom” = Yes in an Automatic Export creation and from the dropdown then select the new Export with a name “Meyle Orders Export”. We also want to have identical export which will be used for test purposes with Meyle as there is a possibility for test flag field in the xml file (more explanation in the mapping below). We want to control this with a checkbox called “Test Flag”, so once the Meyle Orders Export is selected, the checkbox will appear and if checked, we should export the order with the test flag field in the xml.

Functionality should then work as everything else for an Export - FTP details to be picked from the Hemi Automatic Export record, email (if file needs to be sent to email) picked from there too etc.

As an Order Export we will want to employ the standard order export unique functionality as well, meaning we will want to track for each order exported with this Automatic Export, and store it in Automatic Exported Orders - with the functionality of “Re Export Order” also working (if flag selected the order should be picked as if it is not previously exported and then the record for this specific OrderID should be updated again with the new export log ID, date, dropping the flag) and marking each successfully exported order by raising the flag Orders > Exported = Yes and each successfully exported product by raising the flag Product In Order >Exported . Just a note - the flag Orders > Exported should not be part of the blockers for selection - uniqueness should be tracked by the table Automatic Exported Orders and Product In Order > Exported Meaning if an export is picking this order for export but we have Product in Order > Exported = yes we don’t want this item to be picked for export. If there are no items to be picked for export we should not be picking the order for any further processing anyway

The exported file should be in a xml format.

Example file :

22-12595-66032.xml

<?xml version="1.0" encoding="utf-8"?>
<PurchaseOrder>
  <TradeSimpleHeaderSent>
    <SendersCodeForRecipient>MEYLE</SendersCodeForRecipient>
    <SendersName>Heritage Parts Centre</SendersName>
    <SendersAddress>
      <AddressLine1>47 Dolphin Road</AddressLine1>
      <AddressLine2>Shoreham-By-Sea</AddressLine2>
      <AddressLine3>West Sussex</AddressLine3>
      <AddressLine4>BN43 6PB</AddressLine4>
      <AddressLine5>UK</AddressLine5>
    </SendersAddress>
    <RecipientsCodeForSender>13957</RecipientsCodeForSender>
    <RecipientsName>Meyle UK</RecipientsName>
    <RecipientsAddress>
      <AddressLine1>47 Dolphin Road</AddressLine1>
      <AddressLine2>Shoreham-By-Sea</AddressLine2>
      <AddressLine3>West Sussex</AddressLine3>
      <AddressLine4>BN43 6PB</AddressLine4>
      <AddressLine5>UK</AddressLine5>
    </RecipientsAddress>
    <TestFlag>true</TestFlag>
  </TradeSimpleHeaderSent>
  <PurchaseOrderHeader>
    <PurchaseOrderReference>22-12595-66032</PurchaseOrderReference>
    <PurchaseOrderDate>2025-01-21</PurchaseOrderDate>
    <DeliveryDetail>
      <DeliveryLocationReference>LA18 4NG</DeliveryLocationReference>
      <DeliveryName>Gaz  Wright</DeliveryName>
      <DeliveryAddress>
        <AddressLine1>GAZ WRIGHT VEHICLE SOLUTIONS THE TA</AddressLine1>
        <AddressLine2>ebayyfmyqqt</AddressLine2>
        <AddressLine3>Haverigg</AddressLine3>
        <AddressLine4>Cumbria</AddressLine4>
        <AddressLine5>LA18 4NG</AddressLine5>
      </DeliveryAddress>
    </DeliveryDetail>
    <Currency>GBP</Currency>
  </PurchaseOrderHeader>
  <PurchaseOrderDetail>
    <PurchaseOrderLine>
      <LineNumber>1</LineNumber>
      <SuppliersProductNumber>MEX0509</SuppliersProductNumber>
      <ProductDescription>MEYLE 114 880 0002 Glow Time Contro</ProductDescription>
      <Quantity>1</Quantity>
      <UnitPriceExclVat>39.23</UnitPriceExclVat>
      <LineCostExclVat>39.23</LineCostExclVat>
    </PurchaseOrderLine>
  </PurchaseOrderDetail>
  <PurchaseOrderTrailer>
    <NumberOfLines>1</NumberOfLines>
    <NumberOfItems>1</NumberOfItems>
    <TotalExclVAT>39.23</TotalExclVAT>
  </PurchaseOrderTrailer>
</PurchaseOrder>

Mapping :

File field Hemi Field Notes
PurchaseOrder
TradeSimpleHeaderSent
SendersCodeForRecipient Hardcoded as “MEYLE”
SendersName
SendersAddress
AddressLine1 Hardcoded as “47 Dolphin Road”
AddressLine2 Hardcoded as “Shoreham-By-Sea”
AddressLine3 Hardcoded as “West Sussex”
AddressLine4 Hardcoded as “BN43 6PB”
AddressLine5 Hardcoded as “UK”
RecipientsCodeForSender Hardcoded as “13957”
RecipientsName Hardcoded as “Meyle UK”
RecipientsAddress
AddressLine1 Hardcoded as “47 Dolphin Road”
AddressLine2 Hardcoded as “Shoreham-By-Sea”
AddressLine3 Hardcoded as “West Sussex”
AddressLine4 Hardcoded as “BN43 6PB”
AddressLine5 Hardcoded as “UK”
TestFlag If we are sending an order with Test Flag checkbox selected, we should send this as “true”
Otherwise we exclude this field.
PurchaseOrderHeader
PurchaseOrderReference <v1.2>Orders > ID </v1.2>
PurchaseOrderDate Orders > Order Created Time We only need to send the date, in a format YYYY-MM-DD
DeliveryDetail
DeliveryLocationReference Orders > Shipping Postal Code
DeliveryName Orders > Shipping Buyer Name <v1.4> Up to 35 symbols </v1.4>
DeliveryAddress
AddressLine1 Orders > Shipping Street 1 <v1.2> Up to 35 symbols </v1.2>
AddressLine2 Orders > Shipping Street 2 <v1.2> Up to 35 symbols </v1.2>
AddressLine3 Orders > Shipping City <v1.4> Up to 35 symbols </v1.4>
AddressLine4 Orders > Shipping State Province <v1.3> If the ‘Shipping State Province’ is empty, we hardcode a dash (-) in the field </v1.3>
AddressLine5 Orders > Shipping Postal Code
Currency Orders > Order Currency
PurchaseOrderDetail
PurchaseOrderLine
LineNumber This will depend how many lines we have in the order. Should start from 1 and increment for every other line
SuppliersProductNumber Product In Order > SKU
ProductDescription Product In Order > Item Title
Quantity Product In Order > Quantity
UnitPriceExclVat Needs to be calculated. Product In Order > Item Price - Product In Order > Vat Item Price
<v1.1> Round to 2 symbols after the decimal </v1.1>
LineCostExclVat Needs to be calculated (Product In Order > Item Price - Product In Order > Vat Item Price) * Product In Order > Quantity
<v1.1> Round to 2 symbols after the decimal </v1.1>
PurchaseOrderTrailer
NumberOfLines Needs to be calculated We calculate all the lines in the order.
NumberOfItems Needs to be calculated We calculate all the quantity of the items in the order.
TotalExclVAT Needs to be calculated We need to calculate the total amount of all products exported and all quantities and substract the VAT for all the products. <v1.1> Round to 2 symbols after the decimal </v1.1>

Requirements :

  • We should export single order per file.
  • We want to pick orders that have shipping cost splitted, debundled and the status is Ready for Shipping.
  • We may have orders with products from different sellers so we want to make sure we are only exporting items for this specific seller. This will be controlled via the WHERE clause in the export filter selected when creating the Automatic Export Feed in which we will have a selected seller id . If there is no selected seller id in the WHERE clause in the export filter, we want to return an error in the terminal and not export any orders.
  • File naming convention : We should be able to add the hemi order id in the naming of the file so this functionality must work. The naming convention will probably be UORmeyle{hemi-order-id}_{YYYYMMDDHHMISS}.xml
Is this article helpful?
0 0 0