Bug 33473 - Allow to send email receipts for payments/writeoff manually instead of automatically
Summary: Allow to send email receipts for payments/writeoff manually instead of automa...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Jake Deery
QA Contact: Testopia
URL:
Keywords:
Depends on: 31448
Blocks:
  Show dependency treegraph
 
Reported: 2023-04-10 15:41 UTC by Katrin Fischer
Modified: 2024-11-13 16:36 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 33473: Rename UseEmailReceipts to AutomaticEmailReceipts (9.68 KB, patch)
2024-08-14 11:36 UTC, Jake Deery
Details | Diff | Splinter Review
Bug 33473: Rename UseEmailReceipts to AutomaticEmailReceipts (9.79 KB, patch)
2024-09-03 12:02 UTC, Jake Deery
Details | Diff | Splinter Review
Bug 33473: Rename UseEmailReceipts to AutomaticEmailReceipts (9.79 KB, patch)
2024-09-04 08:09 UTC, Jake Deery
Details | Diff | Splinter Review
Bug 33473: Rename UseEmailReceipts to AutomaticEmailReceipts (9.85 KB, patch)
2024-09-04 08:39 UTC, Chloe Zermatten
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2023-04-10 15:41:17 UTC
With bug 31448 it's possible to re-send a failed or lost email receipt. It would be nice if you could turn off the automatic sending of receipts by email and send them just manually whenever requested.
Comment 1 Jake Deery 2024-08-14 11:36:50 UTC
Created attachment 170314 [details] [review]
Bug 33473: Rename UseEmailReceipts to AutomaticEmailReceipts

This bug will rename the UseEmailReceipts to AutomaticEmailReceipts, to
make it clearer the purpose of this syspref. This is because the receipts
dropdown is no longer conditional, and will always show, even if
AutomaticEmailReceipts is switched off.

To test (steps a-e before applying patch):
a)  search sysprefs for 'EmailReceipts'
    1)  note the name is currently 'UseEmailReceipts'
    2)  enable this syspref
b)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
c)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is visible
d)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was automatically sent
e)  apply the patch, upgrade the db schema
f)  search sysprefs for 'EmailReceipts'
    1)  note the name is now 'AutomaticEmailReceipts'
g)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
h)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is still visible
i)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was automatically sent again
j)  disable the 'AutomaticEmailReceipts' syspref
k)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
l)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is STILL visible
m)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was NOT automatically sent
n)  go to members/boraccount.pl?borrowernumber=51
    1)  on any account line where a payment is made, click receipts > email
o)  go to members/notices.pl?borrowernumber=51
    1)  confirm a manual notice has been generated
p)  make coffee & have a mini disco
Comment 2 Jake Deery 2024-08-14 11:42:38 UTC
Happy for there to be some discussion on this one, but my thoughts were that it would probably be best to rename the SysPref to 'AutomaticEmailReceipts', and remove the conditional logic for the receipt dropdown.

If we think that having the option to explicitly turn off all email receipts is wise in 2024, I can write up a second patch for that and add a new SysPref called 'ShowEmailReceiptOption'. But do we really think it is necessary to do? Librarians can just choose not to use email receipts if they are undesirable?

Let me know what your thoughts are!
Comment 3 Martin Renvoize (ashimema) 2024-09-02 14:36:59 UTC
Minor request here.. we might want to check that the patron->notice_email_address is populated before displaying the button.
Comment 4 Jake Deery 2024-09-03 11:56:08 UTC
Good point – let me add that in
Comment 5 Jake Deery 2024-09-03 12:02:22 UTC
Created attachment 170980 [details] [review]
Bug 33473: Rename UseEmailReceipts to AutomaticEmailReceipts

This bug will rename the UseEmailReceipts to AutomaticEmailReceipts, to
make it clearer the purpose of this syspref. This is because the receipts
dropdown is no longer conditional, and will always show, even if
AutomaticEmailReceipts is switched off.

To test (steps a-e before applying patch):
a)  search sysprefs for 'EmailReceipts'
    1)  note the name is currently 'UseEmailReceipts'
    2)  enable this syspref
