Winbas Connector - Send Order To Backoffice
This document details the process by which App4Sales orders are prepared and transmitted to the Winbas ERP system. The process involves mapping App4Sales order data to a Winbas-specific XML structure, saving it locally, and then uploading it via FTP. This function primarily handles order headers, order lines, and associated customer information.
Data Source Configuration
Orders originate from the App4Sales platform. The Winbas connector retrieves the order details from the App4Sales internal data structure. The processed order data is then exported as an XML file. This XML file is subsequently transferred to the Winbas ERP system via FTP using the connection details configured in the connector settings.
Data Mapping Table: Order Header
App4Sales Field | Source Field (XML Node) | Logic/Notes |
Order ID (Internal) | UID | Mapped from the connector setting "Unique Identier" ( |
Last Synchronization Date | LastSync | Automatically set to the current date and time of the synchronization. |
Connector Version | Version | Hardcoded to "1.8.5366.26707". |
Order Number (Winbas) | OrderItems[0].Number | Mapped from |
Customer Order Number | OrderItems[0].YourOrderNumber | Mapped directly from |
VAT Code | OrderItems[0].VATCode | Determined by customer's VAT liability: if |
Total VAT Amount | OrderItems[0].VATAmount | Mapped from |
Order Type | OrderItems[0].Type | Hardcoded to "1". |
Salesperson Code | OrderItems[0].SalesmanCode | Based on connector settings: If "Set salesmancode based on customer manager off a customer for sending order" ( |
Customer's Reference | OrderItems[0].Reference | Mapped from |
Our Reference | OrderItems[0].OurReference | Mapped from |
Order Date | OrderItems[0].OrderDate | If connector setting "Send order date as delivery date" ( |
Delivery Date | OrderItems[0].TimeOfDelivery | If connector setting "Send order date as delivery date" ( |
Import Status | OrderItems[0].ImportStatus | Hardcoded to "1". |
Customer Number | OrderItems[0].CustomerNumber | Mapped from |
Order Notes/Comment | OrderItems[0].Comment | Mapped from |
Customer Name | OrderItems[0].Customer.Name | Mapped from |
Customer Number (within Customer node) | OrderItems[0].Customer.Number | Mapped from |
Price List | OrderItems[0].Customer.PriceList | Mapped from |
Terms of Payment | OrderItems[0].Customer.TermsOfPayment | Mapped from |
Terms of Delivery | OrderItems[0].Customer.TermsOfDelivery | Mapped from |
Customer VAT Code | OrderItems[0].Customer.VATCode | Determined by customer's VAT liability, same logic as Order Header VAT Code. |
Customer Post Address | OrderItems[0].Customer.PostAddress | Composed from the App4Sales customer's delivery address (type "DEL") or, if not available, visiting address (type "VIS"). Format: "PostCode City". |
Customer Country Code | OrderItems[0].Customer.CountryCode | Mapped from the |
Customer Telephone | OrderItems[0].Customer.Telephone | Mapped from the |
Customer Email | OrderItems[0].Customer.eMail | Mapped from the |
Data Mapping Table: Order Line
App4Sales Field | Source Field (XML Node) | Logic/Notes |
Line Number | OrderItems[0].Row[i].Number | Sequential index (0-based) for each order line. |
Product Number | OrderItems[0].Row[i].ProdNumber | Mapped from |
Quantity | OrderItems[0].Row[i].Amount | Mapped from |
Discount Percentage | OrderItems[0].Row[i].Discount | Calculated based on original price and actual selling price. Only sent if connector setting "Send original price and calculate discount" ( |
Override Price Flag | OrderItems[0].Row[i].OverridePrice | Set to true if connector setting "Send original price and calculate discount" ( |
Unit Price | OrderItems[0].Row[i].Price | If connector setting "Send original price and calculate discount" ( |
VAT Code | OrderItems[0].Row[i].VATCode | Determined by customer's VAT liability, same logic as Order Header VAT Code. |
Line Comment | OrderItems[0].Row[i].Comment | Mapped from |
Line Delivery Date | OrderItems[0].Row[i].TimeOfDelivery | If connector setting "Use instruction as orderline delivery date" ( |
Special Logic & Filters
Order Number Generation: If an App4Sales order does not have an assigned order number, the connector generates a new one using the Portal Server Provider and updates the App4Sales order accordingly.
XML Serialization: The generated Winbas
OrderInfoobject is serialized into an XML string usingwindows-1252encoding. The connector specifically handles and replaces self-closing XML tags (e.g.,<Tag />becomes<Tag></Tag>) to accommodate Winbas's XML parsing limitations.FTP Transfer: The serialized XML file is saved locally and then uploaded to the Winbas system via FTP. Errors during the FTP transfer are logged, and the order number is reset in App4Sales if the transfer fails.
Address Selection: When populating customer address details in the Winbas XML, the connector prioritizes the App4Sales customer's address with type "DEL" (delivery). If a delivery address is not found, it falls back to an address with type "VIS" (visiting). Other address types are ignored for the order export.
Pricing Logic: The calculation of order line prices and discounts is influenced by the "Send original price and calculate discount" setting. If enabled, the original item price from the App4Sales
ItemPricesContextis used, and a percentage discount is calculated based on the difference from the order line's selling price.
Domain Specifics / Extension Section
Order Header Logic
The order header captures essential customer and order-level metadata. The connector handles customer identification via CustomerCode, and critical fields like VAT liability, payment, and delivery terms are directly mapped. The salesperson code can be dynamically assigned based on either the customer's assigned manager or the App4Sales user who placed the order, configurable via settings.
Line & Pricing Logic
Each order line includes product details, quantity, and pricing. Quantity handling can adjust for purchase package sizes. Pricing is flexible, allowing for either direct transmission of the negotiated price or recalculation of a discount percentage based on an original price, depending on system configuration. VAT codes are applied at the line level, mirroring the order header's VAT liability logic.
Charges & Attachments
Based on the analyzed code, there is no explicit mapping for surcharges (like freight or payment fees) or attachments (such as PDFs or signature images) from App4Sales to the Winbas order XML structure within the SendOrderToBackoffice process. If such elements are required by the Winbas ERP, they would need to be handled by additional custom logic or manual intervention within the Winbas system itself.
Responses & Error Handling
Upon successful transmission, the connector returns the Winbas order number to App4Sales. In case of any errors during the XML generation, local file saving, or FTP upload, an error message is returned, and the order number in App4Sales is reset. Detailed errors are logged for troubleshooting. The connector does not explicitly parse back any additional ERP order identifiers (like a unique ID from Winbas) beyond the order number generated or confirmed during the initial sending process.
Related Settings & Prerequisites
Unique Identier: A unique identifier for the connector, often a license key.
Send original price and calculate discount: (Boolean) If true, the connector sends the original item price and calculates a discount percentage for Winbas. Otherwise, it sends the net price directly.
Round order line discount percentages to nearest full number: (Boolean) If true, calculated discount percentages on order lines are rounded to the nearest whole number.
Send order date as delivery date: (Boolean) If true, the order date is also used as the delivery date in Winbas.
Use unit for purchasepackagesize: (Boolean) If true, order line quantities are divided by the item's purchase package size.
Use instruction as orderline delivery date: (Boolean) If true, the connector attempts to parse the delivery date for an order line from its instruction field (expected format YYYYMMDD).
VatLiable code: (String) The VAT code to use for VAT-liable customers/items in Winbas.
Not vatLiable code: (String) The VAT code to use for non-VAT-liable customers/items in Winbas.
Use order date for time of delivery at every orderline: (Boolean) If true, the order date is also used as the time of delivery for each order line.
Use no order prefix: (Boolean) If true, the App4Sales order number is prefixed with "1" and padded with leading zeros to a total of 5 digits before being sent as the Winbas order number.
Use customer manager: (Boolean) If true, the salesperson code in Winbas is derived from the App4Sales customer's manager.
Use App4Sales user: (Boolean) If true (and "Use customer manager" is false), the salesperson code in Winbas is derived from the App4Sales username.
Delivery Address Type: (Dropdown: None, Delivery, Invoice, Visit) Specifies which App4Sales address type is primarily used for customer delivery address mapping.
Shipping Address Type: (Dropdown: None, Delivery, Invoice, Visit) Specifies which App4Sales address type is used for customer shipping address mapping.
Known Limitations
The connector does not currently support sending surcharges (e.g., freight, payment fees) as distinct line items to Winbas.
No explicit handling or mapping for order attachments (e.g., PDFs, signature images) was observed in the code for the
SendOrderToBackofficeprocess.The connector does not currently retrieve or update App4Sales with additional Winbas-specific order identifiers beyond the order number itself.
The
Versionfield in the Winbas XML export is hardcoded and not configurable via settings.