---
id: change/bcapps/9749
type: change
title: "#9749 OIOUBL fixes after schematron update"
summary: OIOUBL export now correctly handles discounts by reporting them with proper VAT categories per tax type instead of using a synthetic ReverseCharge, ensuring compliance with updated schematron validation rules.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit oioubl-exp. issued fin. chrg
  - codeunit oioubl-common logic
  - table oioubl-tax group buffer
  - codeunit oioubl-export issued reminder
  - codeunit oioubl-export sales cr. memo
  - codeunit oioubl-export sales invoice
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:09:51.961Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 5950fa9832ba50af1751fb24679112d9ef1baf0c
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9749
    title: "microsoft/BCApps#9749: OIOUBL fixes after schematron update"
    date: "2026-08-10"
    commit: 5950fa9832ba50af1751fb24679112d9ef1baf0c
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/13638-dk
    - object/codeunit/13648-dk
    - object/table/13673-dk
    - object/codeunit/13639-dk
    - object/codeunit/13637-dk
    - object/codeunit/13636-dk
    - object/codeunit/13644-dk
    - object/codeunit/13643-dk
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9749
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9749
kind: pr
base_branch: main
major: "30"
merged_at: "2026-08-10T08:11:20Z"
author: mynjj
author_type: User
community_contribution: false
labels:
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 10
  additions: 817
  deletions: 347
  al: 8
apps:
  - OIOUBL
objects_touched:
  - key: codeunit/13638
    page: codeunit/13638-dk
    type: codeunit
    id: 13638
    name: OIOUBL-Exp. Issued Fin. Chrg
    app: OIOUBL
    status: modified
  - key: codeunit/13648
    page: codeunit/13648-dk
    type: codeunit
    id: 13648
    name: OIOUBL-Common Logic
    app: OIOUBL
    status: modified
  - key: table/13673
    page: table/13673-dk
    type: table
    id: 13673
    name: OIOUBL-Tax Group Buffer
    app: OIOUBL
    status: added
  - key: codeunit/13639
    page: codeunit/13639-dk
    type: codeunit
    id: 13639
    name: OIOUBL-Export Issued Reminder
    app: OIOUBL
    status: modified
  - key: codeunit/13637
    page: codeunit/13637-dk
    type: codeunit
    id: 13637
    name: OIOUBL-Export Sales Cr. Memo
    app: OIOUBL
    status: modified
  - key: codeunit/13636
    page: codeunit/13636-dk
    type: codeunit
    id: 13636
    name: OIOUBL-Export Sales Invoice
    app: OIOUBL
    status: modified
  - key: codeunit/13644
    page: codeunit/13644-dk
    type: codeunit
    id: 13644
    name: OIOUBL-Export Service Cr.Memo
    app: OIOUBL
    status: modified
  - key: codeunit/13643
    page: codeunit/13643-dk
    type: codeunit
    id: 13643
    name: OIOUBL-Export Service Invoice
    app: OIOUBL
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 638267
systems:
  - integration
quote: null
joined_against:
  major: "30"
  commit: a4406cfa9e57437fedc49c53c327a199a854491e
---

# #9749 OIOUBL fixes after schematron update

> OIOUBL export now correctly handles discounts by reporting them with proper VAT categories per tax type instead of using a synthetic ReverseCharge, ensuring compliance with updated schematron validation rules.

[Pull request](https://github.com/microsoft/BCApps/pull/9749) · merged into `main` (BC30) on 2026-08-10 by mynjj · 10 files (+817 -347), 8 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Discounts are now exported with the correct VAT category matching each line's tax type instead of always using ReverseCharge
- Tax totals and subtotals are now split per VAT category to match all reported tax categories
- Line-level taxable amounts are reported before discounts to allow header-level allowances to subtract correctly
- Header-level allowance charges are now emitted multiple times per VAT type pair instead of a single ReverseCharge entry
- Validation against the OIOUBL schematron now passes for documents with header or line discounts
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 13638 "OIOUBL-Exp. Issued Fin. Chrg"](../../objects/codeunit/13638-dk.md), OIOUBL (DK layer): modified
- [Codeunit 13648 "OIOUBL-Common Logic"](../../objects/codeunit/13648-dk.md), OIOUBL (DK layer): modified
- [Table 13673 "OIOUBL-Tax Group Buffer"](../../objects/table/13673-dk.md), OIOUBL (DK layer): added
- [Codeunit 13639 "OIOUBL-Export Issued Reminder"](../../objects/codeunit/13639-dk.md), OIOUBL (DK layer): modified
- [Codeunit 13637 "OIOUBL-Export Sales Cr. Memo"](../../objects/codeunit/13637-dk.md), OIOUBL (DK layer): modified
- [Codeunit 13636 "OIOUBL-Export Sales Invoice"](../../objects/codeunit/13636-dk.md), OIOUBL (DK layer): modified
- [Codeunit 13644 "OIOUBL-Export Service Cr.Memo"](../../objects/codeunit/13644-dk.md), OIOUBL (DK layer): modified
- [Codeunit 13643 "OIOUBL-Export Service Invoice"](../../objects/codeunit/13643-dk.md), OIOUBL (DK layer): modified

## Context

- Work items: AB#638267
- Labels: 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).
