add apply-interest script

This commit is contained in:
Robert Dyer
2024-06-19 11:28:33 -05:00
parent 1e25a806d9
commit 7a15e6d6b6
3 changed files with 225 additions and 0 deletions
+38
View File
@@ -2,6 +2,12 @@
This is a collection of useful scripts to help you manage your Actual Budget.
- [Requirements](#requirements)
- [Configuration](#configuration)
- [Installation](#installation)
- Scripts:
- [Loan Interest Calculator](#loan-interest-calculator)
## Requirements
- [Actual Budget](https://actualbudget.org/)
@@ -24,8 +30,40 @@ ACTUAL_FILE_PASSWORD="<file password>"
# optional, if you want to use a different cache directory
ACTUAL_CACHE_DIR="./cache"
# optional, name of the payee for added interest transactions
IMPORTER_INTEREST_PAYEE_NAME="Loan Interest"
```
## Installation
Run `npm install` to install any required dependencies.
## Scripts
### Loan Interest Calculator
This script calculates the interest for a loan account and adds the interest
transactions to Actual Budget.
For each account that you want to automaitcally calculate interest for, you
need to edit the account notes and add the following tags:
- `interestRate:0.0X` sets the interest rate to X percent (note: be sure to
enter the rate as a decimal and not a percentage)
- `interestDay:XX` sets the day of the month that the interest is calculated
As an example, if your loan is at 4.5% interest and you want to insert an
interest transaction on the 28th of the month, set the account note to
`interestRate:0.045 interestDay:28`.
You can optionally change the payee used for the interest transactions by
setting `IMPORTER_INTEREST_PAYEE_NAME` in the `.env` file.
To run:
```console
$ node apply-interest.js
```
It is recommended to run this script once per month.