---
id: change/bcapps/11660
type: change
title: "#11660 Fix #11377: Prevent invalid FatturaPA CAP values"
summary: FatturaPA validation now requires domestic CAP (postal code) values to contain exactly five numeric characters, preventing invalid values like '1234A' from being written to the XML schema.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit fattura doc. helper
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-11-19T00:57:41.676Z"
  flags: []
generated:
  at: "2026-11-19T00:15:47.846Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 2c0357aaf61ccc8e94cd3f519bf375c5d4bc047f
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/11660
    title: "microsoft/BCApps#11660: Fix #11377: Prevent invalid FatturaPA CAP values"
    date: "2026-11-18"
    commit: 2c0357aaf61ccc8e94cd3f519bf375c5d4bc047f
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/12184-it
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 11660
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/11660
kind: pr
base_branch: main
major: "30"
merged_at: "2026-11-18T21:25:03Z"
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: 2
  additions: 184
  deletions: 0
  al: 1
apps:
  - Base Application
objects_touched:
  - 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:
  - 11377
work_items:
  - 653490
systems:
  - integration
quote: null
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #11660 Fix #11377: Prevent invalid FatturaPA CAP values

> FatturaPA validation now requires domestic CAP (postal code) values to contain exactly five numeric characters, preventing invalid values like '1234A' from being written to the XML schema.

[Pull request](https://github.com/microsoft/BCApps/pull/11660) · merged into `main` (BC30) on 2026-11-18 by marcus905 (community contribution) · 2 files (+184 -0), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Validates company and domestic customer post codes before FatturaPA document generation
- Enforces five-digit numeric CAP requirement only for domestic Italian addresses
- Foreign recipient behavior unchanged, still emits '00000' for non-Italian postal codes
- Invalid values reported through existing FatturaPA error validation flow
- Standard Post Code field remains unrestricted for normal Business Central use
- Behaviour changes for users or extensions.

## AL objects touched

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

## Context

- Fixes: [#11377 [Bug]: Italian FatturaPA exporter can generate invalid CAP values from unconstrained Post Code fields](https://github.com/microsoft/BCApps/issues/11377) (closed)
- Work items: AB#653490
- Labels: ADO: Sync, From Fork, Team: Finance
- Systems: integration

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).
