Forum Moderators: coopster & phranque

Message Too Old, No Replies

script for managing balances?

         

victoryrun

1:58 pm on Jun 26, 2003 (gmt 0)

10+ Year Member



Hi everyone....

I've posted on this forum before and you all were great. My newest question I have is that I'm working for a non-profit org. that gives out small grants ($5000) to 2 or 3 different schools for the year for each school to help get their classrooms more accessible for students with disabilities. What the org. wants is a "form" online for each school to log into (so there would have to be several "accts" and an overall "admin" acct), and a very simple form for them to fill out... say "I went to the store today and bought a special desk for students in wheelchairs to be able to access better." And then they put in the ammt. they spent (lets say $200) and click "submit" or "add transaction" and it shows up w/ the new balance of $4800. So my question is what kind of script or string would I use to have this happen? I'm a COMPLETE idiot when it comes to scripting, so please forgive my ignorance. Thank you very much,

Ramsey

jatar_k

7:20 am on Jun 27, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Shouldn't be too tough victoryrun.

What you need is a database to store the information. You have actually written out the basic structure for your db in your post.

they need to login to their account
1. users table
depending on user permissions or multiple logins to a single account you may need an accounts table and a users table

they give out grants
2. acct balance
maybe a table or maybe a column in the accounts table

Enter purchases and amounts
3. transactions table

The project, so far, revolves around these three things(maybe 2 depending on account balance). Figure out what information will need to be tracked for each of these by the user. Then you may need to add values for the system to use.

As far as what language to use perl or php will do just fine. Make a form, write to the tables, show their updated info. No problem.

dmorison

7:43 am on Jun 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should make sure that integrity rests entirely in the transactions table - you should never rely on a "balance" field as being true within a financial accounting system.

i.e., when an account is opened, create a "credit" transaction with the loaned amount. As purchases are made, record "debit" transactions.

Then, at any time in the future, the account balance can be re-calculated from the transactions table alone.

jatar_k

3:56 pm on Jun 27, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The only thing balance is useful for is so that you don't have calculate it every time.

The accounting trail for a monetary system is more important than I can explain. The transactions table is the core of the system and everything needs to be 100% trackable.

I have had to learn quite a bit of accounting to build some of my systems.