Bugzilla – Attachment 100070 Details for
Bug 24082
Add a 'refund' option to anonymous payments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24082: Add `anonymous_refund` permission to `cash_management`
Bug-24082-Add-anonymousrefund-permission-to-cashma.patch (text/plain), 5.01 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-03-03 20:27:49 UTC
(
hide
)
Description:
Bug 24082: Add `anonymous_refund` permission to `cash_management`
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-03-03 20:27:49 UTC
Size:
5.01 KB
patch
obsolete
>From be2b35718464ca1df64b38c493da25e184e87a5d Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 23 Jan 2020 15:52:25 +0000 >Subject: [PATCH] Bug 24082: Add `anonymous_refund` permission to > `cash_management` > >This patch adds the new `anonymous_refund` permission to the >`cash_management` flag and binds it to the visability of the register >details page. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > installer/data/mysql/atomicupdate/bug_24082.perl | 12 ++++++++++++ > installer/data/mysql/userpermissions.sql | 1 + > .../intranet-tmpl/prog/en/includes/permissions.inc | 5 +++++ > .../intranet-tmpl/prog/en/includes/pos-menu.inc | 2 +- > .../intranet-tmpl/prog/en/modules/pos/register.tt | 2 ++ > pos/register.pl | 2 +- > 6 files changed, 22 insertions(+), 2 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_24082.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_24082.perl b/installer/data/mysql/atomicupdate/bug_24082.perl >new file mode 100644 >index 0000000000..be66c07777 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_24082.perl >@@ -0,0 +1,12 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if ( CheckVersion($DBversion) ) { >+ >+ $dbh->do(qq{ >+ INSERT IGNORE permissions (module_bit, code, description) >+ VALUES >+ (25, 'anonymous_refund', 'Perform refund actions from cash registers') >+ }); >+ >+ SetVersion($DBversion); >+ print "Upgrade to $DBversion done (Bug 23442 - Add a refund option to the point of sale system)\n"; >+} >diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql >index bad1b9ad44..f4bc5f6b87 100644 >--- a/installer/data/mysql/userpermissions.sql >+++ b/installer/data/mysql/userpermissions.sql >@@ -121,6 +121,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > (23, 'self_checkout_module', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID'), > (24, 'manage_rotas', 'Create, edit and delete rotas'), > (24, 'manage_rota_items', 'Add and remove items from rotas'), >+ (25, 'anonymous_refund', 'Perform refund actions from cash registers'), > (25, 'cashup', 'Perform cash register cashup action'), > (25, 'takepayment', 'Access the point of sale page and take payments') > ; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 1e678c7dae..affbf0f6f1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -704,5 +704,10 @@ > Perform cash register cashup action > </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'anonymous_refund' -%] >+ <span class="sub_permission anonymous_refund_subpermission"> >+ Perform anonymous refund actions >+ </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- END -%] > [%- END -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc >index bf3e75ba8f..7a0fbaabda 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc >@@ -1,6 +1,6 @@ > <div id="navmenu"> > <div id="navmenulist"> >- [% IF ( CAN_user_cash_management_cashup ) %] >+ [% IF ( CAN_user_cash_management_cashup || CAN_user_cash_management_anonymous_refund ) %] > <h5>Point of sale</h5> > <ul> > <li><a href="/cgi-bin/koha/pos/register.pl">Register details</a></li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >index f596091ba1..03e881886d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >@@ -27,9 +27,11 @@ > </div> > [% ELSE %] > >+ [% IF ( CAN_user_cash_management_cashup ) %] > <div id="toolbar" class="btn-toolbar"> > <button type="button" class="btn btn-default" data-toggle="modal" data-target="#confirmCashupModal" ><i class="fa fa-money"></i> Record cashup</button> > </div> >+ [% END %] > > <h1>Register transaction details for [% register.name | html %]</h1> > >diff --git a/pos/register.pl b/pos/register.pl >index 6e2e73b75e..31c5fe6180 100755 >--- a/pos/register.pl >+++ b/pos/register.pl >@@ -34,7 +34,7 @@ my ( $template, $loggedinuser, $cookie, $user_flags ) = get_template_and_user( > query => $input, > type => 'intranet', > authnotrequired => 0, >- flagsrequired => { cash_management => 'cashup' }, >+ flagsrequired => { cash_management => [ 'cashup', 'anonymous_refund' ] }, > } > ); > my $logged_in_user = Koha::Patrons->find($loggedinuser) or die "Not logged in"; >-- >2.25.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24082
:
97042
|
97826
|
97827
|
97828
|
98849
|
98850
|
98851
|
98854
|
98855
|
98856
|
99983
|
99984
|
99985
|
99991
|
99992
|
99993
|
99995
|
99996
|
99997
|
100031
|
100032
|
100033
| 100070 |
100071
|
100072
|
100073