LP#1360347 - Acq custom copy status at receiving
authorChris Sharp <csharp@georgialibraries.org>
Tue, 23 Aug 2016 12:53:41 +0000 (08:53 -0400)
committerKathy Lussier <klussier@masslnc.org>
Fri, 10 Feb 2017 15:47:32 +0000 (10:47 -0500)
Current acq behavior is that received items get a
copy status of "In Process".  This status is typically
holdable and opac_visible, and some libraries have a need
for an intermediate status between "On Order" and "In Process".

Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq_status_on_lineitem_receiving.sql [new file with mode: 0644]

index d3a106e..2a64bdf 100644 (file)
@@ -767,7 +767,12 @@ sub receive_lineitem_detail {
     if ($lid->eg_copy_id) {
         my $copy = $e->retrieve_asset_copy($lid->eg_copy_id) or return 0;
         # only update status if it hasn't already been updated
-        $copy->status(OILS_COPY_STATUS_IN_PROCESS) if $copy->status == OILS_COPY_STATUS_ON_ORDER;
+        if ($copy->status == OILS_COPY_STATUS_ON_ORDER) {
+            my $custom_status = $U->ou_ancestor_setting_value(
+                $e->requestor->ws_ou, 'acq.copy_status_on_receiving', $e);
+            my $new_status = $custom_status || OILS_COPY_STATUS_IN_PROCESS;
+            $copy->status($new_status);
+        }
         $copy->edit_date('now');
         $copy->editor($e->requestor->id);
         $copy->creator($e->requestor->id) if $U->ou_ancestor_setting_value(
index bfff3e2..a0171f1 100644 (file)
@@ -2640,7 +2640,14 @@ INSERT into config.org_unit_setting_type
         'When receiving a copy in acquisitions, set the copy "creator" to be the staff that received the copy',
         'coust', 'description'),
     'bool', null)
-
+,( 'acq.copy_status_on_receiving', 'acq',
+    oils_i18n_gettext('acq.copy_status_on_receiving',
+        'Initial status for received items',
+        'coust', 'label'),
+    oils_i18n_gettext('acq.copy_status_on_receiving',
+        'Allows staff to designate a custom copy status on received lineitems.  Default status is "In Process".',
+        'coust', 'description'),
+    'link', 'ccs')
 ,( 'acq.default_circ_modifier', 'acq',
     oils_i18n_gettext('acq.default_circ_modifier',
         'Default circulation modifier',
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq_status_on_lineitem_receiving.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq_status_on_lineitem_receiving.sql
new file mode 100644 (file)
index 0000000..ada8a1e
--- /dev/null
@@ -0,0 +1,16 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT into config.org_unit_setting_type
+( name, grp, label, description, datatype, fm_class ) VALUES
+( 'acq.copy_status_on_receiving', 'acq',
+    oils_i18n_gettext('acq.copy_status_on_receiving',
+        'Initial status for received items',
+        'coust', 'label'),
+    oils_i18n_gettext('acq.copy_status_on_receiving',
+        'Allows staff to designate a custom copy status on received lineitems.  Default status is "In Process".',
+        'coust', 'description'),
+    'link', 'ccs');
+
+COMMIT;