stats4sd / aec_portfolio

A proof of concept for the AEC Consortium Project Management / Assessment System
GNU General Public License v3.0
0 stars 0 forks source link

Budget checks #199

Closed dave-mills closed 1 year ago

dave-mills commented 1 year ago

This PR fixes #198, fixes #191.

budget_org not saved

When an initiative's currency is the same as the organisation's default, the exchange_rate entry field is hidden, and instead the exchange_rate is set to 1. This was being done at the database level. This meant that the PHP code to calculate the budget_org field did not have that information, and so was multiplying by null.

This PR fixes that to always send a value for the exchange rate through the CRUD panel when creating or editing a project, so that the budget_org calculation runs correctly.

sort by budget on the initiatives page.

Turns out the sorting wasn't actually working at all, as it was sorting initiatives instead of filteredInitiatives. This PR fixes that issue, and also sets the budget sorting to work with budget_org instead of budget (as budget may be in different currencies, so the absolute values aren't directly comparable for sorting).

dave-mills commented 1 year ago

Screenshots

Initiative with non-default currency, created via CRUD:

CleanShot 2023-08-03 at 09 54 42

Initiative with default currency, created via CRUD. It has the correct budget_org:

CleanShot 2023-08-03 at 09 56 08

Dashboard showing budgets again, using test projects from migrate:fresh --seed:

CleanShot 2023-08-03 at 09 25 12

dan-tang-ssd commented 1 year ago

I got latest code and performed testing in local env, with positive testing result.

I create a new portfolio, add two new projects. The first project with institution default currency EUR, the second project with USD currency. In Initiative information page, both budget and budget in institution currency can be showed.

Assess red flags, principles, additional criteria for them. In dashboard, total budget and AE-focus budget can be showed.

I think it is good to merge.


Screen shots

image

image

image