Commit 4c96010
authored
[Shopify] Fix wrong Refund Line ID being used (#6105)
### Summary
This PR fixes a bug where the Shopify Connector was incorrectly using
the Order Line ID instead of the actual Refund Line ID when creating
refund line records. The issue caused incorrect data to be stored in the
`"Refund Line Id"` field of the `"Shpfy Refund Line"` table.
### Problem
When importing refund lines from Shopify, the system was extracting the
`lineItem.id` from the GraphQL response and using it as both the
`"Refund Line Id"` and `"Order Line Id"`. This was incorrect because:
- `lineItem.id` represents the original order line item
- The actual refund line has its own unique ID that should be stored in
`"Refund Line Id"`
### Solution
1. **Updated GraphQL queries** to include the `id` field for refund line
items:
- ShpfyGQLRefundLines.Codeunit.al - Added `id` to the `nodes` selection
- ShpfyGQLNextRefundLines.Codeunit.al - Added `id` to the `nodes`
selection
2. **Updated the refund line import logic** in
ShpfyRefundsAPI.Codeunit.al:
- Now correctly extracts the refund line's own `id` for the `"Refund
Line Id"` field
- Uses `lineItem.id` only for the `"Order Line Id"` field (the reference
to the original order line)
#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes
[AB#617843](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/617843)1 parent 1992b9c commit 4c96010
File tree
4 files changed
+23
-11
lines changed- src/Apps/W1/Shopify
- App/src
- GraphQL/Codeunits
- Order Refunds/Codeunits
- Test/Order Refunds
4 files changed
+23
-11
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | | - | |
| 154 | + | |
| 155 | + | |
154 | 156 | | |
155 | | - | |
156 | | - | |
| 157 | + | |
| 158 | + | |
157 | 159 | | |
158 | | - | |
| 160 | + | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
| |||
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
225 | | - | |
| 226 | + | |
| 227 | + | |
226 | 228 | | |
227 | 229 | | |
228 | | - | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
| |||
501 | 503 | | |
502 | 504 | | |
503 | 505 | | |
504 | | - | |
| 506 | + | |
505 | 507 | | |
506 | | - | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
507 | 517 | | |
508 | 518 | | |
509 | 519 | | |
| |||
0 commit comments