Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

Service invoice and credit memo tests were failing because Service Management Setup lacked required template names when creating Service Headers.

Changes

  • Added SetupServiceMgtSetupTemplates() helper: Configures Service Mgt. Setup with Gen. Journal Template names for both invoice and credit memo templates before creating service documents

  • Applied in two locations:

    • CreatePostServiceDoc() - affects multiple service invoice/credit memo tests
    • ExportXml_ServiceInvoiceLCY_InvRounding_Positive() - direct service header creation

Pattern follows existing implementation in PEPPOL30ManagementTests.Codeunit.al.

local procedure SetupServiceMgtSetupTemplates()
begin
    LibraryERM.FindGenJournalTemplate(GenJournalTemplate);
    GenJournalTemplate."Posting No. Series" := LibraryERM.CreateNoSeriesCode();
    GenJournalTemplate.Modify(false);
    ServMgtSetup.GetRecordOnce();
    ServMgtSetup."Serv. Inv. Template Name" := GenJournalTemplate.Name;
    ServMgtSetup."Serv. Cr. Memo Templ. Name" := GenJournalTemplate.Name;
    ServMgtSetup.Modify(false);
end;

Fixes 5 failing tests: ExportXml_PEPPOL_BIS3_ServiceInvoice, ExportXml_PEPPOL_BIS3_ServiceCrMemo, ExportXml_PEPPOL_BIS3_ServiceInvoiceFCY, ExportXml_PEPPOL_BIS3_ServiceCrMemoFCY, ExportXml_ServiceInvoiceLCY_InvRounding_Positive.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 28, 2026 18:30
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Copilot AI changed the title [WIP] Add PEPPOL tests to address issue AB#563709 Fix Service Mgt. Setup template configuration in PEPPOL service tests Jan 28, 2026
Copilot AI requested a review from Groenbech96 January 28, 2026 18:35
@Groenbech96 Groenbech96 marked this pull request as ready for review January 28, 2026 18:39
@Groenbech96 Groenbech96 requested a review from a team as a code owner January 28, 2026 18:39
@Groenbech96 Groenbech96 merged commit 4db62ec into private/magnushar/morepeppol Jan 28, 2026
1 check passed
@Groenbech96 Groenbech96 deleted the copilot/sub-pr-6267 branch January 28, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants