View | Details | Raw Unified | Return to bug 31212
Collapse All | Expand All

(-)a/C4/Items.pm (+3 lines)
Lines 399-404 The last optional parameter allows for passing skip_record_index through to the Link Here
399
sub ModDateLastSeen {
399
sub ModDateLastSeen {
400
    my ( $itemnumber, $leave_item_lost, $params ) = @_;
400
    my ( $itemnumber, $leave_item_lost, $params ) = @_;
401
401
402
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 0 });
403
402
    my $item = Koha::Items->find($itemnumber);
404
    my $item = Koha::Items->find($itemnumber);
403
    $item->datelastseen(dt_from_string->ymd);
405
    $item->datelastseen(dt_from_string->ymd);
404
    my $log = $item->itemlost && !$leave_item_lost ? 1 : 0; # If item was lost, record the change to the item
406
    my $log = $item->itemlost && !$leave_item_lost ? 1 : 0; # If item was lost, record the change to the item
Lines 582-587 sub GetItemsForInventory { Link Here
582
    }
584
    }
583
585
584
    if ($datelastseen) {
586
    if ($datelastseen) {
587
        $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 0 });
585
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
588
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
586
        push @bind_params, $datelastseen;
589
        push @bind_params, $datelastseen;
587
    }
590
    }
(-)a/Koha/Schema/Result/Deleteditem.pm (-2 / +2 lines)
Lines 112-118 the date the item was last checked out Link Here
112
112
113
=head2 datelastseen
113
=head2 datelastseen
114
114
115
  data_type: 'date'
115
  data_type: 'datetime'
116
  datetime_undef_if_invalid: 1
116
  datetime_undef_if_invalid: 1
117
  is_nullable: 1
117
  is_nullable: 1
