| * Procedure "renewing a book" changes circulation status as customer
wants to renew a book depending on if that book copy is on hold or not.
If the book copy is on hold, circulation status is changed to on loan
(borrowed by the holder and not allowing others to borrow)
otherwise it will stay the same as on loan(renewed by the same
customer).
|
Procedure RENEWING_A_BOOK
{
/* to disable printing out report when book hasn't been renewed */
set renew_flag as false;
while(CANCEL button not pressed)
{
if(OK button pressed)
{
read in Call_Number from the text-box;
checks for syntax error on Call_Number;
if(syntax error on Call_Number occurred)
{
display error message(syntax error occurred);
set renew_flag as false; /* to disable printing out report */
}
else /* no syntax error */
{
if(Call_Number doesn't exist in database)
display error message(call number doesn't exist);
else if(Circulation_Status is On_Hold)
{
display error message(The book cannot be renewed - there exists a holder);
open new pop-up window displaying a holder's information;
if(PRINT button pressed)
print out the holder's information;
else /* CLOSE button */
close current window;
update Circulation_Status as On_Loan in database;
update Loans.User_ID as a holder and Loans.Loan_Date as today for book copy with Call_Number in database;
}
else if(Circulation_Status is On_Loan or overdue)
{
if(customer is Restricted)
{
display message(cannot be renewed - fines exceeds
the maximum amount allowed);
update Circulation_Status as Available in database;
}
else
{
update Loan_Date as today in database;
display message(the book successfully renewed);
set renewed_flag as true; /* to enable printing out report */
}
}
else /* Circulation_Status is Available or Out_of_Circulation */
display error message(The book is not on loan);
}
}
else if(PRINT_REPORT button pressed)
{
if(renewed_flag is true)
print out customer, book copy, library information;
else
display error message(book hasn't been renewed - enter new call number);
}
else if(CLEAR button pressed)
clear the contents in the entry field;
else /* HLEP button */
{
open new pop-up window displaying help;
if(CLOSE button pressed) close help window;
}
}
}
Copyright ©1997
VoidWorks Software Inc.
Send mail to the Group Leader
or the Webmaster
Pages created and maintained with Mortar