[open-ils-commits] [GIT] Evergreen ILS branch master updated. 1e6cbaca69712d708bf4e720e14ac78e1dc24ab6

Evergreen Git git at git.evergreen-ils.org
Tue Sep 4 16:40:56 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  1e6cbaca69712d708bf4e720e14ac78e1dc24ab6 (commit)
       via  ba4dcdd56abd51eda35aa51fe731cb3d362d014b (commit)
       via  f4c274de501f7e0c08838151b19f8ac36e5f2063 (commit)
       via  1781f399b5458ac08783ba0c8e70f71abea90c6b (commit)
       via  cfdb4b998b8c751ea8ce60aaf47ddecae0ab4797 (commit)
       via  b7ce408d424141a5bc34d699c5bdf52274648117 (commit)
       via  4b6552d74cf790b6c272a80edaa7cfe5a5538d29 (commit)
       via  b3609ca4768322f735358d596eddb4135ea6e44d (commit)
      from  4dbdd7bba989fe9826a2f28d07dfd5823c4e5e2d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1e6cbaca69712d708bf4e720e14ac78e1dc24ab6
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Tue Sep 4 16:36:09 2018 -0400

    LP#1777675 Stamping upgrade script for latest inventory date support
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 5fb343d..c6aab8e 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1124', :eg_version); -- miker/kmlussier/berick
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1125', :eg_version); -- khuckins/kmlussier/dbwells
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql b/Open-ILS/src/sql/Pg/upgrade/1125.schema.lp1777675_latest_inventory_date_support.sql
similarity index 95%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
rename to Open-ILS/src/sql/Pg/upgrade/1125.schema.lp1777675_latest_inventory_date_support.sql
index 8c6cea2..aba4590 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1125.schema.lp1777675_latest_inventory_date_support.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1125', :eg_version);
 
 CREATE TABLE asset.latest_inventory (
     id                          SERIAL                      PRIMARY KEY,

commit ba4dcdd56abd51eda35aa51fe731cb3d362d014b
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Tue Sep 4 14:38:33 2018 -0400

    LP#1777675: Change table names to Latest Inventory
    
    Makes the backend code consistent with the new labels that have been added for
    the latest inventory date.
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 0819f50..a921349 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -7393,7 +7393,7 @@ SELECT  usr,
 			<field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
-			<field reporter:label="Latest Inventory" name="last_copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
+			<field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
@@ -7420,7 +7420,7 @@ SELECT  usr,
 			<link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
 			<link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
 			<link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
-			<link field="last_copy_inventory" reltype="might_have" key="copy" map="" class="alci"/>
+			<link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
 			<link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
 			<link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
 			<link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
@@ -7443,11 +7443,11 @@ SELECT  usr,
         </permacrud>
 	</class>
 
-	<class id="alci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::last_copy_inventory" oils_persist:tablename="asset.last_copy_inventory" reporter:core="true" reporter:label="Latest Inventory">
-		<fields oils_persist:primary="id" oils_persist:sequence="asset.last_copy_inventory_id_seq">
-            <field reporter:label="Last Inventory ID" name="id" reporter:datatype="id"/>
-			<field reporter:label="Last Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
-			<field reporter:label="Last Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
+	<class id="alci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::latest_inventory" oils_persist:tablename="asset.latest_inventory" reporter:core="true" reporter:label="Latest Inventory">
+		<fields oils_persist:primary="id" oils_persist:sequence="asset.latest_inventory_id_seq">
+            <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
+			<field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
+			<field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
 			<field reporter:label="Copy" name="copy" reporter:datatype="link"/>
 		</fields>
 		<links>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
index ddddbc8..2c987d9 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
@@ -371,10 +371,10 @@ sub new_set_circ_lost {
 }
 
 __PACKAGE__->register_method(
-    method    => "update_last_copy_inventory",
-    api_name  => "open-ils.circ.circulation.update_last_copy_inventory");
+    method    => "update_latest_inventory",
+    api_name  => "open-ils.circ.circulation.update_latest_inventory");
 
