From 43f34ccff108975daa6351116195ad37bfbd893e Mon Sep 17 00:00:00 2001 From: Steve Astels Date: Tue, 10 Mar 2020 11:02:31 -0400 Subject: [PATCH] add moneyLost.methodOther field to analyst report --- f2/src/utils/formatAnalystEmail.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/f2/src/utils/formatAnalystEmail.js b/f2/src/utils/formatAnalystEmail.js index 0a0686c4d..fa0d6da7d 100644 --- a/f2/src/utils/formatAnalystEmail.js +++ b/f2/src/utils/formatAnalystEmail.js @@ -163,9 +163,16 @@ const formatSuspectDetails = data => { } const formatFinancialTransactions = data => { - const paymentString = data.moneyLost.methodPayment + const methods = + data.moneyLost.methodOther && data.moneyLost.methodOther.length > 0 + ? data.moneyLost.methodPayment.concat([data.moneyLost.methodOther]) + : data.moneyLost.methodPayment + + const paymentString = methods + .filter(method => method !== 'methodPayment.other') .map(method => method.replace('methodPayment.', '')) .join(', ') + const transactionDate = formatDate( data.moneyLost.transactionDay, data.moneyLost.transactionMonth, @@ -177,6 +184,7 @@ const formatFinancialTransactions = data => { formatLine('Method of payment: ', paymentString) + formatLine('Transaction date: ', transactionDate) + delete data.moneyLost.methodOther delete data.moneyLost.methodPayment delete data.moneyLost.demandedMoney delete data.moneyLost.moneyTaken