diff --git a/lib/graphql/types.ts b/lib/graphql/types.ts index a960c540..62a774fc 100644 --- a/lib/graphql/types.ts +++ b/lib/graphql/types.ts @@ -182,6 +182,9 @@ export type ApplicationsReportColumn = | 'PAYMENT_METHOD' | 'FEE_AMOUNT' | 'DONATION_AMOUNT' + | 'SECOND_PAYMENT_METHOD' + | 'SECOND_FEE_AMOUNT' + | 'SECOND_DONATION_AMOUNT' | 'TOTAL_AMOUNT'; export type ApplicationsResult = { diff --git a/lib/reports/resolvers.ts b/lib/reports/resolvers.ts index aa094600..4ec3c0fb 100644 --- a/lib/reports/resolvers.ts +++ b/lib/reports/resolvers.ts @@ -275,8 +275,10 @@ export const generateApplicationsReport: Resolver< dateOfBirth: dateOfBirth && formatDateYYYYMMDD(dateOfBirth), applicationDate: createdAt ? formatDateYYYYMMDDLocal(createdAt, true) : null, applicantName: formatFullName(firstName, middleName, lastName), - processingFee: `$${Prisma.Decimal.add(processingFee, secondProcessingFee || 0)}`, - donationAmount: `$${Prisma.Decimal.add(donationAmount, secondDonationAmount || 0)}`, + processingFee: `$${processingFee}`, + donationAmount: `$${donationAmount}`, + secondProcessingFee: `$${secondProcessingFee || 0}`, + secondDonationAmount: `$${secondDonationAmount || 0}`, totalAmount: `$${Prisma.Decimal.add( Prisma.Decimal.add(processingFee, donationAmount), Prisma.Decimal.add(secondProcessingFee || 0, secondDonationAmount || 0) diff --git a/lib/reports/schema.ts b/lib/reports/schema.ts index 43d9ebca..6c7c1fc5 100644 --- a/lib/reports/schema.ts +++ b/lib/reports/schema.ts @@ -29,6 +29,9 @@ export default gql` PAYMENT_METHOD FEE_AMOUNT DONATION_AMOUNT + SECOND_PAYMENT_METHOD + SECOND_FEE_AMOUNT + SECOND_DONATION_AMOUNT TOTAL_AMOUNT } diff --git a/tools/admin/reports.ts b/tools/admin/reports.ts index fa2e685c..ae59044e 100644 --- a/tools/admin/reports.ts +++ b/tools/admin/reports.ts @@ -54,6 +54,21 @@ export const APPLICATIONS_COLUMNS: Array<{ value: 'DONATION_AMOUNT', reportColumnId: 'donationAmount', }, + { + name: 'Second Payment Method', + value: 'SECOND_PAYMENT_METHOD', + reportColumnId: 'secondPaymentMethod', + }, + { + name: 'Second Fee Amount', + value: 'SECOND_FEE_AMOUNT', + reportColumnId: 'secondProcessingFee', + }, + { + name: 'Second Donation Amount', + value: 'SECOND_DONATION_AMOUNT', + reportColumnId: 'secondDonationAmount', + }, { name: 'Total Amount', value: 'TOTAL_AMOUNT',