-sub update_last_copy_inventory {
+sub update_latest_inventory {
     my( $self, $conn, $auth, $args ) = @_;
     my $e = new_editor(authtoken=>$auth, xact=>1);
     return $e->die_event unless $e->checkauth;
@@ -382,21 +382,21 @@ sub update_last_copy_inventory {
     my $copies = $$args{copy_list};
     foreach my $copyid (@$copies) {
         my $copy = $e->retrieve_asset_copy($copyid);
-        my $alci = $e->search_asset_last_copy_inventory({copy => $copyid})->[0];
+        my $alci = $e->search_asset_latest_inventory({copy => $copyid})->[0];
 
         if($alci) {
             $alci->inventory_date('now');
             $alci->inventory_workstation($e->requestor->wsid);
-            $e->update_asset_last_copy_inventory($alci) or return $e->die_event;
+            $e->update_asset_latest_inventory($alci) or return $e->die_event;
         } else {
-            my $alci = Fieldmapper::asset::last_copy_inventory->new;
+            my $alci = Fieldmapper::asset::latest_inventory->new;
             $alci->inventory_date('now');
             $alci->inventory_workstation($e->requestor->wsid);
             $alci->copy($copy->id);
-            $e->create_asset_last_copy_inventory($alci) or return $e->die_event;
+            $e->create_asset_latest_inventory($alci) or return $e->die_event;
         }
 
-        $copy->last_copy_inventory($alci);
+        $copy->latest_inventory($alci);
     }
     $e->commit;
     return 1;
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index deae8f1..6f5433a 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -419,7 +419,7 @@ my @AUTOLOAD_FIELDS = qw/
     backdate
     reservation
     do_inventory_update
-    last_copy_inventory
+    latest_inventory
     copy
     copy_id
     copy_barcode
@@ -2675,19 +2675,19 @@ sub do_checkin {
         $self->dont_change_lost_zero($dont_change_lost_zero);
     }
 
-    my $last_copy_inventory = Fieldmapper::asset::last_copy_inventory->new;
+    my $latest_inventory = Fieldmapper::asset::latest_inventory->new;
 
     if ($self->do_inventory_update) {
-        $last_copy_inventory->inventory_date('now');
-        $last_copy_inventory->inventory_workstation($self->editor->requestor->wsid);
-        $last_copy_inventory->copy($self->copy->id());
+        $latest_inventory->inventory_date('now');
+        $latest_inventory->inventory_workstation($self->editor->requestor->wsid);
+        $latest_inventory->copy($self->copy->id());
     } else {
-        my $alci = $self->editor->search_asset_last_copy_inventory(
+        my $alci = $self->editor->search_asset_latest_inventory(
             {copy => $self->copy->id}
         );
-        $last_copy_inventory = $alci->[0]
+        $latest_inventory = $alci->[0]
     }
-    $self->last_copy_inventory($last_copy_inventory);
+    $self->latest_inventory($latest_inventory);
 
     if( $self->checkin_check_holds_shelf() ) {
         $self->bail_on_events(OpenILS::Event->new('NO_CHANGE'));
@@ -3969,22 +3969,22 @@ sub checkin_flesh_events {
         );
     }
 
-    if ($self->last_copy_inventory) {
+    if ($self->latest_inventory) {
         # flesh some workstation fields before returning
-        $self->last_copy_inventory->inventory_workstation(
-            $self->editor->retrieve_actor_workstation([$self->last_copy_inventory->inventory_workstation])
+        $self->latest_inventory->inventory_workstation(
+            $self->editor->retrieve_actor_workstation([$self->latest_inventory->inventory_workstation])
         );
     }
 
-    if($self->last_copy_inventory && !$self->last_copy_inventory->id) {
-        my $alci = $self->editor->search_asset_last_copy_inventory(
-            {copy => $self->last_copy_inventory->copy}
+    if($self->latest_inventory && !$self->latest_inventory->id) {
+        my $alci = $self->editor->search_asset_latest_inventory(
+            {copy => $self->latest_inventory->copy}
         );
         if($alci->[0]) {
-            $self->last_copy_inventory->id($alci->[0]->id);
+            $self->latest_inventory->id($alci->[0]->id);
         }
     }
-    $self->copy->last_copy_inventory($self->last_copy_inventory);
+    $self->copy->latest_inventory($self->latest_inventory);
 
     for my $evt (@{$self->events}) {
 
@@ -3999,7 +3999,7 @@ sub checkin_flesh_events {
         $payload->{patron}  = $self->patron;
         $payload->{reservation} = $self->reservation
             unless (not $self->reservation or $self->reservation->cancel_time);
-        $payload->{last_copy_inventory} = $self->last_copy_inventory;
+        $payload->{latest_inventory} = $self->latest_inventory;
         if ($self->do_inventory_update) { $payload->{do_inventory_update} = 1; }
 
         $evt->{payload}     = $payload;
diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql
index 374a1ec..9beed1d 100644
--- a/Open-ILS/src/sql/Pg/040.schema.asset.sql
+++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql
@@ -120,13 +120,13 @@ CREATE TABLE asset.copy_part_map (
 );
 CREATE UNIQUE INDEX copy_part_map_cp_part_idx ON asset.copy_part_map (target_copy, part);
 
-CREATE TABLE asset.last_copy_inventory (
+CREATE TABLE asset.latest_inventory (
     id                          SERIAL                      PRIMARY KEY,
     inventory_workstation       INTEGER                     REFERENCES actor.workstation (id) DEFERRABLE INITIALLY DEFERRED,
     inventory_date              TIMESTAMP WITH TIME ZONE    DEFAULT NOW(),
     copy                        BIGINT				        NOT NULL
 );
-CREATE INDEX last_copy_inventory_copy_idx ON asset.last_copy_inventory (copy);
+CREATE INDEX latest_inventory_copy_idx ON asset.latest_inventory (copy);
 
 CREATE TABLE asset.opac_visible_copies (
   id        BIGSERIAL primary key,
diff --git a/Open-ILS/src/sql/Pg/800.fkeys.sql b/Open-ILS/src/sql/Pg/800.fkeys.sql
index 50d7927..5eb87db 100644
--- a/Open-ILS/src/sql/Pg/800.fkeys.sql
+++ b/Open-ILS/src/sql/Pg/800.fkeys.sql
@@ -169,7 +169,7 @@ BEGIN
 END;
 $f$ LANGUAGE PLPGSQL VOLATILE COST 50;
 
-CREATE OR REPLACE FUNCTION evergreen.asset_last_copy_inventory_copy_inh_fkey() RETURNS TRIGGER AS $f$
+CREATE OR REPLACE FUNCTION evergreen.asset_latest_inventory_copy_inh_fkey() RETURNS TRIGGER AS $f$
 BEGIN
         PERFORM 1 FROM asset.copy WHERE id = NEW.copy;
         IF NOT FOUND THEN
@@ -189,9 +189,9 @@ CREATE CONSTRAINT TRIGGER inherit_asset_copy_tag_copy_map_copy_fkey
         AFTER UPDATE OR INSERT ON asset.copy_tag_copy_map
         DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_copy_tag_copy_map_copy_inh_fkey();
 
-CREATE CONSTRAINT TRIGGER inherit_asset_last_copy_inventory_copy_fkey
-        AFTER UPDATE OR INSERT ON asset.last_copy_inventory
-        DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_last_copy_inventory_copy_inh_fkey();
+CREATE CONSTRAINT TRIGGER inherit_asset_latest_inventory_copy_fkey
+        AFTER UPDATE OR INSERT ON asset.latest_inventory
+        DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_latest_inventory_copy_inh_fkey();
 
 ALTER TABLE asset.copy_note ADD CONSTRAINT asset_copy_note_creator_fkey FOREIGN KEY (creator) REFERENCES actor.usr (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
index 9465a68..8c6cea2 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
@@ -2,15 +2,15 @@ BEGIN;
 
 SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
 
-CREATE TABLE asset.last_copy_inventory (
+CREATE TABLE asset.latest_inventory (
     id                          SERIAL                      PRIMARY KEY,
     inventory_workstation       INTEGER                     REFERENCES actor.workstation (id) DEFERRABLE INITIALLY DEFERRED,
     inventory_date              TIMESTAMP WITH TIME ZONE    DEFAULT NOW(),
     copy                        BIGINT                      NOT NULL
 );
-CREATE INDEX last_copy_inventory_copy_idx ON asset.last_copy_inventory (copy);
+CREATE INDEX latest_inventory_copy_idx ON asset.latest_inventory (copy);
 
-CREATE OR REPLACE FUNCTION evergreen.asset_last_copy_inventory_copy_inh_fkey() RETURNS TRIGGER AS $f$
+CREATE OR REPLACE FUNCTION evergreen.asset_latest_inventory_copy_inh_fkey() RETURNS TRIGGER AS $f$
 BEGIN
         PERFORM 1 FROM asset.copy WHERE id = NEW.copy;
         IF NOT FOUND THEN
@@ -22,9 +22,9 @@ BEGIN
 END;
 $f$ LANGUAGE PLPGSQL VOLATILE COST 50;
 
-CREATE CONSTRAINT TRIGGER inherit_asset_last_copy_inventory_copy_fkey
-        AFTER UPDATE OR INSERT ON asset.last_copy_inventory
-        DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_last_copy_inventory_copy_inh_fkey();
+CREATE CONSTRAINT TRIGGER inherit_asset_latest_inventory_copy_fkey
+        AFTER UPDATE OR INSERT ON asset.latest_inventory
+        DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_latest_inventory_copy_inh_fkey();
 
 INSERT into config.workstation_setting_type (name, grp, datatype, label)
 VALUES (
diff --git a/Open-ILS/src/templates/staff/cat/bucket/copy/t_pending.tt2 b/Open-ILS/src/templates/staff/cat/bucket/copy/t_pending.tt2
index 60c1146..431d2d4 100644
--- a/Open-ILS/src/templates/staff/cat/bucket/copy/t_pending.tt2
+++ b/Open-ILS/src/templates/staff/cat/bucket/copy/t_pending.tt2
@@ -58,7 +58,7 @@
       {{item['call_number.record.simple_record.title']}}
     </a>
   </eg-grid-field>
-  <eg-grid-field path="last_copy_inventory.inventory_date" datatype="timestamp" label="[% l('Inventory Date') %]"></eg-grid-field>
-  <eg-grid-field path="last_copy_inventory.inventory_workstation.name" label="[% l('Inventory Workstation') %]"></eg-grid-field>
+  <eg-grid-field path="latest_inventory.inventory_date" datatype="timestamp" label="[% l('Inventory Date') %]"></eg-grid-field>
+  <eg-grid-field path="latest_inventory.inventory_workstation.name" label="[% l('Inventory Workstation') %]"></eg-grid-field>
 
 </eg-grid>
diff --git a/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2 b/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2
index 43f3ee0..99a3584 100644
--- a/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2
+++ b/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2
@@ -43,7 +43,7 @@
       {{item['call_number.record.simple_record.title']}}
     </a>
   </eg-grid-field>
-  <eg-grid-field path="last_copy_inventory.inventory_date" datatype="timestamp" label="[% l('Inventory Date') %]"></eg-grid-field>
-  <eg-grid-field path="last_copy_inventory.inventory_workstation.name" label="[% l('Inventory Workstation') %]"></eg-grid-field>
+  <eg-grid-field path="latest_inventory.inventory_date" datatype="timestamp" label="[% l('Inventory Date') %]"></eg-grid-field>
+  <eg-grid-field path="latest_inventory.inventory_workstation.name" label="[% l('Inventory Workstation') %]"></eg-grid-field>
 
 </eg-grid>
diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
index 9241250..7865c94 100644
--- a/Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
+++ b/Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
@@ -123,8 +123,8 @@
       {{item['copy_alert_count']}}
       <button ng-disabled="item['copy_alert_count'] <= 0" class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['id'])">[% l('Manage') %]</button>
     </eg-grid-field>
-    <eg-grid-field label="[% l('Inventory Date') %]"          datatype="timestamp" path="last_copy_inventory.inventory_date"></eg-grid-field>
-    <eg-grid-field label="[% l('Inventory Workstation') %]"   path="last_copy_inventory.inventory_workstation.name"></eg-grid-field>
+    <eg-grid-field label="[% l('Inventory Date') %]"          datatype="timestamp" path="latest_inventory.inventory_date"></eg-grid-field>
+    <eg-grid-field label="[% l('Inventory Workstation') %]"   path="latest_inventory.inventory_workstation.name"></eg-grid-field>
   
   </eg-grid>
 </div>
diff --git a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
index 5827342..245a229 100644
--- a/Open-ILS/src/templates/staff/cat/item/t_list.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
@@ -141,8 +141,8 @@
     {{item['copy_alert_count']}}
     <button ng-disabled="item['copy_alert_count'] <= 0" class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['id'])">[% l('Manage') %]</button>
   </eg-grid-field>
-  <eg-grid-field label="[% l('Inventory Date') %]"        path="last_copy_inventory.inventory_date" datatype="timestamp"></eg-grid-field>
-  <eg-grid-field label="[% l('Inventory Workstation') %]" path="last_copy_inventory.inventory_workstation.name"></eg-grid-field>
+  <eg-grid-field label="[% l('Inventory Date') %]"        path="latest_inventory.inventory_date" datatype="timestamp"></eg-grid-field>
+  <eg-grid-field label="[% l('Inventory Workstation') %]" path="latest_inventory.inventory_workstation.name"></eg-grid-field>
   
 </eg-grid>
 
diff --git a/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
index e67ba11..60797a7 100644
--- a/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
@@ -178,10 +178,10 @@
 
   <div class="flex-row">
     <div class="flex-cell">[% l('Inventory Date') %]</div>
-    <div class="flex-cell well">{{copy.last_copy_inventory().inventory_date() | date:egDateAndTimeFormat}}</div>
+    <div class="flex-cell well">{{copy.latest_inventory().inventory_date() | date:egDateAndTimeFormat}}</div>
 
     <div class="flex-cell">[% l('Inventory Workstation') %]</div>
-    <div class="flex-cell well">{{copy.last_copy_inventory().inventory_workstation().name()}}</div>
+    <div class="flex-cell well">{{copy.latest_inventory().inventory_workstation().name()}}</div>
 
     <div class="flex-cell"></div>
     <div class="flex-cell"></div>
diff --git a/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2 b/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2
index aef321d..2d0aa30 100644
--- a/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2
+++ b/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2
@@ -121,7 +121,7 @@
   <eg-grid-field path="au.*" parent-idl-class="au" hidden></eg-grid-field>
   <eg-grid-field path="transit.*" parent-idl-class="atc" hidden></eg-grid-field>
   <eg-grid-field path="hold.*" parent-idl-class="ahr" hidden></eg-grid-field>
-  <eg-grid-field path="acp.last_copy_inventory.inventory_date" label="[% l('Inventory Date') %]" datatype="timestamp" hidden></eg-grid-field>
-  <eg-grid-field path="acp.last_copy_inventory.inventory_workstation.name" label="[% l('Inventory Workstation')%]" hidden></eg-grid-field>
+  <eg-grid-field path="acp.latest_inventory.inventory_date" label="[% l('Inventory Date') %]" datatype="timestamp" hidden></eg-grid-field>
+  <eg-grid-field path="acp.latest_inventory.inventory_workstation.name" label="[% l('Inventory Workstation')%]" hidden></eg-grid-field>
 </eg-grid>
 
diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js
index 24178d7..f797fec 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js
@@ -610,8 +610,8 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore ,
         // regardless of whether it matches the current item.
         if (!barcode && itemSvc.copy && itemSvc.copy.id() == copyId) {
             $scope.copy = itemSvc.copy;
-            if (itemSvc.last_copy_inventory && itemSvc.last_copy_inventory.copy() == copyId) {
-                $scope.last_copy_inventory = itemSvc.last_copy_inventory;
+            if (itemSvc.latest_inventory && itemSvc.latest_inventory.copy() == copyId) {
+                $scope.latest_inventory = itemSvc.latest_inventory;
             }
             $scope.copy_alert_count = itemSvc.copy.copy_alerts().filter(function(aca) {
                 return !aca.ack_time();
@@ -645,11 +645,11 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore ,
 
             var copy = res.copy;
             itemSvc.copy = copy;
-            if (res.last_copy_inventory) itemSvc.last_copy_inventory = res.last_copy_inventory;
+            if (res.latest_inventory) itemSvc.latest_inventory = res.latest_inventory;
 
 
             $scope.copy = copy;
-            $scope.last_copy_inventory = res.last_copy_inventory;
+            $scope.latest_inventory = res.latest_inventory;
             $scope.copy_alert_count = copy.copy_alerts().filter(function(aca) {
                 return !aca.ack_time();
             }).length;
diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js b/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js
index 37b8b07..476dbe2 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js
@@ -15,7 +15,7 @@ function(egCore , $q) {
     service.prototype.flesh = {   
         flesh : 3,
         flesh_fields : {
-            acp : ['status','location','circ_lib','parts','age_protect','copy_alerts', 'last_copy_inventory'],
+            acp : ['status','location','circ_lib','parts','age_protect','copy_alerts', 'latest_inventory'],
             acn : ['prefix','suffix','copies'],
             alci : ['inventory_workstation']
         }
diff --git a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
index 8d9eec4..a030379 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
@@ -210,8 +210,8 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg
             
             row_item['copy_barcode'] = row_item.acp.barcode();
 
-            if (row_item.acp.last_copy_inventory() && row_item.acp.last_copy_inventory().inventory_date() == "now")
-                row_item.acp.last_copy_inventory().inventory_date(Date.now());
+            if (row_item.acp.latest_inventory() && row_item.acp.latest_inventory().inventory_date() == "now")
+                row_item.acp.latest_inventory().inventory_date(Date.now());
 
             if (row_item.mbts) {
                 var amt = Number(row_item.mbts.balance_owed());
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
index 465eaba..c832c60 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
@@ -300,7 +300,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
         data.record = payload.record;
         data.acp = payload.copy;
         data.acn = payload.volume ?  payload.volume : payload.copy ? payload.copy.call_number() : null;
-        data.alci = egCore.idl.toHash(payload.last_copy_inventory, true);
+        data.alci = egCore.idl.toHash(payload.latest_inventory, true);
         data.au = payload.patron;
         data.transit = payload.transit;
         data.status = payload.status;
@@ -314,10 +314,10 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
         if (payload.circ) data.duration = payload.circ.duration();
         if (payload.circ) data.circ_lib = payload.circ.circ_lib();
         if (payload.do_inventory_update) {
-            if (payload.last_copy_inventory.id()) {
-                egCore.pcrud.update(payload.last_copy_inventory);
+            if (payload.latest_inventory.id()) {
+                egCore.pcrud.update(payload.latest_inventory);
             } else {
-                egCore.pcrud.create(payload.last_copy_inventory);
+                egCore.pcrud.create(payload.latest_inventory);
             }
         }
 
@@ -1472,12 +1472,12 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
 
         var final_resp = {evt : evt, params : params, options : options};
 
-        var copy, hold, transit, last_copy_inventory;
+        var copy, hold, transit, latest_inventory;
         if (evt[0].payload) {
             copy = evt[0].payload.copy;
             hold = evt[0].payload.hold;
             transit = evt[0].payload.transit;
-            last_copy_inventory = evt[0].payload.last_copy_inventory;
+            latest_inventory = evt[0].payload.latest_inventory;
         }
 
         // track the barcode regardless of whether it's valid
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/item.js b/Open-ILS/web/js/ui/default/staff/circ/services/item.js
index 99f260c..9fc4e3f 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/item.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/item.js
@@ -16,7 +16,7 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
         flesh : 4,
         flesh_fields : {
             acp : ['call_number','location','status','location','floating','circ_modifier',
-                'age_protect','circ_lib','copy_alerts', 'editor', 'circ_as_type', 'last_copy_inventory'],
+                'age_protect','circ_lib','copy_alerts', 'editor', 'circ_as_type', 'latest_inventory'],
             acn : ['record','prefix','suffix','label_class'],
             bre : ['simple_record','creator','editor'],
             alci : ['inventory_workstation']
@@ -200,7 +200,7 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
         if (copy_list.length == 0) return;
         return egCore.net.request(
             'open-ils.circ',
-            'open-ils.circ.circulation.update_last_copy_inventory',
+            'open-ils.circ.circulation.update_latest_inventory',
             egCore.auth.token(), {copy_list: copy_list}
         ).then(function(res) {
             if (res) {
@@ -212,8 +212,8 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
                                 {alci: ['inventory_workstation']}
                             }).then(function(alci) {
                                 //update existing grid rows
-                                item["last_copy_inventory.inventory_date"] = alci.inventory_date();
-                                item["last_copy_inventory.inventory_workstation.name"] =
+                                item["latest_inventory.inventory_date"] = alci.inventory_date();
+                                item["latest_inventory.inventory_workstation.name"] =
                                     alci.inventory_workstation().name();
                             });
                         }

commit f4c274de501f7e0c08838151b19f8ac36e5f2063
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Thu Aug 23 14:38:50 2018 -0400

    LP#1777675 Tweak IDL label for copy inventory
    
    "Last Copy Inventory" can be misunderstood at first reading as
    inventory of the "last copy".  "Latest Inventory" seems easier to
    understand, and also still goes well with a potential future "All
    Inventories" entry in the IDL.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index d6a4f20..0819f50 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -7393,7 +7393,7 @@ SELECT  usr,
 			<field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
-			<field reporter:label="Last Copy Inventory" name="last_copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
+			<field reporter:label="Latest Inventory" name="last_copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
@@ -7443,7 +7443,7 @@ SELECT  usr,
         </permacrud>
 	</class>
 
-	<class id="alci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::last_copy_inventory" oils_persist:tablename="asset.last_copy_inventory" reporter:core="true" reporter:label="Last Copy Inventory">
+	<class id="alci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::last_copy_inventory" oils_persist:tablename="asset.last_copy_inventory" reporter:core="true" reporter:label="Latest Inventory">
 		<fields oils_persist:primary="id" oils_persist:sequence="asset.last_copy_inventory_id_seq">
             <field reporter:label="Last Inventory ID" name="id" reporter:datatype="id"/>
 			<field reporter:label="Last Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>

commit 1781f399b5458ac08783ba0c8e70f71abea90c6b
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Thu Aug 23 14:34:57 2018 -0400

    LP#1777675 Re-add missing columns to checkin interface
    
    During one iteration of the inventory code, a box was added to the
    interface, and some room was made for it by shrinking these other
    interface components.
    
    Since the box is now gone, let's get this row back up to the expected
    twelve units of width.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 b/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2
index 30d996b..31b0b61 100644
--- a/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2
+++ b/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2
@@ -49,7 +49,7 @@
 
 <!-- checkin form -->
 <div class="row pad-vert">
-  <div class="col-md-4">
+  <div class="col-md-5">
     <form ng-submit="checkin(checkinArgs)" role="form" class="form-inline">
       <div class="input-group">
 
@@ -78,7 +78,7 @@
     </div>
   </div>
 
-  <div class="col-md-3" ng-if="!is_capture">
+  <div class="col-md-4" ng-if="!is_capture">
     <div class="flex-row">
       <div class="flex-cell"></div>
       <div class="pad-horiz">[% l('Effective Date') %]</div>

commit cfdb4b998b8c751ea8ce60aaf47ddecae0ab4797
Author: Remington Steed <rjs7 at calvin.edu>
Date:   Wed Aug 22 14:19:19 2018 -0400

    LP#1777675: Fix code to update Item Status grid
    
    Testing revealed that the grid rows use a different data structure, and
    the object member names include dots (periods). Thus, bracket notation
    is required to access those members.
    
    This commit also makes a few smaller changes:
      - Prevents an error in the Check-in app when a last_copy_inventory
        doesn't exist yet.
      - Removes the "refresh" parameter from the updateInventory() function,
        which is never supplied when called, nor used by the function.
      - Adds some brief code comments.
    
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
index b1e0aed..8d9eec4 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
@@ -210,7 +210,7 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg
             
             row_item['copy_barcode'] = row_item.acp.barcode();
 
-            if (row_item.acp.last_copy_inventory().inventory_date() == "now")
+            if (row_item.acp.last_copy_inventory() && row_item.acp.last_copy_inventory().inventory_date() == "now")
                 row_item.acp.last_copy_inventory().inventory_date(Date.now());
 
             if (row_item.mbts) {
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/item.js b/Open-ILS/web/js/ui/default/staff/circ/services/item.js
index 79d099f..99f260c 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/item.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/item.js
@@ -195,7 +195,8 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
 
     }
 
-    service.updateInventory = function(copy_list, all_items, refresh) {
+    //all_items = selected grid rows, to be updated in place
+    service.updateInventory = function(copy_list, all_items) {
         if (copy_list.length == 0) return;
         return egCore.net.request(
             'open-ils.circ',
@@ -210,8 +211,9 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
                               {flesh: 1, flesh_fields:
                                 {alci: ['inventory_workstation']}
                             }).then(function(alci) {
-                                item._last_copy_inventory.inventory_date = alci.inventory_date();
-                                item._last_copy_inventory._inventory_workstation_name =
+                                //update existing grid rows
+                                item["last_copy_inventory.inventory_date"] = alci.inventory_date();
+                                item["last_copy_inventory.inventory_workstation.name"] =
                                     alci.inventory_workstation().name();
                             });
                         }

commit b7ce408d424141a5bc34d699c5bdf52274648117
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Tue Aug 21 13:31:59 2018 -0400

    LP#1777675: Release notes entry for inventory date
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/docs/RELEASE_NOTES_NEXT/Cataloging/inventory_date_support.adoc b/docs/RELEASE_NOTES_NEXT/Cataloging/inventory_date_support.adoc
new file mode 100644
index 0000000..b647f63
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Cataloging/inventory_date_support.adoc
@@ -0,0 +1,14 @@
+Support for Last Inventory Date
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Evergreen now provides an option to add an inventory date to items to facilitate
+the process of performing inventory in libraries. Staff can add an inventory
+date to an item in one of the following ways:
+ * From the check in screen, there is now an Update Inventory check in modifier.
+When selected, scanned barcodes will have the current date/time added as the
+inventory date while the item is checked in.
+ * From the Item Status screen, an action is available to add the current 
+date/time as the inventory date to selected items.
+
+This new feature will also store the workstation that was used when the
+inventory date was updated.
+

commit 4b6552d74cf790b6c272a80edaa7cfe5a5538d29
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Tue Aug 21 13:04:13 2018 -0400

    LP#1777675: Add inventory checkin modifier setting to server storage
    
    Allows the inventory checkin modifier value to be stored on the server instead
    of the browser as is done with other checkin modifier settings.
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 7973a4d..d9e75eb 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -18455,6 +18455,13 @@ VALUES (
         'cwst', 'label'
     )
 ), (
+    'eg.circ.checkin.do_inventory_update', 'circ', 'bool',
+    oils_i18n_gettext (
+             'eg.circ.checkin.do_inventory_update',
+             'Checkin: Update Inventory',
+             'cwst', 'label'
+    )
+), (
     'eg.circ.patron.summary.collapse', 'circ', 'bool',
     oils_i18n_gettext(
         'eg.circ.patron.summary.collapse',
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
index b4dcdf8..9465a68 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
@@ -26,4 +26,14 @@ CREATE CONSTRAINT TRIGGER inherit_asset_last_copy_inventory_copy_fkey
         AFTER UPDATE OR INSERT ON asset.last_copy_inventory
         DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_last_copy_inventory_copy_inh_fkey();
 
-COMMIT;
\ No newline at end of file
+INSERT into config.workstation_setting_type (name, grp, datatype, label)
+VALUES (
+    'eg.circ.checkin.do_inventory_update', 'circ', 'bool',
+    oils_i18n_gettext (
+             'eg.circ.checkin.do_inventory_update',
+             'Checkin: Update Inventory',
+             'cwst', 'label'
+    )
+);
+
+COMMIT;

commit b3609ca4768322f735358d596eddb4135ea6e44d
Author: Kyle Huckins <khuckins at catalyte.io>
Date:   Mon Jul 9 18:11:05 2018 +0000

    lp1777675 inventory date support
    
    - Add toggle for updating inventory date and workstation on checkin
    - Create new table asset.last_copy_inventory containing inventory date and inventory workstation columns.
    - Add code to do_checkin subroutine to update last_copy_inventory table on checkin.
    - Update Holdings view, Checkins table, copy buckets, and item detail grid and lists to display new
    inventory date and workstation information.
    - Add Update Inventory action to Item Status detail and list views.
    
    Signed-off-by: Kyle Huckins <khuckins at catalyte.io>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    
    Conflicts:
    	Open-ILS/web/js/ui/default/staff/circ/services/item.js
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index c9a60dd..d6a4f20 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -7393,6 +7393,7 @@ SELECT  usr,
 			<field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
+			<field reporter:label="Last Copy Inventory" name="last_copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
@@ -7419,6 +7420,7 @@ SELECT  usr,
 			<link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
 			<link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
 			<link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
+			<link field="last_copy_inventory" reltype="might_have" key="copy" map="" class="alci"/>
 			<link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
 			<link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
 			<link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
@@ -7441,6 +7443,27 @@ SELECT  usr,
         </permacrud>
 	</class>
 
+	<class id="alci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::last_copy_inventory" oils_persist:tablename="asset.last_copy_inventory" reporter:core="true" reporter:label="Last Copy Inventory">
+		<fields oils_persist:primary="id" oils_persist:sequence="asset.last_copy_inventory_id_seq">
+            <field reporter:label="Last Inventory ID" name="id" reporter:datatype="id"/>
+			<field reporter:label="Last Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
+			<field reporter:label="Last Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
+			<field reporter:label="Copy" name="copy" reporter:datatype="link"/>
+		</fields>
+		<links>
+			<link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
+			<link field="copy" reltype="has_a" key="id" map="" class="acp"/>
+		</links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+				<create/>
+				<retrieve/>
+				<update/>
+				<delete/>
+            </actions>
+        </permacrud>
+	</class>
+
 	<class id="ccat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_alert_type" oils_persist:tablename="config.copy_alert_type" reporter:label="Copy Alert Type" oils_persist:restrict_primary="100">
 		<fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
 			<field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
index 3a59bf9..ddddbc8 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
@@ -370,6 +370,37 @@ sub new_set_circ_lost {
     return 1;
 }
 
+__PACKAGE__->register_method(
+    method    => "update_last_copy_inventory",
+    api_name  => "open-ils.circ.circulation.update_last_copy_inventory");
+
+sub update_last_copy_inventory {
+    my( $self, $conn, $auth, $args ) = @_;
+    my $e = new_editor(authtoken=>$auth, xact=>1);
+    return $e->die_event unless $e->checkauth;
+
+    my $copies = $$args{copy_list};
+    foreach my $copyid (@$copies) {
+        my $copy = $e->retrieve_asset_copy($copyid);
+        my $alci = $e->search_asset_last_copy_inventory({copy => $copyid})->[0];
+
+        if($alci) {
+            $alci->inventory_date('now');
+            $alci->inventory_workstation($e->requestor->wsid);
+            $e->update_asset_last_copy_inventory($alci) or return $e->die_event;
+        } else {
+            my $alci = Fieldmapper::asset::last_copy_inventory->new;
+            $alci->inventory_date('now');
+            $alci->inventory_workstation($e->requestor->wsid);
+            $alci->copy($copy->id);
+            $e->create_asset_last_copy_inventory($alci) or return $e->die_event;
+        }
+
+        $copy->last_copy_inventory($alci);
+    }
+    $e->commit;
+    return 1;
+}
 
 __PACKAGE__->register_method(
     method  => "set_circ_claims_returned",
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index ab9d178..deae8f1 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -418,6 +418,8 @@ my @AUTOLOAD_FIELDS = qw/
     remote_hold
     backdate
     reservation
+    do_inventory_update
+    last_copy_inventory
     copy
     copy_id
     copy_barcode
@@ -2673,6 +2675,20 @@ sub do_checkin {
         $self->dont_change_lost_zero($dont_change_lost_zero);
     }
 
+    my $last_copy_inventory = Fieldmapper::asset::last_copy_inventory->new;
+
+    if ($self->do_inventory_update) {
+        $last_copy_inventory->inventory_date('now');
+        $last_copy_inventory->inventory_workstation($self->editor->requestor->wsid);
+        $last_copy_inventory->copy($self->copy->id());
+    } else {
+        my $alci = $self->editor->search_asset_last_copy_inventory(
+            {copy => $self->copy->id}
+        );
+        $last_copy_inventory = $alci->[0]
+    }
+    $self->last_copy_inventory($last_copy_inventory);
+
     if( $self->checkin_check_holds_shelf() ) {
         $self->bail_on_events(OpenILS::Event->new('NO_CHANGE'));
         $self->hold($U->fetch_open_hold_by_copy($self->copy->id));
@@ -3953,6 +3969,23 @@ sub checkin_flesh_events {
         );
     }
 
+    if ($self->last_copy_inventory) {
+        # flesh some workstation fields before returning
+        $self->last_copy_inventory->inventory_workstation(
+            $self->editor->retrieve_actor_workstation([$self->last_copy_inventory->inventory_workstation])
+        );
+    }
+
+    if($self->last_copy_inventory && !$self->last_copy_inventory->id) {
+        my $alci = $self->editor->search_asset_last_copy_inventory(
+            {copy => $self->last_copy_inventory->copy}
+        );
+        if($alci->[0]) {
+            $self->last_copy_inventory->id($alci->[0]->id);
+        }
+    }
+    $self->copy->last_copy_inventory($self->last_copy_inventory);
+
     for my $evt (@{$self->events}) {
 
         my $payload         = {};
@@ -3966,6 +3999,8 @@ sub checkin_flesh_events {
         $payload->{patron}  = $self->patron;
         $payload->{reservation} = $self->reservation
             unless (not $self->reservation or $self->reservation->cancel_time);
+        $payload->{last_copy_inventory} = $self->last_copy_inventory;
+        if ($self->do_inventory_update) { $payload->{do_inventory_update} = 1; }
 
         $evt->{payload}     = $payload;
     }
diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql
index 04d98b3..374a1ec 100644
--- a/Open-ILS/src/sql/Pg/040.schema.asset.sql
+++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql
@@ -120,6 +120,14 @@ CREATE TABLE asset.copy_part_map (
 );
 CREATE UNIQUE INDEX copy_part_map_cp_part_idx ON asset.copy_part_map (target_copy, part);
 
+CREATE TABLE asset.last_copy_inventory (
+    id                          SERIAL                      PRIMARY KEY,
+    inventory_workstation       INTEGER                     REFERENCES actor.workstation (id) DEFERRABLE INITIALLY DEFERRED,
+    inventory_date              TIMESTAMP WITH TIME ZONE    DEFAULT NOW(),
+    copy                        BIGINT				        NOT NULL
+);
+CREATE INDEX last_copy_inventory_copy_idx ON asset.last_copy_inventory (copy);
+
 CREATE TABLE asset.opac_visible_copies (
   id        BIGSERIAL primary key,
   copy_id   BIGINT, -- copy id
diff --git a/Open-ILS/src/sql/Pg/800.fkeys.sql b/Open-ILS/src/sql/Pg/800.fkeys.sql
index c396119..50d7927 100644
--- a/Open-ILS/src/sql/Pg/800.fkeys.sql
+++ b/Open-ILS/src/sql/Pg/800.fkeys.sql
@@ -169,6 +169,18 @@ BEGIN
 END;
 $f$ LANGUAGE PLPGSQL VOLATILE COST 50;
 
+CREATE OR REPLACE FUNCTION evergreen.asset_last_copy_inventory_copy_inh_fkey() RETURNS TRIGGER AS $f$
+BEGIN
+        PERFORM 1 FROM asset.copy WHERE id = NEW.copy;
+        IF NOT FOUND THEN
+                RAISE foreign_key_violation USING MESSAGE = FORMAT(
+                        $$Referenced asset.copy id not found, copy:%s$$, NEW.copy
+                );
+        END IF;
+        RETURN NEW;
+END;
+$f$ LANGUAGE PLPGSQL VOLATILE COST 50;
+
 CREATE CONSTRAINT TRIGGER inherit_asset_copy_alert_copy_fkey
         AFTER UPDATE OR INSERT ON asset.copy_alert
         DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_copy_alert_copy_inh_fkey();
@@ -177,6 +189,10 @@ CREATE CONSTRAINT TRIGGER inherit_asset_copy_tag_copy_map_copy_fkey
         AFTER UPDATE OR INSERT ON asset.copy_tag_copy_map
         DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_copy_tag_copy_map_copy_inh_fkey();
 
+CREATE CONSTRAINT TRIGGER inherit_asset_last_copy_inventory_copy_fkey
+        AFTER UPDATE OR INSERT ON asset.last_copy_inventory
+        DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_last_copy_inventory_copy_inh_fkey();
+
 ALTER TABLE asset.copy_note ADD CONSTRAINT asset_copy_note_creator_fkey FOREIGN KEY (creator) REFERENCES actor.usr (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
 
 ALTER TABLE asset.call_number ADD CONSTRAINT asset_call_number_owning_lib_fkey FOREIGN KEY (owning_lib) REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
new file mode 100644
index 0000000..b4dcdf8
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
@@ -0,0 +1,29 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE TABLE asset.last_copy_inventory (
+    id                          SERIAL                      PRIMARY KEY,
+    inventory_workstation       INTEGER                     REFERENCES actor.workstation (id) DEFERRABLE INITIALLY DEFERRED,
+    inventory_date              TIMESTAMP WITH TIME ZONE    DEFAULT NOW(),
+    copy                        BIGINT                      NOT NULL
+);
+CREATE INDEX last_copy_inventory_copy_idx ON asset.last_copy_inventory (copy);
+
+CREATE OR REPLACE FUNCTION evergreen.asset_last_copy_inventory_copy_inh_fkey() RETURNS TRIGGER AS $f$
+BEGIN
+        PERFORM 1 FROM asset.copy WHERE id = NEW.copy;
+        IF NOT FOUND THEN
+                RAISE foreign_key_violation USING MESSAGE = FORMAT(
+                        $$Referenced asset.copy id not found, copy:%s$$, NEW.copy
+                );
+        END IF;
+        RETURN NEW;
+END;
+$f$ LANGUAGE PLPGSQL VOLATILE COST 50;
+
+CREATE CONSTRAINT TRIGGER inherit_asset_last_copy_inventory_copy_fkey
+        AFTER UPDATE OR INSERT ON asset.last_copy_inventory
+        DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_last_copy_inventory_copy_inh_fkey();
+
+COMMIT;
\ No newline at end of file
diff --git a/Open-ILS/src/templates/staff/cat/bucket/copy/t_pending.tt2 b/Open-ILS/src/templates/staff/cat/bucket/copy/t_pending.tt2
index 2396333..60c1146 100644
--- a/Open-ILS/src/templates/staff/cat/bucket/copy/t_pending.tt2
+++ b/Open-ILS/src/templates/staff/cat/bucket/copy/t_pending.tt2
@@ -58,5 +58,7 @@
       {{item['call_number.record.simple_record.title']}}
     </a>
   </eg-grid-field>
+  <eg-grid-field path="last_copy_inventory.inventory_date" datatype="timestamp" label="[% l('Inventory Date') %]"></eg-grid-field>
+  <eg-grid-field path="last_copy_inventory.inventory_workstation.name" label="[% l('Inventory Workstation') %]"></eg-grid-field>
 
 </eg-grid>
diff --git a/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2 b/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2
index fb7d3d1..43f3ee0 100644
--- a/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2
+++ b/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2
@@ -43,5 +43,7 @@
       {{item['call_number.record.simple_record.title']}}
     </a>
   </eg-grid-field>
+  <eg-grid-field path="last_copy_inventory.inventory_date" datatype="timestamp" label="[% l('Inventory Date') %]"></eg-grid-field>
+  <eg-grid-field path="last_copy_inventory.inventory_workstation.name" label="[% l('Inventory Workstation') %]"></eg-grid-field>
 
 </eg-grid>
diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
index f188a1a..9241250 100644
--- a/Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
+++ b/Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
@@ -123,6 +123,8 @@
       {{item['copy_alert_count']}}
       <button ng-disabled="item['copy_alert_count'] <= 0" class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['id'])">[% l('Manage') %]</button>
     </eg-grid-field>
+    <eg-grid-field label="[% l('Inventory Date') %]"          datatype="timestamp" path="last_copy_inventory.inventory_date"></eg-grid-field>
+    <eg-grid-field label="[% l('Inventory Workstation') %]"   path="last_copy_inventory.inventory_workstation.name"></eg-grid-field>
   
   </eg-grid>
 </div>
diff --git a/Open-ILS/src/templates/staff/cat/item/index.tt2 b/Open-ILS/src/templates/staff/cat/item/index.tt2
index df5ed04..c661742 100644
--- a/Open-ILS/src/templates/staff/cat/item/index.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/index.tt2
@@ -32,6 +32,10 @@
       "[% l('One or more items could not be transferred. Override?') %]";
     s.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_BODY =
       "[% l('Reason(s) include: [_1]', '{{evt_desc}}') %]";
+    s.SUCCESS_UPDATE_INVENTORY =
+      "[% l('Updated most recent inventory data for selected items.') %]";
+    s.FAIL_UPDATE_INVENTORY =
+      "[% l('Failed to update recent inventory data for selected items.')%]"
   }])
 </script>
 [% END %]
@@ -84,6 +88,7 @@
         <li><a href ng-click="checkin()">[% l('Check In Items') %]</a></li>
         <li><a href ng-click="renew()">[% l('Renew Items') %]</a></li>
         <li><a href ng-click="cancel_transit()">[% l('Cancel Transit') %]</a></li>
+        <li><a href ng-click="update_inventory()">[% l('Update Inventory') %]</a></li>
 
         <p><b>[% l('Mark') %]</b></p>    
         <li><a href ng-click="selectedHoldingsDamaged()">[% l('Item as Damaged') %]</a></li>
diff --git a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
index 111e722..5827342 100644
--- a/Open-ILS/src/templates/staff/cat/item/t_list.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
@@ -27,6 +27,8 @@
     label="[% l('Renew Items') %]"></eg-grid-action>
   <eg-grid-action handler="cancel_transit"
     label="[% l('Cancel Transit') %]"></eg-grid-action>
+  <eg-grid-action handler="update_inventory"
+    label="[% l('Update Inventory') %]"></eg-grid-action>
     
   <eg-grid-action handler="selectedHoldingsItemStatusTgrEvt" group="[% l('Show') %]"
     label="[% l('Triggered Events') %]"></eg-grid-action>
@@ -139,6 +141,8 @@
     {{item['copy_alert_count']}}
     <button ng-disabled="item['copy_alert_count'] <= 0" class="btn btn-sm btn-default" ng-click="col.handlers.copyAlertsEdit(item['id'])">[% l('Manage') %]</button>
   </eg-grid-field>
+  <eg-grid-field label="[% l('Inventory Date') %]"        path="last_copy_inventory.inventory_date" datatype="timestamp"></eg-grid-field>
+  <eg-grid-field label="[% l('Inventory Workstation') %]" path="last_copy_inventory.inventory_workstation.name"></eg-grid-field>
   
 </eg-grid>
 
diff --git a/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
index e4130a2..e67ba11 100644
--- a/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
@@ -177,6 +177,19 @@
   </div>
 
   <div class="flex-row">
+    <div class="flex-cell">[% l('Inventory Date') %]</div>
+    <div class="flex-cell well">{{copy.last_copy_inventory().inventory_date() | date:egDateAndTimeFormat}}</div>
+
+    <div class="flex-cell">[% l('Inventory Workstation') %]</div>
+    <div class="flex-cell well">{{copy.last_copy_inventory().inventory_workstation().name()}}</div>
+
+    <div class="flex-cell"></div>
+    <div class="flex-cell"></div>
+    <div class="flex-cell"></div>
+    <div class="flex-cell"></div>
+  </div>
+
+  <div class="flex-row">
     <div class="flex-cell">[% l('Copy Alerts') %]</div>
     <div class="flex-cell" id="item-status-alert-msg">
       <button class="btn btn-default" ng-click="addCopyAlerts(copy.id())" >[% l('Add') %]</button>
diff --git a/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 b/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2
index 42d6e67..30d996b 100644
--- a/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2
+++ b/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2
@@ -41,12 +41,15 @@
     <div ng-if="modifiers.manual_float" class="alert-danger pad-all-min">
       [% l('Manual Floating Active') %]
     </div>
+    <div ng-if="modifiers.do_inventory_update" class="alert-danger pad-all-min">
+      [% l('Update Inventory') %]
+    </div>
   </div>
 </div>
 
 <!-- checkin form -->
 <div class="row pad-vert">
-  <div class="col-md-5">
+  <div class="col-md-4">
     <form ng-submit="checkin(checkinArgs)" role="form" class="form-inline">
       <div class="input-group">
 
@@ -75,7 +78,7 @@
     </div>
   </div>
 
-  <div class="col-md-4" ng-if="!is_capture">
+  <div class="col-md-3" ng-if="!is_capture">
     <div class="flex-row">
       <div class="flex-cell"></div>
       <div class="pad-horiz">[% l('Effective Date') %]</div>
@@ -231,6 +234,16 @@
             <span>[% l('Manual Floating Active') %]</span>
           </a>
         </li>
+        <li>
+          <a href
+            ng-click="toggle_mod('do_inventory_update')">
+            <span ng-if="modifiers.do_inventory_update"
+              class="label label-success">&#x2713;</span>
+            <span ng-if="!modifiers.do_inventory_update"
+              class="label label-warning">&#x2717;</span>
+            <span>[% l('Update Inventory') %]</span>
+          </a>
+        </li>
       </ul>
     </div><!-- btn grp -->
   </div><!-- col -->
diff --git a/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2 b/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2
index 8f98584..aef321d 100644
--- a/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2
+++ b/Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2
@@ -121,5 +121,7 @@
   <eg-grid-field path="au.*" parent-idl-class="au" hidden></eg-grid-field>
   <eg-grid-field path="transit.*" parent-idl-class="atc" hidden></eg-grid-field>
   <eg-grid-field path="hold.*" parent-idl-class="ahr" hidden></eg-grid-field>
+  <eg-grid-field path="acp.last_copy_inventory.inventory_date" label="[% l('Inventory Date') %]" datatype="timestamp" hidden></eg-grid-field>
+  <eg-grid-field path="acp.last_copy_inventory.inventory_workstation.name" label="[% l('Inventory Workstation')%]" hidden></eg-grid-field>
 </eg-grid>
 
diff --git a/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js b/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
index 3208a42..f39346e 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
@@ -215,6 +215,16 @@ angular.module('egCatCopyBuckets',
         return deferred.promise;
     }
 
+    // apply last inventory data to fetched bucket items
+    service.fetchRecentInventoryData = function(copy) {
+        return egCore.pcrud.search('alci',
+            {copy: copy.id},
+            {flesh: 2, flesh_fields: {alci: ['inventory_workstation']}}
+        ).then(function(alci) {
+            return alci;
+        });
+    }
+
     return service;
 }])
 
diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js
index cededcd..24178d7 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js
@@ -104,6 +104,13 @@ function($scope , $location , $timeout , egCore , egGridDataProvider , itemSvc)
         itemSvc.requestItems([$scope.args.copyId]);
     }
 
+    $scope.update_inventory = function() {
+        itemSvc.updateInventory([$scope.args.copyId], null)
+        .then(function(res) {
+            $timeout(function() { location.href = location.href; }, 1000);
+        });
+    }
+
     $scope.attach_to_peer_bib = function() {
         itemSvc.attach_to_peer_bib([{
             id : $scope.args.copyId,
@@ -236,10 +243,10 @@ function($scope , $location , $timeout , egCore , egGridDataProvider , itemSvc)
 .controller('ListCtrl', 
        ['$scope','$q','$routeParams','$location','$timeout','$window','egCore',
         'egGridDataProvider','egItem','egUser','$uibModal','egCirc','egConfirmDialog',
-        'egProgressDialog',
+        'egProgressDialog', 'ngToast',
 function($scope , $q , $routeParams , $location , $timeout , $window , egCore , 
          egGridDataProvider , itemSvc , egUser , $uibModal , egCirc , egConfirmDialog,
-         egProgressDialog) {
+         egProgressDialog, ngToast) {
 
     var copyId = [];
     var cp_list = $routeParams.idList;
@@ -385,6 +392,18 @@ function($scope , $q , $routeParams , $location , $timeout , $window , egCore ,
         itemSvc.add_copies_to_bucket(copy_list);
     }
 
+    $scope.update_inventory = function() {
+        var copy_list = gatherSelectedHoldingsIds();
+        itemSvc.updateInventory(copy_list, $scope.gridControls.allItems()).then(function(res) {
+            if (res) {
+                $scope.gridControls.allItems(res);
+                ngToast.create(egCore.strings.SUCCESS_UPDATE_INVENTORY);
+            } else {
+                ngToast.warning(egCore.strings.FAIL_UPDATE_INVENTORY);
+            }
+        });
+    }
+
     $scope.need_one_selected = function() {
         var items = $scope.gridControls.selectedItems();
         if (items.length == 1) return false;
@@ -591,6 +610,9 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore ,
         // regardless of whether it matches the current item.
         if (!barcode && itemSvc.copy && itemSvc.copy.id() == copyId) {
             $scope.copy = itemSvc.copy;
+            if (itemSvc.last_copy_inventory && itemSvc.last_copy_inventory.copy() == copyId) {
+                $scope.last_copy_inventory = itemSvc.last_copy_inventory;
+            }
             $scope.copy_alert_count = itemSvc.copy.copy_alerts().filter(function(aca) {
                 return !aca.ack_time();
             }).length;
@@ -623,9 +645,11 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore ,
 
             var copy = res.copy;
             itemSvc.copy = copy;
+            if (res.last_copy_inventory) itemSvc.last_copy_inventory = res.last_copy_inventory;
 
 
             $scope.copy = copy;
+            $scope.last_copy_inventory = res.last_copy_inventory;
             $scope.copy_alert_count = copy.copy_alerts().filter(function(aca) {
                 return !aca.ack_time();
             }).length;
diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js b/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js
index b4fb738..37b8b07 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/services/holdings.js
@@ -13,10 +13,11 @@ function(egCore , $q) {
     };
 
     service.prototype.flesh = {   
-        flesh : 2, 
+        flesh : 3,
         flesh_fields : {
-            acp : ['status','location','circ_lib','parts','age_protect','copy_alerts'],
-            acn : ['prefix','suffix','copies']
+            acp : ['status','location','circ_lib','parts','age_protect','copy_alerts', 'last_copy_inventory'],
+            acn : ['prefix','suffix','copies'],
+            alci : ['inventory_workstation']
         }
     }
 
diff --git a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
index 103a8e0..b1e0aed 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
@@ -86,6 +86,7 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg
     } else {
         modifiers.push('noop'); // AKA suppress holds and transits
         modifiers.push('auto_print_holds_transits');
+        modifiers.push('do_inventory_update');
     }
 
     // set modifiers from stored preferences
@@ -160,14 +161,17 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg
                 params.retarget_mode = 'retarget';
             }
         }
+        if ($scope.modifiers.do_inventory_update) params.do_inventory_update = true;
 
         egCore.hatch.setItem('circ.checkin.strict_barcode', $scope.strict_barcode);
+        egCore.hatch.setItem('circ.checkin.do_inventory_update', $scope.modifiers.do_inventory_update);
         var options = {
             check_barcode : $scope.strict_barcode,
             no_precat_alert : $scope.modifiers.no_precat_alert,
             auto_print_holds_transits : 
                 $scope.modifiers.auto_print_holds_transits,
-            suppress_popups : suppress_popups
+            suppress_popups : suppress_popups,
+            do_inventory_update : $scope.modifiers.do_inventory_update
         };
 
         return {params : params, options: options};
@@ -196,7 +200,6 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg
 
         // track the item in the grid before sending the request
         checkinSvc.checkins.unshift(row_item);
-
         egCirc.checkin(params, options).then(
         function(final_resp) {
             
@@ -207,6 +210,9 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg
             
             row_item['copy_barcode'] = row_item.acp.barcode();
 
+            if (row_item.acp.last_copy_inventory().inventory_date() == "now")
+                row_item.acp.last_copy_inventory().inventory_date(Date.now());
+
             if (row_item.mbts) {
                 var amt = Number(row_item.mbts.balance_owed());
                 if (amt != 0) {
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
index 6be7dc4..465eaba 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
@@ -300,6 +300,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
         data.record = payload.record;
         data.acp = payload.copy;
         data.acn = payload.volume ?  payload.volume : payload.copy ? payload.copy.call_number() : null;
+        data.alci = egCore.idl.toHash(payload.last_copy_inventory, true);
         data.au = payload.patron;
         data.transit = payload.transit;
         data.status = payload.status;
@@ -309,8 +310,16 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
         data.isbn = final_resp.evt[0].isbn;
         data.route_to = final_resp.evt[0].route_to;
 
+
         if (payload.circ) data.duration = payload.circ.duration();
         if (payload.circ) data.circ_lib = payload.circ.circ_lib();
+        if (payload.do_inventory_update) {
+            if (payload.last_copy_inventory.id()) {
+                egCore.pcrud.update(payload.last_copy_inventory);
+            } else {
+                egCore.pcrud.create(payload.last_copy_inventory);
+            }
+        }
 
         // for checkin, the mbts lives on the main circ
         if (payload.circ && payload.circ.billable_transaction())
@@ -1463,11 +1472,12 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
 
         var final_resp = {evt : evt, params : params, options : options};
 
-        var copy, hold, transit;
+        var copy, hold, transit, last_copy_inventory;
         if (evt[0].payload) {
             copy = evt[0].payload.copy;
             hold = evt[0].payload.hold;
             transit = evt[0].payload.transit;
+            last_copy_inventory = evt[0].payload.last_copy_inventory;
         }
 
         // track the barcode regardless of whether it's valid
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/item.js b/Open-ILS/web/js/ui/default/staff/circ/services/item.js
index f8e0d9c..79d099f 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/item.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/item.js
@@ -13,12 +13,13 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
     };
 
     service.flesh = {   
-        flesh : 3, 
+        flesh : 4,
         flesh_fields : {
             acp : ['call_number','location','status','location','floating','circ_modifier',
-                'age_protect','circ_lib','copy_alerts', 'editor', 'circ_as_type'],
+                'age_protect','circ_lib','copy_alerts', 'editor', 'circ_as_type', 'last_copy_inventory'],
             acn : ['record','prefix','suffix','label_class'],
-            bre : ['simple_record','creator','editor']
+            bre : ['simple_record','creator','editor'],
+            alci : ['inventory_workstation']
         },
         select : { 
             // avoid fleshing MARC on the bre
@@ -103,7 +104,6 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
         return fetchCopy(barcode, id).then(function(res) {
 
             if(!res.copy) { return $q.when(); }
-
             return fetchCirc(copyData.copy).then(function(res) {
                 if (copyData.circ) {
                     return fetchSummary(copyData.circ).then(function() {
@@ -195,6 +195,33 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
 
     }
 
+    service.updateInventory = function(copy_list, all_items, refresh) {
+        if (copy_list.length == 0) return;
+        return egCore.net.request(
+            'open-ils.circ',
+            'open-ils.circ.circulation.update_last_copy_inventory',
+            egCore.auth.token(), {copy_list: copy_list}
+        ).then(function(res) {
+            if (res) {
+                if (all_items) angular.forEach(copy_list, function(copy) {
+                    angular.forEach(all_items, function(item) {
+                        if (copy == item.id) {
+                            egCore.pcrud.search('alci', {copy: copy},
+                              {flesh: 1, flesh_fields:
+                                {alci: ['inventory_workstation']}
+                            }).then(function(alci) {
+                                item._last_copy_inventory.inventory_date = alci.inventory_date();
+                                item._last_copy_inventory._inventory_workstation_name =
+                                    alci.inventory_workstation().name();
+                            });
+                        }
+                    });
+                });
+                return all_items || res;
+            }
+        });
+    }
+
     service.add_copies_to_bucket = function(copy_list) {
         if (copy_list.length == 0) return;
 

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |   23 ++++++++++++
 .../src/perlmods/lib/OpenILS/Application/Circ.pm   |   31 ++++++++++++++++
 .../lib/OpenILS/Application/Circ/Circulate.pm      |   35 ++++++++++++++++++
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/040.schema.asset.sql           |    8 ++++
 Open-ILS/src/sql/Pg/800.fkeys.sql                  |   16 ++++++++
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |    7 ++++
 ...ema.lp1777675_latest_inventory_date_support.sql |   39 ++++++++++++++++++++
 .../templates/staff/cat/bucket/copy/t_pending.tt2  |    2 +
 .../src/templates/staff/cat/bucket/copy/t_view.tt2 |    2 +
 .../src/templates/staff/cat/catalog/t_holdings.tt2 |    2 +
 Open-ILS/src/templates/staff/cat/item/index.tt2    |    5 +++
 Open-ILS/src/templates/staff/cat/item/t_list.tt2   |    4 ++
 .../templates/staff/cat/item/t_summary_pane.tt2    |   13 +++++++
 .../src/templates/staff/circ/checkin/t_checkin.tt2 |   13 +++++++
 .../staff/circ/checkin/t_checkin_table.tt2         |    2 +
 .../web/js/ui/default/staff/cat/bucket/copy/app.js |   10 +++++
 Open-ILS/web/js/ui/default/staff/cat/item/app.js   |   28 +++++++++++++-
 .../js/ui/default/staff/cat/services/holdings.js   |    7 ++--
 .../web/js/ui/default/staff/circ/checkin/app.js    |   10 ++++-
 .../web/js/ui/default/staff/circ/services/circ.js  |   12 ++++++-
 .../web/js/ui/default/staff/circ/services/item.js  |   37 +++++++++++++++++--
 .../Cataloging/inventory_date_support.adoc         |   14 +++++++
 23 files changed, 309 insertions(+), 13 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/1125.schema.lp1777675_latest_inventory_date_support.sql
 create mode 100644 docs/RELEASE_NOTES_NEXT/Cataloging/inventory_date_support.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list