[Shopify] Configurable Return Processing#6722
Open
GediminasGaubys wants to merge 1 commit intomicrosoft:mainfrom
Open
[Shopify] Configurable Return Processing#6722GediminasGaubys wants to merge 1 commit intomicrosoft:mainfrom
GediminasGaubys wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Introduces a shop-level setting to choose whether returns are processed as Credit Memo or Return Order, improving flexibility for refund handling. Updates UI labels and tooltips for clarity, and refactors processing logic to use the new enum and interface pattern. Expands test coverage to validate Return Order creation from refunds.
|
Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation Description - Configurable Return Processing
Summary
This PR introduces a shop-level configuration to determine whether Shopify returns are processed as Credit Memos or Return Orders in Business Central. The implementation uses an interface-based strategy pattern for extensibility, updates UI labels for clarity, and includes test coverage for Return Order creation.
Changes
New Functionality:
Shop-Level Configuration:
Strategy Pattern Implementation:
GetTargetDocumentType()method.Shpfy Process Credit MemocodeunitShpfy Process Return OrdercodeunitImplementation Codeunits:
Sales Document Type::"Credit Memo".Sales Document Type::"Return Order".Refund Processing Logic Update:
CreateSalesDocumentprocedure.UI Updates for Clarity:
CreateCreditMemotoCreateDocument.Architecture Benefits:
Prerequisites:
Tests
Modified ShpfyOrderRefundTest codeunit with enhanced coverage:
Code Quality Improvements:
ResetProccesOnRefund→ResetProcessOnRefund(4 occurrences).New Test: Return Order Creation:
UnitTestCreateReturnOrder(): Validates Return Order creation from Shopify refund.Process Returns As = "Return Order".SalesHeader."Document Type" = "Return Order".Fixes #