Bugzilla – Attachment 111130 Details for
Bug 24786
Allow setting a cash register for a login session and configuring library-default cash registers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24786: Update borroaccount to use session register
Bug-24786-Update-borroaccount-to-use-session-regis.patch (text/plain), 5.80 KB, created by
Martin Renvoize (ashimema)
on 2020-10-02 11:28:38 UTC
(
hide
)
Description:
Bug 24786: Update borroaccount to use session register
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-10-02 11:28:38 UTC
Size:
5.80 KB
patch
obsolete
>From 62e732b9f20684128ef8b1e10730648029de4b34 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 21 Jul 2020 10:52:49 +0100 >Subject: [PATCH] Bug 24786: Update borroaccount to use session register > >This patch adds handling to allow for the use of the session cash >register by default if it has been set, otherwise it defaults to '-- >None --' and requires the end user to select the register to proceed >with the refund or payout action. >--- > .../prog/en/modules/members/boraccount.tt | 28 +++++++++---------- > members/boraccount.pl | 27 +----------------- > 2 files changed, 15 insertions(+), 40 deletions(-) > >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 a6a8cdc485..c27f3b506f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -7,7 +7,9 @@ > [% USE AuthorisedValues %] > [% USE Price %] > [% USE Branches %] >+[% USE Registers %] > [% SET footerjs = 1 %] >+[% SET registers = Registers.all( filters => { current_branch => 1 } ) %] > > [% PROCESS 'accounts.inc' %] > >@@ -143,6 +145,11 @@ > <h4 class="modal-title" id="issuePayoutLabel">Issue payout</h4> > </div> > <div class="modal-body"> >+ [% IF Koha.Preference('UseCashRegisters') && ( registers.size == 0 ) %] >+ <div id="payout_error" class="dialog alert"> >+ You must have at least one cash register associated with this branch before you can record cash payouts. >+ </div> >+ [% END %] > <fieldset class="rows"> > <ol> > <li> >@@ -172,13 +179,7 @@ > <li> > <label for="registerid">Cash register: </label> > <select name="registerid" id="payout_registerid"> >- [% FOREACH register IN registers %] >- [% IF register.id == registerid %] >- <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option> >- [% ELSE %] >- <option value="[% register.id | html %]">[% register.name | html %]</option> >- [% END %] >- [% END %] >+ [% PROCESS options_for_registers register_required => 1 %] > </select> > </li> > [% END %] >@@ -209,6 +210,11 @@ > <h4 class="modal-title" id="issueRefundLabel">Issue refund</h4> > </div> > <div class="modal-body"> >+ [% IF Koha.Preference('UseCashRegisters') && ( registers.size == 0 ) %] >+ <div id="refund_error" class="dialog alert"> >+ You must have at least one cash register associated with this branch before you can record cash refunds. >+ </div> >+ [% END %] > <fieldset class="rows"> > <ol> > <li> >@@ -239,13 +245,7 @@ > <li> > <label for="registerid">Cash register: </label> > <select name="registerid" id="refund_registerid"> >- [% FOREACH register IN registers %] >- [% IF register.id == registerid %] >- <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option> >- [% ELSE %] >- <option value="[% register.id | html %]">[% register.name | html %]</option> >- [% END %] >- [% END %] >+ [% PROCESS options_for_registers register_required => 1 %] > </select> > </li> > [% END %] >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 71546a7efc..320b2c8814 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -66,32 +66,7 @@ unless ( $patron ) { > > output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); > >-my $registerid; >-if ( C4::Context->preference('UseCashRegisters') ) { >- $registerid = scalar $input->param('registerid'); >- my $registers = Koha::Cash::Registers->search( >- { branch => $library_id, archived => 0 }, >- { order_by => { '-asc' => 'name' } } >- ); >- >- if ( !$registers->count ) { >- $template->param( error_registers => 1 ); >- } >- else { >- >- if ( !$registerid ) { >- my $default_register = Koha::Cash::Registers->find( >- { branch => $library_id, branch_default => 1 } ); >- $registerid = $default_register->id if $default_register; >- } >- $registerid = $registers->next->id if !$registerid; >- >- $template->param( >- registerid => $registerid, >- registers => $registers, >- ); >- } >-} >+my $registerid = $input->param('registerid'); > > if ( $action eq 'void' ) { > my $payment_id = scalar $input->param('accountlines_id'); >-- >2.20.1
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 24786
:
107145
|
107146
|
107147
|
107148
|
107149
|
107739
|
107740
|
107741
|
107742
|
107743
|
107754
|
107755
|
107756
|
107757
|
107758
|
107759
|
107957
|
107958
|
107959
|
107960
|
107961
|
107962
|
108060
|
108061
|
108062
|
108063
|
108064
|
108065
|
108066
|
108510
|
108511
|
108512
|
108513
|
108514
|
108515
|
108516
|
110162
|
110163
|
110164
|
110165
|
110166
|
110167
|
110168
|
110187
|
110188
|
110189
|
110190
|
110191
|
110192
|
110193
|
111066
|
111067
|
111068
|
111069
|
111070
|
111071
|
111072
|
111074
|
111126
|
111127
|
111128
|
111129
|
111130
|
111131
|
111132
|
111133
|
111220
|
111221
|
111222
|
111223
|
111224
|
111225
|
111226
|
111227
|
111228
|
111229
|
111230
|
111231
|
111232
|
111233
|
111234
|
111235
|
111611
|
111612
|
111613
|
111614
|
111615
|
111616
|
111617
|
111618
|
111619
|
111620
|
111623
|
111725
|
111757
|
111758
|
111759
|
111760
|
111761
|
111762
|
111763
|
111764
|
111765
|
111766
|
111767
|
111768
|
111769
|
111770
|
111776
|
111777
|
111778
|
111779
|
111780
|
111781
|
111782
|
111783
|
111784
|
111785
|
111786
|
111787
|
111788
|
112985
|
112988
|
112989
|
113226
|
113227
|
113241
|
113251
|
113253
|
113256
|
113257
|
113260