Finance Manager Website - Techist - Tech Forum

Go Back   Techist - Tech Forum > Techist Forum Information > Projects and Tutorials
Click Here to Login
Reply
 
Thread Tools Display Modes
 
Old 04-14-2017, 10:21 AM   #1 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,625
Send a message via MSN to S0ULphIRE
Default Finance Manager Website

What are you doing!
As of last year I decided to start keeping a record of my finances and setting a monthly budget. Google Sheets was great at first, but as things got more complicated with interest/stocks/etc, I decided to move to using some actual accounting software.

GnuCash, is free, the learning curve isn't too steep, and it's ugly as hell I also hate the fact that I can't view or update my details from anywhere like I could with Google Sheets.

The goal of this project will be to setup a locally hosted webpage capable of pulling and pushing data to my PostgreSQL GnuCash Database, and to display that data in a much more eye pleasing way than this:



Like seriously, ew.

Getting Started
You will need to install:
  • Apache Httpd (Web server)
  • PHP (To connect our webpage to our database)
  • PostgreSQL (To store our GnuCash data)
  • Bootstrap (Because who wants to write everything from scratch )

For the top 3 items in the list, EnterpriseDB has conveniently packaged it all together, Download Here

There's plenty of guides out there on how to setup the above programs, so I'll leave that out of this tutorial. The only thing I'll add is that you probably want to set your apache server to run as a service:
Code:
/path/to/httpd.exe -k install
If you used the EnterpriseDB installer to install Apache, your Apache directory will be "C:\Program Files (x86)\PostgreSQL\EnterpriseDB-ApachePHP\apache", so go there for any initial config setup you need to do (e.g. selecting your web directory)

Next download the GnuCash Website and put the contents in the root of your web directory (whatever you set that to in httpd.conf)
If you have Git, you can clone it with: https://github.com/S0ULphIRE/GnuCash.git

Modify line 35 of index.php to reflect your Postgres login details and the name of your gnucash database, then you should be good to go! Browse to http ://localhost (or whatever the server is set to in httpd.conf again) and you should see your pretty data

I'll be modifying the github repo over the next few weeks to slowly tweak it better, and hopefully I haven't forgotten anything in the setup that was required.
__________________

__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline   Reply With Quote
Old 04-15-2017, 11:09 PM   #2 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,625
Send a message via MSN to S0ULphIRE
Default Re: Finance Manager Website

Update on what it looks like at the moment. Still a few formatting errors to fix up but getting closer!


Still to do:
  • Add budgeting page
  • Enable transactions to be added/edited/removed
__________________

__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline   Reply With Quote
Old 04-15-2017, 11:36 PM   #3 (permalink)
Private Joker
 
carnageX's Avatar
 
Join Date: Feb 2007
Location: South Dakota
Posts: 24,478
Default Re: Finance Manager Website

Looking good!

Your transactions table header isn't lined up correctly with the data .
__________________
Laptop: MSI GT70 2OC-059us | i7-4700MQ | 16GB | GTX 770m | 500GB SSD / 750GB HDD | 17.3" | Win10 Pro
Desktop: 4690k | 12GB g.Skill RipJaws | GTX 970 | 520hx | Z87X-UD4H | Corsair Vengeance C70 | Corsair H110 | Acer 25" | Acer 22" | Win10
Mobile: Samsung Galaxy Note 5


If I help you, or you just like what I said, rep me by clicking the under my post
carnageX is offline   Reply With Quote
Old 04-15-2017, 11:36 PM   #4 (permalink)
Private Joker
 
carnageX's Avatar
 
Join Date: Feb 2007
Location: South Dakota
Posts: 24,478
Default Re: Finance Manager Website

Looking good!

Your transactions table header isn't lined up correctly with the data .
__________________
Laptop: MSI GT70 2OC-059us | i7-4700MQ | 16GB | GTX 770m | 500GB SSD / 750GB HDD | 17.3" | Win10 Pro
Desktop: 4690k | 12GB g.Skill RipJaws | GTX 970 | 520hx | Z87X-UD4H | Corsair Vengeance C70 | Corsair H110 | Acer 25" | Acer 22" | Win10
Mobile: Samsung Galaxy Note 5


If I help you, or you just like what I said, rep me by clicking the under my post
carnageX is offline   Reply With Quote
Old 04-16-2017, 12:32 AM   #5 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,625
Send a message via MSN to S0ULphIRE
Default Re: Finance Manager Website

Yeah I know lol, it's the friggin scroll bar -_-
I didn't want the whole table showing, so I did this in the css (stole someone else's code ):
Code:
table {
    width: 436px; /* 140px * 5 column + 16px scrollbar width */
    border-spacing: 0;
}

tbody, thead tr { display: block; }