b)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
c)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is visible
d)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was automatically sent
e)  apply the patch, upgrade the db schema
f)  search sysprefs for 'EmailReceipts'
    1)  note the name is now 'AutomaticEmailReceipts'
g)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
h)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is no longer visible
i)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was automatically sent again
j)  disable the 'AutomaticEmailReceipts' syspref
k)  go to members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=19
    1)  add a valid email address
k)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
l)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is now visible
m)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was NOT automatically sent
n)  go to members/boraccount.pl?borrowernumber=51
    1)  on any account line where a payment is made, click receipts > email
o)  go to members/notices.pl?borrowernumber=51
    1)  confirm a manual notice has been generated
p)  make coffee & have a mini disco
Comment 6 Chloe Zermatten 2024-09-03 16:16:27 UTC
Quick silly question: in the test plan, should the path in step k) finish with borrowernumber=51 instead of borrowernumber=19? (There also seem to be two step k))


Otherwise, I've gone through the test plan and it all seems to be working as intended (provided the right patron is updated with a working email address), so I'm happy to sign off!
Comment 7 Jake Deery 2024-09-04 08:09:37 UTC
Well spotted Chloe, a lazy copy-paste from me. Fixing the patch note as we speak. Thanks in advance for the sign-off!

Jake.
Comment 8 Jake Deery 2024-09-04 08:09:41 UTC
Created attachment 171012 [details] [review]
Bug 33473: Rename UseEmailReceipts to AutomaticEmailReceipts

This bug will rename the UseEmailReceipts to AutomaticEmailReceipts, to
make it clearer the purpose of this syspref. This is because the receipts
dropdown is no longer conditional, and will always show, even if
AutomaticEmailReceipts is switched off.

To test (steps a-e before applying patch):
a)  search sysprefs for 'EmailReceipts'
    1)  note the name is currently 'UseEmailReceipts'
    2)  enable this syspref
b)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
c)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is visible
d)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was automatically sent
e)  apply the patch, upgrade the db schema
f)  search sysprefs for 'EmailReceipts'
    1)  note the name is now 'AutomaticEmailReceipts'
g)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
h)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is no longer visible
i)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was automatically sent again
j)  disable the 'AutomaticEmailReceipts' syspref
k)  go to members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=51
    1)  add a valid email address
k)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
l)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is now visible
m)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was NOT automatically sent
n)  go to members/boraccount.pl?borrowernumber=51
    1)  on any account line where a payment is made, click receipts > email
o)  go to members/notices.pl?borrowernumber=51
    1)  confirm a manual notice has been generated
p)  make coffee & have a mini disco
Comment 9 Chloe Zermatten 2024-09-04 08:39:26 UTC
Created attachment 171013 [details] [review]
Bug 33473: Rename UseEmailReceipts to AutomaticEmailReceipts

This bug will rename the UseEmailReceipts to AutomaticEmailReceipts, to
make it clearer the purpose of this syspref. This is because the receipts
dropdown is no longer conditional, and will always show, even if
AutomaticEmailReceipts is switched off.

To test (steps a-e before applying patch):
a)  search sysprefs for 'EmailReceipts'
    1)  note the name is currently 'UseEmailReceipts'
    2)  enable this syspref
b)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
c)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is visible
d)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was automatically sent
e)  apply the patch, upgrade the db schema
f)  search sysprefs for 'EmailReceipts'
    1)  note the name is now 'AutomaticEmailReceipts'
g)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
h)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is no longer visible
i)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was automatically sent again
j)  disable the 'AutomaticEmailReceipts' syspref
k)  go to members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=19
    1)  add a valid email address
l)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
m)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is now visible
n)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was NOT automatically sent
o)  go to members/boraccount.pl?borrowernumber=51
    1)  on any account line where a payment is made, click receipts > email
p)  go to members/notices.pl?borrowernumber=51
    1)  confirm a manual notice has been generated
q)  make coffee & have a mini disco

Signed-off-by: Chloe Zermatten <chloe.zermatten@ptfs-europe.com>
Comment 10 Jake Deery 2024-11-13 16:36:27 UTC
Once we're over the hump of 24.11, it would be nice to get a SO from someone outside of PTFS Europe :-) 

Jake.