From 40978210da17b7c437df924e2999114439b0f287 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 13 Jan 2024 08:55:39 +0000 Subject: include tip in total calculation --- routes/users.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routes/users.js b/routes/users.js index a0a0dcf9..2d9c4a1b 100644 --- a/routes/users.js +++ b/routes/users.js @@ -71,7 +71,8 @@ export default { let p = await g(`payment:${pid}`); if (!p) continue; total += p.amount; - if (p.amount < 0) total -= (p.fee || 0) + (p.ourfee || 0); + if (p.amount < 0) total -= (p.fee || 0) + (p.ourfee || 0) + (p.tip || 0); + else total += (p.tip || 0) } user.expected = total; -- cgit v1.2.3