Bugzilla – Attachment 111759 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 point of sale to use session register
Bug-24786-Update-point-of-sale-to-use-session-regi.patch (text/plain), 5.28 KB, created by
Martin Renvoize (ashimema)
on 2020-10-15 16:04:39 UTC
(
hide
)
Description:
Bug 24786: Update point of sale to use session register
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-10-15 16:04:39 UTC
Size:
5.28 KB
patch
obsolete
>From 9a7a371e16245ff1f9b66db3ee6e8cec4c223f1d Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 21 Jul 2020 13:08:18 +0100 >Subject: [PATCH] Bug 24786: Update point of sale 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 sale. > >Test plan >1/ Enable cash registers via the 'UseCashRegisters' system preference >2/ Enable point of sale via the 'EnablePointOfSale' system preference >3/ Navigate to the point of sale page >4/ Note that if you are logged in at a branch with no cash registers yet >defined, then an alert should appear >5/ Note that when you are logged in at a branch with cash regsiters >defined, but without a cash register associated with your session then >the cash 'Cash register' select box is populated with '-- None --' and >you are required to select a register prior to submission >6/ Note that upon selection, the '-- None --' option is disabled >7/ Note that when you have a register associated with your session then >the 'Cash register' select box is pre-populated with that register. >8/ Signoff > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >--- > .../prog/en/includes/html_helpers.inc | 2 +- > .../intranet-tmpl/prog/en/modules/pos/pay.tt | 13 +++++------ > pos/pay.pl | 22 ------------------- > 3 files changed, 6 insertions(+), 31 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >index d8d7e12fcd..19f89bb810 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -25,7 +25,7 @@ > > [% BLOCK options_for_registers %] > <!-- <option hidden disabled selected value> -- select an option -- </option> --> >- <option id="noregister" value="">-- None --</option> >+ <option id="noregister"[% IF register_required %] disabled selected [% END %] value="">-- None --</option> > [% FOREACH r IN registers %] > [% IF r.branch == branch %] > [% IF r.selected %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >index 3977ca09d7..08b79318e4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >@@ -1,11 +1,14 @@ > [% USE raw %] > [% USE Asset %] >+[% USE Branches %] > [% USE Koha %] > [% USE Price %] > [% USE TablesSettings %] >+[% USE Registers %] > [% SET footerjs = 1 %] > [% PROCESS 'payments.inc' %] > [% INCLUDE 'doc-head-open.inc' %] >+[% SET registers = Registers.all( filters => { current_branch => 1 } ) %] > <title>Koha › Payments</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >@@ -20,7 +23,7 @@ > <div class="row"> > <div class="col-sm-10 col-sm-push-2"> > >- [% IF ( error_registers ) %] >+ [% IF ( registers.size == 0 ) %] > <div id="error_message" class="dialog message"> > <p> > You must have at least one cash register associated with the library before you can record payments. >@@ -126,13 +129,7 @@ > <li> > <label for="registerid">Cash register: </label> > <select name="registerid" id="registerid"> >- [% FOREACH register IN registers %] >- [% IF register.id == default_register %] >- <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> > </ol> >diff --git a/pos/pay.pl b/pos/pay.pl >index 5cc4279992..6fd7fcef30 100755 >--- a/pos/pay.pl >+++ b/pos/pay.pl >@@ -32,28 +32,6 @@ my $logged_in_user = Koha::Patrons->find($loggedinuser) or die "Not logged in"; > > my $library_id = C4::Context->userenv->{'branch'}; > my $registerid = $input->param('registerid'); >-my $default_registerid = $input->param('default_register'); >-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 ( !$default_registerid ) { >- my $default_register = Koha::Cash::Registers->find( >- { branch => $library_id, branch_default => 1 } ); >- $default_registerid = >- $default_register ? $default_register->id : $registers->next->id; >- } >- >- $template->param( >- default_register => $default_registerid, >- registers => $registers, >- ); >-} > > my $invoice_types = > Koha::Account::DebitTypes->search_with_library_limits( { can_be_sold => 1 }, >-- >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