Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End sql table info needed Reply To: sql table info needed

#175353
Rohithzr
Participant

First I’ll probably change the db otherwise it will be an headache
Second I currently on mobile so will upload schema as soon as I get home

Now your idea is good, but won’t it require me to charge all the customers with an amount at beginning of the month
Cause that would mean 10,000 entries every month and then another 10,000 if they all pay?

PayId amount. Pack Status. DueDate. Clearingdate. TransTime cId
[IMG]http://i.imgur.com/SOMJmKv.png[/IMG]

What I am doing currently : let the user do payments whole month by taking the current package from customers table, secondly.
With every payment i store the package amount in a column (to know what package was active when)
So if a customer with 500 as package who pays 200 it looks something like this

123 | 200 | 500 | 0 | 2014-01-01 | NULL | 2014-01-01 00:00:00 | 177
124 | 300 | 0 | 5 | 2014-01-01 | NULL | 2014-01-01 00:00:00 | 177

when he clears the pending payment id 124 i update
124 | 300 | 0 | **9** | 2014-01-01 | 2014-02-01 00:00:00 | 2014-01-01 00:00:00 | 177

I calculate payments with date columns
And If he doesn’t do any payments

Only then at the end of the month I do an automatic entry

127 | 0 | 500 | 5 | 2014-01-01 | NULL | 2014-01-01 00:00:00 | 177

Hence reducing the the number of queries to 10,000 + partial balance entries

So ur thoughts …. And ur idea is goood
Working on it

Edit I don’t know what the hell happend to formatting I’ll correct it in a few mint …. Nearly home
Edit: I am home :)