Below are test cases used when testing the [[https://bugs.launchpad.net/evergreen/+bug/1198465|Conditional Negative Balances branch]] and identify some combinations of settings that should be tested when changes are made to billing. ==== 1. No Prohibit Negative Balance Settings Are Enabled, Payment Made ==== **Note:** tested with negative balance settings unset and with //Prohibit Negative Balances (default)// setting set to False. * Check out item. * Mark as lost. Price of item (29.99) added to the record as lost materials fee * Pay the entire 29.99 fee. * Check the item in. **Expected Behavior:** Produces negative balance in the amount of 29.99 ==== 2. Negative Balance Settings Are Unset, No Payment Made ==== * Check out item. * Mark as lost. Price of item (29.99) added to the record as lost materials fee * Check in item **Expected Behavior:** $0 balance on transaction. No history of the transaction visible to the user through the GUI. ==== 3. Basic No Negative Balance Test ==== **Relevant settings:** //Prohibit Negative Balances (default)// set to True. * Check out item * Mark as lost. Price of item (12.99) added to the record as lost materials fee * Apply $12.99 payment to the transaction. * Check the item back in. **Expected Behavior:** $0 balance on the transaction. ==== 4. Prohibit Negative Balances with Partial Payment ==== **Relevant settings:** //Prohibit Negative Balances (default)// set to True. * Check out item * Mark as lost. Price of item (3.99) added to record as lost materials fee * Pay 1.99, leaving 2.00 owed on the transaction. * Check the item back in. **Expected behavior:** $0 balance on the transaction ==== 5. No negative balance setting set to True – no payment made ==== * Check out item * Mark as lost – item price (24.95) added to record as lost materials fee * Check the item back in. **Expected behavior:** $0 balance on the transaction ==== 6. Restores Overdue Fines Appropriately, No Previous "Voids", Patron Will Not Owe On Lost Item Return==== **Relevant Settings:** //Void overdue fines when item is marked lost// is set to True; //Restore overdues on lost item return// is set to True; //Generate new overdues on lost item return// is set to True; //Prohibit negative balance (default)// is set to True Due date for transaction is one month ago. Overdue fines have accrued (in my example, $1.35), but have not yet reached the maxfine rate for the transaction (in my example, $3.00). * Mark lost item as lost. Item price (20.00) added to record as lost materials fee. Overdue fines (1.35) show as adjusted payments. * Pay $10.00 towards lost fee. $10 in lost fees remaining. * Return the day after it is marked lost **Expected Behavior:** Zero balance on the transaction. $11.40 is adjusted on the item return ($10.00 in remaining lost materials fee + $1.35 in reinstated overdues + $.05 in new overdue fine generated upon lost item return) ====7. Restores Overdue Fines Appropriately, No Previous "Voids", Patron Will Still Owe On Lost Item Return==== **Relevant Settings:** //Void overdue fines when item is marked lost// is set to True; //Restore overdues on lost item return// is set to True; //Generate new overdues on lost item return// is set to True; //Prohibit negative balance (default)// is set to True Due date for item is a year ago. Overdue fines have accrued ($3 in my example, reaching the max fine limit) * Mark item lost. Item price ($23) is added to the record in lost materials fee. $3.00 in overdue fines are "adjusted". * Pay $1 towards lost fee. Patron still owes $22 * Check the item in. **Expected behavior:** $2 balance on transaction for the remaining overdue fines. $23 has been adjusted upon the lost item return ====8. Restore Overdue Fines Appropriately, Previous Voids, Negative Balance Allowed==== **Relevant Settings:** //Void overdue fines when item is marked lost// set to True; //Restore overdues on lost item return// set to True; //Generate new overdues on lost item return// Set to True; //Prohibit negative balance (default)// is unset Overdue fines had accrued on transaction ($1.75 in my example) when it was marked lost, but had not yet reached the max fine rate for the transaction ($3.00 in my example). * Items are marked lost before the negative balance code is loaded (or perhaps when the //Prohibit negative balance// settings are unset). The item price ($20) is added to the record as a lost materials fee. The accrued overdue fines are "voided". * A partial payment ($10) is made to the lost materials fee. * Enough time goes by for the transaction to exceed the max fine rate for the transaction. * Check the item in. **Expected behavior:** The negative balance on the transaction will equal the partial payment minus the max fine rate, for a total of -$7.00 in my example. ====9. Restore Overdue Fines Appropriately, Previous Voids, Negative Balance Allowed==== **Relevant settings** - //Void overdue fines when item is marked lost// is set to True; //Restore overdues on lost item return// is set to True; //Generate new overdues on lost item return// is set to True; Prohibit negative balance (default) – True Overdue fines had accrued on transaction ($2.45 in my example) when it was marked lost, but had not yet reached the max fine rate for the transaction ($3.00 in my example). * Items are marked lost before the negative balance code is loaded (or perhaps when the //Prohibit negative balance// settings are unset). The item price ($22) is added to the record as a lost materials fee. The accrued overdue fines are "voided". * The //Prohibit negative balance (default)// setting is subsequently enabled. * A $10 partial payment is made to the lost materials fee leaving a balance of $12 on the transaction * Enough time goes by for the transaction to exceed the max fine rate for the transaction. * Check the item in. **Expected behavior:** The balance on the transaction is zero.The adjusted payment on the transaction should equal the remaining lost materials fee ($12) plus the max fine rate ($3). In my example, a total of $15 is adjusted. ====10. Interval Testing==== **Relevant Settings:** //Negative balance interval// set to 1 hour; //Prohibit negative balance (default)// set to True * Two items are checked out and marked lost. * Pay the entire lost materials fees more than an hour later. * Return one item immediately after paying the fee. * Return the second item more than an hour after paying the lost fee. **Expected behavior:** A negative balance in the amount of the lost materials fee should be remaining on the first item returned. A zero balance should be remaining on the second items returned. ====11. Manually voiding lost book fee does not result in negative balances==== **Relevant Settings**: Prohibit negative balance set to true; No interval settings * Check out item. * Mark it lost. Item price ($25.25) added to the record as lost materials fee. * Make a partial payment in the amount of $10. Balance owed is $15.25 * Void the rest of the payment from the client. **Expected/Desired behavior:** No negative balance should be produced. **Current behavior:** Negative balance is produced. ====12. Test negative balance settings on fines==== **Relevant settings:** //Prohibit negative balances (default)// set to True * Use transaction that has accrued fines ($4.00 in my example) * Apply $2.00 payment to the fine. Remaining balance is 2.00 * Check in using Amnesty Mode **Expected behavior** zero balance on the transaction. ====13. Prohibit negative balances on lost materials bills ONLY==== **Relevant settings** //Prohibit negative balances on bills for lost materials// set to True; all other negative balance settings unset. Repeat test 1 and test 12. **Expected behavior:** * Test 1 should result in a zero balance on the transaction. * Test 12 should result in a negative balance that equals the amount of the partial payment that was made. ====14. Prohibit negative balances on overdue bills ONLY==== Relevant settings – //Prohibit negative balances on bills for overdue materials// set to True; All other negative balance settings unset. Repeat test 1 and test 12. **Expected behavior:** * Test 1 should return a negative balance in the amount of the lost materials fee that was paid. * Test 12 should result in a zero balance on the transaction.