Bugzilla – Attachment 102913 Details for
Bug 25139
POS explodes in error when trying to display older transactions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25139: Corrections to date picker handling
Bug-25139-Corrections-to-date-picker-handling.patch (text/plain), 3.23 KB, created by
Martin Renvoize (ashimema)
on 2020-04-14 09:19:48 UTC
(
hide
)
Description:
Bug 25139: Corrections to date picker handling
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-04-14 09:19:48 UTC
Size:
3.23 KB
patch
obsolete
>From 03efccab361c2cd59dfeea4766ffeb940e133fbe Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 14 Apr 2020 10:16:58 +0100 >Subject: [PATCH] Bug 25139: Corrections to date picker handling > >It would appear one has to format the dates in the controller rather >than in the template for input fields.. I wasn't aware of this caveat >until now. > >Test plan >1/ Prior to applying patch attempt to look at previous transactions >ensuring you enter a 'to' date. >2/ Note a catastrophic failure >3/ Apply patch >4/ Look at the same date range and note you no longer get a failure but >are instead faced with the requested transactions. >5/ Signoff >--- > koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt | 4 ++-- > pos/register.pl | 7 ++++--- > 2 files changed, 6 insertions(+), 5 deletions(-) > >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 88e5f111f5..2d4bd818e2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >@@ -126,9 +126,9 @@ > <ol> > <li> > <label for="trange_f">From: </label> >- <input type="text" size="10" id="from" name="trange_f" value="[% trange_f | html %]"/> >+ <input type="text" size="10" id="from" class="datepickerfrom" name="trange_f" value="[% trange_f | html %]"/> > <label class="inline" for="trange_t">To: </label> >- <input size="10" id="to" name="trange_t" value="[% trange_t | $KohaDates with_hours => 0%]" type="text"/> >+ <input type="text" size="10" id="to" class="datepickerto" name="trange_t" value="[% trange_t | html %]" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> > </li> > </ol> >diff --git a/pos/register.pl b/pos/register.pl >index bb0b601683..ada83c470f 100755 >--- a/pos/register.pl >+++ b/pos/register.pl >@@ -78,13 +78,12 @@ else { > $input->param('trange_t') ? $input->param('trange_t') > : $last_cashup ? $last_cashup->timestamp > : ''; >- $template->param( trange_t => $transactions_range_to ); >+ my $end = dt_from_string($transactions_range_to); >+ > if ($transactions_range_from) { >- $template->param( trange_f => $transactions_range_from ); > > my $dtf = $schema->storage->datetime_parser; > my $start = dt_from_string($transactions_range_from); >- my $end = dt_from_string($transactions_range_to); > my $past_accountlines = Koha::Account::Lines->search( > { > register_id => $registerid, >@@ -97,7 +96,9 @@ else { > } > ); > $template->param( past_accountlines => $past_accountlines ); >+ $template->param( trange_f => output_pref({dt => $start, dateonly => 1})); > } >+ $template->param( trange_t => output_pref({dt => $end, dateonly => 1})); > > my $op = $input->param('op') // ''; > if ( $op eq 'cashup' ) { >-- >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 25139
:
102913
|
102924
|
102949