Uniconta - Item Update
This function synchronizes item data from Uniconta ERP to the App4Sales platform. It retrieves various item-related information, including basic item details, prices, stock levels, images, categories, and descriptions, and maps them to the internal App4Sales item structure. The synchronization process can handle both standard items and items with variants, and it considers several connector settings to tailor the data transfer.
Data Source Configuration
The connector retrieves item data directly from the Uniconta ERP system via its API. Key data sources include:
Items: All active items (`InvItemClient`) are retrieved.
VAT Codes: VAT percentages (`GLVatClient`) are fetched based on configured VAT codes.
Item Categories: Item group definitions (`InvGroupClient`) are retrieved.
Price Lists: Customer price lists (`DebtorPriceListClient`) are retrieved and updated in App4Sales.
Item Prices: Specific item prices per price list (`InvPriceListLineClient`) are retrieved.
Selected Variants: Configured item variants (`InvVariantCombiClient`, `InvVariantDetailClient`) are retrieved. This is controlled by the 'Disable selected variants' setting.
Standard Variants: Standard item variants (`InvStandardVariantClient`, `InvStandardVariantCombiClient`) are retrieved. This is controlled by the 'Disable standard variants' setting.
Variant Stocks: Stock levels for item variants (`InvItemStorageClient`) are retrieved if selected or standard variants are not disabled.
Item Notes: User-defined notes (`UserNotesClient`) linked to items are retrieved.
Item Descriptions: Multi-language item descriptions (`InvItemTextClient`, `InvItemNameGroupClient`) are retrieved.
Item Pictures: Image attachments (`UserDocsClient`) associated with items are retrieved. This feature respects a daily request limit of 5000 and can be disabled.
Data Mapping Table: Items
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
|
| Uniconta's internal identifier for the item. |
|
| Timestamp of the last modification in Uniconta. |
|
| The primary currency of the item. Converts the Uniconta currency enum to a string. |
|
| The main name or description of the item. |
|
| The European Article Number for the item. |
|
| If |
|
| The first sales price defined in Uniconta. |
|
| Available stock. Prioritizes variant-specific stock if found; otherwise, uses the stock from the base item. |
|
| The unit of measure for the item. |
| Connector Setting: | Set to 'I' if |
| Derived from | The VAT percentage associated with the item's configured VAT code. |
|
| The type of item (e.g., 'Inventory', 'Service'). Converts the Uniconta item type enum to a string. |
|
| If |
|
| Raw byte data of item images from Uniconta attachments (PNG, JPEG, BMP, GIF). |
| User-defined field ( | Date retrieved from the user-defined field specified by |
| User-defined field ( | Status retrieved from the user-defined field specified by |
|
| Additional descriptions populated based on retrieved multi-language descriptions and the configured language codes for description fields. |
Data Mapping Table: Item Categories
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
|
| Product category from Uniconta. |
|
| Category group from Uniconta. |
|
| Item weight. |
|
| Item volume. |
|
| Minimum purchase quantity. |
|
| Standard purchase quantity. |
|
| The name of the item group to which the item belongs. |
|
| The discount group assigned to the item. |
User-defined fields |
| All user-defined fields configured in Uniconta for items are mapped as item categories. |
|
| Values for up to 5 variants if |
|
| Concatenated text from all user notes associated with the item. |
Data Mapping Table: Price Lists and Prices
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
| Derived from | A hash code generated from the currency name (e.g., EUR, USD) is used as the PriceList ID. |
| Currency (e.g., EUR) | The currency name is used as the PriceList Code. |
| Currency (e.g., EUR) | The currency name is used as the PriceList Currency. |
| Hardcoded | Always |
| Currency (e.g., EUR) | The currency name is used as the External Currency. |
| Item Code | The item code to which this price applies. |
|
| Prices are determined based on a hierarchy: direct item price, discount group price, then item group price. Parent price lists are also considered. |
| Derived from Currency | Matches the ID of the generated PriceList. |
Special Logic & Filters
Item Filtering (
ShouldSyncItem): Items can be filtered based on a boolean user-defined field. If the settingOnlySyncItemsWithCheckedUserFieldis configured, only items with this user field checked (true) will be synchronized. If the setting is empty, all items are synchronized.Item Picture Synchronization: Item pictures are retrieved from Uniconta attachments. This process is automatically disabled if
AdministrationSession.CurrentSession.PimSettings.UseImagesOnlyFromPIMis true. Additionally, to prevent hitting Uniconta's daily request limit (5000 requests), picture synchronization is automatically disabled unless it's a Sunday (DateTime.Now.DayOfWeek == DayOfWeek.Sunday) or the settingSyncItemPicturesis explicitly true. If disabled, a key setting namedUniconta_SyncItemPicturesis saved with value "0".Variant Handling: The system can generate unique item codes for variants by appending variant values (e.g.,
ITEMCODE~VARIANT1~VARIANT2) if theUseVariantsAsPartOfItemCodesetting is enabled.Language-Specific Descriptions: The connector attempts to populate additional description fields (Description2-5) based on the most populated languages found in item descriptions, excluding the main language. The default language for description field 1 is determined by
AdministrationSession.CurrentSession.Administration.DefaultLanguageCodeor overridden byLanguageCodeForDefaultItemNamessetting if valid.Stock Calculation (
ToItemStocksDictionary): Stock values consider both base item stock (`InvItemClient`) and variant-specific stock (`InvItemStorageClient`). If the settingDetermineNextDeliveryDateAndToBeReceivedAmountBasedOnPurchaseOrdersis enabled, next delivery dates and 'to be received' quantities are calculated based on Uniconta purchase orders and lines.
Domain Specifics (Expanded)
Price Logic
Uniconta item prices are retrieved from InvPriceListLineClient and InvItemClient. The system constructs custom price lists in App4Sales based on the currency of the sales prices (SalesPrice1, SalesPrice2, SalesPrice3) defined in Uniconta. The price determination follows a hierarchy:
Direct Item Price: Price defined explicitly for the item in a price list.
Discount Group Price: Price defined for the item's discount group within a price list.
Item Group Price: Price defined for the item's item group within a price list.
Prices can also be inherited from parent price lists (DebtorPriceListClient.LinkToPricelist). When multiple prices apply, the one with the highest priority (Direct > Discount Group > Item Group) and lowest quantity threshold is chosen. Price calculation subtracts any specified discount amount and percentage from the base price.
Image Handling
Images are sourced from Uniconta's attachments functionality, specifically UserDocsClient records linked to items. The connector only processes image files with extensions PNG, JPEG, BMP, or GIF. There is no explicit filename-to-item matching logic other than the attachment being linked to the item's RowId in Uniconta. The system performs no resize or compression; raw byte data is transferred. Synchronization is subject to a daily API request limit (5000) and is automatically managed by the connector to avoid exceeding it, potentially disabling sync on non-Sundays.
Stock & Availability
Stock information (`LastAvailableStock`) is determined by looking at available stock on the `InvItemClient` and, if variants are used, on the `InvItemStorageClient`. If DetermineNextDeliveryDateAndToBeReceivedAmountBasedOnPurchaseOrders is enabled, the 'To Be Received' quantity and `NextDeliveryDate` are calculated from Uniconta purchase orders (`CreditorOrderClient`) and their lines (`CreditorOrderLineClient`), specifically considering quantities not yet delivered. Otherwise, 'To Be Received' comes from `InvItemClient.QtyOrdered`.
Matrix & Attributes
Variant handling is supported for both selected variants (`InvVariantCombiClient`, `InvVariantDetailClient`) and standard variants (`InvStandardVariantClient`, `InvStandardVariantCombiClient`). When variants are used, the App4Sales ItemCode will include the variant values. Up to 5 variant values (Variant1 to Variant5) can be mapped as item categories. Item attributes are primarily mapped from Uniconta's item categories (`_PrCategory`, `_CategoryGroup`, `_Group`, `_DiscountGroup`) and all user-defined fields associated with an item. Item notes are also concatenated and mapped as an 'Notes' item category.
Related Settings & Prerequisites
Company ID: Uniconta Company ID (
Settings.CompanyId).Uniconta API Key: (
settings.UnicontaApiKey).Uniconta Username & Password: Credentials for Uniconta API access (
settings.UnicontaUsername,settings.UnicontaPassword, orSession.Administration.Username,Session.Administration.Password).Use variants as part of item code: (
UseVariantsAsPartOfItemCode) - If enabled, variant values are appended to the item code.Disable selected variants: (
DisableSelectedVariants) - If true, selected variants are not processed.Disable standard variants: (
DisableStandardVariants) - If true, standard variants are not processed.Only sync items with checked user field: (
OnlySyncItemsWithCheckedUserField) - Specifies a boolean user-defined field in Uniconta. Only items where this field is checked will be synced.VAT Code used for items: (
VatCodeUsedForItems) - Specifies the VAT code to use for items.Items are VAT included: (
ItemsAreVatIncluded) - Determines if sales prices include VAT.Use default sales quantity as purchase package size: (
UseDefaultSalesQuantityAsPps) - If true, uses the default sales quantity for purchase package size.Use minimum purchase quantity for package size: (
UseMinimumPurchaseQuantityForPackageSize) - If true andUseDefaultSalesQuantityAsPpsis false, uses the minimum purchase quantity for package size.Item user field for next delivery date: (
ItemUserFieldForNextDeliveryDate) - Specifies a user-defined field in Uniconta that contains the next delivery date.Custom field for item status: (
CustomFieldForItemStatus) - Specifies a user-defined field in Uniconta that contains the item status.Language code for default item names: (
LanguageCodeForDefaultItemNames) - Overrides the default language code for item descriptions.Determine next delivery date and to be received amount based on purchase orders: (
DetermineNextDeliveryDateAndToBeReceivedAmountBasedOnPurchaseOrders) - If enabled, stock calculations consider open purchase orders for 'to be received' and next delivery dates.
Known Limitations
Image Sync Frequency: Due to Uniconta API limitations (5000 requests/day), image synchronization is throttled and potentially disabled on most days, being fully enabled only on Sundays.
Image Processing: No resizing or compression of images is performed; images are transferred as raw byte data.
Hardcoded PriceList Selectable: The automatically generated price lists in App4Sales (based on Uniconta currencies) are marked as non-selectable.