Formula - payment term and due date

:robot: Kuma (Baserow’s AI assistant): often the fastest way to get help. Try asking Kuma before posting here. Available to all SaaS users, and to self-hosted users with a connected AI model.

on

Are you using our SaaS platform (Baserow.io) or self-hosting Baserow?

SaaS

What do you need help with?

Hello,
I would like to find out the due date for my invoice, based on the payment term. When I need to add a certain number of days to the due date, that’s not a problem. How can I work out the correct due date when the payment term is XX days to the end of the month? I can’t seem to find the right formula to display the last day of the month after adding 30 days to the due date.

Thank you for your support.

Hey @Alahrikk, I could only come up with something like this:

Using this formula:
if(field('Payment Term') = '30 days', field('Invoice Date') + date_interval('30 days'), if(field('Payment Term') = '14 days', field('Invoice Date') + date_interval('14 days'), field('Invoice Date')))

Is it what you’re looking for?

Thank you for your feedback.

That’s not exactly what I need. Some of the payment terms I use define the payment date as the last day of the month. This is calculated by adding 30 days to the invoice send date and setting the last day of the month. So, I am wondering whether Baserow could help by showing the correct payment date using this method.

We don’t have end_of_month() or last_day() functions, so it’s not straightforward. Let me check with the team if we plan to add these functions :slightly_smiling_face: