Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Budget Totals #471

Closed
adriancollier opened this issue Mar 21, 2014 · 6 comments
Closed

Budget Totals #471

adriancollier opened this issue Mar 21, 2014 · 6 comments
Assignees

Comments

@adriancollier
Copy link
Contributor

We currently have 2 x rsr_budgetitemlabels for Total budgets:

13 = total
14 = Total Budget

We should merge the data for these so that all entries are using 14 = Total Budget.

We should then remove 13 = total from RSR.

@adriancollier adriancollier added this to the 2.3.6 Voavanga milestone Mar 21, 2014
@KasperBrandt KasperBrandt self-assigned this Apr 10, 2014
@KasperBrandt
Copy link
Contributor

@Lynngre @adriancollier Right now it is possible to select a total budget multiple times or a total budget in combination with other budgets. These budget will then be summed up which leads to the amount shown on the project page.

Is this desirable? We can change this to;

  • If a total budget is specified, then that is the budget to be shown on the project page.
  • Otherwise, sum up all budgets.
  • Only one total budget specification is allowed.

There are currently 2 projects that would be effected by this change: id's 400 and 1897. Both having a total budget in combination with other budgets.

@adriancollier
Copy link
Contributor Author

OK, with it only being 2 projects, then I think we can manually resolve these 2 projects (I'll take a look).

Agree with the calculations changes and limiting to 1 total budget.

We should also merge the existing entries for both types of total budget now.

@zzgvh
Copy link
Contributor

zzgvh commented May 5, 2014

A couple of comments.

  • The label text should be "total" or "total budget". Capitalization should be handled in the template if needed.
  • This is a kind of "overloading" of the BudgetItem functionality, as it's now either a list of budget items or one total budget. This needs to be validated with an admin validation method that disallows multiple items if total budget is chosen.
  • Also the code now refers to a particular ID (14) for the total budget object. This should be changed to use the same method as for the "other 1" etc objects, by referring to the label text thus making it a bit more robust. I don't remember if we have a check that the "other 1" etc objects exist in the DB, if we do "total budget" should be added to that. Or if there is no such check it probably should be added 😉

@KasperBrandt
Copy link
Contributor

@zzgvh Thanks for the feedback. Code has been updated, can you check again?

stellanl added a commit that referenced this issue May 6, 2014
stellanl added a commit that referenced this issue May 6, 2014
[#471] Code checked, Tweaked a variable name.
@KasperBrandt
Copy link
Contributor

Merged in #515

@KasperBrandt
Copy link
Contributor

Test plan

This issue consists of two parts;

  • A script for removing budget item id 13
  • An extra validation on budget items

Script

The budget_totals.py script can be found in the rsr-akvo/akvo/scripts/ folder.

GIVEN the script
WHEN the script is run
THEN budget item label id 13 should be removed from the database
AND budget item label id 14 should be renamed to 'total'
AND all budget items with label id 13 should be replaced with label id 14
AND total budgets for each project should be recalculated

Validation

GIVEN the project admin
WHEN a combination of a 'total' budget item and another budget item is entered
AND the project is saved
THEN a validation error should appear

@MichaelAkvo MichaelAkvo moved this to Done in RSR Dec 8, 2022
@MichaelAkvo MichaelAkvo added this to RSR Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants