Marco,
While you are working on the manage function, can you consider my comments. For Live Sims that are not fully invested ( and over time that have varying levels of cash), it doesn't work well at all. As Yuval suggested you have to manually add/ reduce cash.