Lähetä ensimmäiset laskut nollasummallakin

This commit is contained in:
Saku Laesvuori 2024-10-31 14:26:43 +02:00
parent 2198931d97
commit 992d0b42b7
Signed by: slaesvuo
GPG Key ID: 257D284A2A1D3A32
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ sendEmail sendmail email = do
renderInvoice :: Bool -> Invoice -> Maybe (Text, Text) renderInvoice :: Bool -> Invoice -> Maybe (Text, Text)
renderInvoice isReminder invoice@Invoice {rows, reference, account, recipient, due, subject, message, paid} 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,) $ | 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 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")) <> (if T.null message then mempty else (message <> "\n\n\n"))