From a84d141d2ea456719fc18879f1e5bccbddec9972 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Tue, 23 Aug 2016 08:53:41 -0400 Subject: [PATCH] LP#1360347 - Acq custom copy status at receiving 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 Signed-off-by: Kathy Lussier --- .../lib/OpenILS/Application/Acq/Order.pm | 7 ++++++- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 9 ++++++++- ...XXX.data.acq_status_on_lineitem_receiving.sql | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq_status_on_lineitem_receiving.sql diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm index d3a106ebe2..2a64bdf8c3 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -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( 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 bfff3e2a06..a0171f1898 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -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 index 0000000000..ada8a1e7ff --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.acq_status_on_lineitem_receiving.sql @@ -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; -- 2.43.2