Skip to main content

Visma - Item sync

Visma.NET Connector - ItemUpdate This function synchronizes item data from Visma.NET to App4Sales. It processes inventory information, V...

Updated over a week ago

Visma.NET Connector - ItemUpdate

This function synchronizes item data from Visma.NET to App4Sales. It processes inventory information, VAT details, unit of measures, sales categories, and item attributes. It also handles item images and updates stock information, ensuring that App4Sales has the most current product data. The synchronization typically runs as part of a scheduled connector sync.

Data Source Configuration

The connector retrieves item-related data directly from the Visma.NET API. This includes:

  • Inventory Information: Core item data (e.g., product codes, descriptions, default prices) are fetched from Visma.NET Inventory.

  • VAT Information: VAT zones, categories, and rates are retrieved from Visma.NET VAT settings.

  • Unit of Measures: Units used for sales, purchase, and base units are pulled from Visma.NET Unit of Measure definitions.

  • Sales Categories: Sales categories and their sub-categories are fetched from Visma.NET Sales Categories, and linked to inventory items.

  • Item Attachments (Images): Image data is fetched for each item's attachments from the Visma.NET API, provided that attachment synchronization is enabled in the connector settings and PIM images are not exclusively used.

  • Order Types: Active sales order types are retrieved from Visma.NET Sales Order Types to ensure consistency with App4Sales order types.

Data is pulled from the Visma.NET API using internal API calls for each specific entity.

Data Mapping Table - Items

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

ItemCode

InventoryNumber (from Visma.NET Inventory)

Direct mapping from the Visma.NET inventory number.

InternalItemCode

InventoryId (from Visma.NET Inventory)

Mapped from the Visma.NET internal inventory ID, converted to a string.

Description

Description (from Visma.NET Inventory)

Direct mapping of the item description.

SalesPrice

DefaultPrice (from Visma.NET Inventory)

The default sales price for the item.

VatIncluded

Hardcoded

Always set to 'E' (Exclusive).

VatPercentage

VatCode (from Visma.NET Inventory), VatRate (from Visma.NET VAT)

Derived from matching the item's VatCode with a Visma.NET VAT category. The percentage is taken from the most recent schedule's VAT rate for the matched VAT zone (based on DefaultVatCodeForItems setting).

Unit

SalesUnit (from Visma.NET Inventory)

The sales unit for the item.

EanCode

CrossReferences (from Visma.NET Inventory)

Extracted from CrossReferences where AlternateType is 'Barcode'.

ItemStatus

CustomItemFieldForTheItemStatus setting, Attributes (from Visma.NET Inventory)

If the setting CustomItemFieldForTheItemStatus is configured, the item status is sourced from a custom field or an attribute in Visma.NET Inventory matching this setting. The value must be one of the pre-defined available item statuses in App4Sales.

Data Mapping Table - ItemClasses

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

ItemClass (Type: "Filter")

PostingClass.Description (from Visma.NET Inventory)

A custom ItemClass named "Filter" is created based on the item's posting class description.

ItemClass (Type: "Item class")

ItemClass.Description (from Visma.NET Inventory)

A custom ItemClass named "Item class" is created based on the item's item class description.

ItemClass (Type: "Sales category")

Description (from Visma.NET Sales Category)

For each sales category an item belongs to, an ItemClass is created. If the sales category has a parent, the ItemClass description will be the parent's name. Otherwise, it will be "Sales category". The ItemClass value is the sales category's name.

Data Mapping Table - ItemCategories

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

ItemCategories

Attributes (from Visma.NET Inventory)

Item categories are derived from Visma.NET Inventory attributes.

  • If OnlyUseAttributeDescriptionForItemCategories setting is true: The category name is the attribute's ID, and the value is the attribute's description (or value if description is empty).

  • Otherwise: The category name is the attribute's ID, and the value is a concatenation of the attribute's value and description (e.g., "Value - Description").

Data Mapping Table - Stock

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

LastAvailableStock

AvailableForShipment (from Visma.NET Inventory Warehouse Details), Live stock call (if enabled)

  • If SyncDetailedStockInformation setting is true: Stock is retrieved via a live API call using the internal GetStockForItemsCommand. The AvailableStock from this call is used.

  • If SyncDetailedStockInformation setting is false:

    • If no specific warehouses are configured: Sum of AvailableForShipment across all warehouse details for the item.

    • If specific warehouses are configured (via Warehouse setting): Sum of AvailableForShipment for the configured warehouses only.

fullStockValues (internal)

Live stock call (if enabled), VismaNetInventorySummary

If SyncDetailedStockInformation setting is true, detailed stock values (Shelf Stock, To Be Delivered, To Be Received, Available For Shipment) are retrieved via a live API call and stored in fullStockValues. Warehouse filtering (include/exclude) can apply based on settings. The final AvailableStock is calculated using the configured stock formula.

Data Mapping Table - Purchase Package Size

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

PurchasePackageSize

PurchasePackageSizeAttribute setting, Attributes (from Visma.NET Inventory), UnitRate (from Visma.NET Unit of Measure)

Defaults to 1.

  • If PurchasePackageSizeAttribute setting is configured and a matching attribute exists in Visma.NET Inventory: The value from this attribute is used if it can be parsed as a decimal.

  • Otherwise, based on the UnitFieldForPackageSize setting:

    • If "Sales": Uses the UnitRate of the SalesUnit (falls back to BaseUnit).

    • If "Purchase": Uses the UnitRate of the PurchaseUnit (falls back to BaseUnit).

    • Otherwise: Uses the UnitRate of the BaseUnit.

