---
id: change/bcapps/10467
type: change
title: "#10467 [Shopify] Fix more-expensive exchange refund: no balancing G/L line, no false processed-order warning"
summary: Fixed Shopify exchange refund handling when the replacement item is more expensive than the returned item, eliminating the false processed-order warning and removing the spurious balancing G/L line that forced the credit memo total to zero.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit shpfy create sales doc. refund
  - codeunit shpfy import order
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:07:44.267Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 11884afa0af50217fb0e76c0a7e904aaac4647a2
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/10467
    title: "microsoft/BCApps#10467: [Shopify] Fix more-expensive exchange refund: no balancing G/L line, no false processed-order warning"
    date: "2026-08-24"
    commit: 11884afa0af50217fb0e76c0a7e904aaac4647a2
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/30246
    - object/codeunit/30161
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 10467
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/10467
kind: pr
base_branch: main
major: "30"
merged_at: "2026-08-24T15:44:26Z"
author: onbuyuka
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: Integrations"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 5
  additions: 224
  deletions: 35
  al: 2
apps:
  - Shopify
objects_touched:
  - key: codeunit/30246
    page: codeunit/30246
    type: codeunit
    id: 30246
    name: Shpfy Create Sales Doc. Refund
    app: Shopify
    status: modified
  - key: codeunit/30161
    page: codeunit/30161
    type: codeunit
    id: 30161
    name: Shpfy Import Order
    app: Shopify
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 647369
systems:
  - integration
quote: null
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #10467 [Shopify] Fix more-expensive exchange refund: no balancing G/L line, no false processed-order warning

> Fixed Shopify exchange refund handling when the replacement item is more expensive than the returned item, eliminating the false processed-order warning and removing the spurious balancing G/L line that forced the credit memo total to zero.

[Pull request](https://github.com/microsoft/BCApps/pull/10467) · merged into `main` (BC30) on 2026-08-24 by onbuyuka · 5 files (+224 -35), 2 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Exchange line IDs are now fetched up front and excluded from the processed-order conflict detection to prevent false warnings on re-import
- The redundancy hash for processed orders now excludes exchange lines for consistent re-import behavior
- Credit memo no longer creates a spurious Refund Account G/L line when the refund contains exchange lines
- The credit memo total now correctly reflects the customer's remaining payment obligation instead of being forced to zero
- Two new unit tests validate the fix for exchanges where the replacement item costs more than the returned item
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 30246 "Shpfy Create Sales Doc. Refund"](../../objects/codeunit/30246.md), Shopify: modified
- [Codeunit 30161 "Shpfy Import Order"](../../objects/codeunit/30161.md), Shopify: modified

## Context

- Work items: AB#647369
- Labels: AL: Apps (W1), Team: Integrations
- 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).
