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

Make the TOTAL PROJECT COST data field in General Info mirror the COMPUTED total cost in the matrix on Investment Cost per Funding Source (rather than as freehand) #206

Open
mtayco opened this issue Jan 15, 2024 · 3 comments
Assignees
Labels
backend The task requires working on the backend critical This is a critical issue that needs to be addressed immediately enhancement New feature or request frontend This task requires working on the frontend
Milestone

Comments

@mtayco
Copy link

mtayco commented Jan 15, 2024

PIPS_Total Cost to mirror computed Total Cost in Funding Source table

Encoders are required to provide an annual breakdown of their investment targets in the Investment Cost per Funding Source; we suggest that whatever will be automatically computed as the total cost ("TOTAL" column, which could be sum of all Funding Sources), should be automatically mirrored in the Data Field, "Total Project Cost (in absolute PHP)" found in the General Information section. This is to do away with the need for encoders to have to edit this data field every time they have to revise/ edit the annual breakdown in the Funding Source table.

@clorae clorae self-assigned this Jan 18, 2024
@clorae clorae added enhancement New feature or request frontend This task requires working on the frontend backend The task requires working on the backend labels Jan 18, 2024
@clorae clorae modified the milestones: 2023-version-wrapup, v3 Jan 18, 2024
@mlab817
Copy link
Contributor

mlab817 commented Jan 24, 2024

The purpose of the total project cost field is to serve as reference in checking the breakdown by funding source and by region. If you allow it to be autocomputed instead you won't know which of the breakdown is correct or if any of them are correct.

@mtayco
Copy link
Author

mtayco commented Jan 24, 2024 via email

@mlab817
Copy link
Contributor

mlab817 commented Jan 25, 2024

Consistency =/= correctness

To illustrate:

sample total project cost: 9

sample regional breakdown:

region 2018 2019 2020 total
region 1 1 1 1 3
region 2 1 1 1 3
total 2 2 2 6

sample funding source breakdown:

region 2018 2019 2020 total
oda-loan 2 2 2 6
total 2 2 2 6

Since they match, the system will accept the inputs as correct. However, the true total project cost is 9 which means something is missing. A potentially correct breakdown would be:

correct sample regional breakdown:

region 2018 2019 2020 total
ncr 1 1 1 3
region 1 1 1 1 3
region 2 1 1 1 3
total 3 3 3 9

correct sample funding source breakdown:

region 2018 2019 2020 total
ng 1 1 1 3
oda-loan 2 2 2 6
total 3 3 3 9

The reason why it's there is to have a reference in case some records go missing in the database or other users
(like Carole did) accidentally delete records. You wouldn't know about this if the total project cost is auto-computed and only the one who updated/deleted it would know (esp. if it's the reviewer that changed the records since they don't comply with validation rules).

Now, I think the problem is not with the encoders but the reviewers since the system prevents encoders from endorsing PAPs whose investment cost per funding source and per region do not match the total cost reported. The code responsible for this is:

// validate consistency of breakdowns with inputted total cost
if (totalCost != null) {
    // check if inputted total cost is not equal to investment per funding source grand total
    if (totalCost!.round() != fsInvestmentTotalRow.grandTotal.round()) {
      // add an issue if the two do not match
      issues
          .add('Total cost is not the same as breakdown per funding source.');
    }

    // check if inputted total cost is not equal to investment per region grand total
    if (totalCost!.round() != regionalInvestmentTotalRow.grandTotal.round()) {
      // add an issue if the two do not match
      issues.add('Total cost is not the same as breakdown per region.');
    }
}

Given this, my recommendations would be:

  • If the problem is the encoder not seeing the total project cost above, you can just put the total project cost somewhere in the investment cost per funding source and investment cost per region breakdown.

  • The vice versa is also possible, i.e. putting the computed total costs below the total project cost.

  • Impose the same validation logic to reviewers as with the encoders.

For your consideration.

@clorae clorae added the critical This is a critical issue that needs to be addressed immediately label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend The task requires working on the backend critical This is a critical issue that needs to be addressed immediately enhancement New feature or request frontend This task requires working on the frontend
Projects
None yet
Development

No branches or pull requests

3 participants