
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, main has been updated via 6c34d66d7185d9b7d583a3c262b01c08dcb5a8ce (commit) via 4a7d84b3bd563c8212533f987547186862dd08ed (commit) from 7dfe7cd53939a0c3faed5ca4255099bd0389a7b0 (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 6c34d66d7185d9b7d583a3c262b01c08dcb5a8ce Author: Terran McCanna <tmccanna@georgialibraries.org> Date: Thu May 15 11:46:33 2025 -0400 LP2095128 Stamp upgrade script Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org> diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 13d695aadf..01eed66e7e 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 ('1468', :eg_version); -- miker/rdavis/jeffdavis/jeff +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1469', :eg_version); -- dbriem/edavis/tmccanna CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.data.in_house_use_inventory_cwst.sql b/Open-ILS/src/sql/Pg/upgrade/1469.data.in_house_use_inventory_cwst.sql similarity index 82% rename from Open-ILS/src/sql/Pg/upgrade/xxxx.data.in_house_use_inventory_cwst.sql rename to Open-ILS/src/sql/Pg/upgrade/1469.data.in_house_use_inventory_cwst.sql index 3947bd3129..246baa46b7 100644 --- a/Open-ILS/src/sql/Pg/upgrade/xxxx.data.in_house_use_inventory_cwst.sql +++ b/Open-ILS/src/sql/Pg/upgrade/1469.data.in_house_use_inventory_cwst.sql @@ -1,6 +1,6 @@ BEGIN; -SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version); +SELECT evergreen.upgrade_deps_block_check('1469', :eg_version); INSERT INTO config.workstation_setting_type (name, grp, datatype, label) VALUES ('eg.circ.in_house.do_inventory_update', 'circ', 'bool', commit 4a7d84b3bd563c8212533f987547186862dd08ed Author: Dan Briem <dbriem@harrisonpl.org> Date: Fri Jan 31 19:31:48 2025 +0000 LP#2095128 Add inventory option to in-house use Adds workstation setting type: eg.circ.in_house.do_inventory_update that will create a copy inventory when creating an in-house use if the location matches the copy's circulating library or the copy can float there. The setting is toggled by a checkbox on the in-house use interface. The setting is ignored when non-cataloged in-house uses are created. To test: 1. Scan an in-house use for a copy at your workstation library 2. Scan WS copy in item status, note no inventory was created 3. Check the Update Inventory checkbox in the in-house use interface 4. Repeat steps 1 and 2, note an inventory was created 5. Scan an in-house for a copy at a different library 6. Scan the copy in item status, note an inventory was not created 7. Create a floating group and add 2 libs (or ancestor) as members 8. Edit the copy and change its floating attribute to the group 9. Repeat step 5 and 6, note an inventory was created Release-note: Adds checkbox to in-house use to allow inventory updates. Signed-off-by: Dan Briem <dbriem@harrisonpl.org> Signed-off-by: Elizabeth Davis <elizabeth.davis@sparkpa.org> Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org> diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm index 17808476a6..474e00db9a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm @@ -715,6 +715,7 @@ __PACKAGE__->register_method( 'location' The org unit id where the in-house use occurs 'copyid' The copy in question 'count' The number of in-house uses to apply to this copy + 'do_inventory_update' If true, create an inventory entry (optional) @return An array of id's representing the id's of the newly created in-house use objects or an event on an error /); @@ -785,6 +786,32 @@ sub create_in_house_use { push( @ids, $ihu->id ); } + if ($params->{do_inventory_update} && !$non_cat) { + my $do_inventory = $copy->circ_lib == $org; + + if (!$do_inventory && $copy->floating) { + my $res = $e->json_query({ + from => [ + 'evergreen.can_float', + $copy->floating, + $copy->circ_lib, + $org + ] + }); + $do_inventory = $U->is_true( + $res->[0]->{'evergreen.can_float'} + ); + } + + if ($do_inventory) { + my $aci = Fieldmapper::asset::copy_inventory->new; + $aci->inventory_date('now'); + $aci->inventory_workstation($e->requestor->wsid); + $aci->copy($copyid); + $e->create_asset_copy_inventory($aci) or return $e->event; + } + } + $e->commit; return \@ids; } 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 8f34ce9ced..a57aaafb5d 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -19454,6 +19454,13 @@ VALUES ( 'Checkin: Update Inventory', 'cwst', 'label' ) +), ( + 'eg.circ.in_house.do_inventory_update', 'circ', 'bool', + oils_i18n_gettext ( + 'eg.circ.in_house.do_inventory_update', + 'In-House Use: Update Inventory', + 'cwst', 'label' + ) ), ( 'eg.circ.patron.summary.collapse', 'circ', 'bool', oils_i18n_gettext( diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.data.in_house_use_inventory_cwst.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.in_house_use_inventory_cwst.sql new file mode 100644 index 0000000000..3947bd3129 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.in_house_use_inventory_cwst.sql @@ -0,0 +1,14 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version); + +INSERT INTO config.workstation_setting_type (name, grp, datatype, label) +VALUES ('eg.circ.in_house.do_inventory_update', 'circ', 'bool', + oils_i18n_gettext ( + 'eg.circ.in_house.do_inventory_update', + 'In-House Use: Update Inventory', + 'cwst', 'label' + ) +); + +COMMIT; diff --git a/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 b/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 index 4c5ddfc482..8971463500 100644 --- a/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 @@ -57,6 +57,13 @@ class="form-control" ng-model="args.barcode" ng-disabled="args.noncat_type != 'barcode'"/> <input class="btn btn-default" type="submit" value="[% l('Submit') %]"/> + + <label class="pad-horiz"> + <input type="checkbox" ng-model="do_inventory_update" + ng-change="toggle_do_inventory_update()" + ng-disabled="!isBarcodeMode()"> + [% l('Update Inventory') %] + </label> </div><!-- input group --> </div><!-- col --> </div><!-- row --> @@ -66,6 +73,14 @@ <div class="col-md-6 alert alert-danger">[% l('Item Not Found') %]</div> </div> +<div class="row" ng-if="do_inventory_update && isBarcodeMode()"> + <div class="col-md-12"> + <div class="alert alert-danger pad-all-min"> + [% l('Update Inventory') %] + </div> + </div> +</div> + <eg-grid id-field="index" features="-display,-sort,-multisort" diff --git a/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js b/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js index 6c65122210..f5bf8ea2bf 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js @@ -16,6 +16,8 @@ function($scope , egCore , egGridDataProvider , egConfirmDialog, var countCap; var countMax; + $scope.do_inventory_update = false; + egCore.startup.go().then(function() { // grab our non-cat types after startup @@ -44,6 +46,11 @@ function($scope , egCore , egGridDataProvider , egConfirmDialog, $scope.checkinAlert = checkinAlert = set['circ.in_house_use.checkin_alert'] || false; }); + + egCore.hatch.getItem('eg.circ.in_house.do_inventory_update') + .then(function(doInventoryUpdate) { + $scope.do_inventory_update = doInventoryUpdate; + }); }); $scope.bcFocus = true; @@ -114,6 +121,10 @@ function($scope , egCore , egGridDataProvider , egConfirmDialog, coArgs.copyid = copy.id(); + if ($scope.do_inventory_update) { + coArgs.do_inventory_update = true; + } + copy.call_number().record().flat_display_entries( egBibDisplay.mfdeToHash( copy.call_number().record().flat_display_entries()) @@ -189,4 +200,17 @@ function($scope , egCore , egGridDataProvider , egConfirmDialog, }); } + $scope.toggle_do_inventory_update = function() { + var key = 'eg.circ.in_house.do_inventory_update'; + if ($scope.do_inventory_update) { + egCore.hatch.setItem(key, true); + } else { + egCore.hatch.removeItem(key); + } + }; + + $scope.isBarcodeMode = function() { + return $scope.args.noncat_type === 'barcode'; + }; + }]) ----------------------------------------------------------------------- Summary of changes: .../src/perlmods/lib/OpenILS/Application/Circ.pm | 27 ++++++++++++++++++++++ Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 7 ++++++ .../1469.data.in_house_use_inventory_cwst.sql | 14 +++++++++++ .../templates/staff/circ/in_house_use/index.tt2 | 15 ++++++++++++ .../js/ui/default/staff/circ/in_house_use/app.js | 24 +++++++++++++++++++ 6 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/1469.data.in_house_use_inventory_cwst.sql hooks/post-receive -- Evergreen ILS