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

(-)a/C4/Items.pm (-2 / +2 lines)
Lines 403-409 The last optional parameter allows for passing skip_record_index through to the Link Here
403
sub ModDateLastSeen {
403
sub ModDateLastSeen {
404
    my ( $itemnumber, $leave_item_lost, $params ) = @_;
404
    my ( $itemnumber, $leave_item_lost, $params ) = @_;
405
405
406
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
406
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 0 });
407
407
408
    my $item = Koha::Items->find($itemnumber);
408
    my $item = Koha::Items->find($itemnumber);
409
    $item->datelastseen($today);
409
    $item->datelastseen($today);
Lines 587-593 sub GetItemsForInventory { Link Here
587
    }
587
    }
588
588
589
    if ($datelastseen) {
589
    if ($datelastseen) {
590
        $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 1 });
590
        $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 0 });
591
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
591
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
592
        push @bind_params, $datelastseen;
592
        push @bind_params, $datelastseen;
593
    }
593
    }
(-)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 396-402 __PACKAGE__->add_columns( Link Here
396
  "datelastborrowed",
396
  "datelastborrowed",
397
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
397
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
398
  "datelastseen",
398
  "datelastseen",
399
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
399
  { data_type => "datetime", datetime_undef_if_invalid => 1, is_nullable => 1 },
400
  "stack",
400
  "stack",
401
  { data_type => "tinyint", is_nullable => 1 },
401
  { data_type => "tinyint", is_nullable => 1 },
402
  "notforloan",
402
  "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 410-416 __PACKAGE__->add_columns( Link Here
410
  "datelastborrowed",
410
  "datelastborrowed",
411
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
411
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
412
  "datelastseen",
412
  "datelastseen",
413
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
413
  { data_type => "datetime", datetime_undef_if_invalid => 1, is_nullable => 1 },
414
  "stack",
414
  "stack",
415
  { data_type => "tinyint", is_nullable => 1 },
415
  { data_type => "tinyint", is_nullable => 1 },
416
  "notforloan",
416
  "notforloan",
(-)a/installer/data/mysql/kohastructure.sql (-2 / +2 lines)
Lines 2559-2565 CREATE TABLE `deleteditems` ( Link Here
2559
  `replacementprice` decimal(8,2) DEFAULT NULL COMMENT 'cost the library charges to replace the item if it has been marked lost (MARC21 952$v)',
2559
  `replacementprice` decimal(8,2) DEFAULT NULL COMMENT 'cost the library charges to replace the item if it has been marked lost (MARC21 952$v)',
2560
  `replacementpricedate` date DEFAULT NULL COMMENT 'the date the price is effective from (MARC21 952$w)',
2560
  `replacementpricedate` date DEFAULT NULL COMMENT 'the date the price is effective from (MARC21 952$w)',
2561
  `datelastborrowed` date DEFAULT NULL COMMENT 'the date the item was last checked out',
2561
  `datelastborrowed` date DEFAULT NULL COMMENT 'the date the item was last checked out',
2562
  `datelastseen` date DEFAULT NULL COMMENT 'the date the item was last see (usually the last time the barcode was scanned or inventory was done)',
2562
  `datelastseen` datetime DEFAULT NULL COMMENT 'the date the item was last see (usually the last time the barcode was scanned or inventory was done)',
2563
  `stack` tinyint(1) DEFAULT NULL,
2563
  `stack` tinyint(1) DEFAULT NULL,
2564
  `notforloan` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining why this item is not for loan (MARC21 952$7)',
2564
  `notforloan` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining why this item is not for loan (MARC21 952$7)',
2565
  `damaged` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining this item as damaged (MARC21 952$4)',
2565
  `damaged` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining this item as damaged (MARC21 952$4)',
Lines 3120-3126 CREATE TABLE `items` ( Link Here
3120
  `replacementprice` decimal(8,2) DEFAULT NULL COMMENT 'cost the library charges to replace the item if it has been marked lost (MARC21 952$v)',
3120
  `replacementprice` decimal(8,2) DEFAULT NULL COMMENT 'cost the library charges to replace the item if it has been marked lost (MARC21 952$v)',
3121
  `replacementpricedate` date DEFAULT NULL COMMENT 'the date the price is effective from (MARC21 952$w)',
3121
  `replacementpricedate` date DEFAULT NULL COMMENT 'the date the price is effective from (MARC21 952$w)',
3122
  `datelastborrowed` date DEFAULT NULL COMMENT 'the date the item was last checked out/issued',
3122
  `datelastborrowed` date DEFAULT NULL COMMENT 'the date the item was last checked out/issued',
3123
  `datelastseen` date DEFAULT NULL COMMENT 'the date the item was last see (usually the last time the barcode was scanned or inventory was done)',
3123
  `datelastseen` datetime DEFAULT NULL COMMENT 'the date the item was last see (usually the last time the barcode was scanned or inventory was done)',
3124
  `stack` tinyint(1) DEFAULT NULL,
3124
  `stack` tinyint(1) DEFAULT NULL,
3125
  `notforloan` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining why this item is not for loan (MARC21 952$7)',
3125
  `notforloan` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining why this item is not for loan (MARC21 952$7)',
3126
  `damaged` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'authorized value defining this item as damaged (MARC21 952$4)',
3126
  `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 551-557 Note that permanent location is a code, and location may be an authval. Link Here
551
                        [% END %]
551
                        [% END %]
552
552
553
                    </td>
553
                    </td>
554
                    <td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</td>
554
                    <td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates with_hours => 1 %]</td>
555
                    <td class="issues" data-order="[% item.issues || 0 | html %]">[% item.issues || 0 | html %]</td>
555
                    <td class="issues" data-order="[% item.issues || 0 | html %]">[% item.issues || 0 | html %]</td>
556
                    <td class="renewals" data-order="[% item.renewals || 0 | html %]">[% item.renewals || 0 | html %]</td>
556
                    <td class="renewals" data-order="[% item.renewals || 0 | html %]">[% item.renewals || 0 | html %]</td>
557
                    <td class="dateaccessioned" data-order="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</td>
557
                    <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 313-319 Link Here
313
                        0
313
                        0
314
                    [% 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>
314
                    [% 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>
315
315
316
                <li><span class="label">Last seen:</span>[% IF ( ITEM_DAT.datelastseen ) %][% ITEM_DAT.datelastseen | $KohaDates %] [%END %]&nbsp;</li>
316
                <li><span class="label">Last seen:</span>[% IF ( ITEM_DAT.datelastseen ) %][% ITEM_DAT.datelastseen | $KohaDates with_hours => 1 %] [%END %]&nbsp;</li>
317
                <li><span class="label">Last borrowed:</span>[% IF (ITEM_DAT.datelastborrowed ) %][% ITEM_DAT.datelastborrowed | $KohaDates %][% END %]&nbsp;</li>
317
                <li><span class="label">Last borrowed:</span>[% IF (ITEM_DAT.datelastborrowed ) %][% ITEM_DAT.datelastborrowed | $KohaDates %][% END %]&nbsp;</li>
318
                [% IF Koha.Preference('StoreLastBorrower') && ITEM_DAT.object.last_returned_by %]
318
                [% IF Koha.Preference('StoreLastBorrower') && ITEM_DAT.object.last_returned_by %]
319
                    <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>
319
                    <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 (-2 / +4 lines)
Lines 124-131 Link Here
124
                    [% END %]
124
                    [% END %]
125
                [% FOREACH header IN item_header_loop %]
125
                [% FOREACH header IN item_header_loop %]
126
                    [% SET attribute = header.attribute %]
126
                    [% SET attribute = header.attribute %]
127
                    [% IF header.attribute AND date_fields.grep('^' _ attribute _ '$').size %]
127
                    [% IF header.attribute == 'datelastseen' %]
128
                        <td data-order="[% item.$attribute | html %]">[% item.$attribute | $KohaDates %]</td>
128
                        <td data-order="[% item.$attribute | html %]">[% item.$attribute | $KohaDates with_hours => 1%]</td>
129
                    [% ELSIF header.attribute AND date_fields.grep('^' _ attribute _ '$').size %]
130
                        <td data-order="[% item.$attribute | html %]">[% item.$attribute | $KohaDates with_hours %]</td>
129
                    [% ELSE %]
131
                    [% ELSE %]
130
                        <td>[% item.$attribute | html %]</td>
132
                        <td>[% item.$attribute | html %]</td>
131
                    [% END %]
133
                    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt (-1 / +1 lines)
Lines 126-132 Link Here
126
                            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber | uri %]">[% item.barcode | html %]</a>
126
                            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber | uri %]">[% item.barcode | html %]</a>
127
                        </td>
127
                        </td>
128
                        <td>[% item.itemcallnumber | html %]</td>
128
                        <td>[% item.itemcallnumber | html %]</td>
129
                        <td data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</td>
129
                        <td data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates with_hours => 1 %]</td>
130
                        <td>[% item.price | $Price %]</td>
130
                        <td>[% item.price | $Price %]</td>
131
                        <td>[% item.replacementprice | $Price %]</td>
131
                        <td>[% item.replacementprice | $Price %]</td>
132
                        <td>[% Branches.GetName(item.homebranch) | html %]</td>
132
                        <td>[% Branches.GetName(item.homebranch) | html %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (-4 / +3 lines)
Lines 47-53 Link Here
47
            <main>
47
            <main>
48
48
49
    <h1>Inventory</h1>
49
    <h1>Inventory</h1>
50
    [% IF (moddatecount) %]<div class="dialog message">[% moddatecount | html %] items modified : datelastseen set to [% date | $KohaDates %]</div>
50
    [% IF (moddatecount) %]<div class="dialog message">[% moddatecount | html %] items modified : datelastseen set to [% date | $KohaDates with_hours => 1 %]</div>
51
    <div class="dialog alert">Number of potential barcodes read: [% LinesRead | html %]</div>[% END %]
51
    <div class="dialog alert">Number of potential barcodes read: [% LinesRead | html %]</div>[% END %]
52
    [% IF (errorfile) %]<div class="dialog alert">[% errorfile | html %] can't be opened</div>[% END %]
52
    [% IF (errorfile) %]<div class="dialog alert">[% errorfile | html %] can't be opened</div>[% END %]
53
    [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
53
    [% IF (err_length && err_length==1) %]<div class="dialog alert">There was 1 barcode that was too long.</div>[% END %]
Lines 185-191 Link Here
185
        <li>
185
        <li>
186
            <br/>
186
            <br/>
187
            <label for="datelastseen">Last inventory date:</label>
187
            <label for="datelastseen">Last inventory date:</label>
188
            <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="flatpickr" />
188
            <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates with_hours => 1 %]" class="flatpickr" />
189
            (Skip records marked as seen on or after this date.)
189
            (Skip records marked as seen on or after this date.)
190
        </li>
190
        </li>
191
        <li>
191
        <li>
Lines 309-315 Link Here
309
            [% result.withdrawn | html %]
309
            [% result.withdrawn | html %]
310
            </td>
310
            </td>
311
            <td data-order="[% result.datelastseen | html %]">
311
            <td data-order="[% result.datelastseen | html %]">
312
                [% result.datelastseen | $KohaDates%]
312
                [% result.datelastseen | $KohaDates with_hours => 1 %]
313
            </td>
313
            </td>
314
            <td>
314
            <td>
315
            [% FOREACH problem IN result.problems %]
315
            [% FOREACH problem IN result.problems %]
316
- 

Return to bug 31212