Uploaded image for project: 'Apache Fineract'
  1. Apache Fineract
  2. FINERACT-2011

Savings Account - transaction order is incorrectly mixed after certain activities

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 1.9.0
    • Savings

    Description

      The issue generally

      In the cases, when

      • an account balance gets negative
      • backdated transaction gets inserted
      • and other, not tested cases that can be seen in the code

      the transaction order of the already existing and new transactions gets mixed.

      Steps to reproduce

      1. Deposit 100 - no issues so far, balance should be: +100
      2. Withdraw 100 - no issues so far, balance should be: 0
      3. holdAmount 50 -> available balance is negative - no issues so far, balance should be: -50
      4. releaseAmount 50 - no issues so far, balance should be: 0
      5. Deposit 100 - this should have been failed, but did not, balance should be: +100
        So I repeated the steps:
      6. Withdraw 100 - balance should be: 0
      7. holdAmount 50 -> balance should be: -50
      8. releaseAmount 50 - balance should be: 0
      9. Deposit 100 - balance should be: +100

      was desperately bad.
      Attached the screenshot of the transaction table.

      Although the Saving account balance was correct at the end (+100), for the transactions neither the running balance nor the overdraft amount were correct. The number of transactions not reversed was ok, but in wrong order.
      Additionally, several transactions (including the deposit and withdrawal transactions) were reverted and recreated. This we can not allow, because it means that the datatable references were lost.
      It seems to me that unfortunately I really need to dig deep into the core code and change it. For this I need to understand all the possible use-cases, including past-dated transactions, because of which all these complicated revert steps happen.

      Actual result

       

      Expected result

      The transactions must be ordered by value date (transactionDate).

      Attachments

        1. savings_transactions.png
          108 kB
          Peter Santa

        Issue Links

          Activity

            People

              Unassigned Unassigned
              peter.santa Peter Santa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: