[% USE KohaDates %] [% USE Koha %] [% USE ItemTypes %] [% USE Branches %] [% USE AuthorisedValues %] [% USE Asset %] [% USE raw %] [% USE To %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Curbside pickups › Circulation › Koha [% INCLUDE 'doc-head-close.inc' %] [% SET today_iso = date.format(date.now, format = '%Y-%m-%d') %] [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] [% WRAPPER 'sub-header.inc' %] [% WRAPPER breadcrumbs %] [% WRAPPER breadcrumb_item %] Circulation [% END %] [% WRAPPER breadcrumb_item bc_active = 1 %] Curbside pickups [% END %] [% END #/ WRAPPER breadcrumbs %] [% END #/ WRAPPER sub-header.inc %] [% BLOCK waiting_holds %] [% SET waiting_holds = cp.patron.holds.search( found => 'W', branchcode => Branches.GetLoggedInBranchcode ) %] [% FOREACH h IN waiting_holds %] [% h.biblio.title | html %] ([% h.biblio.author | html %], [% h.item.barcode | html %])
[% END %] [% END %] [% BLOCK patron_info %] [% cp.patron.firstname | html %] [% cp.patron.surname | html %] ([% cp.patron.cardnumber | html %]) [% IF cp.notes %]
Notes: [% cp.notes | html %] [% END %] [% IF cp.patron.debarred %]
Patron's account is restricted [% END %] [% IF cp.patron.has_overdues %]
Patron has items overdue [% END %] [% END %]
[% IF Koha.Preference('CircSidebar') %]
[% ELSE %]
[% END %]

Curbside pickups

[% UNLESS policy.enabled %]
Curbside pickups are not enabled for your library.
[% INCLUDE 'intranet-bottom.inc' %] [% STOP %] [% END %] [% FOR m IN messages %]
[% SWITCH m.code %] [% CASE 'not_enabled' %] The curbside pickup feature is not enabled for this library. [% CASE 'library_is_closed' %] Cannot create a curbside pickup for this day, it is a holiday. [% CASE 'no_waiting_holds' %] This patron does not have waiting holds. [% CASE 'too_many_pickups' %] This patron already has a scheduled pickup for this library. [% CASE 'no_matching_slots' %] Wrong slot selected. [% CASE 'no_more_pickups_available' %] There are no more pickups available for this slot. Please choose another one. [% CASE 'cannot_checkout' %] Unable to check the items out to [% INCLUDE 'patron-title.inc' patron=m.patron %] [% CASE %] [% m.code | html %] [% END %]
[% END %]

[% SET to_be_staged = curbside_pickups.filter_by_to_be_staged %] [% SET staged_and_ready = curbside_pickups.filter_by_staged_and_ready %] [% SET patron_outside = curbside_pickups.filter_by_patron_outside %] [% SET delivered_today = curbside_pickups.filter_by_delivered %]
[% IF !tab OR tab == 'to-be-staged' %]
[% ELSE %]
[% END %] [% IF to_be_staged.count %] [% FOREACH cp IN to_be_staged %] [% UNLESS cp.staged_datetime %] [% END %] [% END %]
Pickup date/time Patron Items for pickup Action
[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %] [% PROCESS patron_info %] [% PROCESS waiting_holds %]

[% ELSE %] There are no pickups to be staged. [% END %]
[% IF tab == "staged-and-ready" %]
[% ELSE %]
[% END %] [% IF staged_and_ready.count %] [% FOREACH cp IN staged_and_ready %] [% IF cp.staged_datetime && !cp.arrival_datetime %] [% END %] [% END %]
Pickup date/time Patron Items for pickup Staged by Action
[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %] [% PROCESS patron_info %] [% PROCESS waiting_holds %] [% cp.staged_by_staff.firstname | html %] [% cp.staged_by_staff.surname | html %]

[% ELSE %] There are no pickups staged and ready. [% END %]
[% IF tab == "patron-is-outside" %]
[% ELSE %]
[% END %] [% IF patron_outside.count %] [% FOREACH cp IN patron_outside %] [% IF cp.arrival_datetime && !cp.delivered_datetime %] [% END %] [% END %]
Pickup date/time Patron Items for pickup Staged by Action
[% cp.scheduled_pickup_datetime | $KohaDates with_hours = 1 %] [% PROCESS patron_info %] [% PROCESS waiting_holds %] [% cp.staged_by_staff.firstname | html %] [% cp.staged_by_staff.surname | html %]

[% ELSE %] There are no patrons waiting outside. [% END %]
[% IF tab == "delivered-today" %]
[% ELSE %]
[% END %] [% IF delivered_today.count %] [% FOREACH cp IN delivered_today %] [% IF cp.delivered_datetime %] [% END %] [% END %]
Deliver date/time Patron Items checked out
[% cp.delivered_datetime | $KohaDates with_hours = 1 %] [% PROCESS patron_info %] [% FOREACH c IN cp.checkouts %] [% IF date.format(c.issuedate, format = '%Y-%m-%d') == today_iso %] [% c.item.biblio.title | html %] ([% c.item.biblio.author | html %], [% c.item.barcode | html %])
[% END %] [% END %]
[% ELSE %] No pickups have been delivered today. [% END %]
[% IF tab == "schedule-pickup" %]
[% ELSE %]
[% END %] [% IF !patron || ( patron && existing_curbside_pickups.count >= 1 ) %] [% IF existing_curbside_pickups.count >= 1 %]
[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %]) already has a scheduled pickup for this library.
[% END %]
Search a patron
[% ELSE %] [% SET waiting_holds = patron.holds.search( found => 'W', branchcode => Branches.GetLoggedInBranchcode ) %] [% IF !policy.enable_waiting_holds_only || waiting_holds.count > 0 %]
  1. [% INCLUDE 'patron-title.inc' patron=patron %]
  2. [% IF waiting_holds.count %] [% FOREACH h IN waiting_holds %]

    [% h.biblio.title | html %] ([% h.biblio.author | html %], [% h.item.barcode | html %])

    [% END %] [% ELSE %] There are no waiting holds for this patron at this library. [% END %]
[% ELSE %]
The patron does not have waitings holds.
[% END %] [% END %]
[% IF Koha.Preference('CircSidebar') %]
[% END %]
[% MACRO jsinclude BLOCK %] [% Asset.js("lib/dayjs/dayjs.min.js") | $raw %] [% Asset.js("lib/dayjs/plugin/isSameOrAfter.js") | $raw %] [% Asset.js("lib/dayjs/plugin/customParseFormat.js") | $raw %] [% INCLUDE 'calendar.inc' %] [% INCLUDE 'js-patron-format.inc' %] [% END %] [% INCLUDE 'intranet-bottom.inc' %]