Description
Robin Sheat
2011-05-30 04:52:52 UTC
*** Bug 10057 has been marked as a duplicate of this bug. *** Created attachment 21922 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22704 [details] [review] Update Schema Files Created attachment 22705 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22708 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22709 [details] [review] Update Schema Files Created attachment 22710 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22741 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22870 [details] [review] Update Schema Files Created attachment 22871 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22872 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22873 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22874 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22875 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22876 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22881 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22889 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22940 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22948 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22949 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 22995 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 23000 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Hi Kyle, I would like to start a development using DBIx and I am taking a look at this development. I think we should have some guided guidelines on about how to organize our classes. Looking at your code, I have some questions to ask: 1/ Don't you think we should avoid calls to Koha::Database in pl files ? 2/ Don't you think new module in the Koha namespace should be OOP (for ex. using Class::Accessor)? Outside the DBIx scope, I am wondering why do you have 2 scripts account_payment.pl and members/account_payment_do.pl. I suppose it is in order to remove the $op variable. I think it would be better to head towards a REST architecture. For example, here, we could imagine executing the AddCredit routine on a POST method and using the "show/list" view on a GET method. For discussion. I add Galen, Chris and Paul in the loop. But maybe the discussion should be on the koha-devel mailing-list. Created attachment 23137 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 23158 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 23161 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 23171 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Created attachment 23186 [details] [review] Bug 6427 - Rewrite of the accounts system - WIP Sorry I missed this comment until now! > 1/ Don't you think we should avoid calls to Koha::Database in pl files ? Using DBIx::Class is, afaik, allowed in pl files. Requiring it to be called from modules only just requires yet another layer of abstraction. The only time this is necessary is when business logic needs to be applied. That is, we should definitely keep code DRY by moving repeated chunks of code into a module subroutine, but for a single line call that is not affected by system preferences, this is both unnecessary and unwanted. It would merely slow the system down. For repeated pieces of code that utilize system preferences, I think they *should* be in modules. Better yet, they should be part of the DBIx::Class files, but we haven't gotten to that stage yet. If I am violating my own person views written above, it's simply because I am attempting to implement this new accounting system while making as few modifications to existing code as possible. I think any violations will need to be taken care of eventually. This is of course, assuming everyone else agrees with my views. In any case, those violations can and should be taken care of post-push once we have formalized our policies regarding usage of DBIC. > 2/ Don't you think new module in the Koha namespace should be OOP (for ex. > using Class::Accessor)? Modules in the Koha namespace are not required to be OOP, and I can see no advantage to making Koha::Accounts OOP. The data objects themselves are OO, and Koha::Accounts is just a layer around these objects to manage them. > > Outside the DBIx scope, I am wondering why do you have 2 scripts > account_payment.pl and members/account_payment_do.pl. I suppose it is in > order to remove the $op variable. I think it would be better to head towards > a REST architecture. For example, here, we could imagine executing the > AddCredit routine on a POST method and using the "show/list" view on a GET That is certainly an interesting proposition. What advantages do you see to this? I'd take it much further and say we should make *all* fetching, creating, and updating of data be via REST methods, and make our scripts use those methods via ajax. I think this will make Koha much more responsive, and allow far more flexible integration with other software. What do you think? One example of moving business logic into DBIC. Items should be smart enough to know that when item-level_itypes is set to biblio record, the call to $item->itype() should return $item->biblio->itemtype() instead. I imagine there is a way to override the existing itype() method, or we could just add a new method itemtype_by_preference() or similar. Created attachment 23269 [details] [review] Bug 6427 - Rewrite of the accounts system This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 23275 [details] [review] Bug 6427 - Rewrite of the accounts system This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 23276 [details] [review] Bug 6427 - Rewrite of the accounts system This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Comment on attachment 23276 [details] [review] Bug 6427 - Rewrite of the accounts system Review of attachment 23276 [details] [review]: ----------------------------------------------------------------- ::: C4/Koha.pm @@ +1029,4 @@ > > sub GetAuthorisedValues { > my ( $category, $selected, $opac ) = @_; > + warn "GetAuthorisedValues( $category, $selected, $opac )"; This needs a debug switch, or to be removed @@ +1076,4 @@ > push @results, $data; > } > $sth->finish; > + warn "RET: " . Data::Dumper::Dumper( \@results ); And this too, or the logs get loud very very fast ::: misc/release_notes/release_notes_3_10_0.txt @@ +1762,4 @@ > 8996 normal In result page items with negative notforloan are available > 9017 normal Quote of the day: Table footer not translated > 5312 minor XHTML correction in authority summary > + 8009 minor Item descriptive data not populated on account_payment.pl Shouldnt be in the patch, this looks like a search and replace gone wrong ::: misc/release_notes/release_notes_3_12_0.txt @@ +579,4 @@ > 8429 minor Unnecessary use of Exporter in SIP/ILS objects > 9292 minor Remove dead code related to 'publictype' > 9401 minor Javascript used for tags handling wants access to CGISESSID cookie > + 9582 minor Unused code in members/account_payment.pl Hmm not sure why this is in the patch? In addition to the specific points that Chris has made -- which, to be frank, do not inspire confidence that the rewrite patch has been sufficiently tested by the patch submitter -- this patch is simply too large to evaluate as is. I *strongly* encourage you to break it up into a series of patches that, in effect, tell a story that can be evaluated, or at least read, a patch at a time. A possible sequence might look like this: * test cases: this is an opportunity for the test cases to describe the new API and provide some confidence that all aspect of the existing behavior have been covered. * DB schema updates * schema upgrade -- as this will require particularly close attention * introduction of the new API in the Koha namespace * elimination of the old C4 API and staff-side script changes * public catalog-side changes Other ways of organizing it are of course possible, but the main point is to break it up into smaller units that can be read one at a time, even if the entire series has to be applied for it to work at all. It would be even better, although not necessarily possible, to structure the patch series in such a way that parts of it can be independently applied. Also, to reiterate the point in my first paragraph: the more that you take care to eliminate debug code and trivial violations of the QA guidelines, the easier it will be for patch reviewers to focus on the substance. Created attachment 23391 [details] [review] Bug 6427 - Rewrite of the accounts system This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 23392 [details] [review] Bug 6427 - Rewrite of the accounts system This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 23400 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 23401 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 23402 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 23403 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 23404 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 23405 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 23406 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 23407 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 23408 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 23409 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 23410 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 23411 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 23412 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 23413 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Good calls. I had expected koha-qa.pl to pick those warns up ( it usually does ). Spot on! Thanks for catching those! Kyle (In reply to Chris Cormack from comment #36) > Comment on attachment 23276 [details] [review] [review] > Bug 6427 - Rewrite of the accounts system > > Review of attachment 23276 [details] [review] [review]: > ----------------------------------------------------------------- > > ::: C4/Koha.pm > @@ +1029,4 @@ > > > > sub GetAuthorisedValues { > > my ( $category, $selected, $opac ) = @_; > > + warn "GetAuthorisedValues( $category, $selected, $opac )"; > > This needs a debug switch, or to be removed > > @@ +1076,4 @@ > > push @results, $data; > > } > > $sth->finish; > > + warn "RET: " . Data::Dumper::Dumper( \@results ); > > And this too, or the logs get loud very very fast > > ::: misc/release_notes/release_notes_3_10_0.txt > @@ +1762,4 @@ > > 8996 normal In result page items with negative notforloan are available > > 9017 normal Quote of the day: Table footer not translated > > 5312 minor XHTML correction in authority summary > > + 8009 minor Item descriptive data not populated on account_payment.pl > > Shouldnt be in the patch, this looks like a search and replace gone wrong > > ::: misc/release_notes/release_notes_3_12_0.txt > @@ +579,4 @@ > > 8429 minor Unnecessary use of Exporter in SIP/ILS objects > > 9292 minor Remove dead code related to 'publictype' > > 9401 minor Javascript used for tags handling wants access to CGISESSID cookie > > + 9582 minor Unused code in members/account_payment.pl > > Hmm not sure why this is in the patch? (In reply to Galen Charlton from comment #37) > In addition to the specific points that Chris has made -- which, to be > frank, do not inspire confidence that the rewrite patch has been > sufficiently tested by the patch submitter -- this patch is simply too large > to evaluate as is. I assure you that I have tested it quite a bit, but I also agree with you. I plan to continue testing to with as many add edge cases as I can imagine. So far everything has been quite solid. My largest and foremost concern at that point is to ensure that updatedatabase.pl ports all existing accounting data to the new accounting system properly. > > I *strongly* encourage you to break it up into a series of patches that, in > effect, tell a story that can be evaluated, or at least read, a patch at a > time. A possible sequence might look like this: > > Other ways of organizing it are of course possible, but the main point is to > break it up into smaller units that can be read one at a time, even if the > entire series has to be applied for it to work at all. > Done! I hope I haven't swung too far the other way with this patch series. I've tried to break it up into functional components as you can see ( schema, modules, intranet, opac, etc... ). > It would be even better, although not necessarily possible, to structure the > patch series in such a way that parts of it can be independently applied. Each of these patches should be independently apply-able. However, I'm afraid some parts will not function without the patches after it ( I'm looking at you part 11 ). Splitting this patch was quite a task, and I'm afraid I did not keep it fully chronological such that each patch only requires the preceding patches to to be functional. If you have any suggestions on re-ordering the patches I will be happy to do so! > Also, to reiterate the point in my first paragraph: the more that you take > care to eliminate debug code and trivial violations of the QA guidelines, > the easier it will be for patch reviewers to focus on the substance. I agree. This patch series currently passes koha-qa.pl, so I have a fair confidence that I have taken care of all violations at this point! Created attachment 23420 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 23421 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 23422 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 23423 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 23424 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 23425 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 23426 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 23427 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 23428 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 23429 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 23430 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 23431 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 23432 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 23433 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 23440 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 23441 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 23442 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 23443 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 23444 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 23445 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 23446 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 23447 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 23448 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 23449 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 23450 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 23451 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 23452 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 23453 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 23454 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 23458 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 23459 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 23460 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 23461 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 23462 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 23463 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 23464 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 23465 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 23466 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 23467 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 23468 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 23469 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 23470 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 23471 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 23603 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 23643 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 23644 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 23645 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 23646 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 23647 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 23648 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 23649 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 23650 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 23651 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 23652 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 23653 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 23654 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 23655 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 23656 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 23657 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Warning, this code seems to break SIP functionality. C4/ILS.pm is looking for C4/Accounts.pm, but this update removes it. Test: cd C4/SIP perl -c ILS.pm Can't locate C4/Accounts.pm in @INC (@INC contains: /home/koha/kohaclone /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ILS/Transaction/FeePayment.pm line 23. Please do not signoff until SIP functionality has been restored. - Larry Created attachment 23937 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 23938 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 23939 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 23940 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 23941 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 23942 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 23943 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 23944 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 23945 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 23946 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 23947 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 23948 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 23949 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 23950 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 23951 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts This new patch set fixes the SIP2 issue. (In reply to Larry Baerveldt from comment #115) > Warning, this code seems to break SIP functionality. C4/ILS.pm is looking > for C4/Accounts.pm, but this update removes it. > > Test: > cd C4/SIP > perl -c ILS.pm > > Can't locate C4/Accounts.pm in @INC (@INC contains: /home/koha/kohaclone > /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 > /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 > /usr/local/lib/site_perl .) at ILS/Transaction/FeePayment.pm line 23. > > Please do not signoff until SIP functionality has been restored. > > - Larry Created attachment 24612 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 24613 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 24614 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 24615 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 24616 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 24617 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 24618 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 24619 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 24620 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 24621 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 24622 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 24623 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 24624 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 24625 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 24626 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 24627 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 24628 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 24757 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 24758 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 24759 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 24760 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 24761 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 24762 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 24763 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 24764 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 24765 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 24766 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 24767 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 24768 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 24769 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 24770 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 24771 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 24772 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 24777 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 24792 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 24793 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 24794 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 24795 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 24796 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 24797 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 24798 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 24799 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 24800 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 24801 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 24802 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 24803 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 24804 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 24805 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 24806 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 24807 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 24808 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 24809 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 24810 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 24811 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 24812 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 24813 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 24814 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 24815 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 24816 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 24817 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 24818 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 24819 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 24820 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 24821 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 24822 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 24823 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 24824 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 24825 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 24826 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 24827 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 24828 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 24829 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 24830 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 24831 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 24832 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 24833 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 24834 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 24835 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 24836 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 24837 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 24838 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 24839 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 24840 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 24841 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 24842 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 24843 [details] [review] Bug 6427 [Part 18] - Add TableTools plugin for DataTables Created attachment 24844 [details] [review] Bug 6427 [Part 19] - Add full debit and credit table Print and Download features I've looked quickly at this patch, got 2 issues (or not, correct me if I'm wrong): 1/ In part 4 patch, there is reference to js file that don't exist in repository, next parts also don't contain this file. Bug-6427-Part-04.patch:93:+<script type="text/javascript" src="[% interface %]/[% theme %]/en/js/strings.js"></script> 2/ In part 3, function format_without_symbol don't handle properly, national currencies without leading symbol (eg PLN). It truncate always first character even if it's a number. return substr( $self->format( $amount, FMT_SYMBOL ), 1 ); We can't assume that format always return symbol before number. Created attachment 25777 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 25778 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 25779 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 25780 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 25781 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 25782 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 25783 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 25784 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 25785 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 25786 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 25787 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 25788 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 25789 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 25790 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 25791 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 25792 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 25793 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 25794 [details] [review] Bug 6427 [Part 18] - Add TableTools plugin for DataTables Created attachment 25795 [details] [review] Bug 6427 [Part 19] - Add full debit and credit table Print and Download features Created attachment 25796 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 25797 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 25798 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 25799 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 25800 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 25801 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 25802 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 25803 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 25804 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 25805 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 25806 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 25807 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 25808 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 25809 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 25810 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 25811 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 25812 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 25813 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 25814 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 25815 [details] [review] Bug 6427 [Part 18] - Add TableTools plugin for DataTables Created attachment 25816 [details] [review] Bug 6427 [Part 19] - Add full debit and credit table Print and Download features Thanks for letting me know! I've rolled the fixes for these 2 issues into the main patch set since they are still not signed off, rather than post a qa followup. (In reply to Rafal Kopaczka from comment #219) > I've looked quickly at this patch, got 2 issues (or not, correct me if I'm > wrong): > > 1/ In part 4 patch, there is reference to js file that don't exist in > repository, next parts also don't contain this file. > Bug-6427-Part-04.patch:93:+<script type="text/javascript" src="[% interface > %]/[% theme %]/en/js/strings.js"></script> > > 2/ In part 3, function format_without_symbol don't handle properly, national > currencies without leading symbol (eg PLN). It truncate always first > character even if it's a number. > return substr( $self->format( $amount, FMT_SYMBOL ), 1 ); > We can't assume that format always return symbol before number. Created attachment 25930 [details] [review] Bug 6427 [Part 20] - Update C4::Circulation::AddEnrolmentFeeIfNeeded Created attachment 25932 [details] [review] Bug 6427 [Part 22] - Remove unused scripts that reference previous accounts tables, references to old subroutines Created attachment 25933 [details] [review] Bug 6427 [Part 21] - Fix ILSDI::Services Created attachment 25934 [details] [review] Bug 6427 [Part 22] - Remove unused scripts that reference previous accounts tables, references to old subroutines Created attachment 26033 [details] opac screen (In reply to Kyle M Hall from comment #260) > Thanks for letting me know! I've rolled the fixes for these 2 issues into > the main patch set since they are still not signed off, rather than post a > qa followup. There are still issues with different currencies in "Amount to pay:" box. Previous is fixed, so there are new bugs :) 1/ For EUR and many other currencies, decimal separator is comma not dot. When page is loaded everything looks fine, but after any checkbox change, when amount is recalculated by javascript decimal part is cut off. Also for PLN, initial value in amount to pay box is ended with "PLN" chars. 2/ Not bug, but it would be nice to display title for manual created invoice, of course when barcode is filled. Now on Pay Fines page, only description and notes for manual fines are displayed. 3/ In OPAC: after expanding payment details there are many undefined value, I'm not sure if this should be empty or values aren't fetched properly? I'll attach some screens if something is unclear :) Nb. UTF-8 encoding from screens is IIRC, some other bug. Created attachment 26034 [details]
Pay Fines
Well, sum for decimal didn't go well...
Created attachment 26035 [details]
Currencies
Different separators, for currencies.
BTW is it possible to upload multiple attachment by 1 message?
Created attachment 26036 [details] Pay Fines (In reply to Rafal Kopaczka from comment #266) > Created attachment 26034 [details] > Pay Fines > > Well, sum for decimal didn't go well... better content type :) Created attachment 26107 [details]
typo in fines header
It says "Outsanding", not "Outstanding" on a Patron > Fines details page. See attached.
Created attachment 27167 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 27168 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 27169 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 27170 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 27171 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 27172 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 27173 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 27174 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 27175 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 27176 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 27177 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 27178 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 27179 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 27180 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 27181 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 27182 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 27183 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 27184 [details] [review] Bug 6427 [Part 18] - Add TableTools plugin for DataTables Created attachment 27185 [details] [review] Bug 6427 [Part 19] - Add full debit and credit table Print and Download features Created attachment 27186 [details] [review] Bug 6427 [Part 20] - Update C4::Circulation::AddEnrolmentFeeIfNeeded Created attachment 27187 [details] [review] Bug 6427 [Part 21] - Fix ILSDI::Services Created attachment 27189 [details] [review] Bug 6427 [Part 22] - Remove unused scripts that reference previous accounts tables, references to old subroutines Created attachment 27190 [details] [review] Bug 6427 [Part 23] - Fix typos, symantic error in GetMemberAccountBalance Created attachment 27197 [details] [review] Bug 6427 [Part 24] - Fines with accruing = 0 should not be updated, even if they are for checked out and overdue items Auto-merging Koha/DateUtils.pm CONFLICT (content): Merge conflict in Koha/DateUtils.pm Failed to merge in the changes. Note that the push of bug 6273 adds (at least) three potential payment types to deal with: Pay00 - SIP2 cash payment Pay01 - SIP2 VISA payment Pay02 - SIP2 credit card payment Of course, it wouldn't be surprising if there are SIP2 devices that define non-standard payment types as well. (In reply to Galen Charlton from comment #295) > Note that the push of bug 6273 adds (at least) three potential payment types > to deal with: > > Pay00 - SIP2 cash payment > Pay01 - SIP2 VISA payment > Pay02 - SIP2 credit card payment > > Of course, it wouldn't be surprising if there are SIP2 devices that define > non-standard payment types as well. We have two choices here, we can either hard code these payment types in ( which will rarely be used ) *or* we can add setup documentation to have the library define these as MANUAL_DEBIT authorised values! Considering your final statement, I think that would be the best way to go. Created attachment 28067 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 28068 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 28069 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 28070 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 28071 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 28072 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 28073 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 28074 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 28075 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 28076 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 28077 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 28078 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 28079 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 28080 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 28081 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 28082 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 28083 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 28084 [details] [review] Bug 6427 [Part 18] - Add TableTools plugin for DataTables Created attachment 28085 [details] [review] Bug 6427 [Part 19] - Add full debit and credit table Print and Download features Created attachment 28086 [details] [review] Bug 6427 [Part 20] - Update C4::Circulation::AddEnrolmentFeeIfNeeded Created attachment 28087 [details] [review] Bug 6427 [Part 21] - Fix ILSDI::Services Created attachment 28088 [details] [review] Bug 6427 [Part 22] - Remove unused scripts that reference previous accounts tables, references to old subroutines Created attachment 28089 [details] [review] Bug 6427 [Part 23] - Fix typos, symantic error in GetMemberAccountBalance Created attachment 28090 [details] [review] Bug 6427 [Part 24] - Fines with accruing = 0 should not be updated, even if they are for checked out and overdue items Created attachment 28091 [details] [review] Bug 6427 [Part 25] - Fix inverted logic in GetMemberAccountBalance The total being treated as the total ammount of fines is actually the total amount of charges that are *not* fines. Created attachment 28527 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 28528 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 28529 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 28530 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 28531 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 28532 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 28533 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 28534 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 28535 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 28536 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 28537 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 28538 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 28539 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 28540 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 28541 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 28542 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 28543 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 28544 [details] [review] Bug 6427 [Part 18] - Add TableTools plugin for DataTables Created attachment 28545 [details] [review] Bug 6427 [Part 19] - Add full debit and credit table Print and Download features Created attachment 28546 [details] [review] Bug 6427 [Part 20] - Update C4::Circulation::AddEnrolmentFeeIfNeeded Created attachment 28547 [details] [review] Bug 6427 [Part 21] - Fix ILSDI::Services Created attachment 28548 [details] [review] Bug 6427 [Part 22] - Remove unused scripts that reference previous accounts tables, references to old subroutines Created attachment 28549 [details] [review] Bug 6427 [Part 23] - Fix typos, symantic error in GetMemberAccountBalance Created attachment 28550 [details] [review] Bug 6427 [Part 24] - Fines with accruing = 0 should not be updated, even if they are for checked out and overdue items Created attachment 28551 [details] [review] Bug 6427 [Part 25] - Fix inverted logic in GetMemberAccountBalance The total being treated as the total ammount of fines is actually the total amount of charges that are *not* fines. Created attachment 28552 [details] [review] Bug 6427 [Part 26] - Simplify and improve account normalization and balancing Created attachment 28553 [details] [review] Bug 6427 [Part 26] - Simplify and improve account normalization and balancing Created attachment 28555 [details] [review] Bug 6427 [Part 27] - Reimplement bug 11869 - Add more informations to the member printing pages Created attachment 28556 [details] [review] Bug 6427 [Part 27] - Reimplement bug 11869 - Add more informations to the member printing pages Created attachment 28561 [details] [review] Bug 6427 [Part 28] - Add ability to void payments * Adds ability to void payments * Adds missing setting up updated_on for debits and credits * Adds the display of the offset type if there is one * Adds a column showing the amount paid on a given fine in the payments view Created attachment 28563 [details] [review] Bug 6427 [Part 28] - Add ability to void payments * Adds ability to void payments * Adds missing setting up updated_on for debits and credits * Adds the display of the offset type if there is one * Adds a column showing the amount paid on a given fine in the payments view Created attachment 28564 [details] [review] Bug 6427 [Part 28] - Add ability to void payments * Adds ability to void payments * Adds missing setting up updated_on for debits and credits * Adds the display of the offset type if there is one * Adds a column showing the amount paid on a given fine in the payments view Created attachment 28795 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 28796 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 28797 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 28798 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 28799 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 28800 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 28801 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 28802 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 28803 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 28804 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 28805 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 28806 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 28807 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 28808 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 28809 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 28810 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 28811 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 28812 [details] [review] Bug 6427 [Part 18] - Add TableTools plugin for DataTables Created attachment 28813 [details] [review] Bug 6427 [Part 19] - Add full debit and credit table Print and Download features Created attachment 28814 [details] [review] Bug 6427 [Part 20] - Update C4::Circulation::AddEnrolmentFeeIfNeeded Created attachment 28815 [details] [review] Bug 6427 [Part 21] - Fix ILSDI::Services Created attachment 28816 [details] [review] Bug 6427 [Part 22] - Remove unused scripts that reference previous accounts tables, references to old subroutines Created attachment 28817 [details] [review] Bug 6427 [Part 23] - Fix typos, symantic error in GetMemberAccountBalance Created attachment 28818 [details] [review] Bug 6427 [Part 24] - Fines with accruing = 0 should not be updated, even if they are for checked out and overdue items Created attachment 28819 [details] [review] Bug 6427 [Part 25] - Fix inverted logic in GetMemberAccountBalance The total being treated as the total ammount of fines is actually the total amount of charges that are *not* fines. Created attachment 28820 [details] [review] Bug 6427 [Part 26] - Simplify and improve account normalization and balancing Created attachment 28821 [details] [review] Bug 6427 [Part 27] - Reimplement bug 11869 - Add more informations to the member printing pages Created attachment 28822 [details] [review] Bug 6427 [Part 28] - Add ability to void payments * Adds ability to void payments * Adds missing setting up updated_on for debits and credits * Adds the display of the offset type if there is one * Adds a column showing the amount paid on a given fine in the payments view Created attachment 28887 [details] [review] Bug 6427 [Part 29] - Force the amount to pay to display as a two decimal float Created attachment 28888 [details] [review] Bug 6427 [Part 30] - Do not auto-print reciepts for manual invoices Created attachment 28889 [details] [review] Bug 6427 [Part 31] - Restore the lost item fee description Created attachment 28890 [details] [review] Bug 6427 [Part 32] - Fix koha-qa.pl issues Created attachment 28909 [details] [review] Bug 6427 [Part 33] - Remove unescaped key value pairs Titles and other values with double quotes will break the javascript. We do not need these unescaped values for any reason. Created attachment 29176 [details] [review] Bug 6427 [Part 34] - Issues view should show Yes to fines only for items with associated debits in opac Created attachment 29230 [details] [review] Bug 6427 [Part 1] - Update schema files Created attachment 29231 [details] [review] Bug 6427 [Part 2] - Add new accounts related modules Created attachment 29232 [details] [review] Bug 6427 [Part 3] - Add new TT plugin to deal with currency Created attachment 29233 [details] [review] Bug 6427 [Part 4] - Add new staff-side scripts for viewing/creating fees and payments Created attachment 29234 [details] [review] Bug 6427 [Part 5] - Implement new accounting system in the opac Created attachment 29235 [details] [review] Bug 6427 [Part 6] - Make existing scripts point to the new accounting scripts Created attachment 29236 [details] [review] Bug 6427 [Part 7] - Update cron scripts Created attachment 29237 [details] [review] Bug 6427 [Part 8] - Update existing intranet scripts Created attachment 29238 [details] [review] Bug 6427 [Part 9] - Update existing perl modules to support new accounting system Created attachment 29239 [details] [review] Bug 6427 [Part 10] - Update reports wizard Created attachment 29240 [details] [review] Bug 6427 [Part 11] - Add new utility functions Created attachment 29241 [details] [review] Bug 6427 [Part 12] - Add and update unit tests Created attachment 29242 [details] [review] Bug 6427 [Part 13] - Add database updates Created attachment 29243 [details] [review] Bug 6427 [Part 14] - Delete unused and unnecessary files This patch re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 29244 [details] [review] Bug 6427 [Part 15] - Auto-print payment and manual fee receipts Created attachment 29245 [details] [review] Bug 6427 [Part 16] - Use AuthorisedValues plugin instead of removed KohaAuthorisedValues plugin Created attachment 29246 [details] [review] Bug 6427 [Part 17] - Add cron script to recalculate account balances Created attachment 29247 [details] [review] Bug 6427 [Part 18] - Add TableTools plugin for DataTables Created attachment 29248 [details] [review] Bug 6427 [Part 19] - Add full debit and credit table Print and Download features Created attachment 29249 [details] [review] Bug 6427 [Part 20] - Update C4::Circulation::AddEnrolmentFeeIfNeeded Created attachment 29250 [details] [review] Bug 6427 [Part 21] - Fix ILSDI::Services Created attachment 29251 [details] [review] Bug 6427 [Part 22] - Remove unused scripts that reference previous accounts tables, references to old subroutines Created attachment 29252 [details] [review] Bug 6427 [Part 23] - Fix typos, symantic error in GetMemberAccountBalance Created attachment 29253 [details] [review] Bug 6427 [Part 24] - Fines with accruing = 0 should not be updated, even if they are for checked out and overdue items Created attachment 29254 [details] [review] Bug 6427 [Part 25] - Fix inverted logic in GetMemberAccountBalance The total being treated as the total ammount of fines is actually the total amount of charges that are *not* fines. Created attachment 29255 [details] [review] Bug 6427 [Part 26] - Simplify and improve account normalization and balancing Created attachment 29256 [details] [review] Bug 6427 [Part 27] - Reimplement bug 11869 - Add more informations to the member printing pages Created attachment 29257 [details] [review] Bug 6427 [Part 28] - Add ability to void payments * Adds ability to void payments * Adds missing setting up updated_on for debits and credits * Adds the display of the offset type if there is one * Adds a column showing the amount paid on a given fine in the payments view Created attachment 29258 [details] [review] Bug 6427 [Part 29] - Force the amount to pay to display as a two decimal float Created attachment 29259 [details] [review] Bug 6427 [Part 30] - Do not auto-print reciepts for manual invoices Created attachment 29260 [details] [review] Bug 6427 [Part 31] - Restore the lost item fee description Created attachment 29261 [details] [review] Bug 6427 [Part 32] - Fix koha-qa.pl issues Created attachment 29262 [details] [review] Bug 6427 [Part 33] - Remove unescaped key value pairs Titles and other values with double quotes will break the javascript. We do not need these unescaped values for any reason. Created attachment 29263 [details] [review] Bug 6427 [Part 34] - Issues view should show Yes to fines only for items with associated debits in opac Created attachment 29264 [details] [review] Bug 6427 [Part 35] - Update ProcessOfflinePayment Created attachment 29265 [details] [review] Bug 6427 [Part 35] - Add type to note for SIP2 payments Is there a reason why there are so many separate patches? Is there one all-encompassing test plan for all? Kyle, I think these patches need to be rebased. -Jesse Created attachment 29706 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 29707 [details] [review] Bug 6427 - Update schema files Created attachment 29708 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 29709 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 29710 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 29711 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 29712 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 29713 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 29714 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 29715 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 29716 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 29717 [details] [review] Bug 6427 - Unit Tests Created attachment 29719 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 29720 [details] [review] Bug 6427 - Update schema files Created attachment 29721 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 29722 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 29723 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 29724 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 29725 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 29726 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 29727 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 29728 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 29729 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 29730 [details] [review] Bug 6427 - Unit Tests Created attachment 30271 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 30272 [details] [review] Bug 6427 - Update schema files Created attachment 30273 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 30274 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 30275 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 30276 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 30277 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 30278 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 30279 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 30280 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 30281 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 30282 [details] [review] Bug 6427 - Unit Tests Created attachment 30320 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 30321 [details] [review] Bug 6427 - Update schema files Created attachment 30322 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 30323 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 30324 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 30325 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 30326 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 30327 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 30328 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 30329 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 30330 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 30331 [details] [review] Bug 6427 - Unit Tests Created attachment 30416 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 30417 [details] [review] Bug 6427 - Update schema files Created attachment 30418 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 30419 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 30420 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 30421 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 30422 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 30423 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 30424 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 30425 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 30426 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 30427 [details] [review] Bug 6427 - Unit Tests Created attachment 31477 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 31478 [details] [review] Bug 6427 - Update schema files Created attachment 31479 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 31480 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 31481 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 31482 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 31483 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 31484 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 31485 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 31486 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 31487 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 31488 [details] [review] Bug 6427 - Unit Tests Created attachment 31754 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 31755 [details] [review] Bug 6427 - Update schema files Created attachment 31756 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 31757 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 31758 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 31759 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 31760 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 31761 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 31762 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 31763 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 31764 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 31765 [details] [review] Bug 6427 - Unit Tests Created attachment 31766 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 31767 [details] [review] Bug 6427 - Update schema files Created attachment 31768 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 31769 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 31770 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 31771 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 31772 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 31773 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 31774 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 31775 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 31776 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 31777 [details] [review] Bug 6427 - Unit Tests Good work on this one Kyle! I hope we get this to master some day! Created attachment 32478 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 32479 [details] [review] Bug 6427 - Update schema files Created attachment 32480 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 32481 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 32482 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 32483 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 32484 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 32485 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 32486 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 32487 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 32488 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 32489 [details] [review] Bug 6427 - Unit Tests Created attachment 32591 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 32592 [details] [review] Bug 6427 - Update schema files Created attachment 32593 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 32594 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 32595 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 32596 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 32597 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 32598 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 32599 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 32600 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 32601 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 32602 [details] [review] Bug 6427 - Unit Tests Created attachment 32827 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 32828 [details] [review] Bug 6427 - Update schema files Created attachment 32829 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 32830 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 32831 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 32832 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 32833 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 32834 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 32835 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 32836 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 32837 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 32838 [details] [review] Bug 6427 - Unit Tests Created attachment 33251 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 33252 [details] [review] Bug 6427 - Update schema files Created attachment 33253 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 33254 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 33255 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 33256 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 33257 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 33258 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 33259 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 33260 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 33261 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 33262 [details] [review] Bug 6427 - Unit Tests Created attachment 34096 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Created attachment 34097 [details] [review] Bug 6427 - Update schema files Created attachment 34098 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 34099 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 34100 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 34101 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 34102 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 34103 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 34104 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 34105 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 34106 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 34107 [details] [review] Bug 6427 - Unit Tests Super quick look: 1/ TableTool: Could you explain what is the goal of this plugin (I just have seen a (+) with a 'print receipt' button)? All the files included are needed (html?) 2/ It seems that some tests are missing (AddIssue and AddReturn for instance) 3/ Is this patch set introduced changes compared to master or it's just a rewrite? 4/ What's the interest of splitting pl in 2 files (*_go.pl)? I am really not sure it's useful. (The updatedatabase.pl changes are not at the right place (not at the end)) Created attachment 34204 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways bsoletes: 34103 - Bug 6427 - Update existing intranet scripts Created attachment 34205 [details] [review] Bug 6427 - Update schema files Created attachment 34206 [details] [review] Bug 6427 - Add new Accounts related Koha modules Created attachment 34207 [details] [review] Bug 6427 - Update existing Koha perl modules Created attachment 34208 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Created attachment 34209 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Created attachment 34210 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Created attachment 34211 [details] [review] Bug 6427 - Update existing intranet scripts Created attachment 34212 [details] [review] Bug 6427 - Update OPAC scripts Created attachment 34213 [details] [review] Bug 6427 - Add & update cron scripts Created attachment 34214 [details] [review] Bug 6427 - Delete unused and unnecessary files Created attachment 34215 [details] [review] Bug 6427 - Unit Tests Is this re-write meant to deprecate the 'accountlines' table? If so, there are still a few references to it that I can see... and the table is still present after the updatedb run: 1) C4/Reports/Guided.pm 2) C4/Overdues.pm 3) offline_circ/download.pl And a few tests ;) 1) /db_dependent/Circulation_Branch.t 2) /db_dependent/Members.t 3) /db_dependent/Circulation_issue.t Comment on attachment 34204 [details] [review] Bug 6427 - Update database Review of attachment 34204 [details] [review]: ----------------------------------------------------------------- ::: installer/data/mysql/updatedatabase.pl @@ +9709,5 @@ > + 'W' => Koha::Accounts::CreditTypes::WriteOff, > + 'C' => Koha::Accounts::CreditTypes::Credit, > + 'CR' => Koha::Accounts::CreditTypes::Credit, > + }; > + Should there be any additional handling for existing authorised values for types here... ? @@ +9767,5 @@ > + } > + ); > + } > + } > + Should there also be a 'DROP TABLE accountlines' somewhere in here...? The installer wizard currently gives the below error with these patches: ERROR 1064 (42000) at line 3466: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'account_credits ( credit_id int(11) NOT NULL AUTO_INCREMENT, borrow' at line 1 Testing feedback spreadsheet available at: https://docs.google.com/a/ptfs-europe.com/spreadsheets/d/1EcBAPmPAF0L95uYxWtRcnV9n1sD78IAxTHW2N-9u2K0/edit#gid=0 Created attachment 35196 [details] [review] [SIGNED-OFF] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35197 [details] [review] [SIGNED-OFF] Bug 6427 - Update schema files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35198 [details] [review] [SIGNED-OFF] Bug 6427 - Add new Accounts related Koha modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35199 [details] [review] [SIGNED-OFF] Bug 6427 - Update existing Koha perl modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35200 [details] [review] [SIGNED-OFF] Bug 6427 - Add new TT plugin to deal with currency Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35201 [details] [review] [SIGNED-OFF] Bug 6427 - Add TableTools plugin for DataTables Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35202 [details] [review] [SIGNED-OFF] Bug 6427 - Add new staff scripts for managing accounts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35203 [details] [review] [SIGNED-OFF] Bug 6427 - Update existing intranet scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35204 [details] [review] [SIGNED-OFF] Bug 6427 - Update OPAC scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35205 [details] [review] [SIGNED-OFF] Bug 6427 - Add & update cron scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35206 [details] [review] [SIGNED-OFF] Bug 6427 - Delete unused and unnecessary files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35207 [details] [review] [SIGNED-OFF] Bug 6427 - Unit Tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35208 [details] [review] [SIGNED-OFF] Bug 6427 - Make fines tabs link to account payment page Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 35302 [details] [review] Bug 6427 [QA Followup] - Improvements to OPAC view I'd really like to see some testing notes about this feature with the sign-off. This is huge and no library uses all features. Applying: Bug 6427 - Update existing Koha perl modules CONFLICT (content): Merge conflict in C4/SIP/ILS/Transaction/FeePayment.pm CONFLICT (content): Merge conflict in C4/Reserves.pm I don't see how this got to a signed off state, a large part of the testing spreadsheet recording test results shows half of it is untested. I know when I tested it, I found all sorts of issues with display on the staff client. I also found issues with the code when delving into it to try and fix said bugs, I'd love to see a good comprehensive re-write of accounts, but this code shows that it was written some time ago and I don't believe it actually improved matters. PTFS Europe spent a fair chunk of time attempting to get this in shape for passing through community so we could base our Cash Management work upon it, but we didn't even complete testing before we realised how difficult it would be to extend/enhance it further. I also found that too much changed in this one bug.. The db backend and th display both change dramatically, which means doing a side by side comparison to check that the db update it actually catching everything is near impossible. Martin Further to the above, when I attempted to lookup the original RFC for this, it does not remotely resemble the actually work, further confusing testing. Please don't see this as completely negative.. I just feel things have moved on allot since this patch was written.. and that the way in which it has been posted as one massive bug is unmanageable for both testers and qa team. I have a alternative schema I'd love to post as a counter patch.. but that all depends upon having a moment to get to it. Further to the above, when I attempted to lookup the original RFC for this, it does not remotely resemble the actually work, further confusing testing. Please don't see this as completely negative.. I just feel things have moved on allot since this patch was written.. and that the way in which it has been posted as one massive bug is unmanageable for both testers and qa team. I have a alternative schema I'd love to post as a counter patch.. but that all depends upon having a moment to get to it. I must disagree. This work closely resembles the original RFC some table and column name changes, as well as a few additions. I've spend countless hours to track this feature against master. Nothing has moved on. It has simply been a lack of persons willing to test and qa this feature that has been the problem so far. (In reply to Martin Renvoize from comment #618) > Further to the above, when I attempted to lookup the original RFC for this, > it does not remotely resemble the actually work, further confusing testing. > > Please don't see this as completely negative.. I just feel things have moved > on allot since this patch was written.. and that the way in which it has > been posted as one massive bug is unmanageable for both testers and qa team. > > I have a alternative schema I'd love to post as a counter patch.. but that > all depends upon having a moment to get to it. I'd like to add that 2 libraries are using it in production and have given their sign off to the features. They are not having issues with anything - and since we're talking money related issues you'd expect a lot of screaming if there were issues. Nicole I think i can help out here, Pasco County Library system has been using this patch in production for almost an entire year. We've tested pretty much every way this upgrade works and have made a lot of improvements. We've even found new and interesting ways to break things that no one but a patron could have thought of. Just to confirm I even stepped out to talk to my head of finance who agreed that the system is solid and is functioning as described. We've had 7 libraries using it 5 days a week. At this point human error is what is causing the vast majority of our problems. When this is live in master we hope that other libraries can help us make more tweaks. I can confirm that the system is tested and functioning. Had it not been our county clerk would have made it perfectly clear. If there are individual questions about aspects ill try and answer them as best i can regarding actual function in the library. Created attachment 36324 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36326 [details] [review] Bug 6427 - Update schema files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36327 [details] [review] Bug 6427 - Add new Accounts related Koha modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36328 [details] [review] Bug 6427 - Update existing Koha perl modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36329 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36330 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36331 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36332 [details] [review] Bug 6427 - Update existing intranet scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36333 [details] [review] Bug 6427 - Update OPAC scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36334 [details] [review] Bug 6427 - Add & update cron scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36335 [details] [review] Bug 6427 - Delete unused and unnecessary files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36337 [details] [review] Bug 6427 - Unit Tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36338 [details] [review] Bug 6427 - Make fines tabs link to account payment page Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 36340 [details] [review] Bug 6427 [QA Followup] - Improvements to OPAC view (In reply to Kyle M Hall from comment #619) > I must disagree. This work closely resembles the original RFC some table and > column name changes, as well as a few additions. > > I've spend countless hours to track this feature against master. Nothing has > moved on. It has simply been a lack of persons willing to test and qa this > feature that has been the problem so far. > Hmmm, Martin and others have spent hours trying to QA this. They found problems, they reported them in the spreadsheet. Have you read through the spreadsheet? Or the comment proceeding the one you replied to? I find it quite insulting you just dismiss their findings, and blame them instead. Here at Huntsville-Madison County Public Library, we've been using the accounts re-write in production since we went live on Koha a year ago. We absolutely love the granularity this feature allows for payment types and reporting. As a public library, our city/county auditors strictly require this type of detailed information. Also, as a 12 branch county-wide library system, we're able to make better decisions as we now have better accounting. Finally, our patrons really appreciate that our system tracks what they've paid for and by what method. As Sherry said, we at HMCPL have been using this code in production for a whole year. We have tested this exhaustively, on both 3.14 and 3.16, during that period. And by "we", I mean a 12 branch library system open 7 days a week, with well over 2 million items circulated in that time, exclusively using this code. The current code base is functioning nominally, and even relatively gracefully handled the upgrade from 3.14 to 3.16, as well as multiple patches since. We've no outstanding bugs logged against this current version of the code on our internal nor ByWater's ticketing systems. This current piece of kit is rock solid and well tested; it is well beyond the beta stage that we started with a year ago, and I humbly suggest that it is suitably ready for production. (In reply to Chris Cormack from comment #636) > (In reply to Kyle M Hall from comment #619) > > I must disagree. This work closely resembles the original RFC some table and > > column name changes, as well as a few additions. > > > > I've spend countless hours to track this feature against master. Nothing has > > moved on. It has simply been a lack of persons willing to test and qa this > > feature that has been the problem so far. > > > Hmmm, Martin and others have spent hours trying to QA this. They found > problems, they reported them in the spreadsheet. Have you read through the > spreadsheet? > Or the comment proceeding the one you replied to? > > I find it quite insulting you just dismiss their findings, and blame them > instead. Hi All - Please let's not read any tone into any message. We are all friends here and we speak many different languages - I am at fault for using the wrong word with Katrin (someone that I would go to battle for and have the most respect for). So that being said. I think Kyle needs to know how to work with this "BIG IDEA" of the accounts rewrite and work with everyone - from the most experienced (Tomas and Jonathan) to the most experienced me (Brendan). It may take 10 times of telling us to change certain things - but we are more than will to work with anyone of you all - to make those changes. Tempers fly - and I say that is lost in translation. ok - how to change this. Well we are going to sit down with Katrin, Tomas, Jonathan, and hopefully Martin (on google hangouts), and talk about what needs to be changed and how to submit the patches so that it works for everyone. Please remember that all of us - LOVE LOVE LOVE to be part of this community - and all we ever want is to be part of this community. many things are lost in translation - if you need proof - just ask Paul about baseball. Seriously - all we want is to show that we've got so good code and we totally realize that we need tons of help to get it in. Tons of Respect, Brendan Gallagher (In reply to Brendan Gallagher from comment #639) > (In reply to Chris Cormack from comment #636) > > (In reply to Kyle M Hall from comment #619) > > > I must disagree. This work closely resembles the original RFC some table and > > > column name changes, as well as a few additions. > > > > > > I've spend countless hours to track this feature against master. Nothing has > > > moved on. It has simply been a lack of persons willing to test and qa this > > > feature that has been the problem so far. > > > > > Hmmm, Martin and others have spent hours trying to QA this. They found > > problems, they reported them in the spreadsheet. Have you read through the > > spreadsheet? > > Or the comment proceeding the one you replied to? > > > > I find it quite insulting you just dismiss their findings, and blame them > > instead. > > Hi All - > > Please let's not read any tone into any message. We are all friends here > and we speak many different languages - I am at fault for using the wrong > word with Katrin (someone that I would go to battle for and have the most > respect for). That should be the most INexperienced me (bag) darn typos > > So that being said. I think Kyle needs to know how to work with this "BIG > IDEA" of the accounts rewrite and work with everyone - from the most > experienced (Tomas and Jonathan) to the most experienced me (Brendan). > > It may take 10 times of telling us to change certain things - but we are > more than will to work with anyone of you all - to make those changes. > Tempers fly - and I say that is lost in translation. > > ok - how to change this. Well we are going to sit down with Katrin, Tomas, > Jonathan, and hopefully Martin (on google hangouts), and talk about what > needs to be changed and how to submit the patches so that it works for > everyone. > > Please remember that all of us - LOVE LOVE LOVE to be part of this community > - and all we ever want is to be part of this community. many things are > lost in translation - if you need proof - just ask Paul about baseball. > > Seriously - all we want is to show that we've got so good code and we > totally realize that we need tons of help to get it in. > > Tons of Respect, > Brendan Gallagher (In reply to Martin Renvoize from comment #616) > I don't see how this got to a signed off state, a large part of the testing > spreadsheet recording test results shows half of it is untested. The signer was an independent tester. > I know when I tested it, I found all sorts of issues with display on the > staff client. Please let me know what those issue are! > I also found issues with the code when delving into it to try and fix said > bugs, I'd love to see a good comprehensive re-write of accounts, but this > code shows that it was written some time ago and I don't believe it actually > improved matters. Again, pleases let me know what these bugs are! I believe that this feature improves matters very much. The partners that have been testing this have been able to do far more advanced reporting on fees and payments than is possible with our current schema. I don't see how it *doesn't* improve matters! > > PTFS Europe spent a fair chunk of time attempting to get this in shape for > passing through community so we could base our Cash Management work upon it, > but we didn't even complete testing before we realised how difficult it > would be to extend/enhance it further. I can understand that you want to add a new feature to Koha, and this feature is making it more difficult for you. I've been in the same situation. However, I don't think that's reasonable justification for tossing it out. If you can outline what parts of this are limiting for you, and how I can help resolve this, I would be more than happy to! Have you posted an RFC for your Cash Management feature? Created attachment 36380 [details] [review] Bug 6427 [QA Followup] - Drop old accounts tables Created attachment 36391 [details] [review] Bug 6427 [QA Followup] - Further improvments to updatadatabase Created attachment 36393 [details] [review] Bug 6427 [QA Followup] - Fix accounts table default sorting Created attachment 37127 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37128 [details] [review] Bug 6427 - Update schema files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37129 [details] [review] Bug 6427 - Add new Accounts related Koha modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37130 [details] [review] Bug 6427 - Update existing Koha perl modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37131 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37133 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37134 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37135 [details] [review] Bug 6427 - Update existing intranet scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37136 [details] [review] Bug 6427 - Update OPAC scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37137 [details] [review] Bug 6427 - Add & update cron scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37138 [details] [review] Bug 6427 - Delete unused and unnecessary files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37139 [details] [review] Bug 6427 - Unit Tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37140 [details] [review] Bug 6427 - Make fines tabs link to account payment page Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37141 [details] [review] Bug 6427 [QA Followup] - Improvements to OPAC view Created attachment 37142 [details] [review] Bug 6427 [QA Followup] - Fix accounts table default sorting Created attachment 37143 [details] [review] Bug 6427 [QA Followup] - Drop old accounts tables Created attachment 37147 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37148 [details] [review] Bug 6427 - Update schema files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37149 [details] [review] Bug 6427 - Add new Accounts related Koha modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37150 [details] [review] Bug 6427 - Update existing Koha perl modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37151 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37152 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37153 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37154 [details] [review] Bug 6427 - Update existing intranet scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37155 [details] [review] Bug 6427 - Update OPAC scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37156 [details] [review] Bug 6427 - Add & update cron scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37157 [details] [review] Bug 6427 - Delete unused and unnecessary files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37158 [details] [review] Bug 6427 - Unit Tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37159 [details] [review] Bug 6427 - Make fines tabs link to account payment page Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37160 [details] [review] Bug 6427 [QA Followup] - Improvements to OPAC view Created attachment 37161 [details] [review] Bug 6427 [QA Followup] - Fix accounts table default sorting Created attachment 37162 [details] [review] Bug 6427 [QA Followup] - Drop old accounts tables Created attachment 37229 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37230 [details] [review] Bug 6427 - Update schema files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37231 [details] [review] Bug 6427 - Add new Accounts related Koha modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37232 [details] [review] Bug 6427 - Update existing Koha perl modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37233 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37234 [details] [review] Bug 6427 - Add TableTools plugin for DataTables Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37235 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37236 [details] [review] Bug 6427 - Update existing intranet scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37237 [details] [review] Bug 6427 - Update OPAC scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37238 [details] [review] Bug 6427 - Add & update cron scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37239 [details] [review] Bug 6427 - Delete unused and unnecessary files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37240 [details] [review] Bug 6427 - Unit Tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37241 [details] [review] Bug 6427 - Make fines tabs link to account payment page Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 37242 [details] [review] Bug 6427 [QA Followup] - Improvements to OPAC view Created attachment 37243 [details] [review] Bug 6427 [QA Followup] - Fix accounts table default sorting Created attachment 37244 [details] [review] Bug 6427 [QA Followup] - Drop old accounts tables I tried this by creating new instance, but web installer presented an SQL error when creating db structure: ERROR 1064 (42000) at line 3484: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'account_credits ( credit_id int(11) NOT NULL AUTO_INCREMENT, borrow' at line 1 I think the problem is on this line in kohastructure.sql: 3484 CREATE TABLE IF account_credits ( I think that account_credits table should have foreign key to account_debits.debit_id, without this key, it´s impossible to group payments by fee type in reports. But this work is almost done, so it may be the best approach to open new bug for this enhancement... (In reply to Josef Moravec from comment #694) > I think that account_credits table should have foreign key to > account_debits.debit_id, without this key, it´s impossible to group payments > by fee type in reports. > > But this work is almost done, so it may be the best approach to open new bug > for this enhancement... I am sorry, I just missed the table account_offsets... With Stanwood-Camano School District our textbook libraries really need this functionality to the point that we will offer to have this move onto our production server for more testing. Fines are a big deal for us as it prevents 12th graders from being allowed to graduate. What can we do to help this along further? There have been some commnts that need to be addressed - I am switching to failed QA for the moment. Created attachment 38247 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38248 [details] [review] Bug 6427 - Update schema files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38249 [details] [review] Bug 6427 - Add new Accounts related Koha modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38250 [details] [review] Bug 6427 - Update existing Koha perl modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38251 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38252 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38253 [details] [review] Bug 6427 - Update existing intranet scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38254 [details] [review] Bug 6427 - Update OPAC scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38255 [details] [review] Bug 6427 - Add & update cron scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38256 [details] [review] Bug 6427 - Delete unused and unnecessary files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38257 [details] [review] Bug 6427 - Unit Tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38258 [details] [review] Bug 6427 - Make fines tabs link to account payment page Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 38259 [details] [review] Bug 6427 [QA Followup] - Improvements to OPAC view Created attachment 38260 [details] [review] Bug 6427 [QA Followup] - Fix accounts table default sorting Created attachment 38261 [details] [review] Bug 6427 [QA Followup] - Drop old accounts tables Created attachment 38262 [details] [review] Bug 6427 [QA Followup] - Fix kohastructure.sql Created attachment 39063 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39064 [details] [review] Bug 6427 - Update schema files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39065 [details] [review] Bug 6427 - Add new Accounts related Koha modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39066 [details] [review] Bug 6427 - Update existing Koha perl modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39067 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39069 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39070 [details] [review] Bug 6427 - Update existing intranet scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39071 [details] [review] Bug 6427 - Update OPAC scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39072 [details] [review] Bug 6427 - Add & update cron scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39073 [details] [review] Bug 6427 - Delete unused and unnecessary files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39074 [details] [review] Bug 6427 - Unit Tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39075 [details] [review] Bug 6427 - Make fines tabs link to account payment page Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39076 [details] [review] Bug 6427 [QA Followup] - Improvements to OPAC view Created attachment 39077 [details] [review] Bug 6427 [QA Followup] - Fix accounts table default sorting Created attachment 39078 [details] [review] Bug 6427 [QA Followup] - Drop old accounts tables Created attachment 39079 [details] [review] Bug 6427 [QA Followup] - Fix kohastructure.sql Created attachment 39671 [details] [review] Bug 6427 - Update database This patch set re-engineers Koha's accounting system to be faster, more stable, and have a better historical accounting of fees and payments while also unifying much of the payment logic and simplifying the code behind it. Three new tables have been created: account_debits stores fines and fees owed by the patron. account_credits stores payments, write-offs, and other line items that reduce the amount owed by a patron. account_offsets stores data about changes to debits and credits, including which credits paid which debits. borrowers.account_balance stores the current balance of the patron, so it does not have to be calculated each time it needs to be displayed. issues.issue_id has been added so that individual fines can be directly linked to the issue that caused them without ambiguity. The various accounting code strings ( F, FU, Rent, etc ), some of which have little or no documentation have been replaced by what enumerated data types which are documented via POD. There are three, one for each of Debits ( fees/fines ), Credits ( payments ), and Offsets. The system continues to allow custom fee types ( moving MANUAL_INV to MANUAL_DEBIT ) while additionally allowing custom payment types ( MANUAL_CREDIT ). The system also allows for overpayment, the the outstanding credit being applied to future fees as they are created. The system also allows for a librarian to accept a different amount of money than what is to be paid, and will calculate the change to be given. Test Plan: 1) Apply this patch 2) Create some manual fees 3) Test the fee payments * Pay one fee * Pay multiple fees * Make a partial payment * Write off a fee 4) View the fees/payments, verify they are correct 5) Check out some items as overdue that should have fines 6) Run fines.pl, verify fines were generated 7) Pay on an accruing fine 8) Run fines.pl again, verify the fine hasn't changed 9) Increase the daily fine in issuing rules 10) Run fines.pl again, verify the fine has increased 11) Decrease the daily fine in issuing rules 12) Run fines.pl again, verify the fine has decreased 13) Test dropbox mode 14) Test WhenLostChargeReplacementFee both ways 15) Test RefundLostItemFeeOnReturn both ways 16) Test WhenLostForgiveFine both ways 17) Test CalculateFinesOnReturn both ways Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39672 [details] [review] Bug 6427 - Update schema files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39673 [details] [review] Bug 6427 - Add new Accounts related Koha modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39674 [details] [review] Bug 6427 - Update existing Koha perl modules Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39675 [details] [review] Bug 6427 - Add new TT plugin to deal with currency Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39676 [details] [review] Bug 6427 - Add new staff scripts for managing accounts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39677 [details] [review] Bug 6427 - Update existing intranet scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39678 [details] [review] Bug 6427 - Update OPAC scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39679 [details] [review] Bug 6427 - Add & update cron scripts Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39680 [details] [review] Bug 6427 - Delete unused and unnecessary files Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39681 [details] [review] Bug 6427 - Unit Tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39682 [details] [review] Bug 6427 - Make fines tabs link to account payment page Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> Created attachment 39683 [details] [review] Bug 6427 [QA Followup] - Improvements to OPAC view Created attachment 39684 [details] [review] Bug 6427 [QA Followup] - Fix accounts table default sorting Created attachment 39685 [details] [review] Bug 6427 [QA Followup] - Drop old accounts tables Created attachment 39686 [details] [review] Bug 6427 [QA Followup] - Fix kohastructure.sql Hi Kyle, not sure about the dependency on 13790 - maybe this should be blocked by it and not the other way around (might have made a mistake there)? Also I saw you split of some patches for a more granular approach - what shall we do here? Patch currently doesn't apply - so choosing that for now. *** This bug has been marked as a duplicate of bug 14825 *** |