From bc9bd93e91460d8f28b83b28c8935637444c359d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 27 Jun 2019 12:12:46 -0400 Subject: [PATCH] Bug 23228: Add option to automatically display payment receipt for printing after making a payment Some libraries would like an auto-popup after making a payment so librarians don't have to navigate to the accounts page, locate the new payment, then click the print button. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Make a payment, note no difference in behavior 4) Enable the new syspref FinePaymentAutoPopup 5) Make a payment, note the popup for the payment receipt --- .../atomicupdate/FinePaymentAutoPopup.perl | 10 ++++++++ installer/data/mysql/sysprefs.sql | 1 + .../admin/preferences/circulation.pref | 6 +++++ .../prog/en/modules/members/boraccount.tt | 4 ++++ .../prog/en/modules/members/pay.tt | 6 ++++- .../prog/en/modules/members/paycollect.tt | 4 ++++ members/boraccount.pl | 4 +++- members/pay.pl | 5 +++- members/paycollect.pl | 23 +++++++++++-------- 9 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/FinePaymentAutoPopup.perl diff --git a/installer/data/mysql/atomicupdate/FinePaymentAutoPopup.perl b/installer/data/mysql/atomicupdate/FinePaymentAutoPopup.perl new file mode 100644 index 0000000000..8e1128cd9d --- /dev/null +++ b/installer/data/mysql/atomicupdate/FinePaymentAutoPopup.perl @@ -0,0 +1,10 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do({ + INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('FinePaymentAutoPopup','0',NULL,'If enabled, automatically display a print dialog for a payment receipt when making a payment.','YesNo') + }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 23228 - Add option to automatically display payment receipt for printing after making a payment)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index a0d1132d25..3d09ca477b 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -183,6 +183,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is charged','YesNo'), ('FilterBeforeOverdueReport','0','','Do not run overdue report until filter selected','YesNo'), ('FineNotifyAtCheckin','0',NULL,'If ON notify librarians of overdue fines on the items they are checking in.','YesNo'), +('FinePaymentAutoPopup','0',NULL,'If enabled, automatically display a print dialog for a payment receipt when making a payment.','YesNo'), ('finesCalendar','noFinesWhenClosed','ignoreCalendar|noFinesWhenClosed','Specify whether to use the Calendar in calculating duedates and fines','Choice'), ('FinesIncludeGracePeriod','1',NULL,'If enabled, fines calculations will include the grace period.','YesNo'), ('FinesLog','1',NULL,'If ON, log fines','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 4799e86630..15ea41c285 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -889,6 +889,12 @@ Circulation: - pref: ProcessingFeeNote type: textarea class: code + - + - pref: FinePaymentAutoPopup + choices: + yes: "Do" + no: "Don't" + - automatically display a print dialog for a payment receipt when making a payment.. Self check-in module: - - "Include the following HTML on the self check-in screen:" diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index 8dbdea2511..7a2c19b3bf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -120,6 +120,10 @@ [% Asset.js("js/members-menu.js") | $raw %]