Working with XRechnung
Events
We offer you the possibility to link into our programming logic with events, here we describe how this works.
To subscribe an event for sales invoices or service invoices, the XML port BEL365 S. Inv. XRechnung 2.0 must be specified in an EventSubscriber.
Example:
|
|
For sales credit notes or service credit notes, the following XML port must be entered: BEL365 S. Cr. M. XRechnung 2.0.
Example:
|
|
Connector 365 XRechnung makes partial use of functions from the Microsoft standard Codeunit: PEPPOL Management (1605).
The events concerned are provided with a note box in this documentation.
The XRechnung events offer the possibility to “fill” business terms after they are set by default and before they are further processed, i.e. inserted into the resulting XML file. The business terms are passed as text variables. Prepended to these variables is the keyword VAR, which indicates that the variables are references to the original variables.
After you have defined a function as a subscriber, you can fill the passed variables as you like and according to your own logic.
Example:
|
|
The function SubAfterGetLineInvoicePeriod is here a subscriber for the event OnAfterGetLineInvoicePeriodInfo.
Regardless of the default logic of filling the variables, InvLineInvoicePeriodEndDate after generating the XRechnung now contains the value “2021-04-15” and thus appears in the resulting XML file. The same procedure applies to all other events.
The following is a list of the available events and the variables to be changed with them.
At the beginning of the XML port, it is checked whether the document is a sales document or a service document. Then the associated record variables are transferred to the “Sales Header” and “Sales Line” variables, which are used from there on throughout the XML port. Sales Invoice Example:
“Sales Invoice Header” -> “Sales Header”,
“Sales Invoice Line” -> “Sales Line”.
This is the reason why all following events work with “Sales Header” or with “Sales Line”.
GetGeneralInfoBIS
|
|
| Name | Business Term | Semantic Data Type | ||||||
|---|---|---|---|---|---|---|---|---|
| Invoice number | BT-1 | Identifier | ||||||
| A unique identifier for the invoice that identifies it in the seller's system. | ||||||||
| Invoice issue date | BT-2 | Date | ||||||
| The date on which the invoice was issued. | ||||||||
| Invoice type code | BT-3 | Code | ||||||
| A code that specifies the function type of the invoice. Note: The invoice type must be specified according to UNTDID 1001 | ||||||||
| Invoice currency code | BT-5 | Code | ||||||
| The currency in which all invoice amounts are stated, with the exception of the total VAT amount, which must be stated in the billing currency. | ||||||||
| Value added tax point date | BT-7 | Date | ||||||
| The date on which the VAT becomes relevant for the seller and for the buyer. The application of BT-7 and 8 are mutually exclusive. | ||||||||
| Buyer accounting reference | BT-19 | Text | ||||||
| A text value that indicates where the relevant data is to be posted in the financial costs of the acquirer. | ||||||||
| Invoice note | BT-22 | Text | ||||||
| A text note containing unstructured information relevant to the invoice as a whole. | ||||||||
OnGetInvoicePeriod
|
|
| Name | Business Term | Semantic Data Type |
|---|---|---|
| Invoicing period start date | BT-73 | Date |
| The date on which the billing period begins. | ||
| Invoicing period end date | BT-74 | Date |
| The date on which the billing period ends. | ||
The OnGetInvoicePeriod event can be used to specify the service date or a service period for an invoice. A period is defined by a start and an end time, each of which should have the following format: “YYYY-MM-DD”. Example: 2017-10-01
OnAfterGetLineInvoicePeriodInfo
|
|
This event sets the service date similar to OnGetInvoicePeriod, but at the row level.
OnAfterGetAccountingSupplierPartyContact (BG-6)
|
|
| Name | Business Term | Semantic Data Type |
|---|---|---|
| Seller Contact Point | BT-41 | Text |
| Details of contact person or contact point (e.g. name of a person, department or office name) | ||
| Seller contact telephone number | BT-42 | Text |
| Telephone number of the contact person or contact point | ||
| Seller contact email address | BT-43 | Text |
| E-mail address of the contact person or contact point | ||
Business Rules:
BR-DE-2: The group „SELLER CONTACT“ (BG-6) has to be transmitted.
BR-DE-5: The element „SELLER CONTACT POINT“ (BT-41) has to be transmitted.
BR-DE-6: The element „SELLER CONTACT TELEPHONE NUMBER“ (BT-42) has to be transmitted.
BR-DE-7: The element „SELLER CONTACT EMAIL ADDRESS“ (BT-43) has to be transmitted.
OnAfterGetPaymentTermsInfo
|
|
A text description of the payment terms that apply to the payment amount due (including a description of any discount and late payment terms.) This information element may contain multiple lines and multiple payment term specifications, and may contain both unstructured and structured text. The unstructured text must not contain #.
Specification XRechnung default and extension
Version XRechnung 2.0.0 | Version from 16.12.2020
OnGetOrderLineReference
|
|
Referenced purchase or line reference
An identifier issued by the acquirer for a referenced line item of a purchase order/order.
Note: The order is referred to at invoice level.
Specification XRechnung default and extension
Version XRechnung 2.0.0 | Version from 16.12.2020
OnAfterGetPaymentMeansInfo (BG-16)
|
|
| Name | Business Term | Semantic Data Type |
|---|---|---|
| Payment means type code | BT-81 | Code |
| The means of payment expected or used, expressed as a code. Reference is made to the code list UN/ECE 4461 | ||
| Payment means text | BT-82 | Text |
| The means of payment expected or used, expressed in text form | ||
| Remittance information | BT-83 | Text |
| A text value used to link the payment to the invoice issued by the seller | ||
| Payment card primary account number | BT-87 | Text |
| The number of the credit card used for the payment | ||
Business Rules:
BR-DE-1: An invoice (INVOICE) must contain information on “PAYMENT INSTRUCTIONS” (BG-16).
BR-DE-13: The invoice must include information on one of the three groups “CREDIT TRANSFER” (BG-17), “PAYMENT CARD INFORMATION” (BG-18) or “DIRECT DEBIT” (BG-19).
OnAfterGetContractDocRefInfo
|
|
| Name | Business Term | Semantic data type |
|---|---|---|
| Contract reference | BT-12 | Document Reference |
| A clear description of the contract (e.g. contract number). | ||
OnAfterGetAccountingCustomerPartyInfoBIS
|
|
| Name | Business Term | Semantic Data Type |
|---|---|---|
| Buyer electronic address | BT-49 | Identifier |
| Specifies an electronic address of the purchaser to which an invoice should be sent. | ||
| Buyer electronic address/Scheme identifier | ||
| The formation pattern for Buyer electronic address. The Electronic Address Scheme code list (EAS) is to be used. The code list is maintained and published by the Connecting Europe Facility. |
||
| Buyer identifier | BT-46 | Identifier |
| An identifier (usually assigned by the seller) of the purchaser, such as the customer number for accounting or the customer number for order management. Note: No standardized scheme is required for the creation of the Buyer Identifier |
||
| The identifier of the formation scheme for the “Buyer identifier”. | ||
Note: If the element is used, the entry must be selected from the list published by the ISO/IEC 6523 maintenance agency. |
||
| Buyer trading name | BT-45 | Text |
| A name by which the acquirer is known, if different from the acquirer's name. | ||
OnAfterGetPaymentMeansPayeeFinancialAccBIS (BG-17)
|
|
| Name | Business Term | Semantic Data Type |
|---|---|---|
| Payment account identifier | BT-84 | Identifier |
| The identifier of the account to which the payment is to be made: IBAN for payments in the SEPA area, account number or IBAN in the case of foreign payments | ||
| Payment account name | BT-85 | Text |
| Name of the account with a payment service provider to which the payment is to be made. (e.g. account holder) | ||
OnAfterGetLineGeneralInfo
|
|
OnAfterGetLineItemInfo
|
|
Allows customization of item information for invoice lines, including description, name, and various identification IDs. This event is used to modify item-specific data such as seller and standard identifications as well as country of origin information.
OnAfterGetAccountingSupplierPartyLegalEntityBIS
|
|
Allows customization of the supplier’s legal information, including the registered company name, company ID, and registration address. This event is used to modify the legal identity and registration data of the seller in the XRechnung.
OnAfterGetAccountingSupplierPartyTaxSchemeBIS
|
|
Allows customization of the supplier’s tax scheme information, including the tax ID and tax scheme identifier. This event is used to modify VAT-related identifications and classifications of the seller.
OnAfterGetAccountingSupplierPartyPostalAddr
|
|
Allows customization of the supplier’s postal address, including street name, city, postal code, and country information. This event is used to modify the complete address data of the seller in the XRechnung.
OnAfterGetAccountingSupplierPartyInfoBIS
|
|
| Name | Business Term | Semantic Data Type |
|---|---|---|
| Seller electronic address | BT-34 | Identifier |
| Specifies the electronic address of the vendor to which the application level response to an invoice can be sent. | ||
| Seller trading name | BT-28 | Text |
| A name by which the seller is known, if different from the seller's name. | ||
OnAfterGetSupplierPartyIdentificationID
|
|
| Name | Business Term | Semantic Data Type |
|---|---|---|
| Seller identifier | BT-29 | Identifier |
| An identifier (usually assigned by the buyer) of the seller, such as the creditor number for budget management or the supplier number for the ordering system. | ||
| Seller identifier/Scheme identifier | BT-29-1 | |
| Identifier of the scheme for the element 'Seller identifier' (BT-29). Note: If the element is used, the identifier must be chosen from the entries in the list published by the ISO/IEC 6523 maintenance agency. |
||
OnAfterGetAccountingCustomerPartyPostalAddr
|
|
Allows customization of the customer’s postal address, including street name, city, postal code, and country information. This event is used to modify the complete address data of the buyer in the XRechnung.
OnAfterGetAccountingCustomerPartyTaxSchemeBIS
|
|
Allows customization of the customer’s tax scheme information, including the tax ID and tax scheme identifier. This event is used to modify VAT-related identifications of the buyer.
OnAfterGetAccountingCustomerPartyLegalEntityBIS
|
|
Allows customization of the customer’s legal information, including the registered company name and company ID. This event is used to modify the legal identity and registration data of the buyer in the XRechnung.
OnAfterGetAccountingCustomerPartyContact
|
|
Allows customization of the customer’s contact information, including name, phone, fax, and email address. This event is used to modify the communication data of the buyer in the XRechnung.
OnAfterGetGLNDeliveryInfo
|
|
Allows customization of GLN-based (Global Location Number) delivery information, including the actual delivery date and delivery ID. This event is used to modify specific delivery identifications and dates.
OnAfterGetDeliveryAddress
|
|
Allows customization of the delivery address, including street name, city, postal code, and country information. This event is used to modify the complete delivery address data in the XRechnung.
OnAfterGetLineItemClassfiedTaxCategoryBIS
|
|
Allows customization of classified tax category information for invoice lines, including the tax category ID and tax percentage. This event is used to modify item-specific tax classifications.
OnAfterGetLineAllowanceChargeInfo
|
|
Allows customization of allowances and charges at the invoice line level, including indicator, reason, and amount. This event is used to modify line-specific price adjustments and their justification.
OnAfterGetLineDeliveryInfo
|
|
Allows customization of delivery information at the invoice line level, including the actual delivery date and delivery ID. This event is used to modify line-specific delivery data.
OnAfterGetLineDeliveryPostalAddr
|
|
Allows customization of the delivery address at the invoice line level, including street name, city, postal code, and country information. This event is used to modify line-specific delivery address data.
OnAfterGetTaxRepresentativePartyInfo
|
|
Allows customization of tax representative information, including the name and tax identification data. This event is used to modify tax representative details in the XRechnung.
OnAfterGetAllowanceChargeInfo
|
|
Allows customization of allowances and charges at the document level, including indicator, reason, amount, and tax information. This event is used to modify document-level price adjustments and their tax implications.
OnAfterGetTaxExemptionReason
|
|
Allows customization of tax exemption reasons and tax category information. This event is used to modify the justification for tax exemptions and related tax classifications.
OnAfterGetLineAdditionalItemPropertyInfo
|
|
OnAfterGetLinePriceAllowanceChargeInfo
|
|
OnAfterSetLinePriceAllowanceChargeInfo
|
|
This event is triggered after assigning the price allowance charge information for a sales line. It allows further adjustments to the allowance charge data at the line level.
OnAfterSetLineAllowanceChargeInfo
|
|
This event is triggered after assigning the allowance charge information for a sales line. It allows further adjustments to the allowance charge data at the line level.
OnAfterSetAllowanceChargeInfo
|
|
This event is triggered after assigning the allowance charge information at the document level. It allows further adjustments to the allowance charge data at the header level.
OnAfterGetCrMemoBillingReferenceInfo (Credit Memo Specific)
|
|
This event is specific to credit memos and is triggered after determining the invoice reference information. It allows adjustment of the reference ID and issue date of the original invoice.
OnAfterGetLineItemInfoWithBuyersItemIdentificationID
|
|
Extended version of the OnAfterGetLineItemInfo event that additionally provides the possibility to set the Buyer’s Item Identification ID. Enables the assignment of item-specific buyer IDs.
Event for customizing standard item identification at line level.
OnAfterGetLineItemOriginCountryInfo
|
|
Extended version of the OnAfterGetAccountingSupplierPartyLegalEntityBIS event with additional support for the legal form of the supplier.
OnAfterGetDeliveryAddressWithDeliveryPartyName
|
|
Extended version of the OnAfterGetDeliveryAddress event that additionally allows the name of the delivery party.
OnAfterGetPaymentMeansPayeeFinancialAccBISWithPayeeFinancialAccountName
|
|
Extended version of the OnAfterGetPaymentMeansPayeeFinancialAccBIS event with additional support for the payee financial account name.
OnBeforeGetTotals
|
|
This event is triggered before calculating the total amounts for a sales line. It allows skipping certain lines in the total calculation or modifying the lines before processing.
OnAfterGetBuyerReference
|
|
Allows customization of the buyer reference used for identification at the buyer.
OnGetInvoiceLine (Invoice specific)
|
|
This event is triggered for each invoice line and allows certain lines to be skipped. By setting skip to true, a line can be excluded from XRechnung generation.
OnGetCrMemoLine (Credit Memo Specific)
|
|
This event is triggered for each credit memo line and allows certain lines to be skipped. By setting skip to true, a line can be excluded from XRechnung generation.
``