Bug 28805 - Add on-site option to batch checkout functionality
Summary: Add on-site option to batch checkout functionality
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fabricio Molina
QA Contact: Nick Clemens (kidclamp)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-03 13:16 UTC by Katrin Fischer
Modified: 2023-11-30 13:35 UTC (History)
10 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00


Attachments
Bug 28805: Add on-site checkout checkbox in batch checkout. (2.57 KB, patch)
2023-07-03 19:35 UTC, Fabricio Molina
Details | Diff | Splinter Review
Bug 28805: Add on-site checkout checkbox in batch checkout (5.09 KB, patch)
2023-07-06 19:21 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 28805: Add on-site checkout checkbox in batch checkout (5.13 KB, patch)
2023-07-07 14:51 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 28805: Add on-site checkout checkbox in batch checkout (4.60 KB, patch)
2023-08-10 15:08 UTC, Fabricio Molina
Details | Diff | Splinter Review
Bug 28805: Add on-site checkout checkbox in batch checkout (4.64 KB, patch)
2023-09-25 18:53 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 28805: (QA follow-up) Restore removed asset (953 bytes, patch)
2023-09-25 18:53 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 28805: (QA follow-up) Pass onsite variable to confirmation screen (1.79 KB, patch)
2023-09-25 18:53 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 28805: (follow-up) Fix template logic error (1.78 KB, patch)
2023-10-30 20:54 UTC, Fabricio Molina
Details | Diff | Splinter Review
Bug 28805: (follow-up) Fix template logic error (1.84 KB, patch)
2023-11-02 18:12 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 28805: (follow-up) Fix non-printable char that breaks tests (1.06 KB, patch)
2023-11-04 13:47 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2021-08-03 13:16:13 UTC
The batch checkout is very useful, but currently doesn't support all advanced options of the normal search page.

It's missing the "on-site checkout" functionality.
Comment 1 Katrin Fischer 2023-07-01 12:47:26 UTC
Hi Fabricio, any progress on this?
Comment 2 Fabricio Molina 2023-07-01 14:25:45 UTC
Hi Katrin

I'm pleased to inform you that the development is almost complete. I just need to finish linking the OnSiteCheckoutAutoCheck preference to make the development more comprehensive. It will be finished this week.

Best regards.

Fabricio.
Comment 3 Katrin Fischer 2023-07-01 14:35:25 UTC
Thanks for the update!
Comment 4 Fabricio Molina 2023-07-03 19:35:07 UTC
Created attachment 152992 [details] [review]
Bug 28805: Add on-site checkout checkbox in batch checkout.

Add the 'on-site checkout' checkbox to the 'Batch checkout'. To verify the functionality, follow these steps:

  1) Before the modification is added, enable the 'OnSiteCheckouts' and 'BatchCheckout' system preferences.
  2) In the 'BatchCheckoutsValidCategories' preference, select all categories.
  3) Find a user in the system. For example, Henry Acevedo.
  4) In the 'Check out' section, you can see that the 'Checkout settings' option displays the 'On-site Checkout' checkbox when clicked.
  5) Check the 'On-site checkout' option. This will display the current date with a runtime deadline of 23:59.
  6) Enter a barcode (for example 39999000011418).
  7) Click the 'Check out' button. This will show that the loan was made on-site.
  8) Check the 'Batch checkout' section. This section does not hace the 'On-site checkout' checkbox.

When loading the patch with the addition of the 'on-site checkout' checkbox in 'Batch checkout' starting from step 3), you can already find the checkbox in the 'Batch checkout' section. To use it, you can try the barcodes 39999000006179 and 39999000008494 together. Then continue from step 5).

When viewing the loans, you will see that both items (39999000006179 and 39999000008494) will appear with the label 'On-site checkout'.

If this patch is deactivated, the functionality will remain the same as it was before this change.

Sponsored-by: Banco Central de la República Argentina.
Comment 5 Tomás Cohen Arazi 2023-07-06 19:21:15 UTC
Created attachment 153105 [details] [review]
Bug 28805: Add on-site checkout checkbox in batch checkout

