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

fix(cost centers): filter on reference type #5956

Conversation

jniles
Copy link
Collaborator

@jniles jniles commented Sep 30, 2021

This commit fixes the cost center functions to ensure that we are filtering the account references by the cost center id. I've also combined both of the functions for calculating cost centers into a single file.

This commit fixes the cost center functions to ensure that we are
filtering the account references by the cost center id.
@jniles jniles force-pushed the fix-filter-account_reference-on-is-cost-center branch from 9e35722 to e0f918c Compare September 30, 2021 11:07
During invoicing, we now assign the "principal" cost centers
independently.
@jniles
Copy link
Collaborator Author

jniles commented Oct 1, 2021

@lomamech can I get a review?

@jniles jniles requested a review from mbayopanda October 4, 2021 06:15
Copy link
Contributor

@mbayopanda mbayopanda left a comment

Choose a reason for hiding this comment

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

Good refactoring and it LGTM 👍🏽

SELECT account_reference_id FROM account_reference_item JOIN account_reference
ON account_reference_item.account_reference_id = account_reference.id
WHERE account_reference_item.account_id = account_id
and account_reference.reference_type_id = 1 -- reference_type_id 1 is cost center
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏽

@mbayopanda
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 4, 2021

Build succeeded:

@bors bors bot merged commit 50faea0 into IMA-WorldHealth:master Oct 4, 2021
@jniles jniles deleted the fix-filter-account_reference-on-is-cost-center branch October 4, 2021 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants