1 (edited by dhekabai 2024-01-08 05:17:59)

Topic: Need help with how to structure my app.

Hello all. I'm developing a simple rent management system. I have 4 tenants, each of who have started their tenure on a specific month of a specific year. Their current monthly rent is different for each tenant, and increments by 5% every year on the month they have started.

I have these tables:

tenants:
-name
-current monthly rent amt
-contact details
-current balance (SQL calculated field that is (sum(dues)-sum(received payments))


Dues:
-month
-tenantID
-amount


Payments
-tanantID
-date
-monthID
-amount
-paymentMode


Months
-monthName. (Jan-22, Feb22, Mar23, etc, I have manually addeda bunch of entries from Jan-2021 to Dec-2030)



Now, for example tenant A has rent 2000, and started on Jan 21.
Tenant B has rent 2300 and started on May 21.
I want a way to add a button that, when clicked, will auto add the current rent amount to the dues table with their ID. If a year has passed, the currentRent should be incremented by 5% and then saved in the tenants table, then added to the dues table.


So at the end of the month if I click the button, a new entry will be added for each of the tenants in the dues table, and their balance will get updated in the calculated field, which will get updated when each of them make a payment and I add payments entries for each of them. How do I achieve this?

I can post my project so far if needed.

Thank you for your help smile

Re: Need help with how to structure my app.

dhekabai wrote:

Thank you for your help smile

publish your project
опубликуйте Ваш проект