Created
September 18, 2015 17:24
-
-
Save kaw2k/6ffa562899a751b0edec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.then((details) => { | |
const newDetails = _.merge(details, { | |
creditLines: _.map(credit => { | |
if (!credit.creditTransaction) { return credit; } | |
const taxCredit = parseFloat(credit.creditTransaction.taxAmount, 10); | |
const tax = parseFloat(credit.originalTransaction.taxAmount, 10); | |
const lineTotal = parseFloat(credit.creditTransaction.lineTotal, 10); | |
return _.merge(credit, { | |
lineTotal: lineTotal - tax - taxCredit | |
}); | |
}, details.creditLines) | |
}); | |
this.dispatch(ActionTypes.billing.CREDIT_DETAIL, [ | |
originalTransactionId, | |
newDetails | |
]); | |
return newDetails; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment