We found a calculation error with budget and deleted timetrackings

Steps to reproduce

  1. Create a new project. With the following settings
    • "Price mode *": Budget per hour
    • "Budget time billing *" ~Prepaid
    • "Price": Leave this field empty
  2. Create new budget 100 hours
  3. Create a new task. Using that task. Add a first timetracking 125 hours.
  4. Notice that ERPAL automatically created a second timetracking. Which is normal and by design because the 125 hours timetracking is larger than the remaining budget 100 hours. That second timetracking reads as follow:
    1. Duration: 0 hour
    2. Billing Duration: 25 hours
  5. Using the same task. Add a third timetracking at 0.5 hours.
  6. Delete the second timetracking that was automatically created by ERPAL. The 25 hours.
  7. Delete both the first and third timetrackings you just created.
  8. Go to the project homepage. On the right side column. Into that table. Notice that "Total SUM"/available hours row now reads: 74.50 hours
  9. But it should read 100 hours not 74.50 hours. Because all timetracking were deleted.

Any volunteer for a patch?

The Ubertus team would be happy to contribute testing patch, quality assurance, documentation

Comments

Francewhoa created an issue.

Francewhoa’s picture

For those facing the same challenge. We found a workaround. It does not prevent this issue from reoccurring in the future. And it does not fix this ticket. And it is lots of work. But on the bright side it does fix calculation issues with previous budgets.

Steps workaround

  1. Write down the current total amount of hours in your buggy budget. Let's call it budget "A". For example 100 hours. Also write down its "Available from date". For example Thu Sep 29, 2016.
  2. View the project homepage. Click on the "view" link next to the buggy budget "A". Click on the "Edit" link to edit that buggy budget "A". Temporarily increase its amount so that its balance is positive. We do this because we temporarily need a positive balance on that budget "A". Otherwise with a negative balance you can NOT move timetrackings from that budget "A" to the budget "B" we will create below. For example temporarily change 100 hours to 1,000 hours.
  3. Edit the project. Under "Pricing" ---> "Budgets" section. Create a new budget. Let's call it budget "B". Same date and same amount of hours as the original buggy budget. So 100 hours. And Thu Sep 29, 2016.
  4. Move all timetrackings from budget "A" to "B". To do so edit each timetracking. And change the "Budget" field. This might take a while depending on the amount of timetrackings.
  5. This is optional but double check that all recently created timetrackings are linked to the newly created budget "B".
  6. Delete the previous buggy budget "A". If not working double check that you migrated all timetrackings from "A" to "B". Otherwise it will not work.
  7. Done. Rejoice, LOL ;)