Bug 506949 - Invalid reinvestment transactions reported during consistency check
Summary: Invalid reinvestment transactions reported during consistency check
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (other bugs)
Version First Reported In: 5.2.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-12 11:29 UTC by Thomas Baumgart
Modified: 2025-07-13 07:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.2.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Baumgart 2025-07-12 11:29:23 UTC
SUMMARY
Some institutions apparently provide a negative amount for a reinvested dividend while the number of shares is positive. This was somewhat ignored by versions prior to 5.2.0 but will now be caught by the consistency check.
    
This was first reported on https://discuss.kde.org/t/kmymoney-5-2-upgrade-consistency-check-problems/36221/11

STEPS TO REPRODUCE
1. Open file stored with 5.1.3 that contains imported reinvestment transactions from such a bank
2. Run consistency check or save the file after additional changes were made with 5.2.0

OBSERVED RESULT
All transactions are reported but no fix is applied.

EXPECTED RESULT
All transactions are reported and automatically fixed by KMyMoney

ADDITIONAL INFORMATION
A fix of the statement reader to prevent this scenario in the future is already available in master and 5.2 branches.
Comment 1 Thomas Baumgart 2025-07-12 11:33:16 UTC
Git commit 1f6662e07a41d9050e3fec89e35f88d23db4be6b by Thomas Baumgart.
Committed on 12/07/2025 at 11:32.
Pushed by tbaumgart into branch 'master'.

Fix problems with invalid reinvestment transactions in constency check

Some institutions apparently provide a negative amount for a reinvested
dividend while the number of shares is positive. This was somewhat
ignored by versions prior to 5.2.0 but will now be caught by the
consistency check.

This change provides a fix to the consistency check so that the affected
invalid transactions are corrected.
FIXED-IN: 5.2.1

M  +24   -2    kmymoney/mymoney/mymoneyfile.cpp

https://invent.kde.org/office/kmymoney/-/commit/1f6662e07a41d9050e3fec89e35f88d23db4be6b
Comment 2 Thomas Baumgart 2025-07-13 07:28:49 UTC
Git commit 398fdf12ec67796a940642dca74ff05a1d274ef2 by Thomas Baumgart.
Committed on 13/07/2025 at 06:33.
Pushed by tbaumgart into branch '5.2'.

Fix problems with invalid reinvestment transactions in constency check

Some institutions apparently provide a negative amount for a reinvested
dividend while the number of shares is positive. This was somewhat
ignored by versions prior to 5.2.0 but will now be caught by the
consistency check.

This change provides a fix to the consistency check so that the affected
invalid transactions are corrected.
FIXED-IN: 5.2.1
(cherry picked from commit 1f6662e07a41d9050e3fec89e35f88d23db4be6b)

M  +24   -2    kmymoney/mymoney/mymoneyfile.cpp

https://invent.kde.org/office/kmymoney/-/commit/398fdf12ec67796a940642dca74ff05a1d274ef2