5 --consider all statuses to be "available" and "opac visible"
6 update config.copy_status set opac_visible = 't', is_available = 't';
8 -- consider all copies / locations to be opac visible
9 -- (since we're comparing staff copy counts with opac counts)
10 update asset.copy_location set opac_visible = 't';
11 update asset.copy set opac_visible = 't';
13 -- the lp bug started because of a hardcoded status list.
14 -- make sure we have at least some items with other statuses.
16 'select id from asset.copy where status not in (0,7,12) and not deleted',
17 'cannot test: no suitable copies for comparison'
22 with min_ou as (select min(id) as id from actor.org_unit)
23 select distinct(record)
25 asset.copy cpy join asset.call_number cn on cpy.call_number = cn.id
26 where not cpy.deleted and cpy.status not in (0,7,12)
27 and (select available from asset.staff_ou_record_copy_count(min_ou.id, cn.record))
29 (select available from asset.opac_ou_record_copy_count(min_ou.id, cn.record))
30 ','inconsistent available copy counts between staff client and opac'
33 SELECT * FROM finish();