118
118
Lines 404-410 __PACKAGE__->add_columns( Link Here
404
  "datelastborrowed",
404
  "datelastborrowed",
405
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
405
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
406
  "datelastseen",
406
  "datelastseen",
407
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
407
  { data_type => "datetime", datetime_undef_if_invalid => 1, is_nullable => 1 },
408
  "stack",
408
  "stack",
409
  { data_type => "tinyint", is_nullable => 1 },
409
  { data_type => "tinyint", is_nullable => 1 },
410
  "notforloan",
410
  "notforloan",
(-)a/Koha/Schema/Result/Item.pm (-2 / +2 lines)
Lines 115-121 the date the item was last checked out/issued Link Here
115
115
116
=head2 datelastseen
116
=head2 datelastseen
117
117
118
  data_type: 'date'
118
  data_type: 'datetime'
119
  datetime_undef_if_invalid: 1
119
  datetime_undef_if_invalid: 1
120
  is_nullable: 1
120
  is_nullable: 1
121
121
Lines 418-424 __PACKAGE__->add_columns( Link Here
418
  "datelastborrowed",
418
  "datelastborrowed",
419
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
419
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
420
  "datelastseen",
420
  "datelastseen",
421
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
421
  { data_type => "datetime", datetime_undef_if_invalid => 1, is_nullable => 1 },
422
  "stack",
422
  "stack",
423
  { data_type => "tinyint", is_nullable => 1 },
423
  { data_type => "tinyint", is_nullable => 1 },
424
  "notforloan",
424
  "notforloan",
(-)a/installer/data/mysql/kohastructure.sql (-2 / +2 lines)
Lines 2645-2651 CREATE TABLE `deleteditems` ( Link Here
2645
  `replacementprice` decimal(8,2) DEFAULT NULL COMMENT 'cost the library charges to replace the item if it has been marked lost (MARC21 952$v)',
2645
  `replacementprice` decimal(8,2) DEFAULT NULL COMMENT 'cost the library charges to replace the item if it has been marked lost (MARC21 952$v)',
2646
  `replacementpricedate` date DEFAULT NULL COMMENT 'the date the price is effective from (MARC21 952$w)',
2646
  `replacementpricedate` date DEFAULT NULL COMMENT 'the date the price is effective from (MARC21 952$w)',
2647
  `datelastborrowed` date DEFAULT NULL COMMENT 'the date the item was last checked out',
2647
  `datelastborrowed` date DEFAULT NULL COMMENT 'the date the item was last checked out',
2648
  `datelastseen` date DEFAULT NULL COMMENT 'the date the item was last see (usually the last time the barcode was scanned or inventory was done)',
2648
  `datelastseen` datetime DEFAULT NULL COMMENT 'the date the item was last see (usually the last time the barcode was scanned or inventory was done)',
2649
  `stack` tinyint(1) DEFAULT NULL,
2649
  `stack` tinyint(1) DEFAULT NULL,
2650
  `notforloan` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining why this item is not for loan (MARC21 952$7)',
2650
  `notforloan` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining why this item is not for loan (MARC21 952$7)',
2651
  `damaged` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining this item as damaged (MARC21 952$4)',
2651
  `damaged` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining this item as damaged (MARC21 952$4)',
Lines 3208-3214 CREATE TABLE `items` ( Link Here
3208
  `replacementprice` decimal(8,2) DEFAULT NULL COMMENT 'cost the library charges to replace the item if it has been marked lost (MARC21 952$v)',
3208
  `replacementprice` decimal(8,2) DEFAULT NULL COMMENT 'cost the library charges to replace the item if it has been marked lost (MARC21 952$v)',
3209
  `replacementpricedate` date DEFAULT NULL COMMENT 'the date the price is effective from (MARC21 952$w)',
3209
  `replacementpricedate` date DEFAULT NULL COMMENT 'the date the price is effective from (MARC21 952$w)',
3210
  `datelastborrowed` date DEFAULT NULL COMMENT 'the date the item was last checked out/issued',
3210
  `datelastborrowed` date DEFAULT NULL COMMENT 'the date the item was last checked out/issued',
3211
  `datelastseen` date DEFAULT NULL COMMENT 'the date the item was last see (usually the last time the barcode was scanned or inventory was done)',
3211
  `datelastseen` datetime DEFAULT NULL COMMENT 'the date the item was last see (usually the last time the barcode was scanned or inventory was done)',
3212
  `stack` tinyint(1) DEFAULT NULL,
3212
  `stack` tinyint(1) DEFAULT NULL,
3213
  `notforloan` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining why this item is not for loan (MARC21 952$7)',
3213
  `notforloan` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining why this item is not for loan (MARC21 952$7)',
3214
  `damaged` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining this item as damaged (MARC21 952$4)',
3214
  `damaged` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining this item as damaged (MARC21 952$4)',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +1 lines)
Lines 560-566 Note that permanent location is a code, and location may be an authval. Link Here
560
                        [% END %]
560
                        [% END %]
561
561
562
                    </td>
562
                    </td>
563
                    <td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</td>
563
                    <td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates with_hours => 1 %]</td>
564
                    <td class="issues" data-order="[% item.issues || 0 | html %]">[% item.issues || 0 | html %]</td>
564
                    <td class="issues" data-order="[% item.issues || 0 | html %]">[% item.issues || 0 | html %]</td>
565
                    <td class="renewals" data-order="[% item.renewals || 0 | html %]">[% item.renewals || 0 | html %]</td>
565
                    <td class="renewals" data-order="[% item.renewals || 0 | html %]">[% item.renewals || 0 | html %]</td>
566
                    <td class="dateaccessioned" data-order="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</td>
566
                    <td class="dateaccessioned" data-order="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-1 / +1 lines)
Lines 333-339 Link Here
333
                        0
333
                        0
334
                    [% END %]  (<a href="/cgi-bin/koha/circ/bookcount.pl?&amp;biblionumber=[% ITEM_DAT.biblionumber | uri %]&amp;itm=[% ITEM_DAT.itemnumber | uri %]">View item's checkout history</a>)</li>
334
                    [% END %]  (<a href="/cgi-bin/koha/circ/bookcount.pl?&amp;biblionumber=[% ITEM_DAT.biblionumber | uri %]&amp;itm=[% ITEM_DAT.itemnumber | uri %]">View item's checkout history</a>)</li>
335
335
336
                <li><span class="label">Last seen:</span>[% IF ( ITEM_DAT.datelastseen ) %][% ITEM_DAT.datelastseen | $KohaDates %] [%END %]&nbsp;</li>
336
                <li><span class="label">Last seen:</span>[% IF ( ITEM_DAT.datelastseen ) %][% ITEM_DAT.datelastseen | $KohaDates with_hours => 1 %] [%END %]&nbsp;</li>
337
                <li><span class="label">Last borrowed:</span>[% IF (ITEM_DAT.datelastborrowed ) %][% ITEM_DAT.datelastborrowed | $KohaDates %][% END %]&nbsp;</li>
337
                <li><span class="label">Last borrowed:</span>[% IF (ITEM_DAT.datelastborrowed ) %][% ITEM_DAT.datelastborrowed | $KohaDates %][% END %]&nbsp;</li>
338
                [% IF Koha.Preference('StoreLastBorrower') && ITEM_DAT.object.last_returned_by %]
338
                [% IF Koha.Preference('StoreLastBorrower') && ITEM_DAT.object.last_returned_by %]
339
                    <li><span class="label">Last returned by:</span> <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% ITEM_DAT.object.last_returned_by.borrowernumber | uri %]">[% ITEM_DAT.object.last_returned_by.cardnumber | html %]</a>&nbsp;</li>
339
                    <li><span class="label">Last returned by:</span> <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% ITEM_DAT.object.last_returned_by.borrowernumber | uri %]">[% ITEM_DAT.object.last_returned_by.cardnumber | html %]</a>&nbsp;</li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-4 / +4 lines)
Lines 128-137 Link Here
128
                    [% END %]
128
                    [% END %]
129
                [% FOREACH header IN item_header_loop %]
129
                [% FOREACH header IN item_header_loop %]
130
                    [% SET attribute = header.attribute %]
130
                    [% SET attribute = header.attribute %]
131
                    [% IF header.attribute AND date_fields.grep('^' _ attribute _ '$').size %]
131
                    [% IF header.attribute == 'datelastseen' %]
132
                        <td data-order="[% item.$attribute | html %]">[% item.$attribute | $KohaDates %]</td>
132
                        <td data-order="[% item.$attribute | html %]">[% item.$attribute | $KohaDates with_hours => 1%]</td>
133
                    [% ELSIF ( item.$attribute && ( attribute == 'price' || attribute == 'replacementprice' ) ) %]
133
                    [% ELSIF header.attribute AND date_fields.grep('^' _ attribute _ '$').size %]
134
                        <td data-order="[% item.$attribute | html %]">[% item.$attribute | $Price %]</td>
134
                        <td data-order="[% item.$attribute | html %]">[% item.$attribute | $KohaDates with_hours %]</td>
135
                    [% ELSE %]
135
                    [% ELSE %]
136
                        <td>[% item.$attribute | html %]</td>
136
                        <td>[% item.$attribute | html %]</td>
137
                    [% END %]
137
                    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt (-1 / +1 lines)
Lines 129-135 Link Here
129
                            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber | uri %]">[% item.barcode | html %]</a>
129
                            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber | uri %]">[% item.barcode | html %]</a>
130
                        </td>
130
                        </td>
131
                        <td>[% item.itemcallnumber | html %]</td>
131
                        <td>[% item.itemcallnumber | html %]</td>
132
                        <td data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</td>
132
                        <td data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates with_hours => 1 %]</td>