Add the 'on-site checkout' checkbox to the 'Batch checkout'. To verify the functionality, follow these steps:

  1) Before the modification is added, enable the 'OnSiteCheckouts' and 'BatchCheckout' system preferences.
  2) In the 'BatchCheckoutsValidCategories' preference, select all categories.
  3) Find a user in the system. For example, Henry Acevedo.
  4) In the 'Check out' section, you can see that the 'Checkout settings' option displays the 'On-site Checkout' checkbox when clicked.
  5) Check the 'On-site checkout' option. This will display the current date with a runtime deadline of 23:59.
  6) Enter a barcode (for example 39999000011418).
  7) Click the 'Check out' button. This will show that the loan was made on-site.
  8) Check the 'Batch checkout' section. This section does not hace the 'On-site checkout' checkbox.

When loading the patch with the addition of the 'on-site checkout' checkbox in 'Batch checkout' starting from step 3), you can already find the checkbox in the 'Batch checkout' section. To use it, you can try the barcodes 39999000006179 and 39999000008494 together. Then continue from step 5).

When viewing the loans, you will see that both items (39999000006179 and 39999000008494) will appear with the label 'On-site checkout'.

If this patch is deactivated, the functionality will remain the same as it was before this change.

Sponsored-by: Banco Central de la República Argentina
Comment 6 Fabricio Molina 2023-07-06 19:36:01 UTC
Hello Sam. Thank you very much for taking the time to make the correction. I apologize for the mistake made in the previously uploaded patch. Tomás helped me fix it. Could you please review it again?. Thanks!
Comment 7 Sam Lau 2023-07-07 14:51:14 UTC
Created attachment 153185 [details] [review]
Bug 28805: Add on-site checkout checkbox in batch checkout

Add the 'on-site checkout' checkbox to the 'Batch checkout'. To verify the functionality, follow these steps:

  1) Before the modification is added, enable the 'OnSiteCheckouts' and 'BatchCheckout' system preferences.
  2) In the 'BatchCheckoutsValidCategories' preference, select all categories.
  3) Find a user in the system. For example, Henry Acevedo.
  4) In the 'Check out' section, you can see that the 'Checkout settings' option displays the 'On-site Checkout' checkbox when clicked.
  5) Check the 'On-site checkout' option. This will display the current date with a runtime deadline of 23:59.
  6) Enter a barcode (for example 39999000011418).
  7) Click the 'Check out' button. This will show that the loan was made on-site.
  8) Check the 'Batch checkout' section. This section does not hace the 'On-site checkout' checkbox.

When loading the patch with the addition of the 'on-site checkout' checkbox in 'Batch checkout' starting from step 3), you can already find the checkbox in the 'Batch checkout' section. To use it, you can try the barcodes 39999000006179 and 39999000008494 together. Then continue from step 5).

When viewing the loans, you will see that both items (39999000006179 and 39999000008494) will appear with the label 'On-site checkout'.

If this patch is deactivated, the functionality will remain the same as it was before this change.

Sponsored-by: Banco Central de la República Argentina
Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 8 Sam Lau 2023-07-07 14:52:28 UTC
(In reply to Fabricio Molina from comment #6)
> Hello Sam. Thank you very much for taking the time to make the correction. I
> apologize for the mistake made in the previously uploaded patch. Tomás
> helped me fix it. Could you please review it again?. Thanks!

Fabricio, no need to apologize! The bug is now signed off :)
Comment 9 Jonathan Druart 2023-07-27 13:55:41 UTC
1. If you turn off SpecifyDueDate, the checkbox is no longer displayed

2. Do you really need that?
+    [% Asset.js("js/members-menu.js") | $raw %]
+    [% Asset.js("js/pages/circulation.js") | $raw %]
Comment 10 Katrin Fischer 2023-07-30 21:00:52 UTC
Comment on attachment 153185 [details] [review]
Bug 28805: Add on-site checkout checkbox in batch checkout

Review of attachment 153185 [details] [review]:
-----------------------------------------------------------------

Hi Fabricio, 

thanks for working on this!

Joubu already made 2 good points, I have a bit of an explanation and one more:

::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt
@@ +99,4 @@
>            </li>
>          </ol>
>        </fieldset>
> +    [% IF Koha.Preference('SpecifyDueDate') && Koha.Preference('OnSiteCheckouts') %]

To explain a bit more what Jonathan said: the specify due date feature and the onsite-checkout only partially depend on each other. So this should probably be split into separate conditions or be ||.