Special Logic & Filters

  • Item Filtering: Items with a status of 'Inactive' or 'NoSales' in Visma.NET Inventory are skipped during synchronization.

  • Sales Category Linking: Sales categories are retrieved from Visma.NET and processed to create hierarchical information. Items are then linked to these sales categories.

  • Order Type Synchronization: Active sales order types from Visma.NET are synchronized to App4Sales. The standard "SO" order type in Visma.NET is mapped to the "Order" type in App4Sales. New active Visma.NET order types are added to App4Sales if they don't already exist, with SendToBackoffice set to true and OnRelationCard set to false by default.

Domain Specifics (Expanded)

Image Handling

The connector handles item images attached to items in Visma.NET.

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

ItemPictureLink.Hash

Derived from image binary data

A hash is generated from the raw bytes of the image downloaded from Visma.NET.

ItemPictureLink.Sequence

Implicit from Visma.NET Attachments order

The sequence number is based on the alphabetical order of the attachment names from Visma.NET (starting from 1).

ItemPictureLink.ItemCode

InventoryNumber (from Visma.NET Inventory)

Links the picture to the App4Sales item using its ItemCode.

ItemPicture.Hash

Derived from image binary data

Same hash as used in ItemPictureLink.

ItemPicture.PictureBytes

Image data from Visma.NET Attachment API

Raw image bytes downloaded from Visma.NET. Only stored if the hash does not already exist in App4Sales.

ItemPicture.Source

Hardcoded

Always set to 'ERP'.

Logic/Notes:

  • Images are retrieved from inventory.Attachments (Visma.NET).

  • Images are only synced if DontSyncErpAttachments setting is false and UseImagesOnlyFromPIM PIM setting is false.

  • Each attachment's raw data is fetched via a specific API call using its attachment ID.

  • A hash is computed from the image's binary content to identify unique images.

  • If an image with the same hash already exists in App4Sales, only a link to the existing image is created; the image data itself is not re-stored.

  • Images are sorted alphabetically by their filename from Visma.NET before assigning a sequence.

Stock & Availability

Stock information is synchronized and can be configured to use either summarized data or detailed live calls.

Logic/Notes:

  • The primary stock field updated is LastAvailableStock on the App4Sales Item.

  • Live Stock Information: If the SyncDetailedStockInformation setting is enabled, the connector makes a real-time API call to Visma.NET to retrieve detailed stock values. These values are then processed (including any configured stock formula) to determine LastAvailableStock. This also populates an internal fullStockValues dictionary with detailed stock breakdowns:

    • Shelf Stock (from Visma.NET OnHand)

    • To Be Delivered (from Visma.NET SoBooked)

    • To Be Received (from Visma.NET SoShipped)

    • Available For Shipment (from Visma.NET AvailableForShipment)

    • Available Stock (calculated using the App4Sales stock formula)

    Warehouse filters (warehousesToInclude, warehousesToExclude) can be applied to these detailed stock calls.

  • Summarized Stock Information: If SyncDetailedStockInformation is disabled, LastAvailableStock is calculated from the WarehouseDetails provided within the main Visma.NET Inventory data.

    • If the Warehouse setting is empty, stock is summed from all available warehouses in Visma.NET.

    • If the Warehouse setting contains a comma-separated list of warehouses, stock is summed only from those specified warehouses.

Matrix & Attributes

The connector processes various attributes and classification data from Visma.NET to enrich App4Sales items with ItemClasses and ItemCategories.

Logic/Notes:

  • ItemClasses:

    • "Filter" ItemClass: Created from inventory.PostingClass.Description.

    • "Item class" ItemClass: Created from inventory.ItemClass.Description.

    • Sales Category ItemClasses: For each sales category an item belongs to, an ItemClass is generated. The name of the ItemClass is either "Sales category" or the parent category's name if a hierarchy exists. The value is the specific sales category name.

  • ItemCategories:

    • Derived from VismaNetInventoryAttribute objects.

    • The content of the ItemCategory (name/value combination) is influenced by the OnlyUseAttributeDescriptionForItemCategories setting.

Related Settings & Prerequisites

The following connector settings and prerequisites influence the Item Update process:

  • DefaultVatCodeForItems: Used to identify the relevant VAT zone in Visma.NET for calculating VatPercentage.

  • Warehouse: A comma-separated list of warehouse IDs. If provided, stock synchronization will only consider these warehouses when SyncDetailedStockInformation is false.

  • SyncDetailedStockInformation: Boolean flag. If true, the connector performs live API calls to retrieve detailed stock information and applies the App4Sales stock formula. If false, stock is derived from the main inventory data.

  • DontSyncErpAttachments: Boolean flag. If true, item attachments (images) from Visma.NET will not be synchronized to App4Sales.

  • CustomItemFieldForTheItemStatus: Specifies the name of a custom field or attribute in Visma.NET from which to source the item's status. The value must match a predefined App4Sales item status.

  • PurchasePackageSizeAttribute: Specifies the name of an attribute in Visma.NET from which to source the PurchasePackageSize. If present, it overrides the unit-based calculation.

  • UnitFieldForPackageSize: Determines which unit (Sales, Purchase, or Base Unit) from Visma.NET to use for calculating PurchasePackageSize if PurchasePackageSizeAttribute is not used.

  • PIM Setting UseImagesOnlyFromPIM: If this PIM setting is enabled in App4Sales, images from Visma.NET will not be synchronized, regardless of other connector settings.

  • App4Sales Stock Formula: The calculation for "Available Stock" (when SyncDetailedStockInformation is true) is based on the formula configured in App4Sales.

Did this answer your question?