Skip to content

For personal use to track personal finances using a local database

License

Notifications You must be signed in to change notification settings

MauraSlavin/financeslaravel

Repository files navigation

To start:

  • php artisan serve (in VS Code)
  • go to url: localhost:8000 or localhost:8000/accounts

Working on - Branch 2025-05-01-monthly-bills

Un-committed changes...

  • Search "left off here"
    I think each row has to be a form ... ask Phind
    May be in: https://www.phind.com/search/cmarnium80000357i4khyop9k
  • Save changes to a monthly transaction (need save buttons) to update monthlies table
  • Fix "Eversource" entry in "monthlies" table
  • -- HAVE button
  • -- getting ..
    Missing required parameters for [Route: saveMonthly] [URI: transactions/saveMonthly/{id}/{name}/{account}/{dateOfMonth}/{toFrom}/{amount}/{category}/{bucket}/{notes}/{comments}] [Missing parameters: amount, bucket, comments].
    ** See laravel log

Need to...

  • add new/delete monthly transactions (need add and delete buttons) to update monthlies table
  • Completed date might be different for each transaction in the group. Save an array of transDates, not just the first.

    DONE
  • Reminder to DO THE TRANS!
  • Update monthlies when changed so refreshed page reflects status & date changes
  • Writes monthly to transactions table.
  • Is stmtDate getting set correctly for cc payments??
  • Highlights amount if it's 0
  • Highlights & changes bucket if
    -- account is DiscSavings and bucket is blank (changes to 'Misc')
    -- account is NOT DiscSavings and bucket has a value (changes to '')
  • Writes the transactions checked in the view when "Record" clicked to the transactions table - fields like MikeAmt, MauraAmt are filled in
  • "Pending" transactions don't have a checkbox
  • when transaction clicked, if it's been completed, updates the status to Chosen and the date to the following month
    when unchecked, back to "Completed" and most recent completed date
    changes dates for all transactions in the group (same transaction name) when checkbox clicked
  • Created table "monthlies"
  • Put some transactions in "monthlies" table
  • Created button "Monthly Transactions" on landing page.
  • Created view "monthlies"
  • Clicking "Monthly Transactions" displays the view
  • Filled in transaction date and status
  • Ordered by status & date
  • Add anyCategory and doTrans to monthlies table
  • Color rows
  • Color "Pending" and "Completed" differently
  • Add check boxes
  • fields are all input fields
  • Have submit button which calls writeMonthlyTransactions
  • Enable editting of the rows in the monthlies view - to save to monthlies table

NOTES:

  • NOTE: Catch up on GB Limo paystubs
  • NOTE: Make sure IncomeTaxes and IncomeOtherWH are done correctly
    -- IncomeTaxes is taxes withheld, paid, refunded
    -- IncomeOtherWH is SS and Medicare withholdings

NEXT: Monthly bills, other monthly transactions
-- store in a table (monthly?)
-- interface to update
-- needs day of month (for trans_date), toFrom, category, notes. That might be it.

BUGS

  • On BUCKETS page, Goal Totals missing RetSavings amt
  • Error msg: The GET method is not supported for route transactions/insertTrans. Supported methods: POST.
    GET /transactions/insertTrans

