Custom Orders Export for HerritageParts - Woodauto
Version | Created by | Date | Notes |
---|---|---|---|
1.0 | Milen Markov | 06/27/2025 | First Publish |
This is basically a copy-paste of the Firstline custom export. The only difference would be the ‘SenderCodeForRecepient’ is hardcoded to WOODAUTO. It will work for orders with products with seller woodauto (id 6).
The purpose of this page is to detail the custom Order export we need to create for one of Herritage Parts’ sellers which is Firstline.
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 “Firstline Orders Export”. We also want to have identical export which will be used for test purposes with Firstline as there is a possibility for test flag field in the xml file (more explanation in the mapping below).
After discussion with the Eng team at the moment we are happy for the control of this flag to be only through the DB. Otherwise it should work as described - if selected 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 :
<?xml version="1.0" encoding="utf-8"?>
<PurchaseOrder>
<TradeSimpleHeaderSent>
<SendersCodeForRecipient>WOODAUTO</SendersCodeForRecipient>
<SendersName>Shop4AutoParts</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>Firstline</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 |
<v1.1>Hardcoded as “WOODAUTO”</v1.1> | |||||
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 |
<v1.1>Hardcoded as “Firstline” |
</v1.1>
|
| | | RecipientsAddress
| | | | |
| | | | AddressLine1
| | | <v1.1>Hardcoded as “-”</v1.1> |
| | | | AddressLine2
| | | <v1.1>Hardcoded as “-”</v1.1> |
| | | | AddressLine3
| | | <v1.1>Hardcoded as “-”</v1.1> |
| | | | AddressLine4
| | | <v1.1>Hardcoded as “-”</v1.1> |
| | | | AddressLine5
| | | <v1.1>Hardcoded as “-”</v1.1> |
| | | 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
| | | Orders
> ID
| |
| | | 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
| Up to 35 symbols |
| | | | DeliveryAddress
| | | |
| | | | | AddressLine1
| Orders
> Shipping Street 1
| Up to 35 symbols |
| | | | | AddressLine2
| Orders
> Shipping Street 2
| Up to 35 symbols |
| | | | | AddressLine3
| Orders
> Shipping City
| Up to 35 symbols |
| | | | | AddressLine4
| Orders
> Shipping State Province
| If the ‘Shipping State Province’ is empty, we hardcode a dash (-) in the field |
| | | | | 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
Round to 2 symbols after the decimal |
| | | | LineCostExclVat
| | Needs to be calculated | (Product In Order
> Item Price
- Product In Order
> Vat Item Price
) * Product In Order
> Quantity
Round to 2 symbols after the decimal |
| | 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. Round to 2 symbols after the decimal |
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 UORwoodauto{hemi-order-id}_{YYYYMMDDHHMISS}.xml