From 8a80321fe3fa06e3b26d5a40335374398d17d9ac Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Wed, 14 Aug 2019 12:27:02 +0200 Subject: [PATCH] skip adding null fees if there is no discount --- services/integration/invoiceIntegration.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/integration/invoiceIntegration.js b/services/integration/invoiceIntegration.js index 0519ef5..21f81d1 100644 --- a/services/integration/invoiceIntegration.js +++ b/services/integration/invoiceIntegration.js @@ -358,7 +358,10 @@ const getMembersFeesForDateRange = (dateRange, memberIds) => { //add discount memberIds.forEach((memberId) => { - allFees.push(createNegativeFeeForDiscount(membersMap[memberId], dateRange)); + const discountFee = createNegativeFeeForDiscount(membersMap[memberId], dateRange); + if (discountFee){ + allFees.push(discountFee); + } }); allFees.forEach((fee) => {