Skip to content

Commit

Permalink
fix: inverted pledge & contribution values
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanoshadjipetrou committed Jul 8, 2024
1 parent 701409d commit 4c8d71c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/controllers/pledgescontributions.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,20 @@ export class PledgescontributionsController {
const groupedByDonorSubType = _.groupBy(value, 'donorSubType');
const obj = {
name: key,
value: _.sumBy(value, 'actualAmount'),
value1: _.sumBy(value, 'plannedAmount'),
value: _.sumBy(value, 'plannedAmount'),
value1: _.sumBy(value, 'actualAmount'),
items: _.map(
groupedByDonorSubType,
(donorSubTypeValue, donorSubTypeKey) => {
const groupedByDonor = _.groupBy(donorSubTypeValue, 'donor');
return {
name: donorSubTypeKey,
value: _.sumBy(donorSubTypeValue, 'actualAmount'),
value1: _.sumBy(donorSubTypeValue, 'plannedAmount'),
value: _.sumBy(donorSubTypeValue, 'plannedAmount'),
value1: _.sumBy(donorSubTypeValue, 'actualAmount'),
items: _.map(groupedByDonor, (donorValue, donorKey) => ({
name: donorKey,
value: _.sumBy(donorValue, 'actualAmount'),
value1: _.sumBy(donorValue, 'plannedAmount'),
value: _.sumBy(donorValue, 'plannedAmount'),
value1: _.sumBy(donorValue, 'actualAmount'),
})),
};
},
Expand Down Expand Up @@ -505,20 +505,20 @@ export class PledgescontributionsController {
const groupedByDonorSubType = _.groupBy(value, 'donorSubType');
const obj = {
name: key,
pledge: _.sumBy(value, 'actualAmount'),
contribution: _.sumBy(value, 'plannedAmount'),
pledge: _.sumBy(value, 'plannedAmount'),
contribution: _.sumBy(value, 'actualAmount'),
_children: _.map(
groupedByDonorSubType,
(donorSubTypeValue, donorSubTypeKey) => {
const groupedByDonor = _.groupBy(donorSubTypeValue, 'donor');
return {
name: donorSubTypeKey,
pledge: _.sumBy(donorSubTypeValue, 'actualAmount'),
contribution: _.sumBy(donorSubTypeValue, 'plannedAmount'),
pledge: _.sumBy(donorSubTypeValue, 'plannedAmount'),
contribution: _.sumBy(donorSubTypeValue, 'actualAmount'),
_children: _.map(groupedByDonor, (donorValue, donorKey) => ({
name: donorKey,
pledge: _.sumBy(donorValue, 'actualAmount'),
contribution: _.sumBy(donorValue, 'plannedAmount'),
pledge: _.sumBy(donorValue, 'plannedAmount'),
contribution: _.sumBy(donorValue, 'actualAmount'),
})),
};
},
Expand Down

0 comments on commit 4c8d71c

Please sign in to comment.