Product catalogue and order exchange with Visma.net AutoInvoice

Order exchange is the process of sending and receiving order documents through Visma.net AutoInvoice.

This guide explains how to send and receive order documents through Visma.net AutoInvoice. Documents include product catalogue, purchase order and order confirmation.
Terminology:
Please note that the terms used in this guide for the various electronic documents are not the same as traditionally used in Visma Business. In this guide the following terms are used:
  • Purchase order: Order
  • Order confirmation: Order response
Note: The user System is running the Scheduler function in the Job table, so if this function is used to download files from AutoInvoice, one of two requirements must be in place:
  1. The user System must have an AutoInvoice user API key set in the User table.
  2. The AutoInvoice default user API key must be set in the Company data table.
Note that the second option is not recommended, as it gives the same access to AutoInvoice to any user that does not already have an AutoInvoice user API key in the User table.

Sending of product catalogue

Prerequisites:
  • An active Visma.net AutoInvoice integration
  • Customer must have an AutoInvoice operator no.
  • Customer must have a valid Organisation no.
  • Customer must be able to receive product catalogue electronically
A product catalogue can be used for sending product information (product ID, price information, dimensions) and supplier information to a defined receiver. This document can contain one image file for each product in the catalogue, this is automatically added based on the Picture file name field in the Product table. This document type does not contain any other attachments.
In order to send the product catalogue, select the rows in the Product table that you want to include in the document. Run the processing Product catalogue. A dialog opens which must be filled out before sending is allowed.
  • Customer : Lists all customers in the Associate table. Required.
  • Our contact: The supplier contact. Lists all employees in the Associate table. Not required.
  • Valid from date: Default set as today’s date.
  • Valid to date: Default set as today’s date plus one year. Required if from date is not set.
  • Catalogue type: This gives the receiver an indication of what type of data is being sent.
    • Replace means that the content of the catalogue will replace existing content. Lines (products) will be set to "Update" ("Replace" is not an option on the line level).
    • Add is used when sending new products to the receiver, so that they can add them to their product list.
    • Update is used for replacing information in existing products. For example prices.
    • Delete means that the products contained in the document may be deleted from the receiver’s product list.
    Note: What actually happens on the receiver side may differ from what is described.
  • Send catalogue: When checked, the catalogue is created in the Order document tables and sent automatically, using the Send to AutoInvoice processing. If not checked, the catalogue is created in the Order document tables with AutoInvoice status 2 - Pending. To send the product catalogue from the Order document tables, select it and run the Send to AutoInvoice processing.
When sent, all data in the Order document line table (all product related data) is deleted, leaving only information in the Order document table.
Sent product catalogues are available for viewing in the embedded UI, which is shown in the Visma.net AutoInvoice layout.

Receive product catalogue

Prerequisites:
  • An active Visma.net AutoInvoice integration
To be able to receive product catalogues from Visma.net AutoInvoice, the document type must be enabled for receiving. This can be done in the Configure AutoInvoice account dialog in the Company data table.
Once enabled, downloading of product catalogue is done in the Incoming document table, with the processing Download incoming document. Order documents are downloaded and added to the table as Incm. doc. type 5 - Product catalogue, with Incm. doc. status 1 - New. The XML for the downloaded document is added to the Incoming document attachment table.
To create products from the incoming product catalogue, use the processing Process document. The XML data will now be read, first of all to identify the supplier. The Organisation no. and EAN loc. code fields are used to identify the supplier, and to be found, the numeric part must not contain spaces or other characters. If the supplier is not found, the process will stop with an error message, and the Incoming document will change status to 3 - Error. If the supplier is found, the product catalogue content is added to the Incoming product data for further processing.
If the supplier is not found, this may be created based on the data in the XML file, using the processing Create customer or supplier from XML. If the AutoInvoice processing parameter Create new suppliers from incoming document automatically is set, Create customer or supplier from XML is triggered if the supplier is not found in the Associate table when running Process document.
Create customer or supplier from XML
When the Create customer or supplier from XML processing is run, it repeats the check from Process document to make sure the supplier doesn’t exist, and then uses available data in the XML file to create a supplier in the Associate table. There are two options in the processing dialog for Create customer or supplier from XML. The default is 0 - Use next available number, which will assign the next available supplier no regardless of available series. This can be overridden by setting a supplier account series in Default supplier no. series in the Company data table.
What happens when running Create customer or supplier from XML:
  1. If supplier does not exist, it will be created in the Associate table.
  2. If set in the XML, the contact person for the supplier will also be created and connected to the customer through Contact for.
  3. All new associates will have Created automatically set in Associate processing 2.
