FIX: filling of field amount_main_currency for foreign m…#37439
Open
gschratzer wants to merge 5 commits intoDolibarr:developfrom
Open
FIX: filling of field amount_main_currency for foreign m…#37439gschratzer wants to merge 5 commits intoDolibarr:developfrom
gschratzer wants to merge 5 commits intoDolibarr:developfrom
Conversation
7427dd8 to
5634298
Compare
…oreign money accounts The parameter amount_main_currency (argument Dolibarr#13 of addline()) was previously filled even when the bank account was already using the company main currency. This caused the field amount_main_currency to be populated incorrectly for transactions that were not foreign currency operations. The logic has been updated so that amount_main_currency is only filled when the transaction involves a foreign currency account. For accounts already using the company main currency, the value is now left NULL as expected. This aligns the behavior with the intended usage of addline() and prevents incorrect data in bank transaction records.
…oreign money accounts transfer.php: PhanTypeMismatchArgument: Argument 4 ($amount) is price2num((-1 * (float)($amount[$n]))) of type string but \Account::addline() takes float defined at htdocs/compta/bank/class/account.class.php:611 CI-PULL-REQUEST / phan / Run phan Check warning on line R189 Check warning: transfer.php: PhanTypeMismatchArgument: Argument 13 ($amount_main_currency) is $amount_main_currency_from of type ?string but \Account::addline() takes ?float defined at htdocs/compta/bank/class/account.class.php:611 CI-PULL-REQUEST / phan / Run phan
5634298 to
b8f222c
Compare
Contributor
Author
|
This seems unrelated to my change. |
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.
FIX #37428 bank and cash accounts with foreign currency
The parameter amount_main_currency (argument #13 of addline()) was previously filled even when the bank account was already using the company main currency.
This caused the field amount_main_currency to be populated incorrectly for transactions that were not foreign currency operations.
The logic has been updated so that amount_main_currency is only filled when the transaction involves a foreign currency account. For accounts already using the company main currency, the value is now left NULL as expected.
This aligns the behavior with the intended usage of addline() and prevents incorrect data in bank transaction records.