PROJECT

Payment Schedule

Project Overview

Reoccurring payments can be a pain to keep track of and require a decent amount of oversight. I decided to develop a way to see what my next payment events were without needing to update it manually.

In this project, I will create a Notion dashboard with a little custom code.

Database

First, create a new database. The columns you’ll need are:

Name (the default name column)

Tags – Type: Select (used to cosmetically define what type of thing it it)

Payment Type – Type: Select (Monthly or Yearly)

Cost – Type: Number (your local currency)

Day – Type: Number

Month – Type: Number

Year – Type: Formula

Next Payment – Type: Formula (format as Number)

Today – Type: Formula

Adding Entries

Add some reccurring payment events, such as receiving your paycheck or paying rent, for example. Enter a few or all of your financial events in the database before we put in some custom formulas. Adding more entrees first will show you if the formula works rather than adding one or two things and jumping into the formula.

Example:

Name: Amazon Prime

Tags: Home

Payment Type: Monthly

Cost (£): 8.99

Day: 1 (the day of renewal / payment)

Month: 4 (The current month if monthly, the actual month number if yearly)

Year: automatically created

Next Payment: automatically created

Today

This is the easiest custom formula; it is simply:

now()


This will make all rows in this column today’s date.

Year

This column is the first formula. The outcome should be the year of the next payment. If the payment schedule is ‘Yearly’, you want that to be calculated properly; if your Payment Type is ‘Monthly’, you want the right year shown every December.

Breakdown

 

Monthly payments:

If the payment ‘Day’ is greater than or equal to today’s ‘Day’, make ‘Year’ this year.

If the current ‘Month’ is not 12 (not December) and the payment ‘Day’ is before today’s ‘Day’, make Year this year.

If the current ‘Month’ is 12 (December) and the payment day is before today’s day, make Year next year.

 

Yearly payments:

If today’s month is equal to or earlier than the payment month, set ‘Year’ as this year.

If today’s month is greater than the payment month, make ‘Year’ next year.

Next Payment

This final step calculates the next payment schedule date. 

Breakdown example for final statement

If the ‘Payment Type’ is Monthly and the payment ‘Day’ is before today and the ‘Month’ is not 12 (not December), parse a string as a date from the following:

(year)-(Month + 1 padded if needed)-(Day padded if needed)


Notion Functions

prop() is used to reference a Notion property. parseDate() is used to convert a specific string to a date value of YYYY-MM-DD.

month() extracts the month from a date

date() converts a date string to a date

Calendar

Finally, add a calendar view to your database.


Under the Layout section, change the property ‘Show calendar by’ to the formula column ‘Next Payment’. There you go!


From here you can go to properties to show or hide what information you like from the calendar.

I think the best view is to show: Name, Payment Type, Tags and Cost.


Payments aren’t the only thing you can add on here; you can add reminders and general events and it will work just fine.