I have a task I need assistance with.
I am adding compounding to my script I have wrote the code that should work however having a couple of problems where to put the code in the file.
Right now the cron works fine no need to do any altering to the code unless to make this code work
I added a function/feature that will allow the admin to turn compounding on and off when the investment is created the user determines the compound rate that rate is whats added BACK to the active investment and the rest to their account balance.
Now here are the issues
1. on my query's i have it default by saying id =1 or user_id=2 ect i need that working with the code so it will do it for everyone
2. next it does add the compount percent of the return interest to the invested amount however instead of return the balance to the account balance its giving the whole return
example
say you invest $12.50 at 2.50% a day 10 days that would be a return of $0.32 now if the compounding feature was off then of course the $0.32 would be added to their acct balance but when its on it checks the compound rate which is say 65% of that $0.32 which is $0.21 so $0.21 should be added back to the 12.50 making that $12.71 and the leftover which would be $0.10 added to their account balance
thats how it SHOULD WORK
the way it is working now is
it added to investmed amount, but returns all $0.32 back to account balance
I hope you can understand
This is a simple project as I plan to add it to other simular scripts but i need this one working first before i can use it as a guide to make others do this.
I have included the file and code that i wrote is commented out at the bottom
Thanks