---
id: change/bcapps/12696
type: change
title: "#12696 Fix Norwegian SAF-T 1.30 debit and credit totals"
summary: Norwegian SAF-T 1.30 export now correctly calculates debit and credit totals from actual G/L entry amounts instead of stored columns, ensuring totals match exported line amounts even with reversals or negative entries.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit generate saf-t 1.3 file
  - codeunit saf-t export mgt.
system: finance
review:
  state: reviewed
  by: opus
  at: "2026-10-30T01:10:03.115Z"
  flags: []
generated:
  at: "2026-11-09T00:15:52.409Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 255dc83bf8127be56f279800e0b36e04e87dfccd
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12696
    title: "microsoft/BCApps#12696: Fix Norwegian SAF-T 1.30 debit and credit totals"
    date: "2026-10-28"
    commit: 255dc83bf8127be56f279800e0b36e04e87dfccd
    t: null
    quote: Calculate debit and credit totals from positive and negative G/L Amount using SQL aggregation and the exporter's journal filters.
links:
  learn: []
  objects:
    - object/codeunit/10692-no
    - object/codeunit/10675-no
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/LocalFunctionality/Norway/ui-extensions-setup-and-generate-saf-t-files-no
      title: Set Up and Export Norwegian SAF-T Files
      label: possibly related
      why: Documents Norwegian SAF-T file setup and export, including debit and credit calculations.
      by: model
number: 12696
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12696
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-28T15:49:11Z"
author: AleksanderGladkov
author_type: User
community_contribution: false
labels:
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 5
  additions: 248
  deletions: 8
  al: 3
apps:
  - NorwegianSAFT
objects_touched:
  - key: codeunit/10692
    page: codeunit/10692-no
    type: codeunit
    id: 10692
    name: Generate SAF-T 1.3 File
    app: NorwegianSAFT
    status: modified
  - key: codeunit/10675
    page: codeunit/10675-no
    type: codeunit
    id: 10675
    name: SAF-T Export Mgt.
    app: NorwegianSAFT
    status: modified
objects_unjoined:
  - path: src/Apps/NO/NorwegianSAFT/app/src/Export Engine/SAFTGLEntryTotal.Query.al
    status: added
    reason: not-in-snapshot
obsoletions: []
backports:
  - number: 12899
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/12899
fixes_issues: []
work_items:
  - 653928
systems:
  - finance
quote: Calculate debit and credit totals from positive and negative G/L Amount using SQL aggregation and the exporter's journal filters.
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #12696 Fix Norwegian SAF-T 1.30 debit and credit totals

> Norwegian SAF-T 1.30 export now correctly calculates debit and credit totals from actual G/L entry amounts instead of stored columns, ensuring totals match exported line amounts even with reversals or negative entries.

[Pull request](https://github.com/microsoft/BCApps/pull/12696) · merged into `main` (BC30) on 2026-10-28 by AleksanderGladkov · 5 files (+248 -8), 3 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Debit and credit totals in SAF-T 1.30 now calculated from G/L Amount using SQL aggregation instead of stored debit/credit columns
- Fixes discrepancies when exports contain reversals or negative entries
- Complete selection totals are repeated in every split file for consistency
- SAF-T 1.20 behavior remains unchanged
- Extensive test coverage added for reversals, negative entries, multiple journals, and split scenarios
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 10692 "Generate SAF-T 1.3 File"](../../objects/codeunit/10692-no.md), NorwegianSAFT (NO layer): modified
- [Codeunit 10675 "SAF-T Export Mgt."](../../objects/codeunit/10675-no.md), NorwegianSAFT (NO layer): modified
- `src/Apps/NO/NorwegianSAFT/app/src/Export Engine/SAFTGLEntryTotal.Query.al`: added, not in the BC30 snapshot yet

## Also merged into

- [#12899](https://github.com/microsoft/BCApps/pull/12899) into `releases/29.x` on 2026-10-21

## Context

- Work items: AB#653928
- Labels: Team: Finance
- Systems: finance
- From the description: "Calculate debit and credit totals from positive and negative G/L Amount using SQL aggregation and the exporter's journal filters."

## Possibly related

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

- [Set Up and Export Norwegian SAF-T Files](https://learn.microsoft.com/dynamics365/business-central/LocalFunctionality/Norway/ui-extensions-setup-and-generate-saf-t-files-no) — possibly related: Documents Norwegian SAF-T file setup and export, including debit and credit calculations. (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).
