---
id: change/bcapps/14613
type: change
title: "#14613 Receipt on Invoice: posting an invoice matched to only some lines of a purchase order fails"
summary: Fixed purchase invoice posting when matched to only some lines of a purchase order with Receipt on Invoice. The fix ensures that only matched order lines are received during invoice posting, while unmatched lines retain their quantity to receive for later invoicing.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - table purchase line
  - codeunit matched order line mgmt.
system: purchasing
review:
  state: reviewed
  by: opus
  at: "2026-12-04T01:06:55.824Z"
  flags: []
generated:
  at: "2026-12-05T00:13:03.967Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 31b8c599e78a8f8a3f733f664a82a8c8d9f2d24b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/14613
    title: "microsoft/BCApps#14613: Receipt on Invoice: posting an invoice matched to only some lines of a purchase order fails"
    date: "2026-12-03"
    commit: 31b8c599e78a8f8a3f733f664a82a8c8d9f2d24b
    t: null
    quote: posting a purchase invoice that is matched to only some lines of a purchase order failed
links:
  learn: []
  objects:
    - object/table/39
    - object/codeunit/5826
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/purchasing-how-to-combine-receipts
      title: Combine Receipts or PO Lines on a Single Invoice
      label: possibly related
      why: Documents Receipt on Invoice feature for consolidating purchase receipts into invoices
      by: model
    - to: https://learn.microsoft.com/dynamics365/business-central/match-purchase-invoice-drafts-to-orders
      title: Match Purchase Invoice Drafts to Purchase Orders
      label: possibly related
      why: Documents matching purchase invoice drafts to purchase orders and receipts
      by: model
number: 14613
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/14613
kind: pr
base_branch: main
major: "30"
merged_at: "2026-12-03T12:03:26Z"
author: VolodySyn
author_type: User
community_contribution: false
labels:
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 17
  additions: 702
  deletions: 26
  al: 15
apps:
  - Base Application
objects_touched:
  - key: table/39
    page: table/39
    type: table
    id: 39
    name: Purchase Line
    app: Base Application
    status: modified
  - key: codeunit/5826
    page: codeunit/5826
    type: codeunit
    id: 5826
    name: Matched Order Line Mgmt.
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports:
  - number: 14869
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/14869
fixes_issues: []
work_items:
  - 660778
systems:
  - purchasing
  - inventory
quote: posting a purchase invoice that is matched to only some lines of a purchase order failed
joined_against:
  major: "30"
  commit: f53bb0f1ecd89fde9f133f9dcaf5bf43cf5f2671
---

# #14613 Receipt on Invoice: posting an invoice matched to only some lines of a purchase order fails

> Fixed purchase invoice posting when matched to only some lines of a purchase order with Receipt on Invoice. The fix ensures that only matched order lines are received during invoice posting, while unmatched lines retain their quantity to receive for later invoicing.

[Pull request](https://github.com/microsoft/BCApps/pull/14613) · merged into `main` (BC30) on 2026-12-03 by VolodySyn · 17 files (+702 -26), 15 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Sets Qty. to Receive to 0 on unmatched order lines before auto-posting receipt, then restores it afterward
- CheckMatchedOrderLine now only errors for Receipt on Invoice lines that would actually be received
- Receipt on Invoice is blocked on inventory items at locations requiring warehouse receipts
- Unmatched order lines without Receipt on Invoice are no longer auto-received
- Receipt on Invoice feature telemetry is logged only when an order is actually auto-received
- Behaviour changes for users or extensions.

## AL objects touched

- [Table 39 "Purchase Line"](../../objects/table/39.md), Base Application: modified
- [Codeunit 5826 "Matched Order Line Mgmt."](../../objects/codeunit/5826.md), Base Application: modified

## Also merged into

- [#14869](https://github.com/microsoft/BCApps/pull/14869) into `releases/29.x` on 2026-12-03

## Context

- Work items: AB#660778
- Labels: Team: SCM
- Systems: purchasing, inventory
- From the description: "posting a purchase invoice that is matched to only some lines of a purchase order failed"

## Possibly related

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

- [Combine Receipts or PO Lines on a Single Invoice](https://learn.microsoft.com/dynamics365/business-central/purchasing-how-to-combine-receipts) — possibly related: Documents Receipt on Invoice feature for consolidating purchase receipts into invoices (model-linked)
- [Match Purchase Invoice Drafts to Purchase Orders](https://learn.microsoft.com/dynamics365/business-central/match-purchase-invoice-drafts-to-orders) — possibly related: Documents matching purchase invoice drafts to purchase orders and receipts (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).