Create new suppliers from incoming document automatically
In the AutoInvoice processing field in the Company data table, there is a setting named Create new suppliers from incoming document automatically. When set, Visma Business will do the lookup when Process document is run, but not stop the process if supplier is not found. The Create customer or supplier from XML process will run in the background and set Sup. no.. Sup. no. will automatically be added to the new rows in the Incoming product data.
Incoming product data
When the incoming document has been successfully processed, the product data is added to the Incoming product data, one row per product, with Sup. no. set on each row. When created, each row has Status set as 1 - New. Action is set according to what the supplier wants you to do with the product information. Possible values are 1 - Add, 2 - Update, and 3 - Delete. When the action is 1 - Add, it is expected to create a new product when processed. 2 - Update will update an existing product with data, while 3 - Delete will suspend the use of a product. For all actions, there are parameters in AutoInvoice processing that may influence the result.
Lookup and suggest product no
To ready the product data for update into the product tables, it is recommended to run the Lookup and suggest product no, as this checks whether the product already exists (when creating new) or the product is not found (for updating existing and deleting).
When run on rows with action 1 - Add, the processing will use EAN item no and Sup. prod. no. to identify whether the product already exists or not. If it does, status is set to 3 - Product exists. If it is not found, the processing will run a second check, this time for whether the intended Product no. does not exist in the Product table. The default function is that the processing looks for a match using Sup. prod. no.. If something else should be used, enter this value in the field New product no.. If the value is found in the product table, status is set to 4 - Duplicate found. If it is not found, status is set to 2 - Ready for update. If New product no. was left empty when running the processing, the field will now be updated with the value from Sup. prod. no..
When run on rows with action 2 - Update, the processing try to identify the product to update, using EAN item no and Sup. prod. no.. If no product is identified, status is set to 5 - Product not found. If a product is identified, status is set to 2 - Ready for update and the product to update is identified in the Product no. field.
When run on rows with action 3 - Delete, the processing try to identify the product to suspend/delete, using EAN item no and Sup. prod. no.. If no product is identified, status is set to 5 - Product not found. If a product is identified, status is set to 2 - Ready for update and the product to update is identified in the Product no. field.
AutoInvoice processing has parameters to change the handling when running Lookup and suggest product no. If action is 1 - Add and the product is found, selecting the parameter Update product if found when attempting to add new in AutoInvoice processing will change the action to 2 - Update, and the identified product will be set in Product no. as status is set to 2 - Ready for update. If action is 2 - Update and the product is not identified, selecting the parameter Create product if not found when updating product data in AutoInvoice processing will change the action to 1 - Add, and Sup. prod. no. will be copied to New product no. as status is set to 2 - Ready for update. If the parameter Process product automatically when ready for update is selected in AutoInvoice processing, when Lookup and suggest product no sets the status to 2 - Ready for update, the processing Process product data will start automatically after the lookup is done.
Process product data
When the status is set to 2 - Ready for update, and a product no is set in either New product no. (when action = 1 - Add) or Product no. (when action = 2 - Update or 3 - Delete), the product data is ready to be updated to Product, Delivery alternative and Price- and discount matrix. When running the Process product data processing, it will start with a lookup to make sure that both status and action is correct, in case status 2 - Ready for update has been set manually.
Note: This lookup does not include any of the parameters set in AutoInvoice processing.
When running the processing with action = 1 - Add, a new product will be created and a new row will be added to Delivery alternative and Price- and discount matrix, using the data set in Incoming product data. The created row is also updated with Incm. doc. no., making it possible to identify the incoming document that was the source. When all tables have been updated, the row in Incoming product data will be updated with status 6 - Processed, and the row will be deleted. The row will be left in the table with status 6 - Processed if the AutoInvoice processing parameter Keep Incoming product data when processed has been selected.
When running the processing with action = 2 - Update, the chosen product will be updated using the data set in Incoming product data. The row is also updated with Incm. doc. no., making it possible to identify the incoming document that was the source. When all tables have been updated, the row in Incoming product data will be updated with status 6 - Processed, and the row will be deleted. The row will be left in the table with status 6 - Processed if the AutoInvoice processing parameter Keep Incoming product data when processed has been selected. There are two parameters in AutoInvoice processing that influence how the product update is handled:
  • Add new price row when updating - Price is added to the table instead of replacing the existing price row.
  • Update only supplier related product data - Only Delivery alternative and Price- and discount matrix will be updated with new data.