To do:

  • Copy a transaction (new one in edit mode)
  • splitting Spending transaction may still not be working correctly
  • Repeat Income totals in Bud vs. Acts page at bottom
  • highlight outstanding transactions (no clear date)
  • duplicate a transaction and put in edit mode (when transactions repeat)
  • group "add transaction" page for recurring monthly transactions (multiple accounts)
  • fix saving new aliases
  • Manually add some common aliases. (DiscCC, Checking, done; VISA partly done)
  • button to go to Accounts from any page
  • button to switch Mike/Maura on Spending page
  • button to write M/M spending to a CSV, Google sheets, etc. so I can send Mike a copy
  • Button to add or delete notes
  • Update account totals at top on page for specific account when transaction added/deleted (Cleared balance; Register balance)

  • Maybe include unsaved changes as well as saved changes? Unsaved in grey??
  • budgetactuals page:
       Ability to update budget for current year
       Click on a Budget or Actual box to see the transactions included
       Do I want to group these by category w/subtotals??
  • No category or amtMike (for Maura's) / amtMaura (for Mike's) when adding transactions to Mike/Maura Spending accounts.
  • adjust split_total when amount or total_key or total_amt changes. Search: // handle splitTotal if amount is changed
  • Set up column matches for all accounts (DiscCC and Checking done) - is this worth it? Maybe Disc svgs?? I don't usually do a bulk upload for other accounts.
  • Get saving aliases to work. Include extraDefaults.
  • Automate:
    trips
  • Don't allow "Category" for spending accounts (Mike, MauraSCU, MauraDisc). Remove from page for those accounts.
  • In transactions.blade, a lot of the checking (see // transDate, // clearDate, etc) are similar. Should they be combined into one reusable method?
  • Different users so Mike can have copy of the application?
  • Ability to change year in Spending view?
  • Write transactions in Spending view to a file or Google sheet?

Future Functionality:

  • Append Spending transactions to Google Sheets
    -- https://www.phind.com/search?cache=f8twduhlg5g1fo4ca2bkrs7c
  • Use tables (datatables?) that can sort & filter transactions
  • Handle trips accounting
    - automate each part of the cost calculations
  • **Assets
  • --- Include ability to set end date
  • Loans?
  • App for Marina's Miles??

GIT notes:

  • git branch            // create a new branch
  • git checkout        // work in new branch
  • when ready to push changes...
  • git add *              // includes all changes
  • git commit -m     // ready to push
  • git push (again with -- suggested)
  • log into github & create a merge request, and merge the code
  • Back in VS Code...
  • git pull (in branch - do I need this?)
  • git checkout main
  • git pull
  • should now have all changes in the main branch, and ready to start again with a new branch

Categories (in transactions)

Each transaction, except those for Mike and Maura spending account (Mike, MauraSCU, MauraDisc) need a category.

DiscRet (Discover Retirement) should not have categories, except virtually moving money from Inherited IRA to LTC.
This may seem backwards, but I want it to show as GOING to LTC as an expense.

One exception for $16,000 to WF on 3/26/25.

NOTE: See below for more notes on retirement income.

These are used to track actual spending against the budget.

The categories, and what they include are: (by type of category)

    INCOME
  • IncomeInterest: Interest earned from financial institution, or Edward Jones income.
  • IncomeMisc: Earned or gift income not from pay going toward household expenses:
    • M/M for trips
    • inheritance
    • side jobs
    • gifts
    • solar credits
    • Discover Rewards
    • selling stuff
    • Door Dash (because it's for spending, not household)
    • Great Bay (because it's for spending, not household)
    • RMD from Inherited IRA
    • Selling of savings bonds
    • travel reimbursement
    • found
    • $ virtually transferred from DiscRet to LTC
  • IncomePaycheck: Regular paycheck from employment going to household expenses.
  • IncomeRental: Income from renting rooms in our house.
  • IncomeRetirement: Retirement (SS income is RetContribIn & RetContribOut since saving for future retirement).
  • LoanPaid: Money paid back from a loan.
  • RetContribIn: Money coming in that goes right back out to an IRA, 401k, 403b, or Disc Retirement acct.
    EXPENSE
  • BigExpenses: Money set aside for known, irregular big expenses:
    • New Car
    • Home Improvement
    • Home Repairs
    • Big medical bills
    • Wedding
    • (not an all-inclusive list)
  • Bolt: All costs to run the Bolt:
    • Charging
    • Maintenance (Parts & Labor)
    • Insurance
    • Registration
    • Parking
    • Tolls

    NOTE: Purchase price in category BigExpenses

  • Charity: All donations (may or may not be tax deductible, but we don't itemize, so it doesn't matter).
  • College: Tuition and related school costs.
  • CRZ: All costs to run the CRZ:
    • Gasoline
    • Maintenance (Parts & Labor)
    • Insurance
    • Registration
    • Parking
    • Tolls

    NOTE: Purchase price in category BigExpenses

  • Dentist: Dental insurance and bills. (Dani in KIDS)
  • Doctor: Doctor & hospital insurance, equipment, bills. (Dani in KIDS)
  • ExtraSpending: From Door Dash and Great Bay Limo income that increases spending
  • Eyecare: Insurance & actual expenses.
  • Gift: Gifts (other than to kids) that are from both of us,:
    • birthdays
    • weddings
    • Mass Intentions
    • other

    NOTE: For kids are in KIDS category; from just one of us comes from our own SPENDING category.

  • Groceries: Supermarket food for Mike or Maura & guests. Food for Dani comes from KIDS category. May or may not include holiday meals.
  • Holiday: Extra stuff bought for a holiday from both of us.
    Examples:
    • Easter candy
    • Valentine's Day cards
    • Christmas cards, stamps

    NOTE: From just one of us comes from our own SPENDING category.

  • Home: Examples...
    • Stuff for yard (mulch, fertilizer, grass seed)
    • Misc stuff that's not food: toilet paper, detergent, etc.
    • Pool chemicals and supplies
  • HomeInsurance: Insurance premiums
  • IncomeOtherWH: Medicare and SS withholdings
  • IncomeTaxes: Income tax withheld, paid, returned
  • Kids: Stuff for kids...
    • Food for Dani
    • Birthday, anniversary gifts; cards
    • Help with costs (that aren't loans)
    • Their tickets, etc., when with Mike & Maura
    • Ins premiums, medical bills

    NOTE:If fun stuff with just one of us (movie, restaurant) then it comes from our own SPENDING category.

  • LifeInsurance: Maura's Riversource premium
  • Loan: Money we loaned to people
  • LTC: Money set aside for Long Term Care
  • MarinasMiles: Costs we incurred for Marina's Miles
  • MauraSpending: Maura's spending money
  • MikeSpending: Mike's spending money
  • MiscExpense: Costs not categorized elsewhere. i.e.
    • lost
    • Tickets
    • Trips not for fun
    • Sales tax
    • Funerals/burials
    • Bank fees
  • Prescriptions: Premiums and costs. Can include OTC.
  • PropertyTax: Property tax.
  • RentalExpense: Stuff bought for rental rooms we wouldn't have done otherwise.
  • RetContribOut: To IRA, 401K, or 403B
  • Utilities:
    • Gas
    • Electricity
    • Phone (same for each - extra from SPENDING)
    • Internet
    • Water/Sewer
  • Vacation: Fun trips, Mike & Maura (just one comes from SPENDING)
  • WorkExpense
    NEITHER Income NOR Expense
  • BucketMove: Move from one Big Bills bucket to another. Should be in pairs that cancel each other out.
  • SecurityDeposit: To be moved to a separate account. Should be in pairs that cancel each other out.
  • Transfer: Just moving our own money around. Should be in pairs that cancel each other out.
  • Value: Balance of investment accounts, house, cash value of LI.

Retirement Income

  • NHRetirement: Used for household expenses

    All in category IncomeRetirement

  • MTS IBM Retirement: Save for future retirement, if not needed for household expenses.

    Some being withheld ($278.85 in 2025) for Income taxes.
    Rest can be saved for future retirement, or used for houshold expenses.

  • SSMike: Save for future retirement, if not needed for household expenses.

    Mike's Medicare Part B (& D if there is a premium) come from this,
    but still transfer gross amount to future retirement savings.

NOTE: See more detailed notes in Workbench "Retirement txns" tab.

uploadMatch Documentation

uploadMatch determines how each field in the transactions table gets filled from the csv download.

account_id

See account_id under "tofromaliases documentation" below.

csvField

The field in the downloaded csv field from the financial institution.

transField

The corresponding field in the local transactions table.

NOTE: trans_date and clear_date look like "trans date" and "clear date" in the database. The "_" is there, but not displaying in MySQL Workbench.

formulas

How the csv data needs to be manipulated to assign the transactions fields correctly. This is what is allowed:

  • +, -, *, /, numbers
  • For example, "-.5*Amount" reverses the sign and multiplies the csvField ("Amount" in this case - see the uploadMatch table) by 0.5, and assigns the result to transField ("amtMike" or "amtMaura" in this case - see the uploadMatch table) in that transaction record.

  • if x / then y / else z; in the form (x) ? (y) : z
  • For example, "(Check Number) ? ('Ck #' . Check Number) : '' " puts "Ck #123" in the method field if the Check Number is 123, and a null string if there is no check number

  • concatenates fields using "+"
  • For example: "Description + Memo" is used to combine these two fields in the csv file into the toFrom column of the transactions table for the Checking account. A space is inserted between them, and the resulting string is trimmed. Only 2 fields can be concatenated.

tofromaliases documentation

account_id

account_ids are the ids of the accounts in the accounts table. As of 1/8/25:

  1. Cash
  2. ChargePoint
  3. Checking
  4. DiscCC
  5. DiscRet
  6. DiscSavings
  7. ElectrifyAmerica
  8. * EJ
  9. Eversource
  10. FSA
  11. * House
  12. IrregBig (Disc)
  13. * JH
  14. LTC (Disc)
  15. MauraDisc
  16. MauraSCU
  17. Mike
  18. * Prudential
  19. * TIAA
  20. VISA
  21. * WF-Inv
  22. * WF-IRA

* investment accounts (as opposed to transactional accounts). A transactional account is something like a checking, savings, or cc; an investment account would be a CD or a retirement acct.

origToFrom

...is the beginning of the verbiage in the downloaded csv file from the financial institution. Only as much as needed for a match is in the table.

transToFrom (with IGNORE)

...is the desired toFrom verbiage in the local transactions table.

If this is set to "IGNORE", the origToFrom is spliced from the string for the account indicated by the account_id. This lets us ignore things like "External deposit" in the Checking csv download, and "sq*" in the Disc cc csv download to make matching that csv description easier to match to the local transactions toFrom field.

category

...is the default category for the toFrom text.

extraDefaults

...allow for default notes, tracking, and split categories. A few different formats are allowed:

  • "notes":"text" or "tracking":"text"
  • Sets the notes or the tracking to the text given. Can use both. For example: {"notes":"charging","tracking":"Bolt"}

  • {"splits":["MauraSpending","MikeSpending","Kids"]}
  • Creates duplicate transactions with different categories in addition to the default category. The total_amt is divided equally among all the splits, and the total_key is the id of the original transaction. There's a limit of 10 transactions in the tofromaliases table (more can be created manually in the interface, if needed).

  • {"splits":["Bolt"],"notes":"tolls","tracking":["CRZ","Bolt"]}
  • Multiple default tracking (& notes, I think) can be given for each split. In this case, two records are created: the original from the csv download, and a duplicate with a category of "Bolt". The original transaction gets tracking "CRZ", and the duplicate gets tracking "Bolt". Both get notes "tolls". Each gets 1/2 the total amount.

Variables Documentation - budgetactuals

budgetData

Array where key is category (includes income and expense) with the monthly budget and yearly total budget for each. For example:
Bolt:   {
      "january":"-165.00",
      "february":"-165.00",
      "march":"-165.00",
      "april":"-165.00",
      "may":"-165.00",
      "june":"-165.00",
      "july":"-165.00",
      "august":"-165.00",
      "september":"-165.00",
      "october":"-165.00",
      "november":"-165.00",
      "december":"-165.00",
      "total":"-1,980.00"
   }

actualIncomeData and actualExpenseData:

One element for each income or expense category, with the total amount for each month and a total actual income or expense for the year. For Example:
   IncomeInterest:
    {
     "january":"264.93",
     "february":"263.90",
     "march":"279.04",
     "april":"268.24",
     "may":"250.13",
     "june":"237.77",
     "july":"242.99",
     "august":"320.59",
     "september":"362.30",
     "october":"261.22",
     "november":"250.41",
     "december":"260.81",
     "total":"3,262.33"
    }

actualIncomeTotals, actualExpenseTotals, actualGrandTotals:

(incomeTotals, expenseTotals, grandTotals in actuals blade)

Income, Expense or Grand (I + E) Total for each month, and for the year. For example:
  {
   "january":"23,604.49",
   "february":"10,898.23",
   "march":"12,006.59",
   "april":"11,499.51",
   "may":"9,326.36",
   "june":"9,173.47",
   "july":"10,659.22",
   "august":"17,809.69",
   "september":"11,008.01",
   "october":"11,625.71",
   "november":"12,020.77",
   "december":"16,192.86",
   "total":"155,824.91"
  }

Database notes:

  • transactions: has each transaction
  • bucketgoals: goals for each bucket in Discover Savings account.
  • budget: has one record for each year/category combination w/budget for each month in that year. Total is automatically calculated (defined in table)

  • New tables

  • accounts: accountName, description & lastStmtDate (null for end of month) for each defined account
  • categories: is this used??
  • notes: where notes on budget vs. actual are stored
  • tofromaliases: convert what's in bank download to my verbiage for toFrom field
  • tolls: copied (after massaging) from download from EZPass website
  • trips: calculated cost broken down to use car for Spending trips
  • uploadmatch: maps csv to transaction fields for each account
  • carcostdetails: table for info needed to calc cost of car
    - insurance (payment, begin/end dates, expected mileage)
    - purchase price (purchase price, expected mileage)
    - solar cost
    • carcostdetails (table name)
    • 1 - car
    • 2 - key
    • 3 - value
    • KEYS
    • Purchase - purchase price of the car
    • BeginMiles - mileage on car when we bought it
    • ExpMiles - expected total miles before car dies (or traded in)
    • InsPayyymm - Insurance payment (yymm is the year and month of payment)
    • InsPayyymmBegin - date insurance coverage begins
    • InsPayyymmEnd - date insurance coverage end
    • InsPayyymmMiles - expected mileage during this insurance term
    • Solar - home cost per KwH in cents
    • Mileageyymm - mileage of the car
    • OldMaint - maintenance costs not in transactions file (before 2022)

routes: (needs updating)

  • Default Laravel welcome page
    - http://localhost:8000
  • List of accounts and balances (including a line for all accounts at the bottom)
    - http://localhost:8000/accounts
  • gets the last month of transactions for that account; .../all gets last transactions for all accounts
    - http://localhost:8000/accounts/{accountName}
  • gets transactions for that account for dates passed in; .../all gets transactions for all accounts
    - http://localhost:8000/accounts/{accountName}/{beginDate}/{endDate}
  • Upload transactions from public/uploadFiles/{accountName}.csv file for that account
    - http://localhost:8000/accounts/{accountName}/upload
  • Delete a transaction by id
    - http://localhost:8000/transactions/delete/{id}
  • Insert a record to tofromaliases
    - http://localhost:8000/transactions/insertAlias/{origToFrom}/{newValue}

Error codes:

  • 411 - No first header record in csv file being uploaded.
  • 412 - in http://localhost:8000/accounts/{accountName}/upload, account isn't a defined account.

Cloning

  • git clone {copied url from github}
  • composer install
  • copy in .env
  • php artisan key:generate

Need to have installed:

  • git
  • composer
  • artisan

Laravel Logo

Build Status Total Downloads Latest Stable Version License

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

You may also try the Laravel Bootcamp, where you will be guided through building a modern Laravel application from scratch.

If you don't feel like reading, Laracasts can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Partners program.

Premium Partners

-Vehikl -Tighten Co. -WebReinvent -Kirschbaum Development Group -64 Robots -Curotec -Cyber-Duck -DevSquad -Jump24 -Redberry -Active Logic -byte5 -OP.GG

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

About

For personal use to track personal finances using a local database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages