[E-Document Formats] Migrate NAV PRs 247170 and 247176 into BCApps#9426
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot PR ReviewIteration 7 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 6 knowledge-backed · 0 agent findings. Orchestrator pre-filter (2 file(s) excluded)
Findings produced by the AL review agent v1.7.3. Reply 👎 on any inline comment to flag false positives. |
…e-nav-pr-247170-247176
Resolves Pull Request Build failures AL0185 (missing 'EDocument XML Helper') and AL0297 (Factura-E object id range). [bcapps-fix-loop attempt 1] Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Follow-up on the work-item check: I could not infer a valid ADO work item from the mirrored source PRs, so this needs a human-provided work item ID. Once an ID is provided, add AB# (or Fixes AB#) to the PR description and the check should pass. |
- Change codeunit ID 6410 -> 6430 (6410 clashes with another object in the repo) - Fix inverted #pragma warning disable/restore AA0139 in PINT A-NZ handler - Move procedure-local Label vars to codeunit scope in both handlers [bcapps-fix-loop attempt 2] Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Move XML helper APIs into codeunit 6401 (E-Document PEPPOL Utility) - Switch Factura-E and PINT A-NZ handlers to use PEPPOL utility - Remove temporary EDocument XML Helper codeunit and unnecessary internalsVisibleTo entries - Reassign Factura-E handler from conflicting 10776 to 10766 and update idRanges [bcapps-fix-loop attempt 3] Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve compile issues from migrated handlers by using E-Document document type, replacing inaccessible View implementation, and switching to TryGetStringValue-based field extraction. [bcapps-fix-loop attempt 4] Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Implement View() in PINT A-NZ and Factura-E handlers to open the readable purchase document page instead of erroring, so the ViewExtractedData tests exercise real view behavior. - Make E-Doc. Readable Purchase Doc. SetBuffer public so format apps can reuse it. - Consolidate XML extraction: call shared E-Document PEPPOL Utility SetStringValueInField/SetCurrencyValueInField and remove duplicate local wrappers in both handlers (SetStringValueInField now takes a Text destination). - Guard XmlDocument.ReadFrom and move error/root-element messages to Labels. - Guard Factura-E unit-of-measure Evaluate and enum range lookup. - Use a local line counter instead of GetNextLineNo per row, and build each line document with XmlDocument.Create()/Add(). - Move procedure-local Item labels to object scope in the structured validations codeunits. - Add XML documentation to new public PEPPOL utility procedures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ssertions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The new PINT A-NZ and Factura-E readers rely on the shared Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4 |
The UpdateDraftAndFinalize tests manually reassigned the draft line item via the page, but Prepare Draft had already matched the line to an item via Item Reference (product code 1000/2000). On Finish Draft the stale [BC] Item Reference No. re-resolved the line back to the referenced item, so the manual assignment (and raw 'Bicycle' description) was lost. Clear the item reference on the draft line after reassigning, and give the generic item a Purchase unit of measure so the resulting purchase line UoM is deterministic. Also set the PINT A-NZ line type to Item, mirroring the Factura-E test. For Factura-E, the finalized purchase lines resolve through Item Reference (UoM 'PCS'), so the purchase-line UoM assertions must expect the mapped BC unit of measure 'PCS' rather than the raw Factura-E code '01' (which remains correct only for the extracted E-Document line). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous attempt cleared the matched item reference through the draft subform's Item Reference No. control, but that control is Visible = false so the test framework could not find it (The field with ID ... is not found on the page). Close the draft page after the manual reassignment and clear [BC] Item Reference No. directly on the E-Document Purchase Line, so Finish Draft keeps the manually assigned item instead of re-resolving it from the product code's item reference. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Migrates the PINT A-NZ and Factura-E e-document formats onto the E-Document V2.0 structured import pipeline. Each format now provides an
IStructuredFormatReaderimplementation that reads the received XML directly into the purchase draft staging tables (E-Document Purchase Header/E-Document Purchase Line), replacing the legacy import flow.AB#580191
Changes
PINT A-NZ (
src/Apps/APAC/EDocumentFormats/PINT A-NZ)EDocumentPINTANZHandler— newIStructuredFormatReader.ReadIntoDraftimplementation that parses the PINT A-NZ UBL invoice/credit-memo into the purchase draft buffers.PINT A-NZ EDoc Read into Draft— enum extension registering the handler on"E-Doc. Read into Draft".pint_a-nz-invoice-0.xml), structured tests and validation codeunit.Factura-E (
src/Apps/ES/EDocumentFormats/FacturaE)EDocumentFacturaEHandler— newIStructuredFormatReader.ReadIntoDraftimplementation for the Factura-E 3.2.2 XML, including unit-of-measure mapping from Factura-E international codes to BC units of measure.Factura-E EDoc Read into Draft— enum extension registering the handler on"E-Doc. Read into Draft".facturae-invoice-0.xml), structured tests and validation codeunit.E-Document core (
src/Apps/W1/EDocument)E-Document PEPPOL Utility— new public helper codeunit with reusable PEPPOL BIS 3.0 UBL extraction logic (namespaces, party, amounts, lines, attachments, currency) shared by the format readers.E-Doc. Readable Purchase Doc.—SetBufferpromoted frominternaltopublic(with documentation) so format readers can present extracted data without persisting a draft.Tests
Each format has structured integration tests covering:
All new tests run in the
IntegrationTestsbucket (AU/NZ for PINT A-NZ, ES for Factura-E).