eAccounting Connector - Item Update
The Item Update function synchronizes product information from the eAccounting ERP system into the App4Sales internal item database. This process retrieves active articles and their associated VAT percentages, then maps these to App4Sales' internal item structure, calculating stock levels and classifications. Inactive articles in eAccounting are skipped.
Data Source Configuration
Item data is retrieved from the eAccounting API endpoints:
Articles: Fetched from
/v2/articles. This endpoint provides core item details such as product number, names, prices, stock balances, and associated labels.VAT Percentages: Fetched from
/v2/articleaccountcodings. This endpoint provides VAT rate information used for calculating the correct VAT percentage in App4Sales.
Data Mapping Table (App4Sales Item)
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
ItemCode |
| Direct mapping of the eAccounting article number. |
Description |
| Direct mapping of the eAccounting article name. |
Description2 |
| Direct mapping of the eAccounting article English name. |
InternalItemCode |
| The internal identifier from eAccounting. |
SalesPrice |
| The net sales price of the article. |
Unit |
| The name of the unit of measure for the article. |
VatPercentage |
| Looked up from the fetched VAT percentages using |
EanCode |
| The barcode of the first EAN code associated with the article, if available. |
ItemCategories (Gross price) |
| A custom item category named "Gross price" is created, with its value set to the |
PurchasePackageSize |
| If an |
LastAvailableStock | Derived | Calculated based on stock values from eAccounting using a configurable stock formula (see "Stock & Availability" section). |
StockIndicator | Derived | Determined by the calculated stock values and connector settings (see "Stock & Availability" section). |
ItemClasses (Filter) |
| A hardcoded |
Special Logic & Filters
Article Filtering: Only articles where
Article.IsActiveistrueare processed and synchronized to App4Sales. Inactive articles are skipped.Stock Formula Execution: The connector retrieves several stock-related fields from eAccounting articles (
StockBalanceReserved,StockBalance,StockBalanceAvailable). These values are then passed to anExecuteStockFormulamethod. This method takes these stock fragments and a stock formula (if configured inAdministrationSession.CurrentSession.StockFormula) to calculate theLastAvailableStock. If a custom script for stock calculation exists, it can override this default behavior.Stock Indicator Calculation: The
StockIndicator(Red, Orange, Green) for an item is determined by theCalculateStockIndicatorByFormulamethod, which considers the calculated stock values and several connector settings. This logic can also be overridden by a custom script.
Domain Specifics
Price Logic
Net Price: The
Article.NetPriceis directly mapped toApp4Sales Item.SalesPrice.Gross Price: The
Article.GrossPriceis stored as a customItemCategorynamed "Gross price".VAT Percentage: The VAT percentage for an item is derived from the
VatPercentage.VatRatePercentcorresponding to theArticle.CodingId. This value is multiplied by 100 to convert it from a decimal rate (e.g., 0.12) to a percentage (e.g., 12%).
Stock & Availability
Stock Data Source: Stock information (
StockBalance,StockBalanceReserved,StockBalanceAvailable) is directly sourced from the/v2/articlesAPI endpoint.Last Available Stock Calculation: This value is dynamically calculated. If a
StockFormulais defined in the App4Sales administration settings, it processes the raw stock figures (StockBalanceReserved,StockBalance,StockBalanceAvailable) to determine theLastAvailableStock.Stock Indicator: The visual stock indicator (Red, Orange, or Green) is determined by the
CalculateStockIndicatorByFormulamethod based on the calculated stock.If the setting "Get stock indicator by formula" (
GetStockIndicatorByFormula) is disabled, the indicator defaults to Orange.If a custom script for
CalculateStockIndicatorByFormulais provided and executed, its result is used.Otherwise, a default logic is applied:
If "AvailableStock" is not present, it's Orange.
If "ShelfStock" and "ToBeDelivered" are present:
If
(ShelfStock - ToBeDelivered) > 0, the indicator is Green.Otherwise, if "Economic stock on stock indicator" (
EconomicStockOnStockIndicator) is enabled andAvailableStock + ToBeReceived > 0, the indicator is Orange.Otherwise, the indicator is Red.
If "ShelfStock" and "ToBeDelivered" are not both present:
If
AvailableStock > 0, the indicator is Green.Otherwise, the indicator is Red.
The values
QuantityForRedandQuantityForGreenfrom App4Sales settings can influence the stock indicator calculation if a custom script uses them.
Classification & Attributes
Item Categories: A fixed
ItemCategorynamed "Gross price" is added, containing the article's gross price.Item Classes: A fixed
ItemClassnamed "Filter" is created. Its values are populated from theArticle.ArticleLabelsreceived from eAccounting. Labels that match thePurchasePackageSizePrefixsetting are excluded from becoming item class values.
Related Settings & Prerequisites
Purchase Package Size Prefix: (
PurchasePackageSizePrefix) A connector setting used to identify article labels that should be interpreted as the item's purchase package size. Example: "PACK_".Stock Formula: (
AdministrationSession.CurrentSession.StockFormula) A formula defined in the App4Sales administration settings that dictates how raw stock values from eAccounting are combined to calculate theLastAvailableStock.Get stock indicator by formula: (
Session.ConnectorBaseSettings.GetStockIndicatorByFormula) A boolean setting that, if false, causes the stock indicator to default to Orange regardless of calculated stock.Economic stock on stock indicator: (
Session.ConnectorBaseSettings.EconomicStockOnStockIndicator) A boolean setting that, if true, considers "ToBeReceived" stock when determining the Orange stock indicator.Quantity for Red: (
App4SalesSettings.QuantityForRed) An App4Sales setting defining the threshold for a Red stock indicator. Used if a custom script for stock indicator calculation is implemented.Quantity for Green: (
App4SalesSettings.QuantityForGreen) An App4Sales setting defining the threshold for a Green stock indicator. Used if a custom script for stock indicator calculation is implemented.