---
id: change/bcapps/12292
type: change
title: "#12292 Fix #10964: Use VAT registration number fallback in FatturaPA file name"
summary: FatturaPA file names now use VAT Registration Number as a fallback when Fiscal Code is blank, matching the transmitter identifier already used in the XML document.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit export fatturapa document
  - codeunit fattura doc. helper
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-31T01:04:14.203Z"
  flags: []
generated:
  at: "2026-11-01T00:17:21.384Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 44e42fa4f8604fa92f1368c0b56f71bb33972164
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12292
    title: "microsoft/BCApps#12292: Fix #10964: Use VAT registration number fallback in FatturaPA file name"
    date: "2026-10-30"
    commit: 44e42fa4f8604fa92f1368c0b56f71bb33972164
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/12179-it
    - object/codeunit/12184-it
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/LocalFunctionality/Italy/electronic-invoicing
      title: Electronic Invoicing (FatturaPA) in the Italian Version
      label: possibly related
      why: Documents FatturaPA electronic invoicing setup and file generation in Italian version.
      by: model
number: 12292
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12292
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-30T13:14:57Z"
author: marcus905
author_type: User
community_contribution: true
labels:
  - "ADO: Sync"
  - From Fork
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 3
  additions: 41
  deletions: 5
  al: 2
apps:
  - Base Application
objects_touched:
  - key: codeunit/12179
    page: codeunit/12179-it
    type: codeunit
    id: 12179
    name: Export FatturaPA Document
    app: Base Application
    status: modified
  - key: codeunit/12184
    page: codeunit/12184-it
    type: codeunit
    id: 12184
    name: Fattura Doc. Helper
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues:
  - 10964
work_items:
  - 653568
systems:
  - integration
quote: null
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #12292 Fix #10964: Use VAT registration number fallback in FatturaPA file name

> FatturaPA file names now use VAT Registration Number as a fallback when Fiscal Code is blank, matching the transmitter identifier already used in the XML document.

[Pull request](https://github.com/microsoft/BCApps/pull/12292) · merged into `main` (BC30) on 2026-10-30 by marcus905 (community contribution) · 3 files (+41 -5), 2 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Fiscal Code is checked first; if empty, VAT Registration No. is used for the transmitter identifier
- File naming now aligns with the XML's IdTrasmittente/IdCodice field behavior
- Helper method centralized to avoid duplicated fallback logic in GetFileName()
- Existing files generated with Fiscal Code remain unchanged
- Added unit tests for the fallback scenario
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 12179 "Export FatturaPA Document"](../../objects/codeunit/12179-it.md), Base Application (IT layer): modified
- [Codeunit 12184 "Fattura Doc. Helper"](../../objects/codeunit/12184-it.md), Base Application (IT layer): modified

## Context

- Fixes: [#10964 [Bug]: FatturaPA filename does not fall back to VAT Registration No. when Fiscal Code is empty](https://github.com/microsoft/BCApps/issues/10964) (closed)
- Work items: AB#653568
- Labels: ADO: Sync, From Fork, Team: Finance
- Systems: integration

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Electronic Invoicing (FatturaPA) in the Italian Version](https://learn.microsoft.com/dynamics365/business-central/LocalFunctionality/Italy/electronic-invoicing) — possibly related: Documents FatturaPA electronic invoicing setup and file generation in Italian version. (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
