Bug 25139

Summary: POS explodes in error when trying to display older transactions
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: Fines and feesAssignee: Martin Renvoize <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: critical    
Priority: P5 - low CC: 1joynelson
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24820
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Bug Depends on:    
Bug Blocks: 13985    
Attachments: Bug 25139: Corrections to date picker handling
Bug 25139: Corrections to date picker handling
Bug 25139: Corrections to date picker handling

Description Katrin Fischer 2020-04-13 21:09:17 UTC
When trying to display older transactions in the POS module, there is an error:

Template process failed: undef error - The given date (12.04.2020) does not match the date format (iso) at /home/vagrant/kohaclone/Koha/DateUtils.pm line 168.
 at /home/vagrant/kohaclone/C4/Templates.pm line 122

URL: http://localhost:8081/cgi-bin/koha/pos/register.pl?trange_f=07.04.2020&trange_t=12.04.2020&registerid=1

It looks like the dateformat is not handled correctly here.

Dateformat is set to DD.MM.YYYY
Comment 1 Martin Renvoize 2020-04-14 09:19:48 UTC
Created attachment 102913 [details] [review]
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
Comment 2 David Nind 2020-04-14 11:29:47 UTC
Created attachment 102924 [details] [review]
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
0/ Enable cash register and POS system, add a register, items and
some transactions.
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

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2020-04-14 21:29:13 UTC
Created attachment 102949 [details] [review]
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

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Martin Renvoize 2020-04-15 07:36:01 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 5 Joy Nelson 2020-05-05 22:28:20 UTC
does not apply to 19.11.x - not backported