tbody {
    height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

tbody td, thead th {
    width: 140px;
}
thead th:last-child {
    width: 156px; /* 140px + 16px scrollbar width */
}
I'll change it to a class instead of applying to all tables when I can be bothered, but IDK why it just refuses to line up. I have a feeling it's because I've formatted my table wrong here too with the td class definitions:
Code:
<table class="table table-bordered table-hover table-striped">
<?php
	echo("<thead>");
	echo("<tr>
	<th class='col-xs-3'>Date</th><th class='col-xs-7'>Description</th><th class='col-xs-2'>Amount</th></tr>");
	echo("</thead>");
	echo("<tbody>");
	echo("<tr>");
	echo("<td class='col-xs-3'>$date</td>");
	echo("<td class='col-xs-7'>$row[2]</td>");
	echo("<td class='col-xs-2'>$$value</td>");
	echo("</tr>\n");
	echo("</tbody>");
?>
</table>
edit: urgh so I removed the td classes from my php table, now it lines up but it's still not quite right -_- murdering this XD
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline   Reply With Quote
Old 04-16-2017, 02:55 AM   #6 (permalink)
Private Joker
 
carnageX's Avatar
 
Join Date: Feb 2007
Location: South Dakota
Posts: 24,478
Default Re: Finance Manager Website

Honestly I'd just use a pre-built table library. Something like JTable, or if you wanted to do AngularJS... Angular's UI-Grid. Then you can just spit JSON to it, and configure options on it. Much easier than manually configuring tables and such.

I use UI-Grid at work all the time, and have used JTable a couple of times at work as well.
__________________
Laptop: MSI GT70 2OC-059us | i7-4700MQ | 16GB | GTX 770m | 500GB SSD / 750GB HDD | 17.3" | Win10 Pro
Desktop: 4690k | 12GB g.Skill RipJaws | GTX 970 | 520hx | Z87X-UD4H | Corsair Vengeance C70 | Corsair H110 | Acer 25" | Acer 22" | Win10
Mobile: Samsung Galaxy Note 5


If I help you, or you just like what I said, rep me by clicking the under my post
carnageX is offline   Reply With Quote
Old 04-18-2017, 04:13 AM   #7 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,625
Send a message via MSN to S0ULphIRE
Default Re: Finance Manager Website

God damnit. I googled JTable at home yesterday, first results were about Java stuff so I was like psshhhh nope not using that!

Got to work today, my coworker informed me I'm an idiot, and I now have the right JTable link going to refactor and get my SQL data in appropriate format to be passed to that next. Thanks for the suggestion lol
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline   Reply With Quote
Old 04-18-2017, 11:31 AM   #8 (permalink)
Private Joker
 
carnageX's Avatar
 
Join Date: Feb 2007
Location: South Dakota
Posts: 24,478
Default Re: Finance Manager Website

Quote:
Originally Posted by S0ULphIRE View Post
God damnit. I googled JTable at home yesterday, first results were about Java stuff so I was like psshhhh nope not using that!

Got to work today, my coworker informed me I'm an idiot, and I now have the right JTable link going to refactor and get my SQL data in appropriate format to be passed to that next. Thanks for the suggestion lol
Hahaha, yeah I saw JTable results also listed Java stuff....but I assumed you would be able to figure out that I meant JavaScript .
__________________
Laptop: MSI GT70 2OC-059us | i7-4700MQ | 16GB | GTX 770m | 500GB SSD / 750GB HDD | 17.3" | Win10 Pro
Desktop: 4690k | 12GB g.Skill RipJaws | GTX 970 | 520hx | Z87X-UD4H | Corsair Vengeance C70 | Corsair H110 | Acer 25" | Acer 22" | Win10
Mobile: Samsung Galaxy Note 5


If I help you, or you just like what I said, rep me by clicking the under my post
carnageX is offline   Reply With Quote
Old 04-21-2017, 11:29 PM   #9 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,625
Send a message via MSN to S0ULphIRE
Default Re: Finance Manager Website

I've spent the morning redoing the code so it's not all in one giant file all PHP calls are now properly abstracted...I think...

After adding JTable though, I've run into an issue with it messing with my Morris bar chart

If I comment out the highlighted line below, my Morris chart works like it should but the JTable table completely disappears.


If I leave the line uncommented, my Morris chart doesn't float the column labels like it should.

Morris correct, table missing: https://i.imgur.com/1NEggoP.png
Table shows, Morris screwed: https://i.imgur.com/69ppM06.png

So their custom ui bit is messing things up -_- but without it the table never shows up. Le sighhhh

EDIT: Well, don't I feel stupid lol, downloaded a NORMAL FRIGGIN COPY of jquery ui, and everything works ****ing doh
Next step, fixing the table data
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline   Reply With Quote
Old 04-29-2017, 09:28 AM   #10 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,625
Send a message via MSN to S0ULphIRE
Default Re: Finance Manager Website

I got a friend at work to give me some tips on the SQL side of things, now I've done a whole bunch of changes to the SQL calls and everything's starting to make more sense

Also integrated the Budget part of GnuCash, so you can now easily see whether a particular expense account is under/over budget. As you can see, I've spent way more on gifts this month than planned, also a little over budget on transport + takeaway but everything else is ok
Over:


Under:
__________________

__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finance SiZcO Off Topic Discussion 12 04-14-2008 11:16 PM
UK people - Computer parts on Finance @ scan. Adzh New Systems | Building and Buying 2 01-13-2007 11:27 PM
Bsc. Finance- Full time in Switzerland. paulsimpson Technology Careers and Education 0 04-12-2005 01:23 AM



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 10:50 AM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.