I have three tables:
1.
tblRate - (in accordance with the law, penalty rates are applied at certain intervals)
- rate_ID
- Start_Date (as date)
- End_Date (as date)
- penalty_rate (%)
2.
tblCompany - (companies that have debts)
- Company_ID
- Company_Name
- Debt_Start (as date)
- Debt (money)
3.
tblPayments - (payments made by companies that reduce their debt, as much as they want, when they want)
- PaymentID
- Payment_Date (as date)
- Company (combobox)
- Amount (money)
Penalties are applied to the total debt, starting with Start_Date. They are applied according to the rate established by law for the compensatory interval (tblRate).
The debt is reduced according to each payment, but penalties are also applied to the final debt.
Example, for company Alpha (companyID = 2)
1.
tblRate - (in accordance with the law, penalty rates are applied at certain intervals)
- rate_ID
- Start_Date (as date)
- End_Date (as date)
- penalty_rate (%)
2.
tblCompany - (companies that have debts)
- Company_ID
- Company_Name
- Debt_Start (as date)
- Debt (money)
3.
tblPayments - (payments made by companies that reduce their debt, as much as they want, when they want)
- PaymentID
- Payment_Date (as date)
- Company (combobox)
- Amount (money)
Penalties are applied to the total debt, starting with Start_Date. They are applied according to the rate established by law for the compensatory interval (tblRate).
The debt is reduced according to each payment, but penalties are also applied to the final debt.
Example, for company Alpha (companyID = 2)