Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IF item_object.age_protect IS NOT NULL THEN
- SELECT INTO age_protect_object * FROM config.rule_age_hold_protect WHERE id = item_object.age_protect;
- IF hold_test.distance_is_from_owner THEN
- SELECT INTO use_active_date value FROM actor.org_unit_ancestor_setting('circ.holds.age_protect.active_date', item_cn_object.owning_lib);
- ELSE
- SELECT INTO use_active_date value FROM actor.org_unit_ancestor_setting('circ.holds.age_protect.active_date', item_object.circ_lib);
- END IF;
- IF use_active_date = 'true' THEN
- age_protect_date := COALESCE(item_object.active_date, NOW());
- ELSE
- age_protect_date := item_object.create_date;
- END IF;
- IF age_protect_date + age_protect_object.age > NOW() THEN
- SELECT INTO calc_age_prox * FROM actor.org_unit_setting WHERE name = 'circ.holds.calculated_age_proximity' AND org_unit = item_object.circ_lib;
- IF hold_test.distance_is_from_owner THEN
- prox_ou := item_cn_object.owning_lib;
- ELSE
- prox_ou := item_object.circ_lib;
- END IF;
- IF calc_age_prox.id IS NOT NULL AND calc_age_prox.value = 'true' THEN
- SELECT INTO hold_transit_prox action.copy_calculated_proximity(
- v_pickup_ou,
- v_request_ou,
- prox_ou,
- item_object.circ_modifier,
- item_cn_object.owning_lib,
- item_location_object.owning_lib
- );
- ELSE
- SELECT INTO hold_transit_prox prox::NUMERIC FROM actor.org_unit_proximity WHERE from_org = prox_ou AND to_org = v_pickup_ou;
- END IF;
- IF hold_transit_prox > age_protect_object.prox::NUMERIC THEN
- result.fail_part := 'config.rule_age_hold_protect.prox';
- result.success := FALSE;
- done := TRUE;
- RETURN NEXT result;
- END IF;
- END IF;
- END IF;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement