Skip to content

[Enforced Digital Vouchers] - Attaching EDocuments when using Digital Vouchers - #9208

Merged
ventselartur merged 7 commits into
microsoft:mainfrom
jzaksauskas:dev/aan/digital-voucher
Aug 11, 2026
Merged

ventselartur merged 7 commits into
microsoft:mainfrom
jzaksauskas:dev/aan/digital-voucher

Conversation

@jzaksauskas

@jzaksauskas Justas Zaksauskas (jzaksauskas) commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Original PR: microsoft/ALAppExtensions#29793 (closed due to migration)
This pull request does not have a related issue as it's part of the delivery for development agreed directly with Aleksandar Totovic (@altotovi) Magnus Hartvig Grønbech (@Groenbech96) ventselartur

Implementation

With this update enhanced automation for Digital Vouchers in sales and purchase document posting. When enabled, the system will automatically generate and attach E-Documents and related files to posted documents, streamlining document management and compliance.

Functional Changes

  1. New Check Type Option
  • The Check Type field in the Digital Voucher Entry Setup table has been extended to include a new option: E-Document.
  • E-Document option is only valid when the Entry Type is set to Sales Document or Purchase Document.
  • The E-Document check type can only be selected when Generate Automatically is set to TRUE.
  1. Automated Document Attachment on Posting

When posting sales or purchase documents, if setup is set to use E-Documents the system will attach related E-Document files to the Incoming Document Files of the posted sales/purchase document.

Impact

Reduces manual effort in attaching compliance documents.
Ensures all relevant files are consistently linked to posted documents.

Important

This Pull request related with #7006

Fixes #

Fixes AB#639562

Enables digital vouchers to require linked E-documents for purchase posting and to attach exported or posted E-documents as incoming attachments. It also adds setup validation for E-document check types and covers the flow with dedicated tests.
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork ADO: Sync Creates an Azure DevOps work item if needed and indicates that one is linked labels Jul 8, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 8, 2026
@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Jul 8, 2026
@github-actions github-actions Bot removed the needs-approval Workflow runs require maintainer approval to start label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 1 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Style 2 2 0 2 0

Totals: 2 knowledge-backed · 0 agent findings.

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

…cher

# Conflicts:
#	src/Apps/W1/EDocument/App/src/Processing/EDocumentSubscribers.Codeunit.al
@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Jul 27, 2026
@github-actions github-actions Bot removed the needs-approval Workflow runs require maintainer approval to start label Jul 28, 2026
Cleans up an unused event hook to simplify processing and avoid maintaining an irrelevant integration point.
Removes unused parameters and references from the attachment flow to keep voucher processing lean and avoid unnecessary dependencies.
ventselartur
ventselartur previously approved these changes Aug 3, 2026
@github-actions github-actions Bot removed the needs-approval Workflow runs require maintainer approval to start label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Data\ Modeling}$

The new E-Document invariant on Digital Voucher Entry Setup is enforced only when 'Check Type' or 'Generate Automatically' is validated. A user can still change an existing setup row's 'Entry Type' from Purchase/Sales Document to a journal entry type while 'Check Type' stays E-Document, leaving the row in an unsupported combination. That stores inconsistent setup data, and later journal posting will silently bypass the intended E-Document check because codeunit "Voucher E-Document Check" exits early for non-purchase entry types. Revalidate or clear the E-Document-specific fields when 'Entry Type' changes.

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.26.4

@ventselartur
ventselartur enabled auto-merge August 4, 2026 09:45
auto-merge was automatically disabled August 7, 2026 12:38

Head branch was pushed to by a user without write access

@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Aug 7, 2026
@ventselartur
ventselartur enabled auto-merge August 7, 2026 12:51
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Style}$

Seven new Labels are declared inside procedure-local var blocks instead of each object's top-level var section: DigitalVoucherEntrySetup.Table.al (CheckTypeEDocErr, GenerateAutoMustBeEnabledErr), DigitalVoucherImpl.Codeunit.al (FileNameTok, EDocumentFileNameLbl), VoucherEDocumentCheck.Codeunit.al (NotPossibleToPostWithoutEDocumentErr), and EDocAttachmentTests.Codeunit.al (GenerateAutomaticallyErrorTok, NoIncomingDocumentTxt). BCQuality treats procedure-scoped Labels as fragile for XLIFF extraction and localization review; move these Labels to object scope and keep only references in the procedures.

Knowledge:

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4

@github-actions github-actions Bot removed the needs-approval Workflow runs require maintainer approval to start label Aug 7, 2026
@ventselartur
ventselartur added this pull request to the merge queue Aug 11, 2026
Merged via the queue into microsoft:main with commit b5e64bb Aug 11, 2026
487 of 508 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ADO: Sync Creates an Azure DevOps work item if needed and indicates that one is linked AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork Ownership: Manual Preserve the manually selected team ownership Team: Integrations GitHub request for Integrations area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants