---
id: object/codeunit/6209
type: object
title: Codeunit 6209 "E-Doc Sample Purchase Invoice"
summary: Codeunit 6209 "E-Doc Sample Purchase Invoice" in EDocument (Microsoft.EServices.EDocument.Processing.Import.Purchase). 10 public procedures. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - edocument
versions:
  introduced: "29"
  last_changed: null
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: aed25741f0ee8dc81a64c703f02195beec0150c9cf6e4c6bf15acca7405712cf
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/EDocument/app/src/SampleInvoice/EDocSamplePurchaseInvoice.Codeunit.al
    title: src/Apps/W1/EDocument/app/src/SampleInvoice/EDocSamplePurchaseInvoice.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 6209
name: E-Doc Sample Purchase Invoice
namespace: Microsoft.EServices.EDocument.Processing.Import.Purchase
app: EDocument
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 15
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 0
  called_by: 0
  implements: 0
---

# Codeunit 6209 "E-Doc Sample Purchase Invoice"

> Codeunit 6209 "E-Doc Sample Purchase Invoice" in EDocument (Microsoft.EServices.EDocument.Processing.Import.Purchase). 10 public procedures. Introduced in BC29, still in BC30.

EDocument · Microsoft.EServices.EDocument.Processing.Import.Purchase · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/EDocument/app/src/SampleInvoice/EDocSamplePurchaseInvoice.Codeunit.al) · facts from BC29

## Procedures

- `GetSampleInvoicePostingDate(): Date`: Gets the posting date for the sample invoice.
- `AddInvoice(VendorNo: Code[20]; ExternalDocNo: Text[35]; Scenario: Text[2048])`: Adds a sample purchase invoice.
- `AddInvoice(VendorNo: Code[20]; ExternalDocNo: Text[35]; Scenario: Text[2048]; TotalTaxAmount: Decimal)`: Adds a sample purchase invoice.
- `SetMixLayoutsForPDFGeneration()`: Sets the flag to mix layouts for PDF generation.
- `InitSamplePurchInvHeader(var EDocPurchaseHeader: Record "E-Document Purchase Header"; VendorNo: Code[20]; DocumentDate: Date; ExternalDocNo: Text[35]; TotalTaxAmount: Decimal)` (internal): Initializes a sample purchase invoice header.
- `AddLine(LineType: Enum "Purchase Line Type"; No: Code[20]; Description: Text[100]; Quantity: Decimal; DirectUnitCost: Decimal; UnitOfMeasureCode: Code[10])`: Adds a sample purchase invoice line.
- `AddLine(LineType: Enum "Purchase Line Type"; No: Code[20]; Description: Text[100]; Quantity: Decimal; DirectUnitCost: Decimal; DeferralCode: Code[10]; UnitOfMeasureCode: Code[10])`: Adds a sample purchase invoice line to the current temporary header.
- `AddLine(EDocPurchaseHeader: Record "E-Document Purchase Header"; LineType: Enum "Purchase Line Type"; No: Code[20]; Description: Text[100]; Quantity: Decimal; DirectUnitCost: Decimal; DeferralCode: Code[10]; UnitOfMeasureCode: Code[10])` (internal): Adds a sample purchase invoice line to the specified header.
- `Generate()`: Generates sample invoices in PDF format based on added headers and lines and stores them in the "E-Doc Sample Purch. Inv File" table.
- `UpdateTotalVATInEDocPurchaseHeader(var EDocPurchaseHeader: Record "E-Document Purchase Header"; var EDocPurchaseLine: Record "E-Document Purchase Line")` (internal): Update the total VAT on the e-document purchase header based on the lines added.

Plus 5 local procedures.

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "E-Doc Sample Purchase Invoice")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
