We're going to build an Office For Rent Application. Our Customer
- They will sign with us at least one year contract
- They have to pay 1 month rent deposit when they sign the contract
- Their bill will be sent at the end of the current quarter ( 3, 6, 9, 12 )
- They have to pay the rental fee in the 1st week of the new quarter ( 1, 4, 7, 10 )
The total fee will be calculated for each month. Here is our fee calculation formula
- Full month : if they rent the entire month, they must pay 100% fee
- Partial month : if the month start from 1st and ended 30th and their contract ended in 21st of this month they only have to pay for 21 days
Inputs:
- Start Date Contract
- End Date Contract
- Monthly Fee
Output:
- Calculate the total fee of this contract
- Report for monthly fee for the whole contract
ID | Month | StartDate | EndDate | Days | Fee |
---|---|---|---|---|---|
1 | 01/22 | 15/01/2022 | 31/01/2022 | 16 | 16 * X |
2 | 02/22 | 01/02/2022 | 28/02/2022 | 28 | 100% |
3 | 03/22 | 01/01/2022 | 31/01/2022 | 31 | 100% |
... | |||||
13 | 01/23 | 15/01/2023 | 31/01/2023 | 16 | 16 * X |