133
                        <td>[% item.price | $Price %]</td>
133
                        <td>[% item.price | $Price %]</td>
134
                        <td>[% item.replacementprice | $Price %]</td>
134
                        <td>[% item.replacementprice | $Price %]</td>
135
                        <td>[% Branches.GetName(item.homebranch) | html %]</td>
135
                        <td>[% Branches.GetName(item.homebranch) | html %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (-4 / +3 lines)
Lines 50-56 Link Here
50
            <main>
50
            <main>
51
51
52
    <h1>Inventory</h1>
52
    <h1>Inventory</h1>
53
    [% IF (moddatecount) %]<div class="dialog message">[% moddatecount | html %] items modified : datelastseen set to [% date | $KohaDates %]</div>
53
    [% IF (moddatecount) %]<div class="dialog message">[% moddatecount | html %] items modified : datelastseen set to [% date | $KohaDates with_hours => 1 %]</div>
54
    <div class="dialog alert">Number of potential barcodes read: [% LinesRead | html %]</div>[% END %]
54
    <div class="dialog alert">Number of potential barcodes read: [% LinesRead | html %]</div>[% END %]
55
    [% IF (errorfile) %]<div class="dialog alert">[% errorfile | html %] can't be opened</div>[% END %]
55
    [% IF (errorfile) %]<div class="dialog alert">[% errorfile | html %] can't be opened</div>[% END %]
56
    [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
56
    [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
Lines 188-194 Link Here
188
        <li>
188
        <li>
189
            <br/>
189
            <br/>
190
            <label for="datelastseen">Last inventory date:</label>
190
            <label for="datelastseen">Last inventory date:</label>
191
            <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | html %]" class="flatpickr" />
191
            <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates with_hours => 1 %]" class="flatpickr" />
192
            (Skip records marked as seen on or after this date.)
192
            (Skip records marked as seen on or after this date.)
193
        </li>
193
        </li>
194
        <li>
194
        <li>
Lines 312-318 Link Here
312
            [% result.withdrawn | html %]
312
            [% result.withdrawn | html %]
313
            </td>
313
            </td>
314
            <td data-order="[% result.datelastseen | html %]">
314
            <td data-order="[% result.datelastseen | html %]">
315
                [% result.datelastseen | $KohaDates%]
315
                [% result.datelastseen | $KohaDates with_hours => 1 %]
316
            </td>
316
            </td>
317
            <td>
317
            <td>
318
            [% FOREACH problem IN result.problems %]
318
            [% FOREACH problem IN result.problems %]
319
- 

Return to bug 31212