Basic EDI import/export Process
- EDI connector (DigitalCAB) generates XML orders in C:\Moneyworks\Orders folder (one order per XML file)
- MW connector (Sussol) reads and. processes XML orders from C:\Moneyworks\Orders folder into MW. Orders successfully imported are moved to processed subfolder.
- MW connector (Sussol) checks for posted invoices in MW which have been modified since the timestamp of the last successful run, and exports XML invoices to C:\Moneyworks\Invoices folder (one XML file per invoice). If successful, update the timestamp (can be manually overridden if needed in MW connector settings).
- EDI connector (DigitalCAB) reads and processes XML invoices from C:\Moneyworks\Invoices folder.
- MW connector (Sussol) generates a log file each time it runs, in C:\MoneyworksConnector\Database\Logs (MW connector is a customised version of http://docs.sussol.net/doku.php/moneyworks:magento_integration).
Notes
- The EDI format used by EDI connector contains data for the customer, invoice recipient, buyer and delivery recipient. Currently the buyer is modelled as the customer in MW e.g. “STARK.AA”, where the head office has a code of “STARK.”. For generating invoices, we have to also lookup and export the GLN/EAN for the head office.
- The customer GLN/EAN codes (name.custom1 in MW as name.code has only 11 characters) must be consistent across all systems. When importing an order, MW searches for a match on [Name.Custom1] - import will fail if no match is found.
- The product GTIN codes ([Product.Barcode] in MW = <detail.stockcode> in XML) must be consistent across all systems - importing an order will fail if no match is found. Note also that [Product.Code] (= [Detail.Stockcode]) in MW translates to <detail.supplierarticle> in XML, [Product.Custom1] (=TUN) in MW translates to <detail.manufacturerpart> in XML, and [Product.Custom2] in MW translates to <detail.buyerpart> in XML
- When importing orders, MW uses the account code of 1000 - import will fail if that account code is missing.
- The tax rates and tax codes must be consistent across all systems - import will fail if no match is found.
MW fields used
MW field | Data |
transaction.ourref | invoice number |
transaction.transdate | date of invoice |
transaction.duedate | date payment is due |
transaction.type | DII for invoice, SOI for order |
transaction.theirref | customer's order number |
transaction.namecode | customer code in MW |
transaction.contra | account in MW |
transaction.tofrom | use this for contact person |
transaction.mailingaddress | always uses the customer's default mailing address |
transaction.deliveryaddress | use this for actual delivery address (NAD+DP) if supplied, otherwise the buyer's address (NAD+BY) |
transaction.salesperson | set to DD if using a direct delivery address |
transaction.flag | set to EDI for imported orders |
transaction.description | used to store the contact person as [ToFrom] gets wiped when sales order is processed |
transaction.analysis | supplier's order number |
transaction.user1 | expected delivery date (yyyymmdd) |
transaction.user2 | phone |
transaction.user3 | |
transaction.currency | currency - blank if default (DKK) |
transaction.freightdetails | freight details e.g. shipping code or number |
transaction.prodpricecode | A=DKK, B=SEK, C=NOK |
transaction.gross | gross total for transaction |
transaction.taxamount | tax total for transaction |
name.custom1 | buyer's GLN/EAN (top level GLN/EAN looked up from corresponding head office name record) |
name.custom2 | not used yet |
detail.account | sales account in MW |
detail.gross | line gross amount |
detail.tax | line VAT amount |
detail.net | line total before tax |
detail.description | product description |
detail.taxcode | tax code in MW |
detail.orderqty | quantity ordered |
detail.stockqty | quantity supplied |
detail.stockcode | product code (= supplier's article) - corresponds to <detail.supplierarticle> in XML |
detail.unitprice | unit full price |
product.custom1 | manufacturer's part number (=TUN) corresponds to <detail.manufacturerpart> in XML |
product.custom2 | not used yet - corresponds to <detail.buyerpart> in XML |
product.barcode | product GTIN - corresponds to <detail.stockcode> in XML |
Discounts for Ditas (XL-BYG) for EDI Orders
Script logic:
- When a sales invoice is opened… (on open window or whatever it’s called)
- IF
- The customer code starts with: D and
- The flag field contains “EDI”
- There is no detail line the the code “RABATEDI” then:
- Add a detail line that
- Has the code RABATEDI
- Has the quantity -1
- Has a price that is 1% of the total of the other lines (It gives 1% discount on invoices submitted to these customers via EDI
Pick List logic
Pick lists are split into 2 sections based on either shoe or accessories. Shoes have their product.category1 set to “Access” - that's it!
Shipping charges for customers
- The number of pairs a customer must order in order to get free shipping is stored in name.custom4
- As of Friday 04 July 2014 rates are
- 1 pair DKK 80,00
- 2 pairs DKK 100,00
- 3 pairs DKK 100,00
- 4 pairs DKK 100,00
- 5 pairs DKK 130,00
- 6 pairs DKK 130,00
- 7 pairs DKK 130,00
- 8 pairs DKK 130,00
- 9 pairs DKK 130,00
- So if name.custom4 is “5” and customer orders 4 pairs they pay 100, if they order 5, they pay zero.