<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>506949</bug_id>
          
          <creation_ts>2025-07-12 11:29:23 +0000</creation_ts>
          <short_desc>Invalid reinvestment transactions reported during consistency check</short_desc>
          <delta_ts>2025-07-13 07:28:49 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmymoney</product>
          <component>general</component>
          <version>5.2.0</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Thomas Baumgart">tbaumgart</reporter>
          <assigned_to name="KMyMoney Devel Mailing List">kmymoney-devel</assigned_to>
          
          
          <cf_commitlink>https://invent.kde.org/office/kmymoney/-/commit/398fdf12ec67796a940642dca74ff05a1d274ef2</cf_commitlink>
          <cf_versionfixedin>5.2.1</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2440330</commentid>
    <comment_count>0</comment_count>
    <who name="Thomas Baumgart">tbaumgart</who>
    <bug_when>2025-07-12 11:29:23 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2440332</commentid>
    <comment_count>1</comment_count>
    <who name="Thomas Baumgart">thb</who>
    <bug_when>2025-07-12 11:33:16 +0000</bug_when>
    <thetext>Git commit 1f6662e07a41d9050e3fec89e35f88d23db4be6b by Thomas Baumgart.
Committed on 12/07/2025 at 11:32.
Pushed by tbaumgart into branch &apos;master&apos;.

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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2440435</commentid>
    <comment_count>2</comment_count>
    <who name="Thomas Baumgart">thb</who>
    <bug_when>2025-07-13 07:28:49 +0000</bug_when>
    <thetext>Git commit 398fdf12ec67796a940642dca74ff05a1d274ef2 by Thomas Baumgart.
Committed on 13/07/2025 at 06:33.
Pushed by tbaumgart into branch &apos;5.2&apos;.

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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>