Description
Martin Renvoize (ashimema)
2019-11-21 11:17:56 UTC
Created attachment 97090 [details] [review] Bug 24081: Add credit_types, offset_types and permissions This patch adds the credit_type, offset_type and permissions required for the addition of a discounting workflow in the accounts system. Created attachment 97091 [details] [review] Bug 24081: Add DISCOUNT to the allowed 'reduce' types This patch adds the DISCOUNT type to the handled types list in the reduce method introduced in bug 23442 Created attachment 100044 [details] [review] Bug 24081: Add credit_types, offset_types and permissions This patch adds the credit_type, offset_type and permissions required for the addition of a discounting workflow in the accounts system. Created attachment 100045 [details] [review] Bug 24081: Add DISCOUNT to the allowed 'reduce' types This patch adds the DISCOUNT type to the handled types list in the reduce method introduced in bug 23442 Created attachment 100046 [details] [review] Bug 24081: Add discount action to boraccount This patch adds the ability to apply discounts to existing patron charges from the boraccount page. Test plan Hi Martin, test plan? :-) Test plan: -create manual invoice - go to Transaction a here is new button Appla discount, click - in modal, set discount and confirm - check if amount to pay is lower (minus discount) - pay amount Created attachment 100074 [details] [review] Bug 24081: Add credit_types, offset_types and permissions This patch adds the credit_type, offset_type and permissions required for the addition of a discounting workflow in the accounts system. Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 100075 [details] [review] Bug 24081: Add DISCOUNT to the allowed 'reduce' types This patch adds the DISCOUNT type to the handled types list in the reduce method introduced in bug 23442 Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 100076 [details] [review] Bug 24081: Add discount action to boraccount This patch adds the ability to apply discounts to existing patron charges from the boraccount page. Test plan Signed-off-by: Michal Denar <black23@gmail.com> Hi, I really like this feature. It's works. But itsn't "user friendly". I prefer to apply discout directly at "Pay an amount toward all fines" or "Pay an individual fine" window. Thank you for opinions. (In reply to Michal Denar from comment #11) > Hi, > I really like this feature. It's works. But itsn't "user friendly". I prefer > to apply discout directly at "Pay an amount toward all fines" or "Pay an > individual fine" window. > > Thank you for opinions. Thanks for the quick testing, and my apologies for the lack of test plan.. seems I forgot to paste it into the commit message after drafting it.. oops. As for the feedback, that's great. I wanted to get the foundation in with this bug and then build on top of them. I'll open some further bugs with your idea's as their foundation, as I have done for Tomas when he QA'd the parallel 'Refund' bug requesting similar options. I also intend to migrate some of the existing automated discounting functionality to using this model of record for auditability which has been sorely missed in the past. Thanks again, Created attachment 100084 [details] [review] Bug 24081: Add credit_types, offset_types and permissions This patch adds the credit_type, offset_type and permissions required for the addition of a discounting workflow in the accounts system. Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 100085 [details] [review] Bug 24081: Add DISCOUNT to the allowed 'reduce' types This patch adds the DISCOUNT type to the handled types list in the reduce method introduced in bug 23442 Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 100086 [details] [review] Bug 24081: Add discount action to boraccount This patch adds the ability to apply discounts to existing patron charges from the boraccount page. Test plan 1/ Carry out some accounting actions that end up with debts on the patron record. (Add a manual invoice for example) 2/ Note a new 'Apply discount' action button on the unpaid debt 3/ Paid debts do not display the action button 4/ Click the button 5/ Enter an amount into the resulting modal and click confirm 6/ Confirm that the outstanding debt has been reduced by the amount you specified. 7/ Confirm that a new 'Discount' line appears on the patrons account 8/ Confirm that in the 'details' view of the debt that the discount line was used against the debt to create the reduction. 9/ Signoff Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 100087 [details] [review] Bug 24081: Add credit_types, offset_types and permissions This patch adds the credit_type, offset_type and permissions required for the addition of a discounting workflow in the accounts system. Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 100088 [details] [review] Bug 24081: Add DISCOUNT to the allowed 'reduce' types This patch adds the DISCOUNT type to the handled types list in the reduce method introduced in bug 23442 Signed-off-by: Michal Denar <black23@gmail.com> Created attachment 100089 [details] [review] Bug 24081: Add discount action to boraccount This patch adds the ability to apply discounts to existing patron charges from the boraccount page. Test plan 1/ Carry out some accounting actions that end up with debts on the patron record. (Add a manual invoice for example) 2/ Note a new 'Apply discount' action button on the unpaid debt 3/ Paid debts do not display the action button 4/ Click the button 5/ Enter an amount into the resulting modal and click confirm 6/ Confirm that the outstanding debt has been reduced by the amount you specified. 7/ Confirm that a new 'Discount' line appears on the patrons account 8/ Confirm that in the 'details' view of the debt that the discount line was used against the debt to create the reduction. 9/ Signoff Signed-off-by: Michal Denar <black23@gmail.com> (In reply to Michal Denar from comment #11) > Hi, > I really like this feature. It's works. But itsn't "user friendly". I prefer > to apply discout directly at "Pay an amount toward all fines" or "Pay an > individual fine" window. > > Thank you for opinions. I agree with you! I tried testing it without reading the test plan (following my intuition) as I saw your comment. And it felt like: - Discount could be a percentage as well - It should be cool to have it (also) on the Make payment flow Anyway, good job and really clean implementation. I'm happy where the accounts code is now. Created attachment 100111 [details] [review] Bug 24081: Add credit_types, offset_types and permissions This patch adds the credit_type, offset_type and permissions required for the addition of a discounting workflow in the accounts system. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 100112 [details] [review] Bug 24081: Add DISCOUNT to the allowed 'reduce' types This patch adds the DISCOUNT type to the handled types list in the reduce method introduced in bug 23442 Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 100113 [details] [review] Bug 24081: Add discount action to boraccount This patch adds the ability to apply discounts to existing patron charges from the boraccount page. Test plan 1/ Carry out some accounting actions that end up with debts on the patron record. (Add a manual invoice for example) 2/ Note a new 'Apply discount' action button on the unpaid debt 3/ Paid debts do not display the action button 4/ Click the button 5/ Enter an amount into the resulting modal and click confirm 6/ Confirm that the outstanding debt has been reduced by the amount you specified. 7/ Confirm that a new 'Discount' line appears on the patrons account 8/ Confirm that in the 'details' view of the debt that the discount line was used against the debt to create the reduction. 9/ Signoff Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 100114 [details] [review] Bug 24081: (QA follow-up) Fix small typo Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Nice work everyone! Pushed to master for 20.05 % git grep updatecharges|grep discount koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt: [% IF CAN_user_updatecharges_discount && account.is_debit && ( account.amountoutstanding == account.amount ) && !(account.debit_type_code == 'PAYOUT') %] There is no check on the discount subperm, only hide/show a button. Without a test in the controller that can be forced. not pushed to 19.11.x due to dependencies *** Bug 16820 has been marked as a duplicate of this bug. *** |