htmfilho / minimily

Use Minimily to organize your minimalist life.
https://www.hildeberto.com/minimily/
GNU General Public License v3.0
8 stars 0 forks source link

Create standing instructions for payments and receivables #24

Open htmfilho opened 5 years ago

htmfilho commented 5 years ago

Standing instructions are rules to automatically generate transactions according to recurring payments and receivables. This ways, most of the work of recording transactions is actually automatically done by the application, reducing the effort of the user.

Depends on #23

Frequency

Calculate the Next Payment Date

Given:

we can calculate the next payment date. When the previous payment date is not informed then the next payment day is the same as the start date. The next payment date is between the start date or the previous payment date and the stop date. If the calculated next payment date falls in the weekend or in a holiday then it is recalculated to the next working day.

The following table shows how the frequency is used in the calculation of the next payment date.

Frequency Block Day Example
Annually 1 to 12 (month) 1 to 31 (day) 04 / 15 (Every year on April 15th)
Semi-Annually 1 to 6 (month) 1 to 31 (day) 3 / 20 (March 20th and September 20th)
Three-Annually 1 to 4 (month) 1 to 31 (day) 2 / 12 (February 12th, June 12th, and October 12th)
Quarterly 1 to 3 (month) 1 to 31 (day) 1 / 31 (January 31th, April 30th, July 31th, and October 31th)
Bi-Monthly 1 to 2 (month) 1 to 31 (day) 2 / 30 (February 28th, April 30th, June 30th, August 30th, October 30th, and December 30th)
Monthly 1 (month) 1 to 31 (day) 1 / 5 (January 5th, and so on)
Semi-Monthly 1 to 15 (day) 16 to 31 (day) 1 / 16 (January 1st, January 16th, February 1st, February 16th, etc)
Bi-Weekly 1 to 2 (week) 1 to 7 (day of the week) 2 / 3 (January 1st, January 15th, January 29th, etc)
Weekly 1 (week) 1 to 7 (day of the week) 1 / 5 (Every Thursday)

We already mentioned the case when the next payment date falls in a weekend or in a holiday. An extra special case is when the day of the month is not valid for some of the months, like February 30th or June 31th.

keniasousa commented 5 years ago

We have to see the case when the standing instructions have different values for each transaction. For instance, the payment of the cellphone is ‘monthly ‘ but the value may change each month.

We need the option to show the scheduled transaction to the user and let them change the value for this transaction.

This just happened this month because of the trip to the USA, the cellphone value changed.

htmfilho commented 5 years ago

To simplify things, we could define a default amount and let the user change it when necessary.