[Shopify] Automatic Transaction Posting#9525
Draft
onbuyuka wants to merge 2 commits into
Draft
Conversation
Automatically post Shopify order and refund payment transactions as general journal lines when the related sales invoice or credit memo is posted, when the transaction's payment method mapping is configured for automatic posting. Posting is synchronous and best-effort: a failure to post a payment is logged as a Shopify skipped record and never blocks or reverses the document posting. Preview posting and commit-suppressed postings are respected (auto-posting is skipped in those cases). Fixes AB#620951 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 42e38781-540d-47bf-8a06-86ee9aceb050
…620951-shopify-automatic-transaction-posting
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.
Summary
Introduces automatic posting of Shopify order/refund payment transactions as general journal lines when the related invoice or credit memo is posted in Business Central. This is a reworked, hardened version of the feature originally proposed in #6515.
Changes
New functionality
Shpfy Payment Method Mapping(table + page):Post Automatically,Auto-Post Jnl. Template,Auto-Post Jnl. Batch(validated to require a balancing account on the batch).Auto-Post Enabledflow field onShpfy Order Transaction(table + page).Filter Postable Transactions/Clear Filteractions on the Shopify Transactions list.Prerequisites to post automatically
Shpfy Payment Method Mapping:Post Automatically= true andAuto-Post Jnl. Template/Auto-Post Jnl. Batchfilled in (the batch must have a balancing account).Design notes (safety around the posting routine)
Sales-Post.OnAfterPostSalesDoc, which fires after the document has been committed. No broadCOMMITis added to the posting routine.PreviewModeandCommitIsSuppressedpostings are respected — automatic posting is skipped in those cases so previews and caller-controlled transactions are never disturbed.Gen. Jnl.-Post Batch), independent of thePost with Job Queuesetting.Tests
Added
ShpfyAutoPostTransTest.Codeunit.al(ID 139627) covering:Auto-Post Jnl. Batchvalidation with / without a balancing account and with an empty value.Post Automaticallyis true, and not posting when it is false.Post with Job Queueis enabled.Fixes AB#620951