* If you have both, you are able to change the pre-selected due date for the on-site checkout.
* If you have only OnSiteCheckouts, the date is automatically set to today 23:59:00 in the background.
* Only SpecifyDueDate works like now.

You can compare how it should work with the same options on the checkouts tab.

@@ +104,5 @@
> +            <legend>Due date:</legend>
> +            <label for="duedatespec">Hard due date: [% INCLUDE 'date-format.inc' %]:</label>
> +            <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true"/>
> +            <div id="onsite_checkout-select" class="circ-setting">
> +                <div class="circ-setting">

You double-up the circ-setting classes here in 2 different div - this makes the font size smaller than for the other options. Maybe one or both should be removed.
Comment 11 Fabricio Molina 2023-08-10 15:08:01 UTC
Created attachment 154346 [details] [review]
Bug 28805: Add on-site checkout checkbox in batch checkout

Add the 'on-site checkout' checkbox to the 'Batch checkout'. To verify the functionality, follow these steps:

  1) Before the modification is added, enable the 'OnSiteCheckouts' and 'BatchCheckout' system preferences.
  2) In the 'BatchCheckoutsValidCategories' preference, select all categories.
  3) Find a user in the system. For example, Henry Acevedo.
  4) In the 'Check out' section, you can see that the 'Checkout settings' option displays the 'On-site Checkout' checkbox when clicked.
  5) Check the 'On-site checkout' option. This will display the current date with a runtime deadline of 23:59.
  6) Enter a barcode (for example 39999000011418).
  7) Click the 'Check out' button. This will show that the loan was made on-site.
  8) Check the 'Batch checkout' section. This section does not hace the 'On-site checkout' checkbox.

When loading the patch with the addition of the 'on-site checkout' checkbox in 'Batch checkout' starting from step 3), you can already find the checkbox in the 'Batch checkout' section. To use it, you can try the barcodes 39999000006179 and 39999000008494 together. Then continue from step 5).

When viewing the loans, you will see that both items (39999000006179 and 39999000008494) will appear with the label 'On-site checkout'.

If this patch is deactivated, the functionality will remain the same as it was before this change.

Sponsored-by: Banco Central de la República Argentina
Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 12 Fabricio Molina 2023-08-10 15:19:19 UTC
Hi

Thanks for your feedback and suggestions.

In this fix, the "OnSiteCheckouts" preference can be used without depending on the "SpecifyDueData" preference. Regarding the functionality of being able to modify the preselected due date, I used the same behavior that on-site checkout has for individual loans (the preselected date can also be modified there).

I look forward to any feedback.
Comment 13 Nick Clemens (kidclamp) 2023-09-25 18:53:00 UTC
Created attachment 156182 [details] [review]
Bug 28805: Add on-site checkout checkbox in batch checkout

Add the 'on-site checkout' checkbox to the 'Batch checkout'. To verify the functionality, follow these steps:

  1) Before the modification is added, enable the 'OnSiteCheckouts' and 'BatchCheckout' system preferences.
  2) In the 'BatchCheckoutsValidCategories' preference, select all categories.
  3) Find a user in the system. For example, Henry Acevedo.
  4) In the 'Check out' section, you can see that the 'Checkout settings' option displays the 'On-site Checkout' checkbox when clicked.
  5) Check the 'On-site checkout' option. This will display the current date with a runtime deadline of 23:59.
  6) Enter a barcode (for example 39999000011418).
  7) Click the 'Check out' button. This will show that the loan was made on-site.
  8) Check the 'Batch checkout' section. This section does not hace the 'On-site checkout' checkbox.

When loading the patch with the addition of the 'on-site checkout' checkbox in 'Batch checkout' starting from step 3), you can already find the checkbox in the 'Batch checkout' section. To use it, you can try the barcodes 39999000006179 and 39999000008494 together. Then continue from step 5).

When viewing the loans, you will see that both items (39999000006179 and 39999000008494) will appear with the label 'On-site checkout'.

If this patch is deactivated, the functionality will remain the same as it was before this change.

