'How can I get the monthly balance and overall balance using the daily balance from the child of a data in Firebase?

I have a Firebase Realtime Database that stores the public transport vehicle driver's total balance, monthly balance, and daily balance as shown below:

enter image description here enter image description here

As you can see, I got the computations wrong. But I want to know how can I be able to add the daily balance of the driver for each day, add it to the monthly balance, then to the total balance of the driver because I'm really at lost right now on what to do.

Thank you in advance for your help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source