Oseberg E-Invoice PEPPOL BIS - Development Guide
In the Oseberg PEPPOL solution, you can customize your data output using Events. Contact your Business Central partner for implementing custom code.
If you have questions regarding your customization needs, please contact Oseberg Support for assistance.
Extension Development
For customizing the extenison output, On Line and On Prem, you must use events.
app.json
In your app.json file, please add dependency on the app:
{
"id": "49206e10-c889-400d-8465-bde6555e00fc",
"publisher": "Oseberg Solutions AS",
"name": "E-invoice PEPPOL Bis",
"version": "20.0.0.0"
}
Factoring example
When using factoring, you will often need to change your paymentid and bank account according to your Factoring Vendor. You can do this by using the following code:
[EventSubscriber(ObjectType::Codeunit, Codeunit::"OSB_PEPPOL_Management", 'GetPaymentMeansInfoOnAfterEvent', '', true, true)]
local procedure "OSB_PEPPOL_Management_GetPaymentMeansInfoOnAfterEvent"
(
SalesHeader: Record "Sales Header";
var PaymentCounter: Integer;
var PaymentCount: Integer;
var PaymentMeansCode: Text;
var PaymentMeansListID: text;
var PaymentChannelCode: text;
var PaymentID: Text;
var PrimaryAccountNumberID: Text;
var NetworkID: Text;
ProcessedDocType: Enum OSB_Peppol_ProcessedDocType
)
begin
PaymentID = GetCustomPaymentId();
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"OSB_PEPPOL_Management", 'GetPaymentMeansPayeeFinancialAcc_OnAfterEvent', '', true, true)]
local procedure "OSB_PEPPOL_Management_GetPaymentMeansPayeeFinancialAcc_OnAfterEvent"
(
SalesHeader: Record "Sales Header";
var PaymentCounter: Integer;
var PaymentCount: integer;
var PayeeFinancialAccountID: Text;
var PaymentMeansSchemeID: Text;
var FinancialInstitutionBranchID: Text;
var FinancialInstitutionID: Text;
var FinancialInstitutionSchemeID: Text;
var FinancialInstitutionName: Text
)
begin
PayeeFinancialAccountID := GetCustomPayeeFinancialAccount();
end;
AccountingSupplierParty
Altering AccountingSupplierParty nodes is done with these events.
[EventSubscriber(ObjectType::Codeunit, Codeunit::OSB_PEPPOL_Management, 'GetAccountingSupplierPartyInfo_OnAfterEvent', '', false, false)]
local procedure OSB_PEPPOL_Management_GetAccountingSupplierPartyInfo_OnAfterEvent(SalesHeader: Record "Sales Header"; var SupplierEndpointID: Text; var SupplierSchemeID: Text; var SupplierName: Text)
begin
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::OSB_PEPPOL_Management, 'GetAccountingSupplierPartyInfoBIS_OnAfterEvent', '', false, false)]
local procedure OSB_PEPPOL_Management_GetAccountingSupplierPartyInfoBIS_OnAfterEvent(SalesHeader: Record "Sales Header"; var SupplierEndpointID: Text; var SupplierSchemeID: Text; var SupplierName: Text)
begin
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::OSB_PEPPOL_Management, 'GetAccountingSupplierPartyPostalAddr_OnAfterEvent', '', false, false)]
local procedure OSB_PEPPOL_Management_GetAccountingSupplierPartyPostalAddr_OnAfterEvent_SetFromPartner(SalesHeader: Record "Sales Header"; var StreetName: Text; var SupplierAdditionalStreetName: Text; var CityName: Text; var PostalZone: Text; var CountrySubentity: Text; var IdentificationCode: Text; var ListID: Text)
begin
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::OSB_PEPPOL_Management, 'GetAccountingSupplierPartyLegalEntityByFormat_OnAfterEvent_V2', '', false, false)]
local procedure OSB_PEPPOL_Management_GetAccountingSupplierPartyLegalEntityByFormat_OnAfterEvent(SalesHeader: Record "Sales Header"; var PartyLegalEntityRegName: Text; var PartyLegalEntityCompanyID: Text; var PartyLegalEntitySchemeID: Text; var SupplierRegAddrCityName: Text; var SupplierRegAddrCountryIdCode: Text; var SupplRegAddrCountryIdListId: Text; IsBISBilling: Boolean)
begin
end;
AdditionalDocumentReference
When additional information is needed in the xml, use AdditionalDocumentReference tag.
Result
Role Tailored Client
Implementing the Role Tailored Client is version specific as Microsoft has developed the sending routines in the NAV versions. Please follow the guide regarding your NAV version.
NAV 2016
NAV 2016 has two ways of sending documents. Either using Print button or “Send…” button.
Send button
For using “Send” or “Post and Send..” button you need to implement some code in standard NAV.
Please add the following code in Table 60.
Add event procedure:
Modify Send procedure:
Print button
Implementing the print routine or other business logic:
Add codeunit 15027002 OSB_PEPPOLExportBis30 as a variable.
Call the function with the appropriate document
boolean := OSB_PEPPOLExportBis30.DocumentSendingPrint(SalesInvHeader);
IF the customer is qualified for PEPPOL the procedure sends the document and returns true.
If the customer is not qualified for PEPPOL it returns false, so that another channel can be used.
OSB_PEPPOLExportBis30.DocumentSendingPrint handles table id’s 112,114,5992,5994
Menu Suite
Add page 15027000 as part of the menu suite.