---
id: change/bcapps/13917
type: change
title: "#13917 [Main][ALL-E] Posting a Sales Credit Memo with a different Unit of Measure does not convert the quantity before updating the originating Sales Order (Blanket Sales Order is updated correctly)"
summary: Fixed a bug where posting a sales credit memo with a different unit of measure failed to convert the quantity before updating the originating sales order, causing incorrect deductions.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit correct posted sales invoice
system: sales
review:
  state: reviewed
  by: opus
  at: "2026-11-19T00:57:46.867Z"
  flags: []
generated:
  at: "2026-11-30T13:33:07.232Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 6d987a0e264b9b982d90703ec24922161f5a76c9
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/13917
    title: "microsoft/BCApps#13917: [Main][ALL-E] Posting a Sales Credit Memo with a different Unit of Measure does not convert the quantity before updating the originating Sales Order (Blanket Sales Order is updated correctly)"
    date: "2026-11-18"
    commit: 6d987a0e264b9b982d90703ec24922161f5a76c9
    t: null
    quote: Convert the credited base quantity using the sales order line's Qty. per Unit of Measure before updating quantities.
links:
  learn: []
  objects:
    - object/codeunit/1303
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/sales-how-correct-cancel-sales-invoice
      title: Correct or cancel a posted sales invoice
      label: possibly related
      why: Documents correcting posted sales invoices and credit memos with quantity conversion
      by: model
number: 13917
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/13917
kind: pr
base_branch: main
major: "30"
merged_at: "2026-11-18T12:09:40Z"
author: sanjmaurya
author_type: User
community_contribution: false
labels:
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 4
  additions: 139
  deletions: 6
  al: 3
apps:
  - Base Application
objects_touched:
  - key: codeunit/1303
    page: codeunit/1303
    type: codeunit
    id: 1303
    name: Correct Posted Sales Invoice
    app: Base Application
    status: modified
objects_unjoined:
  - path: src/Layers/ES/BaseApp/Sales/History/CorrectPostedSalesInvoice.Codeunit.al
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 658769
systems:
  - sales
quote: Convert the credited base quantity using the sales order line's Qty. per Unit of Measure before updating quantities.
joined_against:
  major: "30"
  commit: f53bb0f1ecd89fde9f133f9dcaf5bf43cf5f2671
---

# #13917 [Main][ALL-E] Posting a Sales Credit Memo with a different Unit of Measure does not convert the quantity before updating the originating Sales Order (Blanket Sales Order is updated correctly)

> Fixed a bug where posting a sales credit memo with a different unit of measure failed to convert the quantity before updating the originating sales order, causing incorrect deductions.

[Pull request](https://github.com/microsoft/BCApps/pull/13917) · merged into `main` (BC30) on 2026-11-18 by sanjmaurya · 4 files (+139 -6), 3 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Credit memo quantities are now converted to the sales order line's unit of measure before updating shipped and invoiced quantities
- Previously, 8 PCS was incorrectly deducted as 8 SET instead of 2 SET when units differed
- Regression tests added for different, fractional, and matching units of measure scenarios
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 1303 "Correct Posted Sales Invoice"](../../objects/codeunit/1303.md), Base Application: modified
- `src/Layers/ES/BaseApp/Sales/History/CorrectPostedSalesInvoice.Codeunit.al`: modified, not in the BC30 snapshot

## Context

- Work items: AB#658769
- Labels: Team: SCM
- Systems: sales
- From the description: "Convert the credited base quantity using the sales order line's Qty. per Unit of Measure before updating quantities."

## Possibly related

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

- [Correct or cancel a posted sales invoice](https://learn.microsoft.com/dynamics365/business-central/sales-how-correct-cancel-sales-invoice) — possibly related: Documents correcting posted sales invoices and credit memos with quantity conversion (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).