Sponsored-by: Banco Central de la República Argentina
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 14 Nick Clemens (kidclamp) 2023-09-25 18:53:03 UTC
Created attachment 156183 [details] [review]
Bug 28805: (QA follow-up) Restore removed asset

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 15 Nick Clemens (kidclamp) 2023-09-25 18:53:05 UTC
Created attachment 156184 [details] [review]
Bug 28805: (QA follow-up) Pass onsite variable to confirmation screen

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 16 Nick Clemens (kidclamp) 2023-09-25 18:55:11 UTC
I still got a warning about tidiness, however, the lines I added are tidied and nothing around them is not
Comment 17 Jonathan Druart 2023-09-26 09:44:27 UTC
If SpecifyDueDate and OnSiteCheckouts are both disabled, you see "Due date" at the bottom of the screen.
Comment 18 Fabricio Molina 2023-10-30 20:54:17 UTC
Created attachment 158108 [details] [review]
Bug 28805: (follow-up) Fix template logic error

This patch fixes a problem in the template logic that made the 'Due
date' legend display when `OnSiteCheckouts` and `SpecifyDueDate` are not
set, as highlighted by QA.

Sponsored-by: Banco Central de la República Argentina
Comment 19 Fabricio Molina 2023-10-30 21:07:02 UTC
(In reply to Jonathan Druart from comment #17)
> If SpecifyDueDate and OnSiteCheckouts are both disabled, you see "Due date"
> at the bottom of the screen.

Sorry for the delay. The last patch fixes the issue.
Comment 20 Nick Clemens (kidclamp) 2023-11-02 18:12:20 UTC
Created attachment 158279 [details] [review]
Bug 28805: (follow-up) Fix template logic error

This patch fixes a problem in the template logic that made the 'Due
date' legend display when `OnSiteCheckouts` and `SpecifyDueDate` are not
set, as highlighted by QA.

Sponsored-by: Banco Central de la República Argentina
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 21 Nick Clemens (kidclamp) 2023-11-02 18:13:09 UTC
QA tool is not happy, but the template pattern works and is used elsewhere - I had to tidy the entire issuing block to remove the tidy error, did not seem worth it
Comment 22 Tomás Cohen Arazi 2023-11-03 15:05:46 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 23 Katrin Fischer 2023-11-04 13:40:43 UTC
It looks like this makes the tests failing:

prove -v xt/author/valid-templates.t

#   Failed test '/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt'
#   at xt/author/valid-templates.t line 141.
# file error - parse error - /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt line 103: unexpected token ( Koha.Preference('OnSiteCheckouts'))
#   [% IF Koha.Preference('SpecifyDueDate') || Koha.Preference('OnSiteCheckouts') %]
# Looks like you failed 1 test of 822.
Comment 24 Katrin Fischer 2023-11-04 13:47:18 UTC
Created attachment 158386 [details] [review]
Bug 28805: (follow-up) Fix non-printable char that breaks tests
Comment 25 David Cook 2023-11-06 05:55:19 UTC
(In reply to Katrin Fischer from comment #24)
> Created attachment 158386 [details] [review] [review]
> Bug 28805: (follow-up) Fix non-printable char that breaks tests

Nice job! I don't know how you spotted that C2A0 no-break space, but that was masterful 👍
Comment 26 Katrin Fischer 2023-11-06 07:12:24 UTC
(In reply to David Cook from comment #25)
> (In reply to Katrin Fischer from comment #24)
> > Created attachment 158386 [details] [review] [review] [review]
> > Bug 28805: (follow-up) Fix non-printable char that breaks tests
> 
> Nice job! I don't know how you spotted that C2A0 no-break space, but that
> was masterful 👍

Thanks David :) It took a bit to figure that one out. As there was no obvious issue with the template logic, I looked at the patches here in bugzilla again and it showed in the browser. Guess more lucky than masterful ;)
Comment 27 Jonathan Druart 2023-11-06 14:17:14 UTC
I have the following in my .vimrc

set list listchars=tab:>-,trail:.,extends:>,nbsp:· 

And (9e675d2ac43 is right before the last patch has been pushed):
% git show 9e675d2ac43:koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt|vim - 

Shows me the non-printable char:
103       [% IF Koha.Preference('SpecifyDueDate') ||·Koha.Preference('OnSiteCheckouts') %]
Comment 28 Fridolin Somers 2023-11-10 02:25:49 UTC
Enhancement not pushed to 23.05.x