use OpenILS::Utils::Fieldmapper;
use OpenILS::Application::Acq::EDI::Translator;
use OpenILS::Application::AppUtils;
+use OpenILS::Application::Cat::AssetCommon;
my $U = 'OpenILS::Application::AppUtils';
use OpenILS::Utils::EDIReader;
}
}
+ # we also need to delete any real copies attached
+ my $copy = $e->retrieve_asset_copy([
+ $lid->eg_copy_id,
+ {flesh => 1, flesh_fields => {acp => ['call_number']}}
+ ]);
+ if ($copy) {
+ $logger->info("EDI: deleting copy $copy->id and volume $copy->call_number for lid $lid->id");
+ my $evt = OpenILS::Application::Cat::AssetCommon->delete_copy($e, 1, $copy->call_number, $copy, 1, 1);
+ if ($evt) {
+ $e->rollback;
+ $logger->error("EDI: failed to delete copies for lid $lid->id: $evt");
+ }
+ } else {
+ $logger->debug("EDI: no copies or volumes to delete for lid $lid->id");
+ }
+
$e->update_acq_lineitem_detail($lid);
$cancel_count++;
}