Conversation
This mostly changes the way that certain data structures are interacted with, avoiding long calls when shorter refereces are possible. This commit does not yet fix any bugs and behaves identical to the code before this commit. However, it ensures that bugs can be fixed after.
The code is extremely complex for what it does. PLEASE NOTE: this does mess with localization with two strings in warnings in the use overpayment workflow. However not only was this workflow broken but the use of the translation API was also broken and therefore I do not believe this should prevent backporting.
Prior to this, the repeatedly updating the overpayment screen would eventually pass in an array as invoice date, and the amount due would be lost.
This fixes an unexpected blank line in the invoice search workflow.
This involved some further simplifying of the code in areas where there were some past bugs. Not sure exactly what the problem was, but it is now fixed. Now Cucumber tests are needed.
einhverfr
commented
Jun 14, 2025
| $Payment->{"amount_$count"}; | ||
| if($invoice_id_amount_to_pay{qq|$Payment->{"invoice_id_$count"}|} | ||
| > $applied_due) { | ||
| $warning .= $locale->text('The amount of the invoice number').qq| $Payment->{"invnumber_$count"} |.$locale->text('is lesser than the amount to be paid').qq|\n|; |
Member
Author
There was a problem hiding this comment.
This use of $locale->text is so fundamentally broken I don't see a problem with introducing a new untranslated string in its place.
| # ojo no me gusta como esta implementado | ||
| ################################################################### | ||
| if($Payment->{"amount_$count"} < 0){ | ||
| $warning .= $locale->text('The amount of the invoice number').qq| $Payment->{"invnumber_$count"} |.$locale->text('is lesser than 0').qq|\n|; |
Member
Author
There was a problem hiding this comment.
Also fundamentally broken.....
einhverfr
commented
Jun 14, 2025
| $amount_to_be_used{$ovp_selected_accno} += $Payment->{"amount_$count"}; | ||
|
|
||
| if($Payment->{"amount_$count"} > $applied_due) { | ||
| $warning .= $locale->text('The amount of the invoice number [_1] is less than the amount to be paid.', $Payment->{"invnumber_$count"}); |
Member
Author
There was a problem hiding this comment.
This is the first replacement which is untranslated
einhverfr
commented
Jun 14, 2025
| } | ||
|
|
||
| if($Payment->{"amount_$count"} < 0){ | ||
| $warning .= $locale->text('The amount of the invoice number [_1] is less than 0', $Payment->{"invnumber_$count"}); |
Member
Author
There was a problem hiding this comment.
This is the second replacement which is untranslated.
Member
|
@einhverfr are you working on fixing overpayments? If not, could you clean up the branches in this repo (and move them to your namespace)? I've been keeping the branches in the main repo to the bare minimum: all feature branches live in other repositories. Same for fix branches. |
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.
This fixes all immediately known bugs with using overpayments/prepayments.
Please note -- there are two cases where current translation of strings is broken by this patch. This is because there were two uses of translation which concatenated variables and then concatenated further translated strings. This is fundamentally incorrect and leads to broken translations even without these changes. I am adding comments in line to point these out. If the consensus is better not to backport these, I will revert those lines specifically.