From 992d0b42b7de0e65ca20f09f329646adae54ed58 Mon Sep 17 00:00:00 2001 From: Saku Laesvuori Date: Thu, 31 Oct 2024 14:26:43 +0200 Subject: [PATCH] =?UTF-8?q?L=C3=A4het=C3=A4=20ensimm=C3=A4iset=20laskut=20?= =?UTF-8?q?nollasummallakin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Laskutin/Email.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Laskutin/Email.hs b/src/Laskutin/Email.hs index 9d9fcaf..413f469 100644 --- a/src/Laskutin/Email.hs +++ b/src/Laskutin/Email.hs @@ -41,7 +41,7 @@ sendEmail sendmail email = do renderInvoice :: Bool -> Invoice -> Maybe (Text, Text) renderInvoice isReminder invoice@Invoice {rows, reference, account, recipient, due, subject, message, paid} - | invoiceSum invoice <= 0 = Nothing + | invoiceSum invoice <= 0 && isReminder = Nothing | otherwise = Just $ (subjectPrefix <> " – " <> subject,) $ (if isReminder then "Muistutus alla olevan laskun maksamisesta. Jos olet juuri maksanut kyseisen laskun, tämä muistutus on aiheeton.\n\n" else mempty) <> (if T.null message then mempty else (message <> "\n\n\n"))