From f0e144cfe7b4a7a49e9533ffaa6c61000a19bd32 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 23 Feb 2024 21:32:37 -0800 Subject: tips total --- routes/payments.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/routes/payments.js b/routes/payments.js index 9891c661..9338b3a2 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -99,6 +99,11 @@ export default { (a, b) => ({ ...a, [b.currency]: { + tips: (a[b.currency] ? a[b.currency].tips : 0) + (b.tip || 0), + fiatTips: ( + parseFloat(a[b.currency] ? a[b.currency].fiatTips : 0) + + ((b.tip || 0) * b.rate) / SATS + ).toFixed(2), sats: (a[b.currency] ? a[b.currency].sats : 0) + (b.amount || 0) + -- cgit v1.2.3