Note: Empty fields in Incoming product data will also replace existing data. The exception is Unit, VAT and accounting group and Source country.
When running the processing with action = 3 - Delete, the chosen product will be updated with the processing method parameter Suspended and also updated in the Product table field Suspended. The row is also updated with Incm. doc. no., making it possible to identify the incoming document that was the source. When the product has been updated, rows in Delivery alternative and Price- and discount matrix with a matching Product no. and Sup. no. will be deleted. The row in Incoming product data will be updated with status 6 - Processed, and the row will be deleted. The row will be left in the table with status 6 - Processed if the AutoInvoice processing parameter Keep Incoming product data when processed has been selected. When handling a 3 - Delete action, the AutoInvoice processing parameter Delete product if possible influences the handling. If selected, deleting the product from the Product will also be attempted. If there is no reason to keep it (ie transactions), the product information will be deleted from Product, in addition to Delivery alternative and Price- and discount matrix. If it is not possible to delete, the Product table will only be updated with Suspended.

Send Order

Prerequisites:
  • An active Visma.net AutoInvoice integration
  • Purchase orders must be selected in Document copies.
  • Supplier must have an AutoInvoice operator no.
  • Supplier must have a valid Organisation no.
  • Supplier must be able to receive product catalogue electronically
  • Supplier must have Purchase orders sent by AutoInvoice set in Document delivery method
With the prerequisites met, sending order is basically done in the same way as sending invoices, i.e. print from the Order table. Any attachments set on the order are delivered as part of the electronic document as embedded data. Sent order can be viewed in the embedded UI.

Receive Order

Prerequisites:
  • An active Visma.net AutoInvoice integration
To be able to receive orders from Visma.net AutoInvoice, the document type must be enabled for receiving. This can be done in the Configure AutoInvoice account dialog in the Company data table.
Once enabled, downloading of orders is done in the Incoming document table, with the processing Download incoming document. Order documents are downloaded and added to the table as Incm. doc. type 1 - Order, with Incm. doc. status 1 - New. Attachments for the downloaded document, including the XML data and PDF data embedded in it, are added to the Incoming document attachment table as separate rows.
To create a sales order from the incoming order document, use the processing Process document. The XML data will now be read, first of all to identify the customer, and if different, the invoice customer. The Organisation no. field on the customer is used to identify the customer, and to be found, the value must not contain any spaces. If either customer is not found, the process will stop with an error message, and the Incoming document will change status to 3 - Error. If the customer is found, the order is created and can be found in the Order table. The connection between the two tables is the Incm. doc. no. field. The order will be created with Document delivery method = AutoInvoice for Order confirmation and Invoice.
If the customer is not found, this may be created based on the data in the XML file, using the processing Create customer or supplier from XML.
Order lines will be added to the order with Source type 17 - AutoInvoice. The products will be looked up based on the EAN item no or Product no. included in the XML file. The order of how the product is identified is:
  1. Barcode field in Barcode table
  2. EAN item no in Product table
  3. Product no. in Product table
If found, the data from the line in the XML file will be added to the Order line table. There will also be a check for price and discount in the Price- and discount matrix table, and if found, these will be added to the order. The price after discount from the incoming order will be added to Proposed price and compared with Price after discount on the order line. If divergent, the Price and Proposed price fields will be shown in red colour.
If not found, the order line will be still created but without a Product no., it will be displayed in red (until a valid Product no. has been entered) with the error text “ERROR! PRODUCT NOT FOUND. Check Incoming document.”. The price after discount and quantity from the XML file will be written to Proposed price and Proposed quantity, and will remain there even if a product is entered on the order line, so that it may be copy/pasted or compared to price/discount found in the Price- and discount matrix.
Create customer or supplier from XML
When the Create customer or supplier from XML processing is run, it repeats the check from Process document to make sure the customer doesn’t exist, and then uses available data in the XML file to create a customer in the Associate table. There are two options in the processing dialog for Create customer or supplier from XML. The default is 0 - Use next available number, which will assign the next available customer no regardless of available series. This can be overridden by setting a customer account series in Default customer no. series in the Company data table.
What happens when running Create customer or supplier from XML:
  1. If the customer is created with the processing, while the invoice customer already exists, the invoice customer will be connected to the customer in the Invoice customer no. field in the Associate table.
  2. If the invoice customer is created with the processing, while the customer exists without a different invoice customer already set, the newly created invoice customer will be connected to the customer in the Invoice customer no. field in the Associate table.
  3. If the invoice customer is created with the processing, while the customer exists with a different invoice customer already set, the new invoice customer will not be connected to the customer.
  4. If neither customer or invoice customer exists, both will be created but not connected in the Associate table.
  5. Contact e-mail address will be set in AutoInvoice e-mail address on the invoice customer if the AutoInvoice processing setting Copy contact e-mail to invoice customer has been selected.
  6. If set in the XML, the contact person for the customer will also be created and connected to the customer through Contact for.
  7. All new associates will have "Created automatically" set in Associate processing 2.
Create new customers from incoming document automatically
In the AutoInvoice processing field in the Company data table, there is a setting named Create new customers from incoming document automatically. When set, Visma Business will do the lookup when Process document is run, but not stop the process if either customer or invoice customer is not found. The Create customer or supplier from XML process will run in the background. Both Cust. no. and Invoice customer no. will automatically be added to the new order.
Process incoming documents automatically
In AutoInvoice processing there is also an option to make Process document run automatically when running the Download incoming document. When selected, the Create new customers from incoming document automatically option is also selected, making the incoming document handling a single step process. The option is run for all incoming document types.

Send Order response

Prerequisites:
  • An active Visma.net AutoInvoice integration
  • Order confirmations must be selected in Document copies.
  • Customer must have an AutoInvoice operator no.
  • Customer must have a valid Organisation no.
  • Customer must be able to receive order response electronically
  • Customer must have Order confirmations sent by AutoInvoice set in Document delivery method
  • The order must have a value in the Cust/Suppl. order no. field
When the prerequisites are met, the order is ready to be printed and sent to Visma.net AutoInvoice as an order response. The document will contain a response code on both header and line levels indicating whether it has been accepted as is, if changes have been made, or even if it has been rejected. The actual sending works in basically the same way as with orders or invoices. The only difference is that the order response does not contain any PDF attachments.

Receive Order response

Prerequisites:
  • An active Visma.net AutoInvoice integration

To be able to receive order response messages from Visma.net AutoInvoice, the document type must be enabled for receiving. This can be done in the Configure AutoInvoice account dialog in the Company data table.

Once enabled, downloading of orders is done using the processing Download incoming document in the Incoming document table. If documents ready for downloading are found, they will be downloaded and written to the table as Incm. doc. type 2 - Order response, with Incm. doc. status 1 - New. The XML data will be written to the Incoming document attachment table. The contents of the XML data field may be viewed using the View document(s) processing.
When downloaded, the Incoming document table will include the document sender’s name in the Sender field, and the order reference in Order no. This order reference represents the order being updated with the incoming document, which means the same value must exist in the Order table.
To update an existing order with the data in the order response document, run Process document. Visma Business will check two values to make sure that the order can be updated:
  • Order no.: If this does not exist in the Incoming document table, or no match is found in the Order table, the process will fail and the Incm. doc. status will change to 3 - Error.
  • Currency: If the currency in the incoming document does not match the currency of the order referenced in Order no., the process will fail and theIncm. doc. status will change to 3 - Error.
If both values are matched, the process will continue by first updating the order, followed by each order line referenced in the order response document.
Note: The Order no. field is editable with a lookup to the Order table. If the currency is different, the Currency no. must be changed in the Order table (and order lines, if the parameter Reduplicate from order head to order lines when storing is not enabled) to be able to update the order.
Identifying changes to order
To identify what has happened during the update, the EDI status dialog in both Order and Order line tables contain flags for AutoInvoice. Each flag set is represented by a colour to indicate whether the order line has been confirmed (green), rejected (red) or changed (orange). This colour will be displayed in the EDI status field. The updated order will also include a value in Incm. doc. no. matching the order response document in the Incoming document table.
Possible AutoInvoice related EDI status flags on the updated order:
  • Rejected by supplier (red)
  • Delivery date changed (orange)
Possible AutoInvoice related EDI status flags on the updated order line:
  • Rejected by supplier (red)
  • Delivery date changed (orange)
  • Quantity confirmed (green)
  • Quantity partially confirmed (orange)
  • Quantity increased by supplier (orange)
  • Product not found (red)
  • Product replaced (orange)
  • Price changed by supplier (orange)
  • Line added by supplier (orange)
Updating the order
The order response document contains a Response code on both order and line level that determines how the order and/or each order line is handled. This code may have one of three values:
  • 27. Rejected (cancel order or line)
  • 29. Accepted (confirm order or line)
  • 30. Accepted with change (confirmed, but which changes)
If the order response document has either code 27 or 29 in the header section, then all order lines will be handled in the same way as the header.
If the code is 27, the order and order lines will be cancelled, the order type will be changed to 6 - Unprocessed order and the value in EDI status will be displayed in red.
If the code is 29, the order and order lines will be confirmed without changes. This will be handled as if the Confirmed processing is run on the order. The quantity on all order lines will be confirmed, Required delivery date will be copied to Confirmed delivery date, and the value in EDI status will be displayed in green.
If the code is 30, this means that each order line will be updated separately. The order itself will either be confirmed with EDI status in green, or orange if the confirmed delivery date is different from the required delivery date. The Order EDI status will in this scenario be updated with the flag Delivery date changed.
Updating the order lines
When checking for order lines to update, the line reference in the incoming document is matched with Line no. in the Order line table. If not matched, a new line will be added with EDI status Line added by supplier.
If a matching order line is found, the handling depends on the response code.
If the code is 27, the order line is cancelled and EDI status Rejected by supplier is set.
If the code is 29, the order line is confirmed without changes. Required delivery date is copied to Confirmed delivery date and EDI status Quantity confirmed is set.
If the code is 30, the handling depends on incoming document data regarding product, quantity, price and delivery date.
The product in the incoming document is searched for in the Delivery alternative and Product tables. The order of how the product is identified is:
  1. EAN item no in Delivery alternative
  2. Sup. prod. no. in Delivery alternative
  3. EAN item no in Product
  4. Product no. in Product
If found, the update of the order line proceeds. If not found, EDI status Product not found is set and the description “ERROR! PRODUCT NOT FOUND. Check Incoming document.” will be displayed in red on the order line. Price and quantity from the incoming document will be written to Proposed price and Proposed quantity respectively and displayed in red.
If the product is found, the order line is updated with Price and Confirmed delivery date. Note that as the incoming document only contain a net price, this is compared with the Price after discount on the order line. If different, the EDI status Price changed by supplier is set. Any discounts on the purchase order line are removed, before adding the price, so that Price is the same as Price after discount.
The delivery date in the incoming document is compared with Required delivery date on the order line, before being set as Confirmed delivery date. If different, the EDI status Delivery date changed is set.
Quantity from the incoming document is added to the Confirmed field, and compared with the sum of Quantity and Finished. If matched, EDI status Quantity confirmed is set. If Confirmed is lower, EDI status Quantity partially confirmed is set. If Confirmed is higher, Quantity is increased so that Quantity + Finished matches Confirmed, and EDI status Quantity increased by supplier is set.
If the product is found, but does not match the product on the order line, the Product no. and Price on the order line is replaced by incoming document data and EDI status Product replaced is set.
Handling of multiple response documents to a single order
As the supplier may send several responses to the same purchase order, the Incoming document tables are able to handle this eventuality. If, when downloading, the order reference already exists in the Incoming document table, the new downloaded document will be added as a new row in the Incoming document change table with status 1 - New, reusing the same Incm. doc. no.. Existing rows in the Incoming document change table will be left untouched, while the Incoming document will be updated with status 1 - New. The exception is if one of the previous change documents have status 3 - Error. In this case, the Incoming document will keep the status 3 - Error, even when new documents have been added.
Note: Both statuses 1 - New and 3 - Error will be handled when running the processing Process document, the only difference is that documents with 3 - Error have already been attempted and failed. If the Incoming document has status 2 - Processed, no change document will be handled with Process document. Also, any change document with status 2 - Processed will not be handled even if the Incoming document has status 1 - New or 3 - Error.

Send Despatch advice

Prerequisites:
  • An active Visma.net AutoInvoice integration
  • Customer must have an AutoInvoice operator no.
  • Customer must have a valid Organisation no.
  • Customer must be able to receive despatch advice electronically
  • The order must have a value in the Cust/Suppl. order no. field
  • Packing slips selected in Document copies or
  • Create order document for despatch advice selected in AutoInvoice processing.
Despatch advice is a document type that in terms of Visma Business documents contains information present on Packing slips and Consignment notes. To be able to send a despatch advice, a packing slip must first have been printed and updated in the Order document table. Getting the document written to Order document requires one of two options selected: Packing slips in Document copies or Create order document for despatch advice in AutoInvoice processing. Note that unlike the other AutoInvoice documents, there is no document delivery method for Despatch advice, so there is no requirement regarding print method, as long as writing to the Order document table is triggered. This also means that all data in Order document with Doc. type = 3 - Packing slips is available for sending to AutoInvoice. If you want to make sure that a packing slip cannot be transferred by mistake, use the order document processing Set AutoInvoice status Cannot transfer to change its AutoInvoice status and filter it out.
Adding Tracking ID to the document
The main difference between a despatch advice and the other document types, is that you can add tracking ID to the document before sending, using the Outgoing tracking table. You may add multiple rows of tracking IDs to the table before sending, so that when the connected packing slip is sent to AutoInvoice as a despatch advice, the tracking IDs are included and delivered to the customer. Note that as the despatch advice format only has a single field for Tracking ID, if there are multiple rows for the document, the tracking IDs are separated by semicolon in the XML.

Receive Despatch advice

Prerequisites:
  • An active Visma.net AutoInvoice integration
To be able to receive despatch advice messages from Visma.net AutoInvoice, the document type must be enabled for receiving. This can be done in the Enable AutoInvoice dialog in the Company data table.
Once enabled, downloading of despatch advice is done using the processing Download incoming document in the Incoming document table. If documents ready for downloading are found, they will be downloaded and written to the table as Incm. doc. type 4 - Despatch advice, with Incm. doc. status 1 - New. The XML data will be written to the Incoming document attachment table. The contents of the XML data field may be viewed using the View document(s) processing.
When downloaded, the Incoming document table will include the document sender’s name in the Sender field, and the order reference in Order no. This order reference represents the order being updated with the incoming document, which means the same value must exist in the Order table.
To update an existing order with the data in the despatch advice document, run Process document. Visma Business will check the incoming document Order no. against the Order table to make sure that there is data to update. If Order no. does not exist in the Incoming document table, or no match is found in the Order table, the process will fail and the incoming document will change status to 3 - Error.
If matched, the order will be updated with data from the despatch advice document.
Updating the order
Information that is (or may be) updated from despatch advice:
  • Tracking ID will be updated to the Incoming tracking table. If a semicolon is found, or the XML data overruns the length of the Tracking ID field (80 characters), the data that follows will be written to a new row.
  • Gross weight and Volumeon the Order line. This information is accumulated to Gross weight and Volume on the order.
  • Arrival/departure date, on order and order lines.
  • Use by date on order lines.
These updates depend on that the the relevant data is present in the incoming XML file. For more details, see the mapping document for Despatch advice.


We would appreciate your feedback. Send feedback on this topic to Visma.