fix: incorrect paid_amount and exchange rate in Payment Entry #35107
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.
With
Cash
andBank
account unset in Company master and Party hasDefault Company Bank Account
. In such cases, creating Payment against a Sales/Purchase Invoice has incorrect paid/received amount and the exchange rate is not fetched.Fixing in this PR.
Company master:
![Screenshot 2023-04-30 at 1 14 36 PM](https://user-images.githubusercontent.com/3272205/235342050-bcc1bb1d-cf39-46c4-9bf9-f90383618307.png)
Customer master:
![Screenshot 2023-04-30 at 1 16 40 PM](https://user-images.githubusercontent.com/3272205/235342063-52a9cccc-14b7-4623-8fb2-5c57fafdca09.png)
Invoice in foreign currency for above party:
![Screenshot 2023-04-30 at 1 17 23 PM](https://user-images.githubusercontent.com/3272205/235342091-21ec91ff-72ad-4b0d-b067-d32925e30974.png)
before fix - Incorrect exchange rate and amount:
![Screenshot 2023-04-30 at 1 17 34 PM](https://user-images.githubusercontent.com/3272205/235342109-0721d10b-7e9c-406d-b061-a00e8337a2a7.png)
after fix:
![Screenshot 2023-04-30 at 1 18 11 PM](https://user-images.githubusercontent.com/3272205/235342112-a6cdb55c-5bad-40cb-a303-d91009a41a66.png)