ABN-443/fix: credit-memo surcharge override polish (display, zero-handling, messages)#206
Merged
Merged
Conversation
The override input re-rendered its value from a raw float, so after an AJAX recalc a typed "2,50" came back as "2.5" — losing the trailing zero and the locale decimal separator. Render it via the admin locale: fixed 2dp with the locale decimal symbol (2,50 for nl_NL, 2.50 for en), no grouping (the override parser rejects thousands separators by design). Refs ABN-443 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…d message
Credit-memo surcharge override fixes:
- An explicit 0 (or a cleared field, now treated as 0) no longer snaps the
input back to the full proportional default — getDefaultRefund honors the
collected value once collectTotals has run.
- Guard messages drop the "Two" brand ("Surcharge refund ..."), per U2
brand-isolation, with nl_NL / sv_SE / nb_NO translations.
Unit tests for the block (explicit-zero + proportional-default paths) and the
plugin (blank→0, locale value, brand-neutral exceeds message).
Refs ABN-443
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e Totals Removes the blur/debounced-change auto-refresh on the surcharge override input (JS module + template hook + Jest test). The surcharge now recalculates only on the standard "Update Qty's"/"Update Totals" click, consistent with Magento's native shipping/adjustment fields — less surprising than a field that round-trips on its own. Refs ABN-443 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Bundled follow-ups on the credit-memo surcharge override input (all touch the same block/plugin/template):
2,50, not the raw2.5) viaFormatInterface.0or clearing the field now sticks (refund no surcharge) instead of snapping back to the full default.getDefaultRefundhonors the collected value; a blank field is treated as an explicit0override.Tests: PHPUnit block (zero + default paths) + plugin (blank→0, locale value, brand-neutral message); 153 PHPUnit, 28 Jest. Refs ABN-443