LP#1777675: Change table names to Latest Inventory
authorKathy Lussier <klussier@masslnc.org>
Tue, 4 Sep 2018 18:38:33 +0000 (14:38 -0400)
committerDan Wells <dbw2@calvin.edu>
Tue, 4 Sep 2018 20:29:52 +0000 (16:29 -0400)
Makes the backend code consistent with the new labels that have been added for
the latest inventory date.

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
17 files changed:
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
Open-ILS/src/sql/Pg/040.schema.asset.sql
Open-ILS/src/sql/Pg/800.fkeys.sql
Open-ILS/src/sql/Pg/upgrade/XXXX-create-inventory-workstation-and-date.sql
Open-ILS/src/templates/staff/cat/bucket/copy/t_pending.tt2
Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2
Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
Open-ILS/src/templates/staff/cat/item/t_list.tt2
Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
Open-ILS/src/templates/staff/circ/checkin/t_checkin_table.tt2
Open-ILS/web/js/ui/default/staff/cat/item/app.js
Open-ILS/web/js/ui/default/staff/cat/services/holdings.js
Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
Open-ILS/web/js/ui/default/staff/circ/services/circ.js
Open-ILS/web/js/ui/default/staff/circ/services/item.js

index 0819f50..a921349 100644 (file)
@@ -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="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"/>
                        <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="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"/>
                        <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>
 
         </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>
                        <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
                </fields>
                <links>
index ddddbc8..2c987d9 100644 (file)
@@ -371,10 +371,10 @@ sub new_set_circ_lost {
 }
 
 __PACKAGE__->register_method(
 }
 
 __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;
     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 $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);
 
         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 {
         } 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);
             $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;
     }
     $e->commit;
     return 1;
index deae8f1..6f5433a 100644 (file)
@@ -419,7 +419,7 @@ my @AUTOLOAD_FIELDS = qw/
     backdate
     reservation
     do_inventory_update
     backdate
     reservation
     do_inventory_update
-    last_copy_inventory
+    latest_inventory
     copy
     copy_id
     copy_barcode
     copy
     copy_id
     copy_barcode
@@ -2675,19 +2675,19 @@ sub do_checkin {
         $self->dont_change_lost_zero($dont_change_lost_zero);
     }
 
         $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) {
 
     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 {
     } else {
-        my $alci = $self->editor->search_asset_last_copy_inventory(
+        my $alci = $self->editor->search_asset_latest_inventory(
             {copy => $self->copy->id}
         );
             {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'));
 
     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
         # 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]) {
         );
         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}) {
 
 
     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->{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;
         if ($self->do_inventory_update) { $payload->{do_inventory_update} = 1; }
 
         $evt->{payload}     = $payload;
index 374a1ec..9beed1d 100644 (file)
@@ -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 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
 );
     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,
 
 CREATE TABLE asset.opac_visible_copies (
   id        BIGSERIAL primary key,
index 50d7927..5eb87db 100644 (file)
@@ -169,7 +169,7 @@ BEGIN
 END;
 $f$ LANGUAGE PLPGSQL VOLATILE COST 50;
 
 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
 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();
 
         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;
 
 
 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;
 
index 9465a68..8c6cea2 100644 (file)
@@ -2,15 +2,15 @@ BEGIN;
 
 SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
 
 
 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
 );
     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
 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;
 
 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 (
 
 INSERT into config.workstation_setting_type (name, grp, datatype, label)
 VALUES (
index 60c1146..431d2d4 100644 (file)
@@ -58,7 +58,7 @@
       {{item['call_number.record.simple_record.title']}}
     </a>
   </eg-grid-field>
       {{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>
 
 </eg-grid>
index 43f3ee0..99a3584 100644 (file)
@@ -43,7 +43,7 @@
       {{item['call_number.record.simple_record.title']}}
     </a>
   </eg-grid-field>
       {{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>
 
 </eg-grid>
index 9241250..7865c94 100644 (file)
       {{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>
       {{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>
   
   </eg-grid>
 </div>
index 5827342..245a229 100644 (file)
     {{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>
     {{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>
 
   
 </eg-grid>
 
index e67ba11..60797a7 100644 (file)
 
   <div class="flex-row">
     <div class="flex-cell">[% l('Inventory Date') %]</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 well">{{copy.latest_inventory().inventory_date() | date:egDateAndTimeFormat}}</div>
 
     <div class="flex-cell">[% l('Inventory Workstation') %]</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>
 
     <div class="flex-cell"></div>
     <div class="flex-cell"></div>
index aef321d..2d0aa30 100644 (file)
   <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="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>
 
 </eg-grid>
 
index 24178d7..f797fec 100644 (file)
@@ -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;
         // 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();
             }
             $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;
 
             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.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;
             $scope.copy_alert_count = copy.copy_alerts().filter(function(aca) {
                 return !aca.ack_time();
             }).length;
index 37b8b07..476dbe2 100644 (file)
@@ -15,7 +15,7 @@ function(egCore , $q) {
     service.prototype.flesh = {   
         flesh : 3,
         flesh_fields : {
     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']
         }
             acn : ['prefix','suffix','copies'],
             alci : ['inventory_workstation']
         }
index 8d9eec4..a030379 100644 (file)
@@ -210,8 +210,8 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg
             
             row_item['copy_barcode'] = row_item.acp.barcode();
 
             
             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());
 
             if (row_item.mbts) {
                 var amt = Number(row_item.mbts.balance_owed());
index 465eaba..c832c60 100644 (file)
@@ -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.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;
         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.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 {
             } 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 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;
         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
         }
 
         // track the barcode regardless of whether it's valid
index 99f260c..9fc4e3f 100644 (file)
@@ -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',
         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']
             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',
         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) {
             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
                                 {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();
                             });
                         }
                                     alci.inventory_workstation().name();
                             });
                         }