Bug 28730 - Add option to format AH field (due date) in SIP checkout response
Summary: Add option to format AH field (due date) in SIP checkout response
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 31552
  Show dependency treegraph
 
Reported: 2021-07-21 13:59 UTC by Nick Clemens
Modified: 2022-09-12 17:55 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00


Attachments
Bug 28730: Add option to format AH field (due date) in SIP checkout response (3.71 KB, patch)
2021-07-21 14:06 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28730: Add option to format AH field (due date) in SIP checkout response (3.78 KB, patch)
2021-08-24 13:37 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 28730: Add option to format AH field (due date) in SIP checkout response (3.85 KB, patch)
2021-09-22 15:58 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28730: (QA follow-up) Add new option to example configs (1.79 KB, patch)
2021-09-22 15:58 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-07-21 13:59:32 UTC
According to SIP2 spec on due date/AH:
This date field is not necessarily formatted with the ANSI standard X3.30 for date and X3.43 for time. Since it is a variable-length field the ACS can send this date field in any format it wishes.

Some machines pass this directly to the checkout receipt, we should be able to format as a due date
Comment 1 Nick Clemens 2021-07-21 14:06:55 UTC
Created attachment 123012 [details] [review]
Bug 28730: Add option to format AH field (due date) in SIP checkout response

This patch adds a new option to sip accounts:
format_due_date

If set to 1 the AH field in checkouts will follow the dateFormat system preference and format as due dates (ignoring time portion if 23:59:59 or 11:59:59)

To test:
 1 - checkout an item via SIP:
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -t CR --item 3999900000001 --patron enda -m checkout
 2 - Note the AH field is like "YYYYMMDD    HHMMSS"
 3 - Apply patch
 4 - repeat SIP checkout - nothing has changed
 5 - edit SIPConfig.xml and add format_due_date="1" to 'term1' account:
    <login id="term1"  password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii"     checked_in_ok="1" format_due_date="1"/>
 6 - restart all
 7 - repeat the SIP checkout
 8 - AH field now matches dateFormat system preference
 9 - Change your dateFormat preference
10 - repeat the SIP checkout
11 - AH matches new format

Note: If you cannot renew and don't get an AH just check the item back in:
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -t CR --item 3999900000001 --patron enda -m checkin
Comment 2 Andrew Fuerste-Henry 2021-08-24 13:37:33 UTC
Created attachment 124062 [details] [review]
Bug 28730: Add option to format AH field (due date) in SIP checkout response

This patch adds a new option to sip accounts:
format_due_date

If set to 1 the AH field in checkouts will follow the dateFormat system preference and format as due dates (ignoring time portion if 23:59:59 or 11:59:59)

To test:
 1 - checkout an item via SIP:
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -t CR --item 3999900000001 --patron enda -m checkout
 2 - Note the AH field is like "YYYYMMDD    HHMMSS"
 3 - Apply patch
 4 - repeat SIP checkout - nothing has changed
 5 - edit SIPConfig.xml and add format_due_date="1" to 'term1' account:
    <login id="term1"  password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii"     checked_in_ok="1" format_due_date="1"/>
 6 - restart all
 7 - repeat the SIP checkout
 8 - AH field now matches dateFormat system preference
 9 - Change your dateFormat preference
10 - repeat the SIP checkout
11 - AH matches new format

Note: If you cannot renew and don't get an AH just check the item back in:
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -t CR --item 3999900000001 --patron enda -m checkin

Signed-off-by: Winfred Thompkins <Winfred.thompkins@cedarhilltx.com>
Comment 3 Martin Renvoize 2021-09-22 15:58:18 UTC
Created attachment 125155 [details] [review]
Bug 28730: Add option to format AH field (due date) in SIP checkout response

This patch adds a new option to sip accounts:
format_due_date

If set to 1 the AH field in checkouts will follow the dateFormat system preference and format as due dates (ignoring time portion if 23:59:59 or 11:59:59)

To test:
 1 - checkout an item via SIP:
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -t CR --item 3999900000001 --patron enda -m checkout
 2 - Note the AH field is like "YYYYMMDD    HHMMSS"
 3 - Apply patch
 4 - repeat SIP checkout - nothing has changed
 5 - edit SIPConfig.xml and add format_due_date="1" to 'term1' account:
    <login id="term1"  password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii"     checked_in_ok="1" format_due_date="1"/>
 6 - restart all
 7 - repeat the SIP checkout
 8 - AH field now matches dateFormat system preference
 9 - Change your dateFormat preference
10 - repeat the SIP checkout
11 - AH matches new format

Note: If you cannot renew and don't get an AH just check the item back in:
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -t CR --item 3999900000001 --patron enda -m checkin

Signed-off-by: Winfred Thompkins <Winfred.thompkins@cedarhilltx.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2021-09-22 15:58:21 UTC
Created attachment 125156 [details] [review]
Bug 28730: (QA follow-up) Add new option to example configs
Comment 5 Martin Renvoize 2021-09-22 15:59:14 UTC
Works as expected, no regressions.. I added a follow-up to add the config option to the example configs (disabled by default).

Passing QA
Comment 6 Jonathan Druart 2021-10-07 09:20:37 UTC
Pushed to master for 21.11, thanks to everybody involved!