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

duration and utilized #456

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

duration and utilized #456

wants to merge 3 commits into from

Conversation

calellowitz
Copy link
Collaborator

This fixes two separate issues, each in their own commit.

  1. Duration was not visible in the visit export, which made verifying that flag very difficult. I added it to the model as a property in addition to the export so it would be easier to use in the future, and accessible outside the serializer function.
  2. budget utilization for the opportunity was wrong in a number of ways. It included work that was not approved and didn't account for the fact that an individual completed work could accrue multiple payments. Using the completed work functions to get the correct data introduced major performance problems, so I switched to summing payment accrued for each worker, which should be identical, but is a much simpler calculation.

Copy link
Contributor

@pxwxnvermx pxwxnvermx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the budget, we might need to include the org pay as well. The rest looks good to me.

amount = payment_unit_count["amount"]
utilised += completed_count * amount
for u in users:
utilised += u.payment_accrued
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to add the org_pay component here as well for the managed opportunities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants