---
id: change/bcapps/12003
type: change
title: "#12003 [Main]- Project Planning Lines are created in reverse order when purchase line descriptions are copied"
summary: Fix project planning lines being created in reverse order when posting purchase invoices with copy line descriptions enabled.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit purch. post invoice
system: purchasing
review:
  state: reviewed
  by: opus
  at: "2026-10-18T00:55:27.655Z"
  flags: []
generated:
  at: "2026-11-24T00:13:35.655Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 006d20024373394ca4b133676680fdc9831231a6
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12003
    title: "microsoft/BCApps#12003: [Main]- Project Planning Lines are created in reverse order when purchase line descriptions are copied"
    date: "2026-10-09"
    commit: 006d20024373394ca4b133676680fdc9831231a6
    t: null
    quote: Project Planning Lines are created in reverse order when purchase line descriptions are copied
links:
  learn: []
  objects:
    - object/codeunit/816
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/projects-how-invoice-jobs
      title: Create a project sales invoice to invoice a project
      label: possibly related
      why: Create project sales invoices documents project planning lines and invoice creation from projects.
      by: model
number: 12003
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12003
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-09T06:11:46Z"
author: DhavalMore88
author_type: User
community_contribution: true
labels:
  - "ADO: Sync"
  - From Fork
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 10
  additions: 583
  deletions: 60
  al: 8
apps:
  - Base Application
objects_touched:
  - key: codeunit/816
    page: codeunit/816
    type: codeunit
    id: 816
    name: Purch. Post Invoice
    app: Base Application
    status: modified
objects_unjoined:
  - path: src/Layers/CH/BaseApp/Purchases/Posting/PurchPostInvoice.Codeunit.al
    status: modified
    reason: not-in-snapshot
  - path: src/Layers/RU/BaseApp/Purchases/Posting/PurchPostInvoice.Codeunit.al
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 651522
systems:
  - purchasing
quote: Project Planning Lines are created in reverse order when purchase line descriptions are copied
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #12003 [Main]- Project Planning Lines are created in reverse order when purchase line descriptions are copied

> Fix project planning lines being created in reverse order when posting purchase invoices with copy line descriptions enabled.

[Pull request](https://github.com/microsoft/BCApps/pull/12003) · merged into `main` (BC30) on 2026-10-09 by DhavalMore88 (community contribution) · 10 files (+583 -60), 8 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Project Planning Lines now follow the original purchase line order instead of reverse order
- Occurs when Copy Line Descr. to G/L Entry is enabled and several G/L Account lines share a project and task
- Cause: Invoice Posting Buffer groups were processed in descending order of a key that includes the source line number
- Purch. Post Invoice now processes buffer groups in ascending source line order across all layers
- Intended not to change G/L, VAT or Job Ledger Entry posting; job consumption tests updated
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 816 "Purch. Post Invoice"](../../objects/codeunit/816.md), Base Application: modified
- `src/Layers/CH/BaseApp/Purchases/Posting/PurchPostInvoice.Codeunit.al`: modified, not in the BC30 snapshot
- `src/Layers/RU/BaseApp/Purchases/Posting/PurchPostInvoice.Codeunit.al`: modified, not in the BC30 snapshot

## Context

- Work items: AB#651522
- Labels: ADO: Sync, From Fork, Team: SCM
- Systems: purchasing
- From the description: "Project Planning Lines are created in reverse order when purchase line descriptions are copied"

## Possibly related

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

- [Create a project sales invoice to invoice a project](https://learn.microsoft.com/dynamics365/business-central/projects-how-invoice-jobs) — possibly related: Create project sales invoices documents project planning lines and invoice creation from projects. (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).
