Bug 23354 adds a 'Pay' screen as the beginning of a 'Point of Sale' system. Currently, it only allows for payment of items, but there are occasions where librarians may need to issue a refund.
Created attachment 92954 [details] [review] Bug 23442: Add a refund option to POS
Created attachment 92955 [details] [review] Accounttype Translations
Created attachment 92956 [details] [review] Bug 23445: Add previous transactions option
Created attachment 95674 [details] [review] Bug 23442: Add account credit types
Created attachment 95675 [details] [review] Bug 23442: Add 'reduce' method to Koha::Account::Line This enhancement adds a 'reduce' method to Koha::Account::Line which can be used to reduce a charge/debit by adding a credit to offset against the amount outstanding. It may be used to apply a discount whilst retaining the original debit amounts or to apply a full or partial refund for example when a lost item is found and returned. The created credit will be immediately applied against the debit unless the debit has already been paid, in which case a 'zero' offset will be added to maintain a link to the debit but the outstanding credit will be left so it may be applied to other debts. Test Plan: 1) Run the included tests and verify they pass. 2) Signoff
Created attachment 95676 [details] [review] Bug 23442: Add refund permission Add a new subpermission called 'refund' to the 'updatecharges' permission group which will allow/prevent refund actions to be performed by staff.
Created attachment 95677 [details] [review] Bug 23442: Add refund option to patron account page This enhancement adds a refined workflow to allow librarians to refund payments to patrons and record these refunds on the patrons account. The use case is that a patron has paid for something before then performing an action that may require some level of refund to be actioned. Perhaps they are returning a lost and paid for book. Test plan: 1) Undertake a series of transactions that result in a debit accountline being partially or fully paid off. 2) Note that a new 'Issue refund' button appears next to a debit (but only if your user has the refund permission or is a superlibrarian) 3) Click the 'Issue refund' button and a modal should appear pre-populated with the amount - amountoutstanding. 4) You should be able to edit the amount you wish to refund, record the refund or cancel. 5) Signoff
*** Bug 24248 has been marked as a duplicate of this bug. ***
Created attachment 96400 [details] [review] Bug 23442: Add account credit types
Created attachment 96401 [details] [review] Bug 23442: Add 'reduce' method to Koha::Account::Line This enhancement adds a 'reduce' method to Koha::Account::Line which can be used to reduce a charge/debit by adding a credit to offset against the amount outstanding. It may be used to apply a discount whilst retaining the original debit amounts or to apply a full or partial refund for example when a lost item is found and returned. The created credit will be immediately applied against the debit unless the debit has already been paid, in which case a 'zero' offset will be added to maintain a link to the debit but the outstanding credit will be left so it may be applied to other debts. Test Plan: 1) Run the included tests and verify they pass. 2) Signoff
Created attachment 96402 [details] [review] Bug 23442: Add refund permission Add a new subpermission called 'refund' to the 'updatecharges' permission group which will allow/prevent refund actions to be performed by staff.
Created attachment 96403 [details] [review] Bug 23442: Add refund option to patron account page This enhancement adds a refined workflow to allow librarians to refund payments to patrons and record these refunds on the patrons account. The use case is that a patron has paid for something before then performing an action that may require some level of refund to be actioned. Perhaps they are returning a lost and paid for book. Test plan: 1) Undertake a series of transactions that result in a debit accountline being partially or fully paid off. 2) Note that a new 'Issue refund' button appears next to a debit (but only if your user has the refund permission or is a superlibrarian) 3) Click the 'Issue refund' button and a modal should appear pre-populated with the amount - amountoutstanding. 4) You should be able to edit the amount you wish to refund, record the refund or cancel. 5) Signoff
Created attachment 96414 [details] [review] Bug 23442: Add account credit types
Created attachment 96415 [details] [review] Bug 23442: Add 'reduce' method to Koha::Account::Line This enhancement adds a 'reduce' method to Koha::Account::Line which can be used to reduce a charge/debit by adding a credit to offset against the amount outstanding. It may be used to apply a discount whilst retaining the original debit amounts or to apply a full or partial refund for example when a lost item is found and returned. The created credit will be immediately applied against the debit unless the debit has already been paid, in which case a 'zero' offset will be added to maintain a link to the debit but the outstanding credit will be left so it may be applied to other debts. Test Plan: 1) Run the included tests and verify they pass. 2) Signoff
Created attachment 96416 [details] [review] Bug 23442: Add refund permission Add a new subpermission called 'refund' to the 'updatecharges' permission group which will allow/prevent refund actions to be performed by staff.
Created attachment 96417 [details] [review] Bug 23442: Add refund option to patron account page This enhancement adds a refined workflow to allow librarians to refund payments to patrons and record these refunds on the patrons account. The use case is that a patron has paid for something before then performing an action that may require some level of refund to be actioned. Perhaps they are returning a lost and paid for book. Test plan: 1) Undertake a series of transactions that result in a debit accountline being partially or fully paid off. 2) Note that a new 'Issue refund' button appears next to a debit (but only if your user has the refund permission or is a superlibrarian) 3) Click the 'Issue refund' button and a modal should appear pre-populated with the amount - amountoutstanding. 4) You should be able to edit the amount you wish to refund, record the refund or cancel. 5) Signoff
Hi Martin, I get error: {UNKNOWN}: Can't locate object method "payout" via package "Koha::Schema::Result::Accountline" at /home/vagrant/kohaclone/members/boraccount.pl line 139. at /home/vagrant/kohaclone/members/boraccount.pl line 151 at /usr/share/perl5/DBIx/Class/Exception.pm line 77 in DBIx::Class::Exception::throw at /usr/share/perl5/DBIx/Class/Exception.pm line 77 Miss I something?
Erm, I can't replicate that.. did you apply the chain of dependencies and are you running against master?
I'm on masted, all depencies applied. I'll try it again.
Created attachment 97008 [details] [review] Bug 23442: Add account credit types Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 97009 [details] [review] Bug 23442: Add 'reduce' method to Koha::Account::Line This enhancement adds a 'reduce' method to Koha::Account::Line which can be used to reduce a charge/debit by adding a credit to offset against the amount outstanding. It may be used to apply a discount whilst retaining the original debit amounts or to apply a full or partial refund for example when a lost item is found and returned. The created credit will be immediately applied against the debit unless the debit has already been paid, in which case a 'zero' offset will be added to maintain a link to the debit but the outstanding credit will be left so it may be applied to other debts. Test Plan: 1) Run the included tests and verify they pass. 2) Signoff Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 97010 [details] [review] Bug 23442: Add refund permission Add a new subpermission called 'refund' to the 'updatecharges' permission group which will allow/prevent refund actions to be performed by staff. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 97011 [details] [review] Bug 23442: Add refund option to patron account page This enhancement adds a refined workflow to allow librarians to refund payments to patrons and record these refunds on the patrons account. The use case is that a patron has paid for something before then performing an action that may require some level of refund to be actioned. Perhaps they are returning a lost and paid for book. Test plan: 1) Undertake a series of transactions that result in a debit accountline being partially or fully paid off. 2) Note that a new 'Issue refund' button appears next to a debit (but only if your user has the refund permission or is a superlibrarian) 3) Click the 'Issue refund' button and a modal should appear pre-populated with the amount - amountoutstanding. 4) You should be able to edit the amount you wish to refund, record the refund or cancel. 5) Signoff Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 97012 [details] [review] Bug 23442: Add html filter to a couple lines in template Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment on attachment 97008 [details] [review] Bug 23442: Add account credit types Review of attachment 97008 [details] [review]: ----------------------------------------------------------------- ::: installer/data/mysql/account_offset_types.sql @@ +17,5 @@ > ('OVERDUE'), > ('Void Payment'), > ('Credit Applied'), > +('PAYOUT'), > +('DISOUNT'), Typo: should be 'DISCOUNT' ::: installer/data/mysql/atomicupdate/bug_23442.perl @@ +15,5 @@ > + }); > + > + SetVersion($DBversion); > + print "Upgrade to $DBversion done (Bug 23442 - Add REFUND and DISCOUNT account_credit_types)\n"; > + print "Upgrade to $DBversion done (Bug 23442 - Add REFUNDED and DISCOUNTED account_offset_types)\n"; Should be 'REFUND' and 'DISCOUNT' too
Comment on attachment 97011 [details] [review] Bug 23442: Add refund option to patron account page Review of attachment 97011 [details] [review]: ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ +216,5 @@ > + <select name="transaction_type" id="transaction_type"> > + <option value="AC">Account credit</option> > + [% FOREACH pt IN payment_types %] > + <option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> > + [% END %] The condition '[% IF payment_types %]' should be just before 'FOREACH' because if you don't have any payment type defined you can't use the hardcoded 'AC' value neither...
Martin, you have added also "DISCOUNT" offset and credit type, but don't work with this value in further code, are they added by mistake? Shouldn't be better to add them in patch for bug 24081? also, try this: 1) Create and pay any fee 2) Refund it 3) On line described as 'A refund applied to a patrons fine' you have options to payout, use it 4) Now you have new line called 'Payment from library to patron' and refund option available on it, use it, confirm -> boom: Combined reduction (30 + -30) is higher than original amount (30) at /usr/share/perl5/Exception/Class/Base.pm line 88
Thanks for testing this Josef.. at least some of the issue look to be the result of various rebases.. I'll clean it up today and test that nasty failure case too.
Created attachment 97062 [details] [review] Bug 23442: Add account credit types Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 97063 [details] [review] Bug 23442: Add 'reduce' method to Koha::Account::Line This enhancement adds a 'reduce' method to Koha::Account::Line which can be used to reduce a charge/debit by adding a credit to offset against the amount outstanding. It may be used to apply a discount whilst retaining the original debit amounts or to apply a full or partial refund for example when a lost item is found and returned. The created credit will be immediately applied against the debit unless the debit has already been paid, in which case a 'zero' offset will be added to maintain a link to the debit but the outstanding credit will be left so it may be applied to other debts. Test Plan: 1) Run the included tests and verify they pass. 2) Signoff Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 97064 [details] [review] Bug 23442: Add refund permission Add a new subpermission called 'refund' to the 'updatecharges' permission group which will allow/prevent refund actions to be performed by staff. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 97065 [details] [review] Bug 23442: Add refund option to patron account page This enhancement adds a refined workflow to allow librarians to refund payments to patrons and record these refunds on the patrons account. The use case is that a patron has paid for something before then performing an action that may require some level of refund to be actioned. Perhaps they are returning a lost and paid for book. Test plan: 1) Undertake a series of transactions that result in a debit accountline being partially or fully paid off. 2) Note that a new 'Issue refund' button appears next to a debit (but only if your user has the refund permission or is a superlibrarian) 3) Click the 'Issue refund' button and a modal should appear pre-populated with the amount - amountoutstanding. 4) You should be able to edit the amount you wish to refund, record the refund or cancel. 5) Signoff Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 97066 [details] [review] Bug 23442: Add html filter to a couple lines in template Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 97067 [details] [review] Bug 23442: Prevent payouts from being reduced Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
OK, one followup added and the original patches amended to reflect comments. I believe we're back in action and ready for a second QA run now Josef.. again, thanks for looking :)
Created attachment 97151 [details] [review] Bug 23442: Add account credit types Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 97152 [details] [review] Bug 23442: Add 'reduce' method to Koha::Account::Line This enhancement adds a 'reduce' method to Koha::Account::Line which can be used to reduce a charge/debit by adding a credit to offset against the amount outstanding. It may be used to apply a discount whilst retaining the original debit amounts or to apply a full or partial refund for example when a lost item is found and returned. The created credit will be immediately applied against the debit unless the debit has already been paid, in which case a 'zero' offset will be added to maintain a link to the debit but the outstanding credit will be left so it may be applied to other debts. Test Plan: 1) Run the included tests and verify they pass. 2) Signoff Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 97153 [details] [review] Bug 23442: Add refund permission Add a new subpermission called 'refund' to the 'updatecharges' permission group which will allow/prevent refund actions to be performed by staff. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 97154 [details] [review] Bug 23442: Add refund option to patron account page This enhancement adds a refined workflow to allow librarians to refund payments to patrons and record these refunds on the patrons account. The use case is that a patron has paid for something before then performing an action that may require some level of refund to be actioned. Perhaps they are returning a lost and paid for book. Test plan: 1) Undertake a series of transactions that result in a debit accountline being partially or fully paid off. 2) Note that a new 'Issue refund' button appears next to a debit (but only if your user has the refund permission or is a superlibrarian) 3) Click the 'Issue refund' button and a modal should appear pre-populated with the amount - amountoutstanding. 4) You should be able to edit the amount you wish to refund, record the refund or cancel. 5) Signoff Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 97155 [details] [review] Bug 23442: Add html filter to a couple lines in template Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 97156 [details] [review] Bug 23442: Prevent payouts from being reduced Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Thanks Martin for such quick reaction, Passed QA now ;)
Nice work everyone! Pushed to master for 20.05
Not backported to 19.11.x