The problem I have been asked to overcome is the following:
A person can loan a book for any 12 months in a 36-month period, the loan does not have to be a continuous loan, and it can consist of various smaller loans e.g. 4 loans of 3 months.
I need to be able to calculate how long each person has had each book over this period.
As each day passes 1 is added to the length of the current loan.
If the person had the book at this point 36months ago 1 must be added to the current loan and 1 taken off the previous loan total of the book.
If the person did not have the book at this point 36months ago then 1 must be added to the current loan and 0 taken off the loan total.
If the person is 1 month off the 12 month limit I need to set a warning flag of some kind so we can send out a reminder.
A person can loan a book for any 12 months in a 36-month period, the loan does not have to be a continuous loan, and it can consist of various smaller loans e.g. 4 loans of 3 months.
I need to be able to calculate how long each person has had each book over this period.
As each day passes 1 is added to the length of the current loan.
If the person had the book at this point 36months ago 1 must be added to the current loan and 1 taken off the previous loan total of the book.
If the person did not have the book at this point 36months ago then 1 must be added to the current loan and 0 taken off the loan total.
If the person is 1 month off the 12 month limit I need to set a warning flag of some kind so we can send out a reminder.