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

Dev #210

Merged
merged 3 commits into from Apr 5, 2017
Merged

Dev #210

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/heart-walk/coffee/controller/companyListPage.coffee
Expand Up @@ -54,10 +54,7 @@ angular.module 'ahaLuminateControllers'
childCompanyAmountRaised = if companyItem.amountRaised then Number(companyItem.amountRaised) else 0
angular.forEach rootAncestorCompanies, (rootAncestorCompany, rootAncestorCompanyIndex) ->
if rootAncestorCompany.companyId is rootParentCompanyId
console.log rootParentCompanyId, rootAncestorCompanies[rootAncestorCompanyIndex].amountRaised, childCompanyAmountRaised
rootAncestorCompanies[rootAncestorCompanyIndex].amountRaised = rootAncestorCompanies[rootAncestorCompanyIndex].amountRaised + childCompanyAmountRaised
console.log rootParentCompanyId, rootAncestorCompanies[rootAncestorCompanyIndex].amountRaised
console.log rootAncestorCompanies
angular.forEach rootAncestorCompanies, (rootAncestorCompany, rootAncestorCompanyIndex) ->
rootAncestorCompanies[rootAncestorCompanyIndex].amountRaisedFormatted = $filter('currency') rootAncestorCompany.amountRaised / 100, '$', 0
TeamraiserCompanyService.getCompanies 'list_sort_column=total&list_ascending=false&list_page_size=500',
Expand All @@ -76,7 +73,9 @@ angular.module 'ahaLuminateControllers'
rootAncestorCompanies[rootAncestorCompanyIndex].teamCount = teamCount
angular.forEach rootAncestorCompanies, (rootAncestorCompany, rootAncestorCompanyIndex) ->
if rootParentCompanyId and rootAncestorCompany.companyId is rootParentCompanyId
console.log rootParentCompanyId, rootAncestorCompanies[rootAncestorCompanyIndex].participantCount, participantCount
rootAncestorCompanies[rootAncestorCompanyIndex].participantCount = rootAncestorCompanies[rootAncestorCompanyIndex].participantCount + participantCount
console.log rootAncestorCompanies[rootAncestorCompanyIndex].participantCount
rootAncestorCompanies[rootAncestorCompanyIndex].teamCount = rootAncestorCompanies[rootAncestorCompanyIndex].teamCount + teamCount
setTopCompanies rootAncestorCompanies
$scope.sortCompanyList 'companyName'
Expand Down