]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP 2061136 follow-up: ng lint --fix
[working/Evergreen.git] / Open-ILS / examples / fm_IDL.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4 Copyright (C) 2006-2008 Georgia Public Library Service
5 Copyright (C) 2008 Equinox Software, Inc
6 Author: Mike Rylander <miker@esilibrary.com>
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
21
22 ############################
23           TEMPLATE
24 ############################
25
26     <class
27         id=""
28         controller="open-ils.cstore open-ils.pcrud"
29         oils_obj:fieldmapper=""
30         oils_persist:tablename=""
31         reporter:label=""
32         oils_persist:field_safe=""
33         oils_persist:virtual=""
34         oils_persist:readonly=""
35         reporter:core=""
36     >
37
38         <oils_persist:source_definition><![CDATA[
39             SELECT * FROM foo
40         ]]></oils_persist:source_definition>
41
42         <fields oils_persist:primary="" oils_persist:sequence="">
43             <field reporter:label="ID" name="id" reporter:datatype="id"/>
44                         <field reporter:label="" name="" reporter:datatype="org_unit"/>
45             <field reporter:label="" name="" reporter:datatype="text"/>
46             <field reporter:label="" name="" reporter:datatype="link"/>
47             <field reporter:label="" name="" reporter:datatype="timestamp"/>
48             <field reporter:label="" name="" reporter:datatype="money"/>
49             <field reporter:label="" name="" reporter:datatype="bool"/>
50             <field reporter:label="" name="" reporter:datatype="int" oils_obj:required="true"/>
51             <field reporter:label="" name="" reporter:datatype="int" oils_persist:virtual="true"/>
52         </fields>
53
54         <links>
55             <link field="" reltype="has_a" key="" map="" class=""/>
56         </links>
57
58         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
59             <actions>
60                 <create permission="" gloabl_required="true"/>
61                 <retrieve/>
62                 <update permission="" context_field=""/>
63                 <delete permission="">
64                     <context link="" field=""/>
65                 </delete>
66             </actions>
67         </permacrud>
68
69     </class>
70
71
72 -->
73 <IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:idl="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" xmlns:sr="http://open-ils.org/spec/opensrf/IDL/simple-reporter/v1" xmlns:permacrud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
74
75         <!-- Virtual classes -->
76
77         <class id="oaib" controller="open-ils.cstore" oils_obj:fieldmapper="oai::biblio" oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list" oils_persist:tablename="oai.biblio">
78                 <fields oils_persist:primary="rec_id">
79                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
80                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
81                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
82                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
83                 </fields>
84         </class>
85         <class id="oaia" controller="open-ils.cstore" oils_obj:fieldmapper="oai::authority" oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list" oils_persist:tablename="oai.authority">
86                 <fields oils_persist:primary="rec_id">
87                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
88                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
89                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
90                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
91                 </fields>
92         </class>
93
94         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
95                 <fields>
96                         <field name="usr" oils_persist:virtual="true"/>
97                         <field name="forgive_payment" oils_persist:virtual="true"/>
98                         <field name="work_payment" oils_persist:virtual="true"/>
99                         <field name="credit_payment" oils_persist:virtual="true"/>
100                         <field name="goods_payment" oils_persist:virtual="true"/>
101                         <field name="account_adjustment" oils_persist:virtual="true"/>
102                 </fields>
103                 <links>
104                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
105                 </links>
106         </class>
107
108         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
109                 <fields>
110                         <field name="workstation" oils_persist:virtual="true"/>
111                         <field name="cash_payment" oils_persist:virtual="true"/>
112                         <field name="check_payment" oils_persist:virtual="true"/>
113                         <field name="credit_card_payment" oils_persist:virtual="true"/>
114                         <field name="debit_card_payment" oils_persist:virtual="true"/>
115                 </fields>
116                 <links>
117                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
118                 </links>
119         </class>
120
121         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
122                 <fields>
123                         <field name="id" oils_persist:virtual="true"/>
124                         <field name="children" oils_persist:virtual="true"/>
125                         <field name="owner_doc" oils_persist:virtual="true"/>
126                         <field name="intra_doc_id" oils_persist:virtual="true"/>
127                         <field name="parent_node" oils_persist:virtual="true"/>
128                         <field name="node_type" oils_persist:virtual="true"/>
129                         <field name="namespace_uri" oils_persist:virtual="true"/>
130                         <field name="name" oils_persist:virtual="true"/>
131                         <field name="value" oils_persist:virtual="true"/>
132                 </fields>
133         </class>
134
135         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
136                 <fields>
137                         <field name="title" oils_persist:virtual="true"/>
138                         <field name="author" oils_persist:virtual="true"/>
139                         <field name="doc_id" oils_persist:virtual="true"/>
140                         <field name="doc_type" oils_persist:virtual="true"/>
141                         <field name="pubdate" oils_persist:virtual="true"/>
142                         <field name="isbn" oils_persist:virtual="true"/>
143                         <field name="publisher" oils_persist:virtual="true"/>
144                         <field name="tcn" oils_persist:virtual="true"/>
145                         <field name="subject" oils_persist:virtual="true"/>
146                         <field name="types_of_resource" oils_persist:virtual="true"/>
147                         <field name="call_numbers" oils_persist:virtual="true"/>
148                         <field name="edition" oils_persist:virtual="true"/>
149                         <field name="online_loc" oils_persist:virtual="true"/>
150                         <field name="synopsis" oils_persist:virtual="true"/>
151                         <field name="physical_description" oils_persist:virtual="true"/>
152                         <field name="toc" oils_persist:virtual="true"/>
153                         <field name="copy_count" oils_persist:virtual="true"/>
154                         <field name="series" oils_persist:virtual="true"/>
155                         <field name="serials" oils_persist:virtual="true"/>
156                         <field name="foreign_copy_maps" oils_persist:virtual="true"/>
157                 </fields>
158         </class>
159
160         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
161                 <fields>
162                         <field name="err_msg" oils_persist:virtual="true"/>
163                         <field name="type" oils_persist:virtual="true"/>
164                 </fields>
165         </class>
166
167         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
168                 <fields>
169                         <field name="err_msg" oils_persist:virtual="true"/>
170                         <field name="type" oils_persist:virtual="true"/>
171                 </fields>
172         </class>
173
174         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
175                 <fields oils_persist:primary="matchpoint">
176                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
177                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
178                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
179                 </fields>
180                 <links>
181                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
182                 </links>
183         </class>
184
185         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
186                 <!-- when the time is right, turn me into a view.  -->
187                 <fields>
188                         <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
189                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
190                         <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
191                         <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
192                         <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
193                         <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
194                         <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
195                         <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
196                         <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
197                         <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
198                 </fields>
199         </class>
200
201         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
202                 <fields>
203                         <field name="public_name" oils_persist:virtual="true"/>
204                         <field name="target_url" oils_persist:virtual="true"/>
205                         <field name="target_coverage" oils_persist:virtual="true"/>
206                         <field name="target_embargo" oils_persist:virtual="true"/>
207                 </fields>
208         </class>
209
210         <!-- Actually in the DB -->
211         <class id="vmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::merge_profile" oils_persist:tablename="vandelay.merge_profile" reporter:label="Bib Import Merge Profile">
212                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
213                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
214                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
215                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
216                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
217                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
218                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
219                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
220                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
221                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
222                         <field reporter:label="Update Bib. Edit Date" name="update_bib_editor" reporter:datatype="bool"/>
223                 </fields>
224                 <links>
225                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
226                 </links>
227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
228                         <actions>
229                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
230                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
231                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
232                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
233                         </actions>
234                 </permacrud>
235         </class>
236
237         <class id="vibtf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_bib_trash_fields" oils_persist:tablename="vandelay.import_bib_trash_fields" reporter:label="Import/Overlay Fields for Removal">
238                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
239                         <field reporter:label="Field ID" name="id" reporter:datatype="id" reporter:selector="field"/>
240                         <field reporter:label="Group" name="grp" reporter:datatype="link" config_field="true" oils_obj:required="true"/>
241                         <field reporter:label="Field" name="field" reporter:datatype="text" oils_obj:required="true"/>
242                 </fields>
243                 <links>
244                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
245                 </links>
246                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
247                         <actions>
248                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
249                                         <context link="grp" field="owner"/>
250                                 </create>
251                                 <retrieve/>
252                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
253                                         <context link="grp" field="owner"/>
254                                 </update>
255                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
256                                         <context link="grp" field="owner"/>
257                                 </delete>
258                         </actions>
259                 </permacrud>
260         </class>
261
262         <class id="rrbs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="rating::record_badge_score" oils_persist:tablename="rating.record_badge_score" reporter:label="Statistical Popularity Badge">
263                 <fields oils_persist:primary="id" oils_persist:sequence="rating.record_badge_score_id_seq">
264                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
265                         <field reporter:label="Badge" name="badge" reporter:datatype="link" oils_obj:required="true"/>
266                         <field reporter:label="Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
267                         <field reporter:label="Score" name="score" reporter:datatype="int" oils_obj:required="true"/>
268                 </fields>
269                 <links>
270                         <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
271                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
272                 </links>
273                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
274                         <actions>
275                                 <retrieve/>
276                         </actions>
277                 </permacrud>
278         </class>
279
280         <class id="rp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="rating::popularity_parameter" oils_persist:tablename="rating.popularity_parameter" reporter:label="Statistical Popularity Parameter">
281                 <fields oils_persist:primary="id" oils_persist:sequence="rating.popularity_parameter_id_seq">
282                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" oils_obj:required="true"/>
283                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
284                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
285                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
286                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
287                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
288                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
289                 </fields>
290                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
291                         <actions>
292                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
293                                 <retrieve/>
294                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
295                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
296                         </actions>
297                 </permacrud>
298         </class>
299
300         <class id="rb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="rating::badge" oils_persist:tablename="rating.badge" reporter:label="Statistical Popularity Badge">
301                 <fields oils_persist:primary="id" oils_persist:sequence="rating.badge_id_seq">
302                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
303                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
304                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
305                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit" oils_obj:required="true"/>
306                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
307                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
308                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
309                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
310                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
311                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
312                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
313                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
314                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
315                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
316                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
317                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
318                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
319                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
320                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link" oils_obj:required="true"/>
321                 </fields>
322                 <links>
323                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
324                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
325                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
326                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
327                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
328                 </links>
329                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
330                         <actions>
331                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
332                                 <retrieve/>
333                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
334                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
335                         </actions>
336                 </permacrud>
337         </class>
338
339         <class id="vibtg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_bib_trash_group" oils_persist:tablename="vandelay.import_bib_trash_group" reporter:label="Import/Overlay Field Groups for Removal">
340                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
341                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
342                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
343                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
344                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
345                         <field reporter:label="Fields" name="import_bib_trash_fields" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
346                 </fields>
347                 <links>
348                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
349                         <link field="import_bib_trash_fields" reltype="has_many" key="grp" map="" class="vibtf"/>
350                 </links>
351                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
352                         <actions>
353                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
354                                 <retrieve/>
355                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
356                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
357                         </actions>
358                 </permacrud>
359         </class>
360
361
362         <class id="vii" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item" oils_persist:tablename="vandelay.import_item" reporter:label="Import Item">
363                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
364                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
365                         <field reporter:label="Import Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
366                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link" oils_obj:required="true"/>
367                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
368                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
369                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
370                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
371                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
372                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
373                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
374                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
375                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
376                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
377                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
378                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
379                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
380                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
381                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
382                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
383                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
384                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
385                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
386                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
387                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
388                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
389                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
390                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
391                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
392                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
393                 </fields>
394                 <links>
395                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
396                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
397                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
398                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
399                 </links>
400                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
401                         <actions>
402                                 <create permission="CREATE_IMPORT_ITEM">
403                                         <context link="definition" field="owner"/>
404                                 </create>
405                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
406                                         <context link="definition" field="owner"/>
407                                 </retrieve>
408                                 <update permission="UPDATE_IMPORT_ITEM">
409                                         <context link="definition" field="owner"/>
410                                 </update>
411                                 <delete permission="DELETE_IMPORT_ITEM">
412                                         <context link="definition" field="owner"/>
413                                 </delete>
414                         </actions>
415                 </permacrud>
416         </class>
417
418         <class id="viiad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item_attr_definition" oils_persist:tablename="vandelay.import_item_attr_definition" reporter:label="Import Item Attribute Definition">
419                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
420                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
421                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
422                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
423                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
424                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
425                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
426                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
427                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
428                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
429                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
430                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
431                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
432                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
433                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
434                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
435                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
436                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
437                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
438                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
439                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
440                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
441                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
442                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
443                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
444                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
445                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
446                 </fields>
447                 <links>
448                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
449                 </links>
450                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
451                         <actions>
452                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
453                                 <retrieve permission="CREATE_IMPORT_ITEM_ATTR_DEF UPDATE_IMPORT_ITEM_ATTR_DEF DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
454                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
455                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
456                         </actions>
457                 </permacrud>
458         </class>
459
460         <class id="vbq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_queue" oils_persist:tablename="vandelay.bib_queue" reporter:label="Import/Overlay Bib Queue">
461                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
462                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
463                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
464                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
465                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
466                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
467                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
468                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
469                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
470                 </fields>
471                 <links>
472                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
473                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
474                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
475                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
476                 </links>
477                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
478                         <actions>
479                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
480                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
481                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
482                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
483                         </actions>
484                 </permacrud>
485         </class>
486
487         <class id="vie" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_error" oils_persist:tablename="vandelay.import_error" reporter:label="Import/Overlay Error Definitions">
488                 <fields oils_persist:primary="code">
489                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id" oils_obj:required="true"/>
490                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
491                 </fields>
492                 <links>
493                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
494                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
495                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
496                 </links>
497                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
498                         <actions>
499                                 <retrieve/>
500                         </actions>
501                 </permacrud>
502         </class>
503
504         <class id="vqbr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record" oils_persist:tablename="vandelay.queued_bib_record" reporter:label="Queued Bib Record">
505                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
506                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
507                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
508                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
509                         <field reporter:label="MARC" name="marc" reporter:datatype="text" oils_obj:required="true"/>
510                         <field reporter:label="Queue" name="queue" reporter:datatype="link" oils_obj:required="true"/>
511                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
512                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
513                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
514                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
515                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
516                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
517                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
518                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
519                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
520                 </fields>
521                 <links>
522                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
523                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
524                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
525                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
526                         <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
527                         <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
528                         <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
529                 </links>
530                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
531                         <actions>
532                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
533                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
534                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
535                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
536                         </actions>
537                 </permacrud>
538         </class>
539
540         <class id="vqbrad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_attr_definition" oils_persist:tablename="vandelay.bib_attr_definition" reporter:label="Queued Bib Record Attribute Definition">
541                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
542                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
543                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
544                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
545                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
546                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
547                 </fields>
548                 <links/>
549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
550                         <actions>
551                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
552                                 <retrieve/>
553                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
554                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
555                         </actions>
556                 </permacrud>
557         </class>
558
559         <class id="vqbra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record_attr" oils_persist:tablename="vandelay.queued_bib_record_attr" reporter:label="Queued Bib Record Attribute">
560                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
561                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
562                         <field reporter:label="Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
563                         <field reporter:label="Field" name="field" reporter:datatype="link" oils_obj:required="true"/>
564                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" oils_obj:required="true"/>
565                 </fields>
566                 <links>
567                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
568                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
569                 </links>
570                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
571                         <actions>
572                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
573                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
574                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
575                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
576                         </actions>
577                 </permacrud>
578         </class>
579
580         <class id="vbm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_match" oils_persist:tablename="vandelay.bib_match" reporter:label="Queued Bib Record Match">
581                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
582                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
583                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
584                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
585                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
586                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
587                 </fields>
588                 <links>
589                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
590                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
591                 </links>
592                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
593                         <actions>
594                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
595                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
596                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
597                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
598                         </actions>
599                 </permacrud>
600         </class>
601
602         <class id="vaq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_queue" oils_persist:tablename="vandelay.authority_queue" reporter:label="Import/Overlay Authority Queue">
603                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
604                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
605                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
606                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
607                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
608                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
609                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
610                 </fields>
611                 <links>
612                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
613                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
614                 </links>
615                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
616                         <actions>
617                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
618                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
619                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
620                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
621                         </actions>
622                 </permacrud>
623         </class>
624
625         <class id="vqar" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record" oils_persist:tablename="vandelay.queued_authority_record" reporter:label="Queued Authority Record">
626                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
627                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
628                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
629                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
630                         <field reporter:label="MARC" name="marc" reporter:datatype="text" oils_obj:required="true"/>
631                         <field reporter:label="Queue" name="queue" reporter:datatype="link" oils_obj:required="true"/>
632                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
633                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
634                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
635                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
636                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
637                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
638                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
639                 </fields>
640                 <links>
641                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
642                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
643                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
644                         <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
645                         <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
646                 </links>
647                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
648                         <actions>
649                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
650                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
651                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
652                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
653                         </actions>
654                 </permacrud>
655         </class>
656
657         <class id="vqarad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_attr_definition" oils_persist:tablename="vandelay.authority_attr_definition" reporter:label="Queued Authority Record Attribute Definition">
658                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
659                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
660                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
661                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
662                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
663                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
664                 </fields>
665                 <links/>
666                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
667                         <actions>
668                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
669                                 <retrieve/>
670                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
671                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
672                         </actions>
673                 </permacrud>
674         </class>
675
676         <class id="vqara" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record_attr" oils_persist:tablename="vandelay.queued_authority_record_attr" reporter:label="Queued Authority Record Attribute">
677                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
678                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
679                         <field reporter:label="Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
680                         <field reporter:label="Field" name="field" reporter:datatype="link" oils_obj:required="true"/>
681                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" oils_obj:required="true"/>
682                 </fields>
683                 <links>
684                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
685                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
686                 </links>
687                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
688                         <actions>
689                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
690                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
691                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
692                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
693                         </actions>
694                 </permacrud>
695         </class>
696
697         <class id="vam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_match" oils_persist:tablename="vandelay.authority_match" reporter:label="Queued Authority Record Match">
698                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
699                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
700                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
701                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
702                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
703                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
704                 </fields>
705                 <links>
706                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
707                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
708                 </links>
709                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
710                         <actions>
711                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
712                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
713                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
714                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
715                         </actions>
716                 </permacrud>
717         </class>
718
719         <class id="vms" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set" oils_persist:tablename="vandelay.match_set" reporter:label="Record Matching Definition Set">
720                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
721                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
722                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
723                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link" oils_obj:required="true"/>
724                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
725                 </fields>
726                 <links>
727                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
728                 </links>
729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
730                         <actions>
731                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
732                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
733                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
734                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
735                         </actions>
736                 </permacrud>
737         </class>
738
739         <class id="vmsp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_point" oils_persist:tablename="vandelay.match_set_point" reporter:label="Record Matching Definition">
740                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
741                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
742                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
743                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
744                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
745                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
746                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
747                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
748                         <field reporter:label="Negate" name="negate" reporter:datatype="bool"/>
749                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
750                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
751                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
752                 </fields>
753                 <links>
754                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
755                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
756                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
757                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
758                 </links>
759                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
760                         <actions>
761                                 <create permission="ADMIN_IMPORT_MATCH_SET">
762                                         <context link="match_set" field="owner"/>
763                                 </create>
764                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
765                                         <context link="match_set" field="owner"/>
766                                 </retrieve>
767                                 <update permission="ADMIN_IMPORT_MATCH_SET">
768                                         <context link="match_set" field="owner"/>
769                                 </update>
770                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
771                                         <context link="match_set" field="owner"/>
772                                 </delete>
773                         </actions>
774                 </permacrud>
775         </class>
776
777         <class id="vmsq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_quality" oils_persist:tablename="vandelay.match_set_quality" reporter:label="Record Quality Metric">
778                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
779                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
780                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link" oils_obj:required="true"/>
781                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
782                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
783                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
784                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
785                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
786                 </fields>
787                 <links>
788                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
789                 </links>
790                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
791                         <actions>
792                                 <create permission="ADMIN_IMPORT_MATCH_SET">
793                                         <context link="match_set" field="owner"/>
794                                 </create>
795                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
796                                         <context link="match_set" field="owner"/>
797                                 </retrieve>
798                                 <update permission="ADMIN_IMPORT_MATCH_SET">
799                                         <context link="match_set" field="owner"/>
800                                 </update>
801                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
802                                         <context link="match_set" field="owner"/>
803                                 </delete>
804                         </actions>
805                 </permacrud>
806         </class>
807
808         <class id="vst" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::session_tracker" oils_persist:tablename="vandelay.session_tracker" reporter:label="Vandelay Session Tracker">
809                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.session_tracker_id_seq">
810                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
811                         <field reporter:label="Session Key" name="session_key" reporter:datatype="text" oils_obj:required="true"/>
812                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
813                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
814                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link" oils_obj:required="true"/>
815                         <field reporter:label="Record Type" name="record_type" reporter:datatype="text"/>
816                         <!-- queue doesn't use datatype 'link' because it may refer to a bib
817                                  queue or an auth queue and there's no IDL class for vandelay.queue .
818                                  parent table.
819                         -->
820                         <field reporter:label="Source Queue" name="queue" reporter:datatype="int" oils_obj:required="true"/>
821                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
822                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
823                         <field reporter:label="State" name="state" reporter:datatype="text"/>
824                         <field reporter:label="Action Type" name="action_type" reporter:datatype="text"/>
825                         <field reporter:label="Total Actions" name="total_actions" reporter:datatype="int"/>
826                         <field reporter:label="Actions Performed" name="actions_performed" reporter:datatype="int"/>
827                 </fields>
828                 <links>
829                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
830                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
831                 </links>
832                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
833                         <actions>
834                                 <!-- created by the API -->
835                                 <retrieve global_required="true" permission="CREATE_BIB_IMPORT_QUEUE CREATE_AUTHORITY_IMPORT_QUEUE"/>
836                                 <update global_required="true" permission="UPDATE_BIB_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE">
837                                         <context link="workstation" field="owning_lib"/>
838                                 </update>
839                                 <delete permission="DELETE_BIB_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE">
840                                         <context link="workstation" field="owning_lib"/>
841                                 </delete>
842                         </actions>
843                 </permacrud>
844         </class>
845
846         <class id="auoi" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_org_unit_opt_in" oils_persist:tablename="actor.usr_org_unit_opt_in" reporter:label="User Sharing Opt-in">
847                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
848                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
849                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link" oils_obj:required="true"/>
850                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link" oils_obj:required="true"/>
851                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
852                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
853                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
854                 </fields>
855                 <links>
856                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
857                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
858                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
859                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
860                 </links>
861         </class>
862
863         <class id="cgf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::global_flag" oils_persist:tablename="config.global_flag" reporter:label="Global Flags and Settings" oils_persist:field_safe="true">
864                 <fields oils_persist:primary="name">
865                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
866                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
867                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
868                         <field reporter:label="Enabled" name="enabled" reporter:datatype="bool"/>
869                 </fields>
870                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
871                         <actions>
872                                 <create permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
873                                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
874                                 <update permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
875                                 <delete permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
876                         </actions>
877                 </permacrud>
878         </class>
879
880         <class id="cin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::index_normalizer" oils_persist:tablename="config.index_normalizer" reporter:label="Indexing Normalizer" oils_persist:field_safe="true">
881                 <fields oils_persist:primary="id">
882                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
883                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
884                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
885                         <field reporter:label="Function" name="func" reporter:datatype="text" oils_obj:required="true"/>
886                         <field reporter:label="Required Parameter Count" name="param_count" reporter:datatype="int"/>
887                 </fields>
888                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
889                         <actions>
890                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
891                                 <retrieve/>
892                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
893                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
894                         </actions>
895                 </permacrud>
896         </class>
897
898         <class id="cmfinm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_index_norm_map" oils_persist:tablename="config.metabib_field_index_norm_map" reporter:label="Metabib Field to Indexing Normalizer Map" oils_persist:field_safe="true">
899                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
900                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
901                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link" oils_obj:required="true"/>
902                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link" oils_obj:required="true"/>
903                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
904                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
905                 </fields>
906                 <links>
907                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
908                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
909                 </links>
910                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
911                         <actions>
912                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
913                                 <retrieve/>
914                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
915                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
916                         </actions>
917                 </permacrud>
918         </class>
919
920         <class id="cmrcfmt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_format" oils_persist:tablename="config.marc_format" reporter:label="MARC Formats" oils_persist:field_safe="true">
921                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
922                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
923                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
924                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
925                 </fields>
926                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
927                         <actions>
928                                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
929                                 <retrieve/>
930                                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
931                                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
932                         </actions>
933                 </permacrud>
934         </class>
935
936         <class id="cmrcfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_field" oils_persist:tablename="config.marc_field" reporter:label="MARC Fields" oils_persist:field_safe="true">
937                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
938                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
939                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
940                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
941                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
942                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
943                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
944                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
945                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
946                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
947                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
948                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
949                 </fields>
950                 <links>
951                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
952                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
953                 </links>
954                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
955                         <actions>
956                                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
957                                 <retrieve/>
958                                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
959                                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
960                         </actions>
961                 </permacrud>
962         </class>
963
964         <class id="cmrcsubfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_subfield" oils_persist:tablename="config.marc_subfield" reporter:label="MARC Subfields" oils_persist:field_safe="true">
965                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
966                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
967                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
968                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
969                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
970                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
971                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
972                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
973                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
974                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
975                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
976                 </fields>
977                 <links>
978                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
979                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
980                 </links>
981                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
982                         <actions>
983                                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
984                                 <retrieve/>
985                                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
986                                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
987                         </actions>
988                 </permacrud>
989         </class>
990
991         <class id="crad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_definition" oils_persist:tablename="config.record_attr_definition" reporter:label="SVF Record Attribute Defintion" oils_persist:field_safe="true">
992                 <fields oils_persist:primary="name">
993                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label" oils_obj:required="true"/>
994                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
995                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
996                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
997                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
998                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
999                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
1000                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
1001                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
1002                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
1003                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
1004                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
1005                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
1006                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
1007                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
1008                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
1009                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
1010                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
1011                 </fields>
1012                 <links>
1013                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
1014                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
1015                 </links>
1016                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1017                         <actions>
1018                                 <create permission="ADMIN_SVF" global_required="true"/>
1019                                 <retrieve/>
1020                                 <update permission="ADMIN_SVF" global_required="true"/>
1021                                 <delete permission="ADMIN_SVF" global_required="true"/>
1022                         </actions>
1023                 </permacrud>
1024         </class>
1025
1026         <class id="csc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::sms_carrier" oils_persist:tablename="config.sms_carrier" reporter:label="SMS Carrier" oils_persist:field_safe="true">
1027                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
1028                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1029                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
1030                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1031                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1032                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
1033                 </fields>
1034                 <links/>
1035                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1036                         <actions>
1037                                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
1038                                 <retrieve/>
1039                                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1040                                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1041                         </actions>
1042                 </permacrud>
1043         </class>
1044
1045         <class id="ccraed" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::composite_attr_entry_definition" oils_persist:tablename="config.composite_attr_entry_definition" reporter:label="Composite Attribute Definitions" oils_persist:field_safe="true">
1046                 <fields oils_persist:primary="coded_value">
1047                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1048                         <field reporter:label="Defintion" name="definition" reporter:datatype="text" oils_obj:required="true"/>
1049                 </fields>
1050                 <links>
1051                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1052                 </links>
1053                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1054                         <actions>
1055                                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1056                                 <retrieve/>
1057                                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1058                                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1059                         </actions>
1060                 </permacrud>
1061         </class>
1062
1063         <class id="murav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::uncontrolled_record_attr_value" oils_persist:tablename="metabib.uncontrolled_record_attr_value" reporter:label="Uncontrolled Record Attribute Values" oils_persist:field_safe="true">
1064                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1065                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1066                         <field reporter:label="Attribute" name="attr" reporter:datatype="text" oils_obj:required="true"/>
1067                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1068                 </fields>
1069                 <links>
1070                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1071                 </links>
1072                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1073                         <actions>
1074                                 <retrieve/>
1075                         </actions>
1076                 </permacrud>
1077         </class>
1078
1079
1080         <class id="mrs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_sorter" oils_persist:tablename="metabib.record_sorter" reporter:label="Record Sort Values" oils_persist:field_safe="true">
1081                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1082                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1083                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1084                         <field reporter:label="Attribute" name="attr" reporter:datatype="text" oils_obj:required="true"/>
1085                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1086                 </fields>
1087                 <links>
1088                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1089                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1090                 </links>
1091                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1092                         <actions>
1093                                 <retrieve/>
1094                         </actions>
1095                 </permacrud>
1096         </class>
1097
1098
1099         <class id="mravl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_vector_list" oils_persist:tablename="metabib.record_attr_vector_list" reporter:label="MVF Record Attribute Vectors" oils_persist:field_safe="true">
1100                 <fields oils_persist:primary="source">
1101                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1102                         <field reporter:label="Vector" name="vlist" reporter:datatype="text" oils_obj:required="true"/> <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
1103                 </fields>
1104                 <links>
1105                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1106                 </links>
1107                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1108                         <actions>
1109                                 <retrieve/>
1110                         </actions>
1111                 </permacrud>
1112         </class>
1113
1114         <class id="mraf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_flat" oils_persist:tablename="metabib.record_attr_flat" reporter:label="MVF Record Attribute Flat List" oils_persist:field_safe="true">
1115                 <fields>
1116                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1117                         <field reporter:label="Attribute" name="attr" reporter:datatype="text" oils_obj:required="true"/>
1118                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1119                 </fields>
1120                 <links>
1121                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1122                 </links>
1123                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1124                         <actions>
1125                                 <retrieve/>
1126                         </actions>
1127                 </permacrud>
1128         </class>
1129
1130         <class id="mra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr" oils_persist:tablename="metabib.record_attr" reporter:label="SVF Record Attribute" oils_persist:field_safe="true" oils_persist:readonly="true">
1131                 <fields oils_persist:primary="id">
1132                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1133                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text" oils_obj:required="true"/>
1134                 </fields>
1135                 <links>
1136                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1137                 </links>
1138                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1139                         <actions>
1140                                 <retrieve/>
1141                         </actions>
1142                 </permacrud>
1143         </class>
1144
1145         <class id="crainm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_index_norm_map" oils_persist:tablename="config.record_attr_index_norm_map" reporter:label="SVF Record Attribute to Indexing Normalizer Map" oils_persist:field_safe="true">
1146                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1147                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1148                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
1149                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link" oils_obj:required="true"/>
1150                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1151                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1152                 </fields>
1153                 <links>
1154                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1155                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1156                 </links>
1157                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1158                         <actions>
1159                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1160                                 <retrieve/>
1161                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1162                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1163                         </actions>
1164                 </permacrud>
1165         </class>
1166
1167         <class id="ccvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::coded_value_map" oils_persist:tablename="config.coded_value_map" reporter:label="SVF Record Attribute Coded Value Map" oils_persist:field_safe="true">
1168                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1169                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true" reporter:selector="value"/>
1170                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link" oils_obj:required="true"/>
1171                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
1172                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
1173                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1174                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1175                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1176                         <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1177                         <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1178                         <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1179                 </fields>
1180                 <links>
1181                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1182                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1183                 </links>
1184                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1185                         <actions>
1186                                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1187                                 <retrieve/>
1188                                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1189                                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1190                         </actions>
1191                 </permacrud>
1192         </class>
1193
1194         <class id="cracct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remote_account" oils_persist:tablename="config.remote_account" reporter:label="Remote (3rd party) Account">
1195                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1196                         <field name="id" reporter:datatype="id" reporter:label="ID"/>
1197                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
1198                         <field name="host" reporter:datatype="text" reporter:label="Host" oils_obj:required="true"/>
1199                         <field name="username" reporter:datatype="text" reporter:label="Username"/>
1200                         <field name="password" reporter:datatype="text" reporter:label="Password"/>
1201                         <field name="account" reporter:datatype="text" reporter:label="Account"/>
1202                         <field name="path" reporter:datatype="text" reporter:label="Path"/>
1203                         <field name="owner" reporter:datatype="link" reporter:label="Owner" oils_obj:required="true"/>
1204                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1205                 </fields>
1206                 <links>
1207                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1208                 </links>
1209                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1210                         <actions>
1211                                 <create permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1212                                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1213                                 <update permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1214                                 <delete permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1215                         </actions>
1216                 </permacrud>
1217         </class>
1218
1219         <class id="czs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_source" oils_persist:tablename="config.z3950_source" reporter:label="Z39.50 Source">
1220                 <fields oils_persist:primary="name">
1221                         <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id" oils_obj:required="true"/>
1222                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1223                         <field reporter:label="Host" name="host" reporter:datatype="text" oils_obj:required="true"/>
1224                         <field reporter:label="Port" name="port" reporter:datatype="int" oils_obj:required="true"/>
1225                         <field reporter:label="DB" name="db" reporter:datatype="text" oils_obj:required="true"/>
1226                         <field reporter:label="Record Format" name="record_format" reporter:datatype="text"/>
1227                         <field reporter:label="Transmission Format" name="transmission_format" reporter:datatype="text"/>
1228                         <field reporter:label="Auth" name="auth" reporter:datatype="bool"/>
1229                         <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
1230                         <field reporter:label="Use Permission" name="use_perm" reporter:datatype="link"/>
1231                 </fields>
1232                 <links>
1233                         <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1234                         <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1235                 </links>
1236                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1237                         <actions>
1238                                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1239                                 <retrieve/>
1240                                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1241                                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1242                         </actions>
1243                 </permacrud>
1244         </class>
1245
1246         <class id="cza" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
1247                 <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1248                         <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1249                         <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link" config_field="true" oils_obj:required="true"/>
1250                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
1251                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1252                         <field reporter:label="Code" name="code" reporter:datatype="int" oils_obj:required="true"/>
1253                         <field reporter:label="Format" name="format" reporter:datatype="int" oils_obj:required="true"/>
1254                         <field reporter:label="Truncation" name="truncation" reporter:datatype="int"/>
1255                 </fields>
1256                 <links>
1257                         <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1258                 </links>
1259                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1260                         <actions>
1261                                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1262                                 <retrieve/>
1263                                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1264                                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1265                         </actions>
1266                 </permacrud>
1267         </class>
1268
1269         <class id="czifm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_index_field_map" oils_persist:tablename="config.z3950_index_field_map" reporter:label="Z39.50 Index Field Map">
1270                 <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1271                         <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1272                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1273                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1274                         <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1275                         <field reporter:label="Z39.50 Attribute" name="z3950_attr" reporter:datatype="link"/>
1276                         <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1277                 </fields>
1278                 <links>
1279                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1280                         <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1281                         <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1282                 </links>
1283                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1284                         <actions>
1285                                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1286                                 <retrieve/>
1287                                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1288                                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1289                         </actions>
1290                 </permacrud>
1291         </class>
1292
1293
1294         <class id="ateo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_output" oils_persist:tablename="action_trigger.event_output" reporter:label="Event Output">
1295                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1296                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1297                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1298                         <field reporter:label="Data" name="data" reporter:datatype="text" oils_obj:required="true"/>
1299                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1300                         <field reporter:label="Events" name="events" oils_persist:virtual="true" reporter:datatype="link"/>
1301                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true" reporter:datatype="link"/>
1302                         <field reporter:label="Output Locale" name="locale" reporter:datatype="text"/>
1303                 </fields>
1304                 <links>
1305                         <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1306                         <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1307                 </links>
1308                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1309                         <actions>
1310                                 <retrieve/>
1311                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1312                         </actions>
1313                 </permacrud>
1314         </class>
1315
1316         <class id="ath" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::hook" oils_persist:tablename="action_trigger.hook" reporter:label="Trigger Hook Point">
1317                 <fields oils_persist:primary="key">
1318                         <field reporter:label="Hook Key" name="key" reporter:datatype="text" reporter:selector="key" oils_obj:required="true"/>
1319                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text" oils_obj:required="true"/>
1320                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1321                         <field reporter:label="Passive" name="passive" reporter:datatype="bool"/>
1322                 </fields>
1323                 <links/>
1324                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1325                         <actions>
1326                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1327                                 <retrieve/>
1328                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1329                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1330                         </actions>
1331                 </permacrud>
1332         </class>
1333
1334         <class id="atcol" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1335                 <fields oils_persist:primary="module">
1336                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1337                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1338                 </fields>
1339                 <links/>
1340                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1341                         <actions>
1342                                 <retrieve/>
1343                         </actions>
1344                 </permacrud>
1345         </class>
1346
1347         <class id="atval" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::validator" oils_persist:tablename="action_trigger.validator" reporter:label="Trigger Condition Validator">
1348                 <fields oils_persist:primary="module">
1349                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1350                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1351                 </fields>
1352                 <links/>
1353                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1354                         <actions>
1355                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1356                                 <retrieve/>
1357                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1358                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1359                         </actions>
1360                 </permacrud>
1361         </class>
1362
1363         <class id="atreact" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::reactor" oils_persist:tablename="action_trigger.reactor" reporter:label="Trigger Event Reactor">
1364                 <fields oils_persist:primary="module">
1365                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1366                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1367                 </fields>
1368                 <links/>
1369                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1370                         <actions>
1371                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1372                                 <retrieve/>
1373                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1374                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1375                         </actions>
1376                 </permacrud>
1377         </class>
1378
1379         <class id="atclean" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::cleanup" oils_persist:tablename="action_trigger.cleanup" reporter:label="Trigger Event Cleanup">
1380                 <fields oils_persist:primary="module">
1381                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1382                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1383                 </fields>
1384                 <links/>
1385                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1386                         <actions>
1387                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1388                                 <retrieve/>
1389                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1390                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1391                         </actions>
1392                 </permacrud>
1393         </class>
1394
1395         <class id="atenv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::environment" oils_persist:tablename="action_trigger.environment" reporter:label="Trigger Event Environment Entry">
1396                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1397                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1398                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1399                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1400                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1401                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1402                 </fields>
1403                 <links>
1404                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1405                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1406                 </links>
1407                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1408                         <actions>
1409                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1410                                         <context link="event_def" field="owner"/>
1411                                 </create>
1412                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1413                                         <context link="event_def" field="owner"/>
1414                                 </retrieve>
1415                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1416                                         <context link="event_def" field="owner"/>
1417                                 </update>
1418                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1419                                         <context link="event_def" field="owner"/>
1420                                 </delete>
1421                         </actions>
1422                 </permacrud>
1423         </class>
1424
1425         <class id="atevdef" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_definition" oils_persist:tablename="action_trigger.event_definition" reporter:label="Trigger Event Definition">
1426                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1427                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1428                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1429                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
1430                         <field reporter:label="Hook" name="hook" reporter:datatype="link" oils_obj:required="true"/>
1431                         <field reporter:label="Validator" name="validator" reporter:datatype="link" oils_obj:required="true"/>
1432                         <field reporter:label="Reactor" name="reactor" reporter:datatype="link" oils_obj:required="true"/>
1433                         <field reporter:label="Success Cleanup" name="cleanup_success" reporter:datatype="link"/>
1434                         <field reporter:label="Failure Cleanup" name="cleanup_failure" reporter:datatype="link"/>
1435                         <field reporter:label="Processing Delay" name="delay" reporter:datatype="interval"/>
1436                         <field reporter:label="Max Event Validity Delay" name="max_delay" reporter:datatype="interval"/>
1437                         <field reporter:label="Processing Delay Context Field" name="delay_field" reporter:datatype="text"/>
1438                         <field reporter:label="Processing Group Context Field" name="group_field" reporter:datatype="text"/>
1439                         <field reporter:label="Template" name="template" reporter:datatype="text"/>
1440                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
1441                         <field reporter:label="Granularity" name="granularity" reporter:datatype="text"/>
1442                         <field reporter:label="Opt-In User Field" name="usr_field" reporter:datatype="text"/>
1443                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting" reporter:datatype="link"/>
1444                         <field reporter:label="Event Repeatability Delay" name="repeat_delay" reporter:datatype="interval"/>
1445                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1446                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1447                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1448                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1449                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true" reporter:datatype="link"/>
1450                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true" reporter:datatype="link"/>
1451                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1452                         <field reporter:label="Context User Path" name="context_usr_path" reporter:datatype="text"/>
1453                         <field reporter:label="Context Library Path" name="context_library_path" reporter:datatype="text"/>
1454                         <field reporter:label="Context Bib Path" name="context_bib_path" reporter:datatype="text"/>
1455                         <field reporter:label="Context Item Path" name="context_item_path" reporter:datatype="text"/>
1456                 </fields>
1457                 <links>
1458                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1459                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1460                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1461                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1462                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1463                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1464                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1465                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1466                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1467                 </links>
1468                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1469                         <actions>
1470                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1471                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1472                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1473                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1474                         </actions>
1475                 </permacrud>
1476         </class>
1477
1478         <class id="atevalt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::alternate_template" oils_persist:tablename="action_trigger.alternate_template" reporter:label="Alternate Action Trigger Templates">
1479                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.alternate_template_id_seq">
1480                         <field reporter:label="Alternate Template ID" name="id" reporter:datatype="id"/>
1481                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1482                         <field reporter:label="Template" name="template" reporter:datatype="text"/>
1483                         <field reporter:label="Template Locale" name="locale" reporter:datatype="link" oils_obj:required="true"/>
1484                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1485                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1486                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1487                 </fields>
1488                 <links>
1489                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1490                         <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
1491                 </links>
1492                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1493                         <actions>
1494                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1495                                         <context link="event_def" field="owner"/>
1496                                 </create>
1497                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1498                                         <context link="event_def" field="owner"/>
1499                                 </retrieve>
1500                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1501                                         <context link="event_def" field="owner"/>
1502                                 </update>
1503                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1504                                         <context link="event_def" field="owner"/>
1505                                 </delete>
1506                         </actions>
1507                 </permacrud>
1508         </class>
1509
1510
1511         <class id="atevdefg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_def_group" oils_persist:tablename="action_trigger.event_def_group" reporter:label="Trigger Event Definition Group" oils_persist:restrict_primary="100">
1512                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_id_seq">
1513                         <field reporter:label="Group ID" name="id" reporter:datatype="id"/>
1514                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1515                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
1516                         <field reporter:label="Hook" name="hook" reporter:datatype="link" oils_obj:required="true"/>
1517                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
1518                         <field reporter:label="Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
1519                 </fields>
1520                 <links>
1521                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1522                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1523                         <link field="members" reltype="has_many" key="grp" map="" class="atevdefgm"/>
1524                 </links>
1525                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1526                         <actions>
1527                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1528                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1529                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1530                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1531                         </actions>
1532                 </permacrud>
1533         </class>
1534
1535         <class id="atevdefgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_def_group_member" oils_persist:tablename="action_trigger.event_def_group_member" reporter:label="Trigger Event Definition Group Member">
1536                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_member_id_seq">
1537                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1538                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
1539                         <field reporter:label="Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1540                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1541                         <field reporter:label="Sortable" name="sortable" reporter:datatype="bool"/>
1542                         <field reporter:label="Include Holdings" name="holdings" reporter:datatype="bool"/>
1543                         <field reporter:label="Externally Processed" name="external" reporter:datatype="bool"/>
1544                 </fields>
1545                 <links>
1546                         <link field="grp" reltype="has_a" key="id" map="" class="atevdefg"/>
1547                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1548                 </links>
1549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1550                         <actions>
1551                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1552                                         <context link="grp" field="owner"/>
1553                                 </create>
1554                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1555                                         <context link="grp" field="owner"/>
1556                                 </retrieve>
1557                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1558                                         <context link="grp" field="owner"/>
1559                                 </update>
1560                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1561                                         <context link="grp" field="owner"/>
1562                                 </delete>
1563                         </actions>
1564                 </permacrud>
1565         </class>
1566
1567         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1568                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1569                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1570                         <field reporter:label="Target ID" name="target" reporter:datatype="int" oils_obj:required="true"/>
1571                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1572                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1573                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp" oils_obj:required="true"/>
1574                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1575                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1576                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1577                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1578                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1579                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1580                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1581                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1582                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1583                         <field reporter:label="Context User" name="context_user" reporter:datatype="link"/>
1584                         <field reporter:label="Context Library" name="context_library" reporter:datatype="link"/>
1585                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link"/>
1586                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link"/>
1587                 </fields>
1588                 <links>
1589                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1590                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1591                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1592                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1593                         <link field="context_user" reltype="has_a" key="id" map="" class="au"/>
1594                         <link field="context_library" reltype="has_a" key="id" map="" class="aou"/>
1595                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre"/>
1596                         <link field="context_item" reltype="has_a" key="id" map="" class="acp"/>
1597                 </links>
1598         </class>
1599
1600         <class id="atevparam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_param" oils_persist:tablename="action_trigger.event_params" reporter:label="Trigger Event Parameter">
1601                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1602                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1603                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1604                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text" oils_obj:required="true"/>
1605                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1606                 </fields>
1607                 <links>
1608                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1609                 </links>
1610                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1611                         <actions>
1612                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1613                                         <context link="event_def" field="owner"/>
1614                                 </create>
1615                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1616                                         <context link="event_def" field="owner"/>
1617                                 </retrieve>
1618                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1619                                         <context link="event_def" field="owner"/>
1620                                 </update>
1621                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1622                                         <context link="event_def" field="owner"/>
1623                                 </delete>
1624                         </actions>
1625                 </permacrud>
1626         </class>
1627
1628         <class id="atul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::user_log" reporter:label="Action Trigger User Log" oils_persist:readonly="true">
1629                 <oils_persist:source_definition><![CDATA[
1630                 SELECT  atevdef.hook,
1631                         atevdef.name,
1632                         atevdef.reactor,
1633                         atev.id,
1634                         atev.event_def,
1635                         atev.add_time,
1636                         atev.run_time,
1637                         atev.start_time,
1638                         atev.update_time,
1639                         atev.complete_time,
1640                         atev.update_process,
1641                         atev.state,
1642                         atev.user_data,
1643                         atev.template_output,
1644                         atev.error_output,
1645                         atev.async_output,
1646                         targ_circ.id AS target_circ,
1647                         targ_ahr.id AS target_hold,
1648                         COALESCE(
1649                                 targ_circ.circ_lib,
1650                                 targ_ahr.pickup_lib
1651                         ) AS perm_lib
1652                 FROM action_trigger.event atev
1653                 JOIN action_trigger.event_definition atevdef ON
1654                         (atevdef.id = atev.event_def)
1655                 JOIN action_trigger.hook ath ON
1656                         (ath.key = atevdef.hook)
1657                 LEFT JOIN action.circulation targ_circ ON
1658                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1659                 LEFT JOIN action.hold_request targ_ahr ON
1660                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1661                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1662                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1663                                 'circ.staff.max_visible_event_age',
1664                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1665                         ) UNION
1666                         SELECT '1000 YEARS'::INTERVAL AS value
1667                 ) ous)
1668                 ]]></oils_persist:source_definition>
1669                 <fields oils_persist:primary="id">
1670                         <field reporter:label="Hook" name="hook" reporter:datatype="link"/>
1671                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
1672                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text"/>
1673                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1674                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int"/>
1675                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp"/>
1676                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp"/>
1677                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp"/>
1678                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp"/>
1679                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1680                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int"/>
1681                         <field reporter:label="Event State" name="state" reporter:datatype="text"/>
1682                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text"/>
1683                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link"/>
1684                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link"/>
1685                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link"/>
1686                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link"/>
1687                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link"/>
1688                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit"/>
1689                 </fields>
1690                 <links>
1691                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1692                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1693                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1694                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1695                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ"/>
1696                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr"/>
1697                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou"/>
1698                 </links>
1699                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1700                         <actions>
1701                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib"/>
1702                         </actions>
1703                 </permacrud>
1704         </class>
1705
1706         <class id="atoul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::optimized_user_log" reporter:label="Action Trigger Optimized User Log" oils_persist:readonly="true">
1707                 <oils_persist:source_definition><![CDATA[
1708                 SELECT  atevdef.hook,
1709                         atevdef.name,
1710                         atevdef.reactor,
1711                         atev.id,
1712                         atev.event_def,
1713                         atev.add_time,
1714                         atev.run_time,
1715                         atev.start_time,
1716                         atev.update_time,
1717                         atev.complete_time,
1718                         atev.update_process,
1719                         atev.state,
1720                         atev.user_data,
1721                         atev.template_output,
1722                         atev.error_output,
1723                         atev.async_output,
1724                         atev.target,
1725                         CASE WHEN ath.core_type = 'circ' THEN atev.target END AS target_circ,
1726                         CASE WHEN ath.core_type = 'ahr' THEN atev.target END AS target_hold,
1727                         atev.context_user,
1728                         atev.context_library,
1729                         atev.context_bib,
1730                         atev.context_item,
1731                         rssr.title,
1732                         rssr.author
1733                 FROM action_trigger.event atev
1734                 JOIN action_trigger.event_definition atevdef ON
1735                         (atevdef.id = atev.event_def)
1736                 JOIN action_trigger.hook ath ON
1737                         (ath.key = atevdef.hook AND ath.core_type IN ('circ','ahr'))
1738                 LEFT JOIN reporter.super_simple_record rssr ON
1739                         (atev.context_bib = rssr.id)
1740                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1741                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1742                                 'circ.staff.max_visible_event_age',
1743                                 atev.context_library
1744                         ) UNION
1745                         SELECT '1000 YEARS'::INTERVAL AS value
1746                 ) ous)
1747                 ]]></oils_persist:source_definition>
1748                 <fields oils_persist:primary="id">
1749                         <field reporter:label="Hook" name="hook" reporter:datatype="link"/>
1750                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
1751                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text"/>
1752                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1753                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int"/>
1754                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp"/>
1755                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp"/>
1756                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp"/>
1757                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp"/>
1758                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1759                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int"/>
1760                         <field reporter:label="Event State" name="state" reporter:datatype="text"/>
1761                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text"/>
1762                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link"/>
1763                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link"/>
1764                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link"/>
1765                         <field reporter:label="Event Target Object ID" name="target" reporter:datatype="link"/>
1766                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link"/>
1767                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link"/>
1768                         <field reporter:label="Context User" name="context_user" reporter:datatype="link"/>
1769                         <field reporter:label="Context Library" name="context_library" reporter:datatype="org_unit"/>
1770                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link"/>
1771                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link"/>
1772                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
1773                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
1774                 </fields>
1775                 <links>
1776                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1777                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1778                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1779                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1780                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ"/>
1781                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr"/>
1782                         <link field="context_user" reltype="has_a" key="id" map="" class="au"/>
1783                         <link field="context_library" reltype="has_a" key="id" map="" class="aou"/>
1784                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre"/>
1785                         <link field="context_item" reltype="has_a" key="id" map="" class="acp"/>
1786                 </links>
1787                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1788                         <actions>
1789                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="context_library"/>
1790                         </actions>
1791                 </permacrud>
1792         </class>
1793
1794         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1795                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1796                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1797                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
1798                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
1799                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1800                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1801                 </fields>
1802                 <links>
1803                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1804                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1805                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1806                 </links>
1807                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1808                         <actions>
1809                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
1810                         </actions>
1811                 </permacrud>
1812         </class>
1813
1814         <class id="ccm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_modifier" oils_persist:tablename="config.circ_modifier" reporter:label="Circulation Modifier">
1815                 <fields oils_persist:primary="code">
1816                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id" oils_obj:required="true"/>
1817                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1818                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1819                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1820                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1821                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1822                 </fields>
1823                 <links/>
1824                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1825                         <actions>
1826                                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1827                                 <retrieve/>
1828                                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1829                                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1830                         </actions>
1831                 </permacrud>
1832         </class>
1833
1834         <class id="aiit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_item_type" oils_persist:tablename="acq.invoice_item_type" reporter:label="Non-bibliographic Invoice Item Type" oils_persist:field_safe="true">
1835                 <fields oils_persist:primary="code">
1836                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id" oils_obj:required="true"/>
1837                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1838                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1839                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1840                 </fields>
1841                 <links/>
1842                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1843                         <actions>
1844                                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1845                                 <retrieve/>
1846                                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1847                                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1848                         </actions>
1849                 </permacrud>
1850         </class>
1851
1852         <class id="acqim" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_method" oils_persist:tablename="acq.invoice_method" reporter:label="Invoice Method used by Vendor" oils_persist:field_safe="true">
1853                 <fields oils_persist:primary="code">
1854                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id" oils_obj:required="true"/>
1855                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1856                 </fields>
1857                 <links/>
1858                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1859                         <actions>
1860                                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1861                                 <retrieve/>
1862                                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1863                                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1864                         </actions>
1865                 </permacrud>
1866         </class>
1867
1868         <class id="ccpbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_type" oils_persist:tablename="container.copy_bucket_type" reporter:label="Copy Bucket Type" oils_persist:field_safe="true">
1869                 <fields oils_persist:primary="code">
1870                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id" oils_obj:required="true"/>
1871                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1872                 </fields>
1873                 <links/>
1874                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1875                         <actions>
1876                                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1877                                 <retrieve/>
1878                                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1879                                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1880                         </actions>
1881                 </permacrud>
1882         </class>
1883
1884         <class id="ccnbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_type" oils_persist:tablename="container.call_number_bucket_type" reporter:label="Call Number Bucket Type" oils_persist:field_safe="true">
1885                 <fields oils_persist:primary="code">
1886                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id" oils_obj:required="true"/>
1887                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1888                 </fields>
1889                 <links/>
1890                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1891                         <actions>
1892                                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1893                                 <retrieve/>
1894                                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1895                                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1896                         </actions>
1897                 </permacrud>
1898         </class>
1899
1900         <class id="bpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_type" oils_persist:tablename="biblio.peer_type" reporter:label="Bibliographic Record Peer Type" oils_persist:field_safe="true">
1901                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1902                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1903                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1904                 </fields>
1905                 <links/>
1906                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1907                         <actions>
1908                                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1909                                 <retrieve/>
1910                                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1911                                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1912                         </actions>
1913                 </permacrud>
1914         </class>
1915
1916         <class id="bpbcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_bib_copy_map" oils_persist:tablename="biblio.peer_bib_copy_map" reporter:label="Bibliographic Record Peer Copy Map">
1917                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1918                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1919                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link" oils_obj:required="true"/>
1920                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link" oils_obj:required="true"/>
1921                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
1922                 </fields>
1923                 <links>
1924                         <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1925                         <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1926                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1927                 </links>
1928                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1929                         <actions>
1930                                 <create permission="UPDATE_COPY">
1931                                         <context link="target_copy" field="circ_lib"/>
1932                                 </create>
1933                                 <retrieve/>
1934                                 <update permission="UPDATE_COPY">
1935                                         <context link="target_copy" field="circ_lib"/>
1936                                 </update>
1937                                 <delete permission="UPDATE_COPY">
1938                                         <context link="target_copy" field="circ_lib"/>
1939                                 </delete>
1940                         </actions>
1941                 </permacrud>
1942         </class>
1943
1944         <class id="cbrebt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_type" oils_persist:tablename="container.biblio_record_entry_bucket_type" reporter:label="Bibliographic Record Bucket Type" oils_persist:field_safe="true">
1945                 <fields oils_persist:primary="code">
1946                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id" oils_obj:required="true"/>
1947                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1948                 </fields>
1949                 <links/>
1950                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1951                         <actions>
1952                                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1953                                 <retrieve/>
1954                                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1955                                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1956                         </actions>
1957                 </permacrud>
1958         </class>
1959
1960         <class id="cubt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_type" oils_persist:tablename="container.user_bucket_type" reporter:label="User Bucket Type" oils_persist:field_safe="true">
1961                 <fields oils_persist:primary="code">
1962                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id" oils_obj:required="true"/>
1963                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
1964                 </fields>
1965                 <links/>
1966                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1967                         <actions>
1968                                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1969                                 <retrieve/>
1970                                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1971                                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1972                         </actions>
1973                 </permacrud>
1974         </class>
1975
1976         <class id="cvrfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::videorecording_format_map" oils_persist:tablename="config.videorecording_format_map" reporter:label="Videorecording Format" oils_persist:field_safe="true">
1977                 <fields oils_persist:primary="code">
1978                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1979                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1980                 </fields>
1981                 <links/>
1982                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1983                         <actions>
1984                                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1985                                 <retrieve/>
1986                                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1987                                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1988                         </actions>
1989                 </permacrud>
1990         </class>
1991
1992         <class id="chmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_weights" oils_persist:tablename="config.hold_matrix_weights" reporter:label="Hold Matrix Weights">
1993                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1994                         <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1995                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
1996                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float" oils_obj:required="true"/>
1997                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="float" oils_obj:required="true"/>
1998                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float" oils_obj:required="true"/>
1999                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float" oils_obj:required="true"/>
2000                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float" oils_obj:required="true"/>
2001                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float" oils_obj:required="true"/>
2002                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float" oils_obj:required="true"/>
2003                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2004                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2005                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2006                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2007                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2008                         <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float" oils_obj:required="true"/>
2009                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float" oils_obj:required="true"/>
2010                         <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float" oils_obj:required="true"/>
2011                 </fields>
2012                 <links/>
2013                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2014                         <actions>
2015                                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2016                                 <retrieve/>
2017                                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2018                                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2019                         </actions>
2020                 </permacrud>
2021         </class>
2022
2023         <class id="ccmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_weights" oils_persist:tablename="config.circ_matrix_weights" reporter:label="Circ Matrix Weights">
2024                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
2025                         <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2026                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
2027                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float" oils_obj:required="true"/>
2028                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float" oils_obj:required="true"/>
2029                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float" oils_obj:required="true"/>
2030                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float" oils_obj:required="true"/>
2031                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float" oils_obj:required="true"/>
2032                         <field reporter:label="Permission Group" name="grp" reporter:datatype="float" oils_obj:required="true"/>
2033                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float" oils_obj:required="true"/>
2034                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float" oils_obj:required="true"/>
2035                         <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float" oils_obj:required="true"/>
2036                         <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float" oils_obj:required="true"/>
2037                         <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float" oils_obj:required="true"/>
2038                         <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float" oils_obj:required="true"/>
2039                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float" oils_obj:required="true"/>
2040                         <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float" oils_obj:required="true"/>
2041                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float" oils_obj:required="true"/>
2042                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float" oils_obj:required="true"/>
2043                         <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float" oils_obj:required="true"/>
2044                 </fields>
2045                 <links/>
2046                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2047                         <actions>
2048                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2049                                 <retrieve/>
2050                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2051                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2052                         </actions>
2053                 </permacrud>
2054         </class>
2055
2056         <class id="cwa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::weight_assoc" oils_persist:tablename="config.weight_assoc" reporter:label="Matrix Weight Association">
2057                 <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
2058                         <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
2059                         <field reporter:label="Active?" name="active" reporter:datatype="bool" oils_obj:required="true"/>
2060                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2061                         <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
2062                         <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
2063                 </fields>
2064                 <links>
2065                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2066                         <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
2067                         <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
2068                 </links>
2069                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2070                         <actions>
2071                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field="org_unit"/>
2072                                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field="org_unit"/>
2073                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field="org_unit"/>
2074                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field="org_unit"/>
2075                         </actions>
2076                 </permacrud>
2077         </class>
2078
2079         <class id="chmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_matchpoint" oils_persist:tablename="config.hold_matrix_matchpoint" reporter:label="Hold Matrix Matchpoint">
2080                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
2081                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2082                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2083                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
2084                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
2085                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
2086                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
2087                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
2088                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
2089                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
2090                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link" oils_obj:required="true"/>
2091                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2092                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2093                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2094                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2095                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2096                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2097                         <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2098                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
2099                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
2100                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
2101                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
2102                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
2103                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
2104                         <field reporter:label="Stop Blocked User?" name="stop_blocked_user" reporter:datatype="bool"/>
2105                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2106                 </fields>
2107                 <links>
2108                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2109                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
2110                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
2111                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
2112                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
2113                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
2114                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
2115                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2116                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2117                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2118                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2119                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2120                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
2121                         <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
2122                 </links>
2123                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2124                         <actions>
2125                                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2126                                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2127                                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2128                                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2129                         </actions>
2130                 </permacrud>
2131         </class>
2132
2133         <class id="ccmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_matchpoint" oils_persist:tablename="config.circ_matrix_matchpoint" reporter:label="Circulation Matrix Matchpoint">
2134                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
2135                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2136                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
2137                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2138                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2139                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
2140                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
2141                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
2142                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
2143                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2144                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
2145                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2146                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2147                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2148                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2149                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2150                         <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
2151                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
2152                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
2153                         <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2154                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
2155                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
2156                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
2157                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
2158                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2159                         <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
2160                         <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
2161                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
2162                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
2163                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
2164                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2165                         <field name="renew_extends_due_date" reporter:datatype="bool" reporter:label="Early Renewal Extends Due Date"/>
2166                         <field name="renew_extend_min_interval" reporter:datatype="interval" reporter:label="Early Renewal Minimum Duration Interval"/>
2167                 </fields>
2168                 <links>
2169                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2170                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2171                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2172                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2173                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2174                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2175                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2176                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2177                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2178                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2179                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2180                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2181                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2182                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2183                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2184                 </links>
2185                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2186                         <actions>
2187                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="org_unit"/>
2188                                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field="org_unit"/>
2189                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="org_unit"/>
2190                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="org_unit"/>
2191                         </actions>
2192                 </permacrud>
2193         </class>
2194
2195         <class id="cclg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_group" oils_persist:tablename="config.circ_limit_group" reporter:label="Circulation Limit Group">
2196                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2197                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2198                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
2199                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2200                 </fields>
2201                 <links/>
2202                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2203                         <actions>
2204                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2205                                 <retrieve/>
2206                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2207                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2208                         </actions>
2209                 </permacrud>
2210         </class>
2211
2212         <class id="ccls" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set" oils_persist:tablename="config.circ_limit_set" reporter:label="Circulation Limit Set">
2213                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2214                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2215                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
2216                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
2217                         <field reporter:label="Items Out" name="items_out" reporter:datatype="int" oils_obj:required="true"/>
2218                         <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2219                         <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2220                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2221                 </fields>
2222                 <links>
2223                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2224                 </links>
2225                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2226                         <actions>
2227                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2228                                 <retrieve/>
2229                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2230                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2231                         </actions>
2232                 </permacrud>
2233         </class>
2234
2235         <class id="ccmlsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_limit_set_map" oils_persist:tablename="config.circ_matrix_limit_set_map" reporter:label="Circulation Matrix Limit Set Map">
2236                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2237                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2238                         <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link" oils_obj:required="true"/>
2239                         <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link" oils_obj:required="true"/>
2240                         <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2241                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2242                 </fields>
2243                 <links>
2244                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2245                         <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2246                 </links>
2247                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2248                         <actions>
2249                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2250                                         <context link="matchpoint" field="org_unit"/>
2251                                 </create>
2252                                 <retrieve/>
2253                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2254                                         <context link="matchpoint" field="org_unit"/>
2255                                 </update>
2256                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2257                                         <context link="matchpoint" field="org_unit"/>
2258                                 </delete>
2259                         </actions>
2260                 </permacrud>
2261         </class>
2262
2263         <class id="cclscmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_circ_mod_map" oils_persist:tablename="config.circ_limit_set_circ_mod_map" reporter:label="Circulation Limit Set Circ Mod Map">
2264                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2265                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2266                         <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link" oils_obj:required="true"/>
2267                         <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link" oils_obj:required="true"/>
2268                 </fields>
2269                 <links>
2270                         <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2271                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2272                 </links>
2273                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2274                         <actions>
2275                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2276                                         <context link="limit_set" field="owning_lib"/>
2277                                 </create>
2278                                 <retrieve/>
2279                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2280                                         <context link="limit_set" field="owning_lib"/>
2281                                 </update>
2282                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2283                                         <context link="limit_set" field="owning_lib"/>
2284                                 </delete>
2285                         </actions>
2286                 </permacrud>
2287         </class>
2288         <class id="cclsacpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_copy_loc_map" oils_persist:tablename="config.circ_limit_set_copy_loc_map" reporter:label="Circulation Limit Set Copy Location Map">
2289                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2290                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2291                         <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link" oils_obj:required="true"/>
2292                         <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link" oils_obj:required="true"/>
2293                 </fields>
2294                 <links>
2295                         <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2296                         <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2297                 </links>
2298                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2299                         <actions>
2300                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2301                                         <context link="limit_set" field="owning_lib"/>
2302                                 </create>
2303                                 <retrieve/>
2304                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2305                                         <context link="limit_set" field="owning_lib"/>
2306                                 </update>
2307                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2308                                         <context link="limit_set" field="owning_lib"/>
2309                                 </delete>
2310                         </actions>
2311                 </permacrud>
2312         </class>
2313
2314         <class id="cclsgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_group_map" oils_persist:tablename="config.circ_limit_set_group_map" reporter:label="Circulation Limit Set Group Map">
2315                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2316                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2317                         <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link" oils_obj:required="true"/>
2318                         <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link" oils_obj:required="true"/>
2319                         <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2320                 </fields>
2321                 <links>
2322                         <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2323                         <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2324                 </links>
2325                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2326                         <actions>
2327                                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2328                                         <context link="limit_set" field="owning_lib"/>
2329                                 </create>
2330                                 <retrieve/>
2331                                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2332                                         <context link="limit_set" field="owning_lib"/>
2333                                 </update>
2334                                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2335                                         <context link="limit_set" field="owning_lib"/>
2336                                 </delete>
2337                         </actions>
2338                 </permacrud>
2339         </class>
2340
2341         <class id="cit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::identification_type" oils_persist:tablename="config.identification_type" reporter:label="Identification Type">
2342                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2343                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2344                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2345                 </fields>
2346                 <links/>
2347                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2348                         <actions>
2349                                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2350                                 <retrieve/>
2351                                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2352                                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2353                         </actions>
2354                 </permacrud>
2355         </class>
2356
2357         <class id="asvq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_question" oils_persist:tablename="action.survey_question" reporter:label="User Survey Question">
2358                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2359                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2360                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2361                         <field reporter:label="Question ID" name="id" reporter:datatype="id"/>
2362                         <field reporter:label="Question" name="question" reporter:datatype="text" oils_obj:required="true"/>
2363                         <field reporter:label="Survey" name="survey" reporter:datatype="link" oils_obj:required="true"/>
2364                 </fields>
2365                 <links>
2366                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2367                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2368                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2369                 </links>
2370                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2371                         <actions>
2372                                 <create permission="ADMIN_SURVEY">
2373                                         <context link="survey" field="owner"/>
2374                                 </create>
2375                                 <retrieve/>
2376                                 <update permission="ADMIN_SURVEY">
2377                                         <context link="survey" field="owner"/>
2378                                 </update>
2379                                 <delete permission="ADMIN_SURVEY">
2380                                         <context link="survey" field="owner"/>
2381                                 </delete>
2382                         </actions>
2383                 </permacrud>
2384         </class>
2385         <class id="mbts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction_summary" oils_persist:tablename="money.materialized_billable_xact_summary" reporter:label="Billable Transaction Summary" oils_persist:readonly="true">
2386                 <fields oils_persist:primary="id" oils_persist:sequence="">
2387                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2388                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2389                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2390                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2391                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2392                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2393                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2394                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2395                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2396                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2397                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2398                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp"/>
2399                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp"/>
2400                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2401                 </fields>
2402                 <links>
2403                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2404                 </links>
2405                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2406                         <actions>
2407                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2408                                         <context link="usr" field="home_ou"/>
2409                                 </retrieve>
2410                         </actions>
2411                 </permacrud>
2412         </class>
2413         <class id="mbtslv" controller="open-ils.cstore" oils_obj:fieldmapper="money::billable_transaction_summary_location_view" oils_persist:tablename="money.billable_xact_summary_location_view" reporter:label="Billable Transaction Summary with Billing Location" oils_persist:readonly="true" reporter:core="true">
2414                 <fields oils_persist:primary="id" oils_persist:sequence="">
2415                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2416                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2417                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2418                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2419                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2420                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2421                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2422                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2423                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2424                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2425                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2426                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp"/>
2427                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp"/>
2428                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2429                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2430                 </fields>
2431                 <links>
2432                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2433                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2434                 </links>
2435         </class>
2436         <class id="aum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message" oils_persist:tablename="actor.usr_message" reporter:label="User Message">
2437                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2438                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2439                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2440                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link" oils_obj:required="true"/>
2441                         <field reporter:label="Message ID" name="id" reporter:datatype="id"/>
2442                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2443                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2444                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
2445                         <field reporter:label="Message" name="message" reporter:datatype="text" oils_obj:required="true"/>
2446                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2447                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2448                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
2449                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2450                 </fields>
2451                 <links>
2452                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2453                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2454                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2455                 </links>
2456                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2457                         <actions> <!-- created magically, so no create action -->
2458                                 <retrieve permission="VIEW_USER" context_field="sending_lib"/>
2459                                 <update permission="UPDATE_USER" context_field="sending_lib"/>
2460                                 <delete permission="UPDATE_USER" context_field="sending_lib"/>
2461                         </actions>
2462                 </permacrud>
2463         </class>
2464         <class id="auml" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_limited" oils_persist:tablename="actor.usr_message_limited" reporter:label="User Message (Limited Access)">
2465                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2466                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2467                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2468                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2469                         <field reporter:label="Message ID" name="id" reporter:datatype="id"/>
2470                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2471                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2472                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2473                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2474                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2475                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2476                         <field reporter:label="Editor" name="usr" reporter:datatype="link"/>
2477                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2478                 </fields>
2479                 <links>
2480                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2481                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2482                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2483                 </links>
2484                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2485                         <actions> <!-- created magically, so no create action -->
2486                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2487                                 <update permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2488                         </actions>
2489                 </permacrud>
2490         </class>
2491         <class id="aump" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_penalty" oils_persist:tablename="actor.usr_message_penalty" reporter:label="User Message Penalty">
2492                 <fields oils_persist:primary="id">
2493                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2494                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2495                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2496                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2497                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2498                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2499                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2500                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2501                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id"/>
2502                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id"/>
2503                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2504                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2505                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2506                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link"/>
2507                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link"/>
2508                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2509                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2510                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2511                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2512                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2513                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
2514                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2515                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2516                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2517                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2518                 </fields>
2519                 <links>
2520                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2521                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2522                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2523                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2524                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2525                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2526                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2527                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2528                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2529                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2530                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2531                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2532                 </links>
2533                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2534                         <actions> <!-- created magically, so no create action -->
2535                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2536                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2537                         </actions>
2538                 </permacrud>
2539         </class>
2540
2541         <class id="aupw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_privacy_waiver" oils_persist:tablename="actor.usr_privacy_waiver" reporter:label="Privacy Waiver">
2542                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2543                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2544                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
2545                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
2546                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool"/>
2547                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool"/>
2548                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool"/>
2549                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool"/>
2550                 </fields>
2551                 <links>
2552                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2553                 </links>
2554                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2555                         <actions>
2556                                 <create permission="UPDATE_USER">
2557                                         <context link="usr" field="home_ou"/>
2558                                 </create>
2559                                 <retrieve permission="VIEW_USER">
2560                                         <context link="usr" field="home_ou"/>
2561                                 </retrieve>
2562                                 <update permission="UPDATE_USER">
2563                                         <context link="usr" field="home_ou"/>
2564                                 </update>
2565                                 <delete permission="UPDATE_USER">
2566                                         <context link="usr" field="home_ou"/>
2567                                 </delete>
2568                         </actions>
2569                 </permacrud>
2570         </class>
2571         <class id="aupr" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_password_reset" oils_persist:tablename="actor.usr_password_reset" reporter:label="User password reset requests">
2572                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2573                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2574                         <field reporter:label="UUID" name="uuid" reporter:datatype="text" oils_obj:required="true"/>
2575                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
2576                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2577                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2578                 </fields>
2579                 <links>
2580                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2581                 </links>
2582         </class>
2583         <class id="aus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2584                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2585                         <field reporter:label="Setting ID" name="id" reporter:datatype="id"/>
2586                         <field reporter:label="Name" name="name" reporter:datatype="link" oils_obj:required="true"/>
2587                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
2588                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
2589                 </fields>
2590                 <links>
2591                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2592                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2593                 </links>
2594                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2595                         <actions>
2596                                 <retrieve permission="VIEW_USER">
2597                                         <context link="usr" field="home_ou"/>
2598                                 </retrieve>
2599                         </actions>
2600                 </permacrud>
2601         </class>
2602         <class id="mafe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::author_field_entry" oils_persist:tablename="metabib.author_field_entry" reporter:label="Author Field Entry">
2603                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2604                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
2605                         <field name="id" reporter:datatype="id"/>
2606                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
2607                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
2608                 </fields>
2609                 <links>
2610                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2611                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2612                 </links>
2613         </class>
2614         <class id="aihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::in_house_use" oils_persist:tablename="action.in_house_use" reporter:core="true" reporter:label="In House Use">
2615                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2616                         <field reporter:label="Use ID" name="id" reporter:datatype="id"/>
2617                         <field reporter:label="Item" name="item" reporter:datatype="int" oils_obj:required="true"/>
2618                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2619                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link" oils_obj:required="true"/>
2620                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2621                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2622                 </fields>
2623                 <links>
2624                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2625                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2626                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2627                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2628                 </links>
2629                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2630                         <actions>
2631                                 <retrieve/>
2632                         </actions>
2633                 </permacrud>
2634         </class>
2635         <class id="ancihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cat_in_house_use" oils_persist:tablename="action.non_cat_in_house_use" reporter:core="true" reporter:label="Non-cataloged In House Use">
2636                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2637                         <field reporter:label="Use ID" name="id" reporter:datatype="id"/>
2638                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link" oils_obj:required="true"/>
2639                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2640                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link" oils_obj:required="true"/>
2641                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2642                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2643                 </fields>
2644                 <links>
2645                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2646                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2647                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2648                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2649                 </links>
2650                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2651                         <actions>
2652                                 <retrieve/>
2653                         </actions>
2654                 </permacrud>
2655         </class>
2656         <class id="atc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::transit_copy" oils_persist:tablename="action.transit_copy" reporter:core="true" reporter:label="Copy Transit">
2657                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2658                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool" oils_obj:required="true"/>
2659                         <field reporter:label="Destination" name="dest" reporter:datatype="link" oils_obj:required="true"/>
2660                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2661                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2662                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2663                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2664                         <field reporter:label="Source" name="source" reporter:datatype="link" oils_obj:required="true"/>
2665                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2666                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2667                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
2668                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2669                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2670                 </fields>
2671                 <links>
2672                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2673                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2674                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2675                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2676                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2677                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2678                 </links>
2679                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2680                         <actions>
2681                                 <create permission="TRANSIT_COPY" context_field="owner">
2682                                         <context link="target_copy" field="circ_lib"/>
2683                                 </create>
2684                                 <retrieve/>
2685                                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2686                                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2687                         </actions>
2688                 </permacrud>
2689         </class>
2690         <class id="asvr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_response" oils_persist:tablename="action.survey_response" reporter:label="Survey Response">
2691                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2692                         <field reporter:label="Answer" name="answer" reporter:datatype="link" oils_obj:required="true"/>
2693                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2694                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2695                         <field reporter:label="Answer ID" name="id" reporter:datatype="id"/>
2696                         <field reporter:label="Question" name="question" reporter:datatype="link" oils_obj:required="true"/>
2697                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int"/>
2698                         <field reporter:label="Survey" name="survey" reporter:datatype="link" oils_obj:required="true"/>
2699                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2700                 </fields>
2701                 <links>
2702                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2703                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2704                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2705                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2706                 </links>
2707                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2708                         <actions>
2709                                 <create permission="ADMIN_SURVEY">
2710                                         <context link="survey" field="owner"/>
2711                                 </create>
2712                                 <retrieve permission="VIEW_USER">
2713                                         <context link="usr" field="home_ou"/>
2714                                 </retrieve>
2715                                 <update permission="ADMIN_SURVEY">
2716                                         <context link="survey" field="owner"/>
2717                                 </update>
2718                                 <delete permission="ADMIN_SURVEY">
2719                                         <context link="survey" field="owner"/>
2720                                 </delete>
2721                         </actions>
2722                 </permacrud>
2723         </class>
2724         <class id="ccbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_item" oils_persist:tablename="container.copy_bucket_item" reporter:label="Copy Bucket Item">
2725                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2726                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
2727                         <field name="id" reporter:datatype="id"/>
2728                         <field name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
2729                         <field name="create_time" reporter:datatype="timestamp"/>
2730                         <field name="pos" reporter:datatype="int"/>
2731                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2732                 </fields>
2733                 <links>
2734                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2735                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2736                         <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2737                 </links>
2738                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2739                         <actions>
2740                                 <retrieve permission="ADMIN_COPY_BUCKET">
2741                                         <context link="bucket" field="owning_lib"/>
2742                                 </retrieve>
2743                         </actions>
2744                 </permacrud>
2745         </class>
2746         <class id="ccbin" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_item_note" oils_persist:tablename="container.copy_bucket_item_note" reporter:label="Copy Bucket Item Note">
2747                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2748                         <field name="id" reporter:datatype="id"/>
2749                         <field name="item" reporter:datatype="link" oils_obj:required="true"/>
2750                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
2751                 </fields>
2752                 <links>
2753                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2754                 </links>
2755         </class>
2756
2757         <class id="acs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set" oils_persist:tablename="authority.control_set" reporter:label="Authority Control Set" oils_persist:field_safe="true">
2758                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2759                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2760                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2761                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
2762                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2763                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2764                 </fields>
2765                 <links>
2766                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2767                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2768                 </links>
2769                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2770                         <actions>
2771                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2772                                 <retrieve/>
2773                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2774                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2775                         </actions>
2776                 </permacrud>
2777         </class>
2778
2779         <class id="acsaf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_authority_field" oils_persist:tablename="authority.control_set_authority_field" reporter:label="Authority Control Set Authority Field" oils_persist:field_safe="true">
2780                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2781                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2782                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2783                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true" oils_obj:required="true"/>
2784                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2785                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" oils_obj:required="true"/>
2786                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" oils_obj:required="true"/>
2787                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text"/>
2788                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2789                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
2790                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text"/>
2791                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2792                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2793                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2794                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2795                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
2796                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link"/>
2797                 </fields>
2798                 <links>
2799                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2800                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2801                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2802                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2803                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2804                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2805                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2806                 </links>
2807                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2808                         <actions>
2809                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2810                                 <retrieve/>
2811                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2812                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2813                         </actions>
2814                 </permacrud>
2815         </class>
2816
2817         <class id="acsbf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field" oils_persist:tablename="authority.control_set_bib_field" reporter:label="Authority Control Set Bib Field" oils_persist:field_safe="true">
2818                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2819                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2820                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link" oils_obj:required="true"/>
2821                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2822                 </fields>
2823                 <links>
2824                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2825                 </links>
2826                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2827                         <actions>
2828                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2829                                 <retrieve/>
2830                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2831                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2832                         </actions>
2833                 </permacrud>
2834         </class>
2835
2836         <class id="acsbfmfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field_metabib_field_map" oils_persist:tablename="authority.control_set_bib_field_metabib_field_map" reporter:label="Authority Control Set Bib Field to Metabib Field Map" oils_persist:field_safe="true">
2837                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2838                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2839                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link" oils_obj:required="true"/>
2840                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link" oils_obj:required="true"/>
2841                 </fields>
2842                 <links>
2843                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2844                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2845                 </links>
2846                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2847                         <actions>
2848                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2849                                 <retrieve/>
2850                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2851                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2852                         </actions>
2853                 </permacrud>
2854         </class>
2855
2856         <class id="at" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::thesaurus" oils_persist:tablename="authority.thesaurus" reporter:label="Authority Thesaurus" oils_persist:field_safe="true">
2857                 <fields oils_persist:primary="code">
2858                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:required="true"/>
2859                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2860                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2861                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
2862                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text"/>
2863                         <field reporter:label="URI" name="uri" reporter:datatype="text"/>
2864                 </fields>
2865                 <links>
2866                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2867                 </links>
2868                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2869                         <actions>
2870                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2871                                 <retrieve/>
2872                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2873                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2874                         </actions>
2875                 </permacrud>
2876         </class>
2877
2878         <class id="aba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis" oils_persist:tablename="authority.browse_axis" reporter:label="Authority Browse Axis" oils_persist:field_safe="true">
2879                 <fields oils_persist:primary="code">
2880                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$" oils_obj:required="true"/>
2881                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2882                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2883                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2884                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2885                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2886                 </fields>
2887                 <links>
2888                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2889                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2890                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2891                 </links>
2892                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2893                         <actions>
2894                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2895                                 <retrieve/>
2896                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2897                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2898                         </actions>
2899                 </permacrud>
2900         </class>
2901
2902         <class id="abaafm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis_authority_field_map" oils_persist:tablename="authority.browse_axis_authority_field_map" reporter:label="Authority Browse Axis Field Map" oils_persist:field_safe="true">
2903                 <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2904                         <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2905                         <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2906                         <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2907                 </fields>
2908                 <links>
2909                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2910                         <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2911                 </links>
2912                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2913                         <actions>
2914                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2915                                 <retrieve/>
2916                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2917                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2918                         </actions>
2919                 </permacrud>
2920         </class>
2921
2922         <class id="are" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::record_entry" oils_persist:tablename="authority.record_entry" reporter:label="Authority Record Entry">
2923                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2924                         <field name="active" reporter:datatype="bool"/>
2925                         <field name="create_date" reporter:datatype="timestamp"/>
2926                         <field name="creator"/>
2927                         <field name="deleted" reporter:datatype="bool"/>
2928                         <field name="edit_date" reporter:datatype="timestamp"/>
2929                         <field name="editor"/>
2930                         <field name="id" reporter:datatype="id"/>
2931                         <field name="last_xact_id" oils_obj:required="true"/>
2932                         <field name="marc" oils_obj:required="true"/>
2933                         <field name="source"/>
2934                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2935                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
2936                         <field name="heading"/>
2937                         <field name="simple_heading"/>
2938                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2939                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2940                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2941                 </fields>
2942                 <links>
2943                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2944                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2945                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2946                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2947                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2948                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2949                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2950                 </links>
2951                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2952                         <actions>
2953                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2954                                 <retrieve/>
2955                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2956                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2957                         </actions>
2958                 </permacrud>
2959         </class>
2960         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2961                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2962                         <field name="char_encoding"/>
2963                         <field name="id"/>
2964                         <field name="record"/>
2965                         <field name="record_status"/>
2966                         <field name="thesaurus"/>
2967                 </fields>
2968                 <links>
2969                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2970                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2971                 </links>
2972         </class>
2973         <class id="abl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::bib_linking" oils_persist:tablename="authority.bib_linking" reporter:label="Authority-Bibliographic Record Link">
2974                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2975                         <field name="id" reporter:datatype="id"/>
2976                         <field name="bib" reporter:datatype="link" oils_obj:required="true"/>
2977                         <field name="authority" reporter:datatype="link" oils_obj:required="true"/>
2978                 </fields>
2979                 <links>
2980                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2981                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2982                 </links>
2983                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2984                         <actions>
2985                                 <retrieve/>
2986                         </actions>
2987                 </permacrud>
2988         </class>
2989         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2990                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2991                         <field name="id" reporter:datatype="id"/>
2992                         <field name="record" reporter:datatype="link" oils_obj:required="true"/>
2993                         <field name="atag" reporter:datatype="link" oils_obj:required="true"/>
2994                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
2995                         <field name="thesaurus" reporter:datatype="text"/>
2996                 </fields>
2997                 <links>
2998                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2999                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
3000                 </links>
3001         </class>
3002
3003         <class id="ahf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::heading_field" oils_persist:tablename="authority.heading_field" reporter:label="Authority Heading Fields">
3004                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
3005                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
3006                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" oils_obj:required="true"/>
3007                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" oils_obj:required="true"/>
3008                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" oils_obj:required="true"/>
3009                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format"/>
3010                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" oils_obj:required="true"/>
3011                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" oils_obj:required="true"/>
3012                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath"/>
3013                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath"/>
3014                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath"/>
3015                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string"/>
3016                 </fields>
3017                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3018                         <actions>
3019                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3020                                 <retrieve/>
3021                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3022                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3023                         </actions>
3024                 </permacrud>
3025         </class>
3026
3027         <class id="clm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::language_map" oils_persist:tablename="config.language_map" reporter:label="Language Map" oils_persist:field_safe="true">
3028                 <fields oils_persist:primary="code" oils_persist:sequence="">
3029                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3030                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3031                 </fields>
3032                 <links/>
3033                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3034                         <actions>
3035                                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3036                                 <retrieve/>
3037                                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3038                                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3039                         </actions>
3040                 </permacrud>
3041         </class>
3042         <class id="mccp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_card_payment" oils_persist:tablename="money.credit_card_payment" reporter:label="Credit Card Payment">
3043                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3044                         <field name="accepting_usr" oils_obj:required="true"/>
3045                         <field name="amount" reporter:datatype="money" oils_obj:required="true"/>
3046                         <field name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
3047                         <field name="approval_code" reporter:datatype="text"/>
3048                         <field name="cash_drawer" reporter:datatype="link"/>
3049                         <field name="cc_number" reporter:datatype="text"/>
3050                         <field name="cc_order_number" reporter:datatype="text"/>
3051                         <field name="cc_processor" reporter:datatype="text"/>
3052                         <field name="id" reporter:datatype="id"/>
3053                         <field name="note" reporter:datatype="text"/>
3054                         <field name="payment_ts" reporter:datatype="timestamp"/>
3055                         <field name="xact" reporter:datatype="link" oils_obj:required="true"/>
3056                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3057                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3058                 </fields>
3059                 <links>
3060                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3061                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3062                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3063                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3064                 </links>
3065                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3066                         <actions>
3067                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3068                                         <context link="xact" jump="usr" field="home_ou"/>
3069                                 </retrieve>
3070                         </actions>
3071                 </permacrud>
3072         </class>
3073         <class id="cxt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::xml_transform" oils_persist:tablename="config.xml_transform" reporter:label="XML/XSLT Transform Definition" oils_persist:field_safe="true">
3074                 <fields oils_persist:primary="name">
3075                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
3076                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text" oils_obj:required="true"/>
3077                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text" oils_obj:required="true"/>
3078                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" oils_obj:required="true"/>
3079                 </fields>
3080                 <links/>
3081                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3082                         <actions>
3083                                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3084                                 <retrieve/>
3085                                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3086                                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3087                         </actions>
3088                 </permacrud>
3089         </class>
3090
3091         <class id="cmsa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_search_alias" oils_persist:tablename="config.metabib_search_alias" reporter:label="Metabib Search Alias" oils_persist:field_safe="true">
3092                 <fields oils_persist:primary="alias">
3093                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text" oils_obj:required="true"/>
3094                         <field reporter:label="Class" name="field_class" reporter:datatype="link" oils_obj:required="true"/>
3095                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3096                 </fields>
3097                 <links>
3098                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3099                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3100                 </links>
3101                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3102                         <actions>
3103                                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3104                                 <retrieve/>
3105                                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3106                                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3107                         </actions>
3108                 </permacrud>
3109         </class>
3110
3111         <class id="cmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_class" oils_persist:tablename="config.metabib_class" reporter:label="Metabib Class" oils_persist:field_safe="true">
3112                 <fields oils_persist:primary="name">
3113                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
3114                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3115                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool"/>
3116                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool"/>
3117                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool"/>
3118                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float"/>
3119                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float"/>
3120                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float"/>
3121                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float"/>
3122                         <field reporter:label="Low Result Threshold for Suggestions" name="low_result_threshold" reporter:datatype="int"/>
3123                         <field reporter:label="Max Suggestions" name="max_suggestions" reporter:datatype="int"/>
3124                         <field reporter:label="Perform Variant Heading Authority Suggestion Cross-reference" name="variant_authority_suggestion" reporter:datatype="bool"/>
3125                         <field reporter:label="Minimum Bib Record Suggestion Threshold" name="min_suggestion_use_threshold" reporter:datatype="int"/>
3126                         <field reporter:label="Suggestion SOUNDEX Weight" name="soundex_weight" reporter:datatype="int"/>
3127                         <field reporter:label="Suggestion PG Trigram Weight" name="pg_trgm_weight" reporter:datatype="int"/>
3128                         <field reporter:label="Suggestion Keyboard Distance Weight" name="keyboard_distance_weight" reporter:datatype="int"/>
3129                         <field reporter:label="Retain Case in Suggestions" name="symspell_transfer_case" reporter:datatype="bool"/>
3130                         <field reporter:label="Avoid alternate suggestions on correctly spelled words" name="symspell_skip_correct" reporter:datatype="bool"/>
3131                         <field reporter:label="Symspell suggestion calculation verbosity" name="symspell_suggestion_verbosity" reporter:datatype="int"/>
3132                         <field reporter:label="Maximum average word Edit Distance" name="max_phrase_edit_distance" reporter:datatype="int"/>
3133                         <field reporter:label="Maximum suggestions per word" name="suggestion_word_option_count" reporter:datatype="int"/>
3134                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3135                 </fields>
3136                 <links>
3137                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3138                 </links>
3139                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3140                         <actions>
3141                                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3142                                 <retrieve/>
3143                                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3144                                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3145                         </actions>
3146                 </permacrud>
3147         </class>
3148
3149         <class id="cmf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field" oils_persist:tablename="config.metabib_field" reporter:label="Metabib Field" oils_persist:field_safe="true">
3150                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3151                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3152                         <field reporter:label="Class" name="field_class" reporter:datatype="link" oils_obj:required="true"/>
3153                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3154                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
3155                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3156                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3157                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3158                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3159                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool"/>
3160                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool"/>
3161                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text"/>
3162                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool"/>
3163                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text"/>
3164                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool"/>
3165                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool"/>
3166                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text"/>
3167                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text"/>
3168                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text"/>
3169                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool"/>
3170                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3171                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3172                 </fields>
3173                 <links>
3174                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3175                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3176                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3177                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3178                 </links>
3179                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3180                         <actions>
3181                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3182                                 <retrieve/>
3183                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3184                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3185                         </actions>
3186                 </permacrud>
3187         </class>
3188
3189         <class id="cmfvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_virtual_map" oils_persist:tablename="config.metabib_field_virtual_map" reporter:label="Metabib Field Virtual Map" oils_persist:field_safe="true">
3190                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3191                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3192                         <field reporter:label="Real" name="real" reporter:datatype="link" oils_obj:required="true"/>
3193                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true" oils_obj:required="true"/>
3194                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3195                 </fields>
3196                 <links>
3197                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3198                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3199                 </links>
3200                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3201                         <actions>
3202                                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3203                                 <retrieve/>
3204                                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3205                                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3206                         </actions>
3207                 </permacrud>
3208         </class>
3209
3210         <class id="cbho" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::best_hold_order" oils_persist:tablename="config.best_hold_order" reporter:label="Best-Hold Sort Order">
3211                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3212                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3213                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3214                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int"/>
3215                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int"/>
3216                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int"/>
3217                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int"/>
3218                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int"/>
3219                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int"/>
3220                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int"/>
3221                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int"/>
3222                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int"/>
3223                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int"/>
3224                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int"/>
3225                 </fields>
3226                 <links>
3227                 </links>
3228                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3229                         <actions>
3230                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3231                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3232                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3233                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3234                         </actions>
3235                 </permacrud>
3236         </class>
3237         <class id="cbfp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::biblio_fingerprint" oils_persist:tablename="config.biblio_fingerprint" reporter:label="Fingerprint Definition">
3238                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3239                         <field name="id" reporter:datatype="id"/>
3240                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
3241                         <field name="xpath" reporter:datatype="text" oils_obj:required="true"/>
3242                         <field name="format" reporter:datatype="link"/>
3243                         <field name="first_word" reporter:datatype="bool"/>
3244                 </fields>
3245                 <links/>
3246                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3247                         <actions>
3248                                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3249                                 <retrieve/>
3250                                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3251                                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3252                         </actions>
3253                 </permacrud>
3254         </class>
3255         <class id="cam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::audience_map" oils_persist:tablename="config.audience_map" reporter:label="Audience Map" oils_persist:field_safe="true">
3256                 <fields oils_persist:primary="code" oils_persist:sequence="">
3257                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3258                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3259                         <field reporter:label="Audience" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3260                 </fields>
3261                 <links/>
3262                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3263                         <actions>
3264                                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3265                                 <retrieve/>
3266                                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3267                                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3268                         </actions>
3269                 </permacrud>
3270         </class>
3271         <class id="cifm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::item_form_map" oils_persist:tablename="config.item_form_map" reporter:label="Item Form Map" oils_persist:field_safe="true">
3272                 <fields oils_persist:primary="code" oils_persist:sequence="">
3273                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3274                         <field reporter:label="Item Form" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3275                 </fields>
3276                 <links/>
3277                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3278                         <actions>
3279                                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3280                                 <retrieve/>
3281                                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3282                                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3283                         </actions>
3284                 </permacrud>
3285         </class>
3286         <class id="acmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course" oils_persist:tablename="asset.course_module_course" reporter:label="Course">
3287                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3288                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3289                         <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
3290                         <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true"/>
3291                         <field reporter:label="Section Number" name="section_number" reporter:datatype="text"/>
3292                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true"/>
3293                         <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
3294                         <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link"/>
3295                         <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool"/>
3296                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3297                 </fields>
3298                 <links>
3299                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3300                         <link field="members" reltype="has_many" key="course" map="" class="acmcu"/>
3301                         <link field="materials" reltype="has_many" key="course" map="" class="acmcm"/>
3302                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm"/>
3303                 </links>
3304                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3305                         <actions>
3306                                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3307                                 <retrieve/>
3308                                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3309                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3310                         </actions>
3311                 </permacrud>
3312         </class>
3313         <class id="acmcu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course_users" oils_persist:tablename="asset.course_module_course_users" reporter:label="Course Users">
3314                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3315                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3316                         <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3317                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
3318                         <field reporter:label="User Role" name="usr_role" reporter:datatype="link"/>
3319                 </fields>
3320                 <links>
3321                         <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3322                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3323                         <link field="usr_role" reltype="has_a" key="id" map="" class="acmr"/>
3324                 </links>
3325                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3326                         <actions>
3327                                 <create permission="MANAGE_RESERVES">
3328                                         <context link="course" field="owning_lib"/>
3329                                 </create>
3330                                 <retrieve/>
3331                                 <update permission="MANAGE_RESERVES">
3332                                         <context link="course" field="owning_lib"/>
3333                                 </update>
3334                                 <delete permission="MANAGE_RESERVES">
3335                                         <context link="course" field="owning_lib"/>
3336                                 </delete>
3337                         </actions>
3338                 </permacrud>
3339         </class>
3340         <class id="acmcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course_materials" oils_persist:tablename="asset.course_module_course_materials" reporter:label="Course Materials" oils_persist:field_safe="true">
3341                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3342                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3343                         <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3344                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
3345                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
3346                         <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool"/>
3347                         <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text"/>
3348                         <field reporter:label="Original Status" name="original_status" reporter:datatype="link"/>
3349                         <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link"/>
3350                         <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link"/>
3351                         <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link"/>
3352                         <field reporter:label="Original Circulating Library" name="original_circ_lib" reporter:datatype="link"/>
3353                 </fields>
3354                 <links>
3355                         <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3356                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
3357                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3358                         <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn"/>
3359                         <link field="original_status" reltype="has_a" key="id" map="" class="ccs"/>
3360                         <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
3361                         <link field="original_location" reltype="has_a" key="id" map="" class="acpl"/>
3362                         <link field="original_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
3363                 </links>
3364                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3365                         <actions>
3366                                 <create permission="MANAGE_RESERVES">
3367                                         <context link="course" field="owning_lib"/>
3368                                 </create>
3369                                 <retrieve/>
3370                                 <update permission="MANAGE_RESERVES">
3371                                         <context link="course" field="owning_lib"/>
3372                                 </update>
3373                                 <delete permission="MANAGE_RESERVES">
3374                                         <context link="course" field="owning_lib"/>
3375                                 </delete>
3376                         </actions>
3377                 </permacrud>
3378         </class>
3379         <class id="acmt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_term" oils_persist:tablename="asset.course_module_term" reporter:label="Term" oils_persist:field_safe="true">
3380                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3381                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3382                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3383                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true"/>
3384                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3385                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3386                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3387                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3388                 </fields>
3389                 <links>
3390                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3391                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3392                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3393                 </links>
3394                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3395                         <actions>
3396                                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3397                                 <retrieve/>
3398                                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3399                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3400                         </actions>
3401                 </permacrud>
3402         </class>
3403         <class id="acmtcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_term_course_map" oils_persist:tablename="asset.course_module_term_course_map" reporter:label="Course Term Map" oils_persist:field_safe="true">
3404                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3405                         <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3406                         <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3407                         <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3408                 </fields>
3409                 <links>
3410                         <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3411                         <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3412                 </links>
3413                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3414                         <actions>
3415                                 <create permission="MANAGE_RESERVES">
3416                                         <context link="course" field="owning_lib"/>
3417                                 </create>
3418                                 <retrieve/>
3419                                 <update permission="MANAGE_RESERVES">
3420                                         <context link="course" field="owning_lib"/>
3421                                 </update>
3422                                 <delete permission="MANAGE_RESERVES">
3423                                         <context link="course" field="owning_lib"/>
3424                                 </delete>
3425                         </actions>
3426                 </permacrud>
3427         </class>
3428         <class id="acmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_role" oils_persist:tablename="asset.course_module_role" reporter:label="Course Role" oils_persist:field_safe="true">
3429                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3430                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3431                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3432                         <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool"/>
3433                 </fields>
3434                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3435                         <actions>
3436                                 <create permission="MANAGE_RESERVES" global_required="true"/>
3437                                 <retrieve/>
3438                                 <update permission="MANAGE_RESERVES" global_required="true"/>
3439                                 <delete permission="MANAGE_RESERVES" global_required="true"/>
3440                         </actions>
3441                 </permacrud>
3442         </class>
3443         
3444         <class id="acnc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_class" oils_persist:tablename="asset.call_number_class" reporter:label="Call number classification scheme">
3445                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3446                         <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3447                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
3448                         <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3449                         <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3450                 </fields>
3451                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3452                         <actions>
3453                                 <retrieve/>
3454                         </actions>
3455                 </permacrud>
3456         </class>
3457         <class id="acns" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_suffix" oils_persist:tablename="asset.call_number_suffix" reporter:label="Call Number/Volume Suffix">
3458                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3459                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3460                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
3461                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3462                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
3463                 </fields>
3464                 <links>
3465                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3466                 </links>
3467                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3468                         <actions>
3469                                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3470                                 <retrieve/>
3471                                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3472                                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3473                         </actions>
3474                 </permacrud>
3475         </class>
3476         <class id="acnp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_prefix" oils_persist:tablename="asset.call_number_prefix" reporter:label="Call Number/Volume Prefix">
3477                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3478                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3479                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
3480                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3481                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
3482                 </fields>
3483                 <links>
3484                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3485                 </links>
3486                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3487                         <actions>
3488                                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3489                                 <retrieve/>
3490                                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3491                                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3492                         </actions>
3493                 </permacrud>
3494         </class>
3495         <class id="acn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number" oils_persist:tablename="asset.call_number" reporter:label="Call Number/Volume">
3496                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3497                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3498                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3499                         <field reporter:label="Creating User" name="creator" reporter:datatype="link" oils_obj:required="true"/>
3500                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3501                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3502                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link" oils_obj:required="true"/>
3503                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id"/>
3504                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
3505                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
3506                         <field reporter:label="Bib Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
3507                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3508                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3509                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3510                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3511                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link" oils_obj:required="true"/>
3512                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3513                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3514                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3515                 </fields>
3516                 <links>
3517                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3518                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3519                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3520                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3521                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3522                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3523                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3524                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3525                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3526                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3527                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3528                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3529                 </links>
3530                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3531                         <actions>
3532                                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3533                                 <retrieve/>
3534                                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3535                                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3536                         </actions>
3537                 </permacrud>
3538         </class>
3539         <class id="racnd" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="reporter::asset_call_number_dewey" oils_persist:tablename="reporter.asset_call_number_dewey" reporter:label="Dewey Classification">
3540                 <fields oils_persist:primary="call_number">
3541                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link"/>
3542                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3543                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3544                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3545                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3546                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3547                 </fields>
3548                 <links>
3549                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3550                 </links>
3551                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3552                         <actions>
3553                                 <retrieve/>
3554                         </actions>
3555                 </permacrud>
3556         </class>
3557         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3558                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3559                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3560                         <field reporter:label="URI" name="href" reporter:datatype="text" oils_obj:required="true"/>
3561                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3562                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3563                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3564                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3565                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3566                 </fields>
3567                 <links>
3568                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3569                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3570                 </links>
3571         </class>
3572         <class id="auricnm" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri_call_number_map" oils_persist:tablename="asset.uri_call_number_map" reporter:label="Electronic Access URI to Call Number Map">
3573                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3574                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3575                         <field reporter:label="URI" name="uri" reporter:datatype="int" oils_obj:required="true"/>
3576                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text" oils_obj:required="true"/>
3577                 </fields>
3578                 <links>
3579                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3580                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3581                 </links>
3582         </class>
3583         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3584                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3585                         <field name="id" reporter:datatype="id"/>
3586                         <field name="value" oils_persist:i18n="true" oils_obj:required="true"/>
3587                 </fields>
3588                 <links/>
3589         </class>
3590         <class id="mous" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_user_summary" oils_persist:tablename="money.open_usr_summary" reporter:label="Open User Summary">
3591                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3592                         <field name="balance_owed" reporter:datatype="money"/>
3593                         <field name="total_owed" reporter:datatype="money"/>
3594                         <field name="total_paid" reporter:datatype="money"/>
3595                         <field name="usr" reporter:datatype="link"/>
3596                 </fields>
3597                 <links>
3598                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3599                 </links>
3600                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3601                         <actions>
3602                                 <retrieve permission="VIEW_USER">
3603                                         <context link="usr" field="home_ou"/>
3604                                 </retrieve>
3605                         </actions>
3606                 </permacrud>
3607         </class>
3608         <class id="mowbus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_with_balance_user_summary" oils_persist:tablename="money.open_with_balance_usr_summary" reporter:label="Open User Summary for transactions with balances">
3609                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3610                         <field name="balance_owed" reporter:datatype="money"/>
3611                         <field name="total_owed" reporter:datatype="money"/>
3612                         <field name="total_paid" reporter:datatype="money"/>
3613                         <field name="usr" reporter:datatype="link"/>
3614                 </fields>
3615                 <links>
3616                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3617                 </links>
3618                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3619                         <actions>
3620                                 <retrieve permission="VIEW_USER">
3621                                         <context link="usr" field="home_ou"/>
3622                                 </retrieve>
3623                         </actions>
3624                 </permacrud>
3625         </class>
3626         <class id="mct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::collections_tracker" oils_persist:tablename="money.collections_tracker" reporter:label="Collections Tracker">
3627                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3628                         <field name="collector" oils_obj:required="true"/>
3629                         <field name="enter_time" reporter:datatype="timestamp"/>
3630                         <field name="id" reporter:datatype="id"/>
3631                         <field name="location" reporter:datatype="link" oils_obj:required="true"/>
3632                         <field name="usr" reporter:datatype="link" oils_obj:required="true"/>
3633                 </fields>
3634                 <links>
3635                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3636                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3637                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3638                 </links>
3639                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3640                         <actions>
3641                                 <create permission="money.collections_tracker.create" context_field="location"/>
3642                                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3643                                 <delete permission="money.collections_tracker.create" context_field="location"/>
3644                         </actions>
3645                 </permacrud>
3646         </class>
3647         <class id="bre" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::record_entry" oils_persist:tablename="biblio.record_entry" reporter:core="true" reporter:label="Bibliographic Record">
3648                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3649                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3650                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3651                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3652                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3653                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3654                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3655                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3656                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3657                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
3658                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
3659                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text" oils_obj:required="true"/>
3660                         <field reporter:label="MARC21Slim" name="marc" reporter:datatype="text" oils_obj:required="true"/>
3661                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int"/>
3662                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3663                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
3664                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
3665                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3666                         <field reporter:label="Share Depth" name="share_depth" reporter:datatype="int"/>
3667                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3668                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3669                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3670                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3671                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3672                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3673                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3674                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3675                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3676                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3677                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3678                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3679                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3680                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3681                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3682                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3683                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3684                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3685                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3686                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3687                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3688                 </fields>
3689                 <links>
3690                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3691                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3692                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3693                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3694                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3695                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3696                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3697                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3698                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3699                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3700                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3701                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3702                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3703                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3704                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3705                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3706                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3707                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3708                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3709                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3710                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3711                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3712                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3713                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3714                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3715                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3716                 </links>
3717                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3718                         <actions>
3719                                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3720                                 <retrieve/>
3721                                 <update permission="UPDATE_MARC" global_required="true"/>
3722                 <!-- WARNING: Deleting records via PCRUD does NOT check that any prerequisite conditions have been handled first. It is your responsibility to check for those conditions before deleting bib records. -->
3723                                 <delete permission="DELETE_RECORD" global_required="true"/>
3724                         </actions>
3725                 </permacrud>
3726         </class>
3727         <class id="aouhoo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit::hours_of_operation" oils_persist:tablename="actor.hours_of_operation" reporter:label="Hours of Operation">
3728                 <fields oils_persist:primary="id">
3729                         <field name="dow_0_close"/>
3730                         <field name="dow_0_open"/>
3731                         <field name="dow_0_note" reporter:datatype="text"/>
3732                         <field name="dow_1_close"/>
3733                         <field name="dow_1_open"/>
3734                         <field name="dow_1_note" reporter:datatype="text"/>
3735                         <field name="dow_2_close"/>
3736                         <field name="dow_2_open"/>
3737                         <field name="dow_2_note" reporter:datatype="text"/>
3738                         <field name="dow_3_close"/>
3739                         <field name="dow_3_open"/>
3740                         <field name="dow_3_note" reporter:datatype="text"/>
3741                         <field name="dow_4_close"/>
3742                         <field name="dow_4_open"/>
3743                         <field name="dow_4_note" reporter:datatype="text"/>
3744                         <field name="dow_5_close"/>
3745                         <field name="dow_5_open"/>
3746                         <field name="dow_5_note" reporter:datatype="text"/>
3747                         <field name="dow_6_close"/>
3748                         <field name="dow_6_open"/>
3749                         <field name="dow_6_note" reporter:datatype="text"/>
3750                         <field name="id" reporter:datatype="id" oils_obj:required="true"/>
3751                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3752                 </fields>
3753                 <links>
3754                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3755                 </links>
3756                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3757                         <actions>
3758                                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3759                                 <retrieve/>
3760                                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3761                                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3762                         </actions>
3763                 </permacrud>
3764         </class>
3765         <class id="bmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::monograph_part" oils_persist:tablename="biblio.monograph_part" reporter:label="Monograph Parts" oils_persist:field_safe="true">
3766                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3767                         <field name="id" reporter:datatype="id"/>
3768                         <field name="record" reporter:datatype="link" oils_obj:required="true"/>
3769                         <field name="label" reporter:datatype="text" oils_obj:required="true"/>
3770                         <field name="label_sortkey" reporter:datatype="text" oils_obj:required="true"/>
3771                         <field name="deleted" reporter:datatype="bool"/>
3772                 </fields>
3773                 <links>
3774                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3775                 </links>
3776                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3777                         <actions>
3778                                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3779                                 <retrieve/>
3780                                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3781                                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3782                         </actions>
3783                 </permacrud>
3784         </class>
3785         <class id="acpm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_part_map" oils_persist:tablename="asset.copy_part_map" reporter:label="Copy Monograph Part Map">
3786                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3787                         <field name="id" reporter:datatype="id"/>
3788                         <field name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
3789                         <field name="part" reporter:datatype="link" oils_obj:required="true"/>
3790                 </fields>
3791                 <links>
3792                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3793                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3794                 </links>
3795                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3796                         <actions>
3797                                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3798                                 <retrieve/>
3799                                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3800                                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3801                         </actions>
3802                 </permacrud>
3803         </class>
3804         <class id="aecc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing_circulation" oils_persist:tablename="action.emergency_closing_circulation" reporter:label="Emergency Closing Circulation Entry" oils_persist:readonly="true"> <!-- This is not a view, but is managed via functions, so it's readonly. -->
3805                 <fields oils_persist:primary="id">
3806                         <field name="id" reporter:datatype="id"/>
3807                         <field name="circulation" reporter:datatype="link"/>
3808                         <field name="emergency_closing" reporter:datatype="link"/>
3809                         <field name="original_due_date" reporter:datatype="timestamp"/>
3810                         <field name="process_time" reporter:datatype="timestamp"/>
3811                 </fields>
3812                 <links>
3813                         <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3814                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3815                 </links>
3816                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3817                         <actions>
3818                                 <retrieve/>
3819                         </actions>
3820                 </permacrud>
3821         </class>
3822         <class id="aecr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing_reservation" oils_persist:tablename="action.emergency_closing_reservation" reporter:label="Emergency Closing Reservation Entry" oils_persist:readonly="true"> <!-- This is not a view, but is managed via functions, so it's readonly. -->
3823                 <fields oils_persist:primary="id">
3824                         <field name="id" reporter:datatype="id"/>
3825                         <field name="reservation" reporter:datatype="link"/>
3826                         <field name="emergency_closing" reporter:datatype="link"/>
3827                         <field name="original_end_time" reporter:datatype="timestamp"/>
3828                         <field name="process_time" reporter:datatype="timestamp"/>
3829                 </fields>
3830                 <links>
3831                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3832                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3833                 </links>
3834                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3835                         <actions>
3836                                 <retrieve/>
3837                         </actions>
3838                 </permacrud>
3839         </class>
3840         <class id="aech" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing_hold" oils_persist:tablename="action.emergency_closing_hold" reporter:label="Emergency Closing Hold Entry" oils_persist:readonly="true"> <!-- This is not a view, but is managed via functions, so it's readonly. -->
3841                 <fields oils_persist:primary="id">
3842                         <field name="id" reporter:datatype="id"/>
3843                         <field name="hold" reporter:datatype="link"/>
3844                         <field name="emergency_closing" reporter:datatype="link"/>
3845                         <field name="original_shelf_expire_time" reporter:datatype="timestamp"/>
3846                         <field name="process_time" reporter:datatype="timestamp"/>
3847                 </fields>
3848                 <links>
3849                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3850                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3851                 </links>
3852                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3853                         <actions>
3854                                 <retrieve/>
3855                         </actions>
3856                 </permacrud>
3857         </class>
3858         <class id="aecs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing_status" oils_persist:tablename="action.emergency_closing_status" reporter:label="Emergency Closing Status" oils_persist:readonly="true">
3859                 <fields oils_persist:primary="id">
3860                         <field name="id" reporter:datatype="id"/>
3861                         <field name="creator" reporter:datatype="link"/>
3862                         <field name="create_time" reporter:datatype="timestamp"/>
3863                         <field name="process_start_time" reporter:datatype="timestamp"/>
3864                         <field name="process_end_time" reporter:datatype="timestamp"/>
3865                         <field name="last_update_time" reporter:datatype="timestamp"/>
3866                         <field name="circulations" reporter:datatype="int"/>
3867                         <field name="circulations_complete" reporter:datatype="int"/>
3868                         <field name="reservations" reporter:datatype="int"/>
3869                         <field name="reservations_complete" reporter:datatype="int"/>
3870                         <field name="holds" reporter:datatype="int"/>
3871                         <field name="holds_complete" reporter:datatype="int"/>
3872                 </fields>
3873                 <links>
3874                         <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3875                 </links>
3876                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3877                         <actions>
3878                                 <retrieve/>
3879                         </actions>
3880                 </permacrud>
3881         </class>
3882         <class id="aec" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing" oils_persist:tablename="action.emergency_closing" reporter:label="Emergency Closing">
3883                 <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3884                         <field name="id" reporter:datatype="id"/>
3885                         <field name="creator" reporter:datatype="link" oils_obj:required="true"/>
3886                         <field name="create_time" reporter:datatype="timestamp"/>
3887                         <field name="process_start_time" reporter:datatype="timestamp"/>
3888                         <field name="process_end_time" reporter:datatype="timestamp"/>
3889                         <field name="last_update_time" reporter:datatype="timestamp"/>
3890                         <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3891                         <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3892                         <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3893                         <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3894                         <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3895                 </fields>
3896                 <links>
3897                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3898                         <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3899                         <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3900                         <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3901                         <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3902                         <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3903                 </links>
3904                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3905                         <actions>
3906                                 <create permission="EMERGENCY_CLOSING">
3907                                         <context link="closing" field="org_unit"/>
3908                                 </create>
3909                                 <retrieve/>
3910                                 <update permission="EMERGENCY_CLOSING">
3911                                         <context link="closing" field="org_unit"/>
3912                                 </update>
3913                                 <delete permission="EMERGENCY_CLOSING">
3914                                         <context link="closing" field="org_unit"/>
3915                                 </delete>
3916                         </actions>
3917                 </permacrud>
3918         </class>
3919         <class id="aoucd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit::closed_date" oils_persist:tablename="actor.org_unit_closed" reporter:label="Closed Dates">
3920                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3921                         <field name="close_end" reporter:datatype="timestamp" oils_obj:required="true"/>
3922                         <field name="close_start" reporter:datatype="timestamp" oils_obj:required="true"/>
3923                         <field name="id" reporter:datatype="id"/>
3924                         <field name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
3925                         <field name="reason" reporter:datatype="text"/>
3926                         <field name="full_day" reporter:datatype="bool"/>
3927                         <field name="multi_day" reporter:datatype="bool"/>
3928                         <field name="emergency_closing" reporter:datatype="link"/>
3929                 </fields>
3930                 <links>
3931                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3932                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3933                 </links>
3934                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3935                         <actions>
3936                                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3937                                 <retrieve/>
3938                                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3939                                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3940                         </actions>
3941                 </permacrud>
3942         </class>
3943         <class id="crcd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::circ_duration" oils_persist:tablename="config.rule_circ_duration" reporter:label="Circulation Duration Rule">
3944                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3945                         <field name="extended" reporter:datatype="interval" oils_obj:required="true"/>
3946                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3947                         <field name="max_renewals" reporter:datatype="int" oils_obj:required="true"/>
3948                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
3949                         <field name="normal" reporter:datatype="interval" oils_obj:required="true"/>
3950                         <field name="shrt" reporter:datatype="interval" oils_obj:required="true"/>
3951                         <field name="max_auto_renewals" reporter:datatype="int" />
3952                 </fields>
3953                 <links>
3954                 </links>
3955                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3956                         <actions>
3957                                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3958                                 <retrieve/>
3959                                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3960                                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3961                         </actions>
3962                 </permacrud>
3963         </class>
3964
3965         <class id="chdd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hard_due_date" oils_persist:tablename="config.hard_due_date" reporter:label="Hard Due Date">
3966                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3967                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3968                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
3969                         <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool" oils_obj:required="true"/>
3970                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp" oils_obj:required="true"/>
3971                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
3972                         <field reporter:label="Values" name="values" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3973                 </fields>
3974                 <links>
3975                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3976                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
3977                 </links>
3978                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3979                         <actions>
3980                                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3981                                 <retrieve/>
3982                                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3983                                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3984                         </actions>
3985                 </permacrud>
3986         </class>
3987
3988         <class id="chddv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hard_due_date_values" oils_persist:tablename="config.hard_due_date_values" reporter:label="Hard Due Date Values">
3989                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3990                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3991                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true" oils_obj:required="true"/>
3992                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp" oils_obj:required="true"/>
3993                         <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp" oils_obj:required="true"/>
3994                 </fields>
3995                 <links>
3996                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3997                 </links>
3998                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3999                         <actions>
4000                                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4001                                 <retrieve/>
4002                                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4003                                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4004                         </actions>
4005                 </permacrud>
4006         </class>
4007
4008         <class id="mobts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_billable_transaction_summary" oils_persist:tablename="money.open_billable_xact_summary" reporter:label="Open Billable Transaction Summary">
4009                 <fields oils_persist:primary="id" oils_persist:sequence="">
4010                         <field name="balance_owed" reporter:datatype="money"/>
4011                         <field name="id" reporter:datatype="id"/>
4012                         <field name="last_billing_note" reporter:datatype="text"/>
4013                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
4014                         <field name="last_billing_type" reporter:datatype="text"/>
4015                         <field name="last_payment_note" reporter:datatype="text"/>
4016                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
4017                         <field name="last_payment_type" reporter:datatype="text"/>
4018                         <field name="total_owed" reporter:datatype="money"/>
4019                         <field name="total_paid" reporter:datatype="money"/>
4020                         <field name="usr" reporter:datatype="link"/>
4021                         <field name="xact_finish" reporter:datatype="timestamp"/>
4022                         <field name="xact_start" reporter:datatype="timestamp"/>
4023                         <field name="xact_type" reporter:datatype="text"/>
4024                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4025                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4026                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4027                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4028                         <field name="billing_location" reporter:datatype="link"/>
4029                 </fields>
4030                 <links>
4031                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4032                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4033                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4034                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4035                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4036                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4037                 </links>
4038                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4039                         <actions>
4040                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4041                                         <context link="usr" field="home_ou"/>
4042                                 </retrieve>
4043                         </actions>
4044                 </permacrud>
4045         </class>
4046         <class id="au" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user" oils_persist:tablename="actor.usr" reporter:core="true" reporter:label="ILS User">
4047                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4048                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4049                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4050                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4051                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4052                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4053                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4054                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4055                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4056                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4057                         <field reporter:label="Privacy Waiver Entries" name="waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4058                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4059                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4060                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4061                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4062                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4063                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4064                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int"/>
4065                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int"/>
4066                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4067                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
4068                         <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
4069                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4070                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
4071                         <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
4072                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4073                         <field reporter:label="Last Name" name="family_name" reporter:datatype="text" oils_obj:required="true"/>
4074                         <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" oils_obj:required="true"/>
4075                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit" oils_obj:required="true"/>
4076                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname"/>
4077                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link" oils_obj:required="true"/>
4078                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4079                         <field reporter:label="Primary Identification" name="ident_value" reporter:datatype="text"/>
4080                         <field reporter:label="Secondary Identification" name="ident_value2" reporter:datatype="text"/>
4081                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4082                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4083                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4084                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4085                         <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text"/>
4086                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text" oils_obj:required="true"/>
4087                         <field reporter:label="Photo URL" name="photo_url" reporter:datatype="text"/>
4088                         <field reporter:label="Prefix/Title" name="prefix" reporter:datatype="text"/>
4089                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link" oils_obj:required="true"/>
4090                         <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
4091                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4092                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
4093                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4094                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4095                         <field reporter:label="OPAC/Staff Client Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
4096                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text"/>
4097                         <field reporter:label="Juvenile" name="juvenile" reporter:datatype="bool"/>
4098                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4099                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4100                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4101                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4102                         <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text"/>
4103                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4104                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4105                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4106                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4107                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4108                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4109                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4110                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4111                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4112                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4113                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4114                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4115                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4116                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4117                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4118                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4119                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4120                         <field reporter:label="Patron Preferred Language" name="locale" reporter:datatype="link"/>
4121                 </fields>
4122                 <links>
4123                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
4124                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
4125                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
4126                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
4127                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
4128                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
4129                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
4130                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
4131                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
4132                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
4133                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
4134                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
4135                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
4136                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
4137                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
4138                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
4139                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
4140                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
4141                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
4142                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
4143                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
4144                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
4145                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
4146                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
4147                         <link field="notes" reltype="has_many" key="usr" map="" class="aum"/>
4148                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
4149                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
4150                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
4151                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
4152                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
4153                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
4154                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
4155                         <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
4156                 </links>
4157                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4158                         <actions>
4159                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou"/>
4160                         </actions>
4161                 </permacrud>
4162         </class>
4163         <class id="cuat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::usr_activity_type" oils_persist:tablename="config.usr_activity_type" reporter:label="User Activity Type">
4164                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4165                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4166                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4167                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4168                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4169                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_obj:required="true"/>
4170                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text" oils_obj:required="true"/>
4171                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4172                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4173                 </fields>
4174                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4175                         <actions>
4176                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4177                                 <retrieve/>
4178                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4179                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4180                         </actions>
4181                 </permacrud>
4182         </class>
4183         <class id="auact" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_activity" oils_persist:tablename="actor.usr_activity" reporter:label="User Activity">
4184                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4185                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
4186                         <field name="usr" reporter:label="User" reporter:datatype="link"/>
4187                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" oils_obj:required="true"/>
4188                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp"/>
4189                 </fields>
4190                 <links>
4191                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4192                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4193                 </links>
4194                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4195                         <actions>
4196                                 <retrieve permission="RUN_REPORTS">
4197                                         <context link="usr" field="home_ou"/>
4198                                 </retrieve>
4199                         </actions>
4200                 </permacrud>
4201         </class>
4202         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4203                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4204                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
4205                         <field name="usr" reporter:label="Owning User" reporter:datatype="link"/>
4206                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link"/>
4207                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link"/>
4208                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4209                         <field name="layout" reporter:label="Layout" reporter:datatype="text" oils_obj:required="true"/>
4210                 </fields>
4211                 <links>
4212                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4213                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4214                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4215                 </links>
4216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4217                         <actions>
4218                                 <create permission="ADMIN_TOOLBAR" context_field="org"/>
4219                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4220                                         <context link="usr" field="home_ou"/>
4221                                         <context link="ws" field="owning_lib"/>
4222                                 </retrieve>
4223                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4224                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4225                         </actions>
4226                 </permacrud>
4227         </class>
4228         <class id="csg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::settings_group" oils_persist:tablename="config.settings_group" reporter:label="Settings Group">
4229                 <fields oils_persist:primary="name">
4230                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
4231                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4232                 </fields>
4233                 <links/>
4234                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4235                         <actions>
4236                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4237                                 <retrieve/>
4238                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4239                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4240                         </actions>
4241                 </permacrud>
4242         </class>
4243         <class id="cust" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::usr_setting_type" oils_persist:tablename="config.usr_setting_type" reporter:label="User Setting Type">
4244                 <fields oils_persist:primary="name">
4245                         <field name="name" reporter:label="Name" reporter:datatype="text" oils_obj:required="true"/>
4246                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4247                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4248                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4249                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4250                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4251                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4252                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4253                 </fields>
4254                 <links>
4255                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4256                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4257                 </links>
4258                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4259                         <actions>
4260                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4261                                 <retrieve/>
4262                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4263                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4264                         </actions>
4265                 </permacrud>
4266         </class>
4267         <class id="coust" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::org_unit_setting_type" oils_persist:tablename="config.org_unit_setting_type" reporter:label="Organizational Unit Setting Type">
4268                 <fields oils_persist:primary="name">
4269                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
4270                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4271                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4272                         <field name="datatype" reporter:datatype="text"/>
4273                         <field name="view_perm" reporter:datatype="link"/>
4274                         <field name="update_perm" reporter:datatype="link"/>
4275                         <field name="fm_class" reporter:datatype="text"/>
4276                         <field name="grp" reporter:datatype="link"/>
4277                 </fields>
4278                 <links>
4279                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4280                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4281                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4282                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4283                 </links>
4284                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4285                         <actions>
4286                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4287                                 <retrieve/>
4288                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4289                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4290                         </actions>
4291                 </permacrud>
4292         </class>
4293         <class id="aous" controller="open-ils.cstore" oils_obj:fieldmapper="actor::org_unit_setting" oils_persist:tablename="actor.org_unit_setting" reporter:label="Organizational Unit Setting">
4294                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4295                         <field name="id"/>
4296                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
4297                         <field name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
4298                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
4299                 </fields>
4300                 <links>
4301                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4302                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4303                 </links>
4304         </class>
4305         <class id="acpn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_note" oils_persist:tablename="asset.copy_note" reporter:label="Copy Note">
4306                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4307                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4308                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
4309                         <field reporter:label="Note ID" name="id" reporter:datatype="id"/>
4310                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link" oils_obj:required="true"/>
4311                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4312                         <field reporter:label="Note Title" name="title" reporter:datatype="text" oils_obj:required="true"/>
4313                         <field reporter:label="Note Content" name="value" reporter:datatype="text" oils_obj:required="true"/>
4314                 </fields>
4315                 <links>
4316                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4317                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4318                 </links>
4319                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4320                         <actions>
4321                                 <create permission="CREATE_COPY_NOTE">
4322                                         <context link="owning_copy" field="circ_lib"/>
4323                                 </create>
4324                                 <retrieve permission="VIEW_COPY_NOTES">
4325                                         <context link="owning_copy" field="circ_lib"/>
4326                                 </retrieve>
4327                                 <update permission="UPDATE_COPY_NOTE">
4328                                         <context link="owning_copy" field="circ_lib"/>
4329                                 </update>
4330                                 <delete permission="DELETE_COPY_NOTE">
4331                                         <context link="owning_copy" field="circ_lib"/>
4332                                 </delete>
4333                         </actions>
4334                 </permacrud>
4335         </class>
4336         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4337                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4338                         <field reporter:label="Field ID" name="id" reporter:datatype="id"/>
4339                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string" reporter:datatype="text"/>
4340                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string" reporter:datatype="text"/>
4341                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4342                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string" reporter:datatype="text"/>
4343                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
4344                         <field reporter:label="Normalized Value" name="value" reporter:datatype="text"/>
4345                 </fields>
4346                 <links>
4347                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4348                 </links>
4349         </class>
4350         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4351                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4352                         <field name="fingerprint" reporter:datatype="text" oils_obj:required="true"/>
4353                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint"/>
4354                         <field name="master_record" reporter:datatype="link"/>
4355                         <field name="mods" reporter:datatype="text"/>
4356                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4357                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4358                 </fields>
4359                 <links>
4360                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4361                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4362                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4363                 </links>
4364                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4365                         <actions>
4366                                 <retrieve/>
4367                         </actions>
4368                 </permacrud>
4369         </class>
4370         <class id="cnal" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::net_access_level" oils_persist:tablename="config.net_access_level" reporter:label="Net Access Level">
4371                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4372                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4373                         <field name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4374                 </fields>
4375                 <links/>
4376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4377                         <actions>
4378                                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4379                                 <retrieve/>
4380                                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4381                                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4382                         </actions>
4383                 </permacrud>
4384         </class>
4385         <class id="ppl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::perm_list" oils_persist:tablename="permission.perm_list" reporter:label="Permission List">
4386                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4387                         <field name="code" reporter:datatype="text" oils_obj:required="true"/>
4388                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4389                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4390                 </fields>
4391                 <links/>
4392                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4393                         <actions>
4394                                 <create permission="CREATE_PERM" global_required="true"/>
4395                                 <retrieve permission="VIEW_PERMISSION CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4396                                 <update permission="UPDATE_PERM" global_required="true"/>
4397                                 <delete permission="DELETE_PERM" global_required="true"/>
4398                         </actions>
4399                 </permacrud>
4400         </class>
4401         <class id="mmrsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord_source_map" oils_persist:tablename="metabib.metarecord_source_map" oils_persist:field_safe="true" reporter:label="Metarecord Source Map">
4402                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4403                         <field name="id" reporter:datatype="id"/>
4404                         <field name="metarecord" reporter:datatype="link" oils_obj:required="true"/>
4405                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
4406                 </fields>
4407                 <links>
4408                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4409                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4410                 </links>
4411                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4412                         <actions>
4413                                 <retrieve/>
4414                         </actions>
4415                 </permacrud>
4416         </class>
4417         <class id="mde" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::display_entry" oils_persist:tablename="metabib.display_entry" oils_persist:field_safe="true" reporter:label="Display Field Entry" oils_persist:readonly="true">
4418                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4419                         <field name="id" reporter:datatype="id"/>
4420                         <field name="field" reporter:datatype="link"/>
4421                         <field name="source" reporter:datatype="link"/>
4422                         <field name="value" reporter:datatype="text"/>
4423                         <field name="highlight" oils_persist:virtual="true" reporter:datatype="text"/>
4424                 </fields>
4425                 <links>
4426                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4427                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4428                 </links>
4429                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4430                         <actions>
4431                                 <retrieve/>
4432                         </actions>
4433                 </permacrud>
4434         </class>
4435         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" oils_persist:tablename="metabib.flat_display_entry" oils_obj:fieldmapper="metabib::flat_display_entry" oils_persist:field_safe="true" reporter:label="Flat Display Entry" oils_persist:readonly="true">
4436                 <fields>
4437                         <field name="source" reporter:datatype="id"/>
4438                         <field name="name" reporter:datatype="text"/>
4439                         <field name="multi" reporter:datatype="bool"/>
4440                         <field name="label" reporter:datatype="text"/>
4441                         <field name="field" reporter:datatype="link"/>
4442                         <field name="value" reporter:datatype="text"/>
4443                 </fields>
4444                 <links>
4445                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4446                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4447                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4448                 </links>
4449                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4450                         <actions>
4451                                 <retrieve/>
4452                         </actions>
4453                 </permacrud>
4454         </class>
4455         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" oils_persist:tablename="metabib.compressed_display_entry" oils_obj:fieldmapper="metabib::compressed_display_entry" oils_persist:field_safe="true" reporter:label="Compressed Display Entry" oils_persist:readonly="true">
4456                 <fields>
4457                         <field name="source" reporter:datatype="id"/>
4458                         <field name="name" reporter:datatype="text"/>
4459                         <field name="multi" reporter:datatype="bool"/>
4460                         <field name="label" reporter:datatype="text"/>
4461                         <field name="field" reporter:datatype="link"/>
4462                         <field name="value" reporter:datatype="text"/>
4463                 </fields>
4464                 <links>
4465                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4466                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4467                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4468                 </links>
4469                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4470                         <actions>
4471                                 <retrieve/>
4472                         </actions>
4473                 </permacrud>
4474         </class>
4475         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" oils_persist:tablename="metabib.wide_display_entry" oils_obj:fieldmapper="metabib::wide_display_entry" oils_persist:field_safe="true" reporter:label="Wide Display Entry" oils_persist:readonly="true">
4476                 <fields oils_persist:primary="source">
4477                         <field name="source" reporter:label="Record ID" reporter:datatype="id"/>
4478                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4479                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4480                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4481                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4482                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4483                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4484                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4485                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4486                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4487                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4488                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4489                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4490                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4491                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4492                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4493                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4494                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4495                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4496                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4497                 </fields>
4498                 <links>
4499                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4500                 </links>
4501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4502                         <actions>
4503                                 <retrieve/>
4504                         </actions>
4505                 </permacrud>
4506         </class>
4507
4508         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" oils_persist:tablename="config.display_field_map" oils_obj:fieldmapper="config::display_field_map" oils_persist:field_safe="true" reporter:label="Display Field Map">
4509                 <fields oils_persist:primary="name">
4510                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
4511                         <field name="field" reporter:datatype="link"/>
4512                         <field name="multi" reporter:datatype="bool"/>
4513                 </fields>
4514                 <links>
4515                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4516                 </links>
4517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4518                         <actions>
4519                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4520                                 <retrieve/>
4521                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4522                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4523                         </actions>
4524                 </permacrud>
4525         </class>
4526
4527         <class id="mfae" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::facet_entry" oils_persist:tablename="metabib.facet_entry" reporter:label="Combined Facet Entry" oils_persist:readonly="true">
4528                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4529                         <field name="id" reporter:datatype="id"/>
4530                         <field name="field" reporter:datatype="link"/>
4531                         <field name="source" reporter:datatype="link"/>
4532                         <field name="value" reporter:datatype="text"/>
4533                 </fields>
4534                 <links>
4535                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4536                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4537                 </links>
4538         </class>
4539         <class id="mbe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::browse_entry" oils_persist:tablename="metabib.browse_entry" reporter:label="Combined Browse Entry" oils_persist:readonly="true">
4540                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4541                         <field name="id" reporter:datatype="id"/>
4542                         <field name="value" reporter:datatype="text"/>
4543                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4544                 </fields>
4545                 <links>
4546                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4547                 </links>
4548                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4549                         <actions>
4550                                 <retrieve/>
4551                         </actions>
4552                 </permacrud>
4553         </class>
4554         <class id="mbedm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::browse_entry_def_map" oils_persist:tablename="metabib.browse_entry_def_map" reporter:label="Combined Browse Entry Definition Map" oils_persist:readonly="true">
4555                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4556                         <field name="id" reporter:datatype="id"/>
4557                         <field name="entry" reporter:datatype="link"/>
4558                         <field name="def" reporter:datatype="link"/>
4559                         <field name="source" reporter:datatype="link"/>
4560                 </fields>
4561                 <links>
4562                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4563                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4564                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4565                 </links>
4566         </class>
4567         <class id="mbeshm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::browse_entry_simple_heading_map" oils_persist:tablename="metabib.browse_entry_simple_heading_map" reporter:label="Combined Browse Entry Simple Authority Heading Map" oils_persist:readonly="true">
4568                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4569                         <field name="id" reporter:datatype="id"/>
4570                         <field name="entry" reporter:datatype="link"/>
4571                         <field name="simple_heading" reporter:datatype="link"/>
4572                 </fields>
4573                 <links>
4574                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4575                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4576                 </links>
4577         </class>
4578         <class id="mfe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::field_entry" reporter:label="Combined Field Entry View" oils_persist:readonly="true">
4579                 <oils_persist:source_definition><![CDATA[
4580                         SELECT * FROM metabib.author_field_entry
4581                                                 UNION ALL
4582                         SELECT * FROM metabib.keyword_field_entry
4583                                                 UNION ALL
4584                         SELECT * FROM metabib.identifier_field_entry
4585                                                 UNION ALL
4586                         SELECT * FROM metabib.title_field_entry
4587                                                 UNION ALL
4588                         SELECT * FROM metabib.subject_field_entry
4589                                                 UNION ALL
4590                         SELECT * FROM metabib.series_field_entry
4591                 ]]></oils_persist:source_definition>
4592                 <fields>
4593                         <field name="field" reporter:datatype="link"/>
4594                         <field name="id" reporter:datatype="id"/>
4595                         <field name="source" reporter:datatype="link"/>
4596                         <field name="value" reporter:datatype="text"/>
4597                 </fields>
4598                 <links>
4599                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4600                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4601                 </links>
4602         </class>
4603         <class id="mkfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::keyword_field_entry" oils_persist:tablename="metabib.keyword_field_entry" reporter:label="Keyword Field Entry">
4604                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4605                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
4606                         <field name="id" reporter:datatype="id"/>
4607                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
4608                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
4609                 </fields>
4610                 <links>
4611                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4612                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4613                 </links>
4614         </class>
4615         <class id="mcp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::cash_payment" oils_persist:tablename="money.cash_payment" reporter:label="Cash Payment">
4616                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4617                         <field name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
4618                         <field name="amount" reporter:datatype="money" oils_obj:required="true"/>
4619                         <field name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
4620                         <field name="cash_drawer" reporter:datatype="link"/>
4621                         <field name="id" reporter:datatype="id"/>
4622                         <field name="note" reporter:datatype="text"/>
4623                         <field name="payment_ts" reporter:datatype="timestamp"/>
4624                         <field name="xact" reporter:datatype="link" oils_obj:required="true"/>
4625                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
4626                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4627                 </fields>
4628                 <links>
4629                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4630                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4631                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4632                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4633                 </links>
4634                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4635                         <actions>
4636                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4637                                         <context link="xact" jump="usr" field="home_ou"/>
4638                                 </retrieve>
4639                         </actions>
4640                 </permacrud>
4641         </class>
4642         <class id="mfp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::forgive_payment" oils_persist:tablename="money.forgive_payment" reporter:label="Forgive Payment">
4643                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4644                         <field name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
4645                         <field name="amount" reporter:datatype="money" oils_obj:required="true"/>
4646                         <field name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
4647                         <field name="id" reporter:datatype="id"/>
4648                         <field name="note" reporter:datatype="text"/>
4649                         <field name="payment_ts" reporter:datatype="timestamp"/>
4650                         <field name="xact" reporter:datatype="link" oils_obj:required="true"/>
4651                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
4652                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4653                 </fields>
4654                 <links>
4655                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4656                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4657                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4658                 </links>
4659                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4660                         <actions>
4661                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4662                                         <context link="xact" jump="usr" field="home_ou"/>
4663                                 </retrieve>
4664                         </actions>
4665                 </permacrud>
4666         </class>
4667         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4668                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4669                         <field name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
4670                         <field name="amount" reporter:datatype="money" oils_obj:required="true"/>
4671                         <field name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
4672                         <field name="id" reporter:datatype="id"/>
4673                         <field name="note" reporter:datatype="text"/>
4674                         <field name="payment_ts" reporter:datatype="timestamp"/>
4675                         <field name="xact" reporter:datatype="link" oils_obj:required="true"/>
4676                         <field name="billing" reporter:datatype="link"/>
4677                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
4678                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4679                 </fields>
4680                 <links>
4681                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4682                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4683                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4684                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4685                 </links>
4686         </class>
4687         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4688                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4689                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string" reporter:datatype="text"/>
4690                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string" reporter:datatype="text"/>
4691                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string" reporter:datatype="text"/>
4692                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string" reporter:datatype="text"/>
4693                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string" reporter:datatype="text"/>
4694                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string" reporter:datatype="text"/>
4695                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id"/>
4696                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string" reporter:datatype="text"/>
4697                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string" reporter:datatype="text"/>
4698                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string" reporter:datatype="text"/>
4699                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string" reporter:datatype="text"/>
4700                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string" reporter:datatype="text"/>
4701                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4702                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string" reporter:datatype="text"/>
4703                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string" reporter:datatype="text"/>
4704                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string" reporter:datatype="text"/>
4705                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string" reporter:datatype="text"/>
4706                 </fields>
4707                 <links>
4708                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4709                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4710                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4711                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4712                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4713                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4714                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4715                 </links>
4716         </class>
4717
4718         <class id="csp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::standing_penalty" oils_persist:tablename="config.standing_penalty" reporter:label="Standing Penalty">
4719                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4720                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4721                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
4722                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
4723                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4724                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4725                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4726                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4727                 </fields>
4728                 <links/>
4729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4730                         <actions>
4731                                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4732                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4733                                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4734                                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4735                         </actions>
4736                 </permacrud>
4737         </class>
4738         <class id="pgpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_penalty_threshold" oils_persist:tablename="permission.grp_penalty_threshold" reporter:label="Group Penalty Threshold">
4739                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4740                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4741                         <field name="grp" reporter:datatype="link" reporter:label="Group" oils_obj:required="true"/>
4742                         <field name="penalty" reporter:datatype="link" reporter:label="Penalty" oils_obj:required="true"/>
4743                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold" oils_obj:required="true"/>
4744                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
4745                 </fields>
4746                 <links>
4747                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4748                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4749                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4750                 </links>
4751                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4752                         <actions>
4753                                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field="org_unit"/>
4754                                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field="org_unit"/>
4755                                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field="org_unit"/>
4756                                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field="org_unit"/>
4757                         </actions>
4758                 </permacrud>
4759         </class>
4760         <class id="ccs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_status" oils_persist:tablename="config.copy_status" oils_persist:restrict_primary="100" reporter:label="Item Status" oils_persist:field_safe="true">
4761                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4762                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4763                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4764                         <field name="name" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name" oils_obj:required="true"/>
4765                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4766                         <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4767                         <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4768                         <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4769                         <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4770                 </fields>
4771                 <links/>
4772                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4773                         <actions>
4774                                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4775                                 <retrieve/>
4776                                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4777                                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4778                         </actions>
4779                 </permacrud>
4780         </class>
4781         <class id="ausp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_standing_penalty" oils_persist:tablename="actor.usr_standing_penalty" oils_persist:restrict_primary="100" reporter:label="User Standing Penalty">
4782                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4783                         <field name="id" reporter:datatype="id" reporter:label="ID"/>
4784                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4785                         <field name="usr" reporter:datatype="link" reporter:label="User" oils_obj:required="true"/>
4786                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4787                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty" oils_obj:required="true"/>
4788                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit" oils_obj:required="true"/>
4789                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4790                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4791                 </fields>
4792                 <links>
4793                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4794                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4795                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4796                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4797                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4798                 </links>
4799                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4800                         <actions>
4801                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4802                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4803                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4804                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4805                         </actions>
4806                 </permacrud>
4807         </class>
4808         <class id="aua" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
4809                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4810                         <field reporter:label="Type" name="address_type" reporter:datatype="text"/>
4811                         <field reporter:label="City" name="city" reporter:datatype="text" oils_obj:required="true"/>
4812                         <field reporter:label="Country" name="country" reporter:datatype="text" oils_obj:required="true"/>
4813                         <field reporter:label="County" name="county" reporter:datatype="text"/>
4814                         <field reporter:label="Address ID" name="id" reporter:datatype="id"/>
4815                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
4816                         <field reporter:label="State" name="state" reporter:datatype="text"/>
4817                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text" oils_obj:required="true"/>
4818                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
4819                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
4820                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4821                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4822                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4823                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4824                 </fields>
4825                 <links>
4826                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4827                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4828                 </links>
4829                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4830                         <actions>
4831                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4832                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4833                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4834                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4835                         </actions>
4836                 </permacrud>
4837         </class>
4838         <class id="aal" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::address_alert" oils_persist:tablename="actor.address_alert" reporter:label="Address Alert">
4839                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4840                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id"/>
4841                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4842                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4843                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool"/>
4844                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4845                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
4846                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
4847                         <field reporter:label="City" name="city" reporter:datatype="text"/>
4848                         <field reporter:label="County" name="county" reporter:datatype="text"/>
4849                         <field reporter:label="State" name="state" reporter:datatype="text"/>
4850                         <field reporter:label="Country" name="country" reporter:datatype="text"/>
4851                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4852                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4853                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4854                 </fields>
4855                 <links>
4856                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4857                 </links>
4858                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4859                         <actions>
4860                                 <create context_field="owner" permission="ADMIN_ADDRESS_ALERT"/>
4861                                 <retrieve context_field="owner" permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4862                                 <update context_field="owner" permission="ADMIN_ADDRESS_ALERT"/>
4863                                 <delete context_field="owner" permission="ADMIN_ADDRESS_ALERT"/>
4864                         </actions>
4865                 </permacrud>
4866         </class>
4867
4868
4869         <class id="auss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_saved_search" oils_persist:tablename="actor.usr_saved_search" reporter:label="User Saved Search">
4870                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4871                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4872                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
4873                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
4874                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4875                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text" oils_obj:required="true"/>
4876                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4877                         <field reporter:label="Target" name="target" reporter:datatype="text" oils_obj:required="true"/>
4878                 </fields>
4879                 <links>
4880                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4881                 </links>
4882         </class>
4883
4884         <class id="acnn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_note" oils_persist:tablename="asset.call_number_note" reporter:label="Call Number Note">
4885                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4886                         <field name="call_number" oils_obj:required="true"/>
4887                         <field name="create_date" reporter:datatype="timestamp"/>
4888                         <field name="creator" reporter:datatype="link" oils_obj:required="true"/>
4889                         <field name="id" reporter:datatype="id"/>
4890                         <field name="pub" reporter:datatype="bool"/>
4891                         <field name="title" reporter:datatype="text" oils_obj:required="true"/>
4892                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
4893                 </fields>
4894                 <links>
4895                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4896                 </links>
4897                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4898                         <actions>
4899                                 <create permission="CREATE_VOLUME_NOTE">
4900                                         <context link="call_number" field="owning_lib"/>
4901                                 </create>
4902                                 <retrieve permission="VIEW_VOLUME_NOTES">
4903                                         <context link="call_number" field="owning_lib"/>
4904                                 </retrieve>
4905                                 <update permission="UPDATE_VOLUME_NOTE">
4906                                         <context link="call_number" field="owning_lib"/>
4907                                 </update>
4908                                 <delete permission="DELETE_VOLUME_NOTE">
4909                                         <context link="call_number" field="owning_lib"/>
4910                                 </delete>
4911                         </actions>
4912                 </permacrud>
4913         </class>
4914         <class id="arn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::record_note" oils_persist:tablename="authority.record_note" reporter:label="Authority Record Note">
4915                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4916                         <field name="create_date" reporter:datatype="timestamp"/>
4917                         <field name="creator" reporter:datatype="link"/>
4918                         <field name="edit_date" reporter:datatype="timestamp"/>
4919                         <field name="editor" reporter:datatype="link"/>
4920                         <field name="id" reporter:datatype="id"/>
4921                         <field name="record" reporter:datatype="link" oils_obj:required="true"/>
4922                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
4923                 </fields>
4924                 <links>
4925                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4926                 </links>
4927                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4928                         <actions>
4929                                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required="true"/>
4930                                 <retrieve/>
4931                                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required="true"/>
4932                                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required="true"/>
4933                         </actions>
4934                 </permacrud>
4935         </class>
4936         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4937                 <oils_persist:source_definition><![CDATA[
4938 SELECT  usr,
4939                 SUM(
4940                         CASE
4941                                 WHEN (
4942                                         ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
4943                                         AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4944                                 ) THEN 1
4945                                 ELSE 0
4946                         END
4947                 ) AS out,
4948
4949                 SUM(
4950                         CASE
4951                                 WHEN (
4952                                         ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
4953                                         AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4954                                 ) THEN 1
4955                                 ELSE 0
4956                         END
4957                 ) AS overdue,
4958
4959                 SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
4960                 SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
4961                 SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
4962   FROM  action.circulation
4963   WHERE checkin_time IS NULL
4964   GROUP BY 1
4965                 ]]></oils_persist:source_definition>
4966                 <fields oils_persist:primary="usr">
4967                         <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4968                         <field reporter:label="Out" name="out" reporter:datatype="text"/>
4969                         <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4970                         <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4971                         <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4972                         <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4973                 </fields>
4974                 <links>
4975                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4976                 </links>
4977         </class>
4978         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
4979                 <oils_persist:source_definition><![CDATA[
4980 SELECT  usr,
4981                 STRING_AGG(
4982                         CASE
4983                                 WHEN (
4984                                         ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
4985                                         AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4986                                 ) THEN id::TEXT
4987                                 ELSE '0'
4988                         END
4989                 ,',') AS out,
4990
4991                 STRING_AGG(
4992                         CASE
4993                                 WHEN (
4994                                         ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
4995                                         AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4996                                 ) THEN id::TEXT
4997                                 ELSE '0'
4998                         END
4999                 ,',') AS overdue,
5000
5001                 STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5002                 STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5003                 STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5004   FROM  action.circulation
5005   WHERE checkin_time IS NULL
5006   GROUP BY 1
5007                 ]]></oils_persist:source_definition>
5008                 <fields oils_persist:primary="usr">
5009                         <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5010                         <field reporter:label="Out" name="out" reporter:datatype="text"/>
5011                         <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5012                         <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5013                         <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5014                         <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5015                 </fields>
5016                 <links>
5017                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5018                 </links>
5019         </class>
5020         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5021                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5022                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id"/>
5023                         <field reporter:label="Patron" name="patron" reporter:datatype="link" oils_obj:required="true"/>
5024                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
5025                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5026                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5027                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5028                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5029                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5030                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5031                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5032                 </fields>
5033                 <links>
5034                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5035                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5036                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5037                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5038                 </links>
5039         </class>
5040         <class id="circ" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circulation" oils_persist:tablename="action.circulation" reporter:core="true" reporter:label="Circulation">
5041                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5042                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5043                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5044                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5045                         <field reporter:label="Checkout / Renewal Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
5046                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link" oils_obj:required="true"/>
5047                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5048                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5049                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5050                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link" oils_obj:required="true"/>
5051                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5052                         <field reporter:label="Circ ID" name="id" reporter:datatype="id"/>
5053                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5054                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link" oils_obj:required="true"/>
5055                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5056                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5057                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
5058                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link" oils_obj:required="true"/>
5059                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" oils_obj:required="true"/>
5060                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" oils_obj:required="true"/>
5061                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5062                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5063                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
5064                         <field reporter:label="Patron" name="usr" reporter:datatype="link" oils_obj:required="true"/>
5065                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5066                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5067                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp"/>
5068                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5069                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5070                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5071                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5072                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5073                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5074                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5075                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5076                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5077                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5078                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5079                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5080                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5081                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5082                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5083                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
5084                 </fields>
5085                 <links>
5086                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5087                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5088                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5089                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5090                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5091                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5092                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5093                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5094                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5095                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5096                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5097                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5098                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5099                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5100                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5101                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5102                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5103                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5104                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5105                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5106                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5107                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5108                 </links>
5109                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5110                         <actions>
5111                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
5112                         </actions>
5113                 </permacrud>
5114         </class>
5115         <class id="aacct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation_combined_types" oils_persist:tablename="action.all_circulation_combined_types" reporter:core="true" reporter:label="All Circulation Combined Types" oils_persist:readonly="true">
5116                 <fields>
5117                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5118                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5119                         <field reporter:label="Circ ID" name="id" reporter:datatype="int"/>
5120                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5121                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
5122                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5123                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5124                 </fields>
5125                 <links>
5126                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5127                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5128                 </links>
5129                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5130                         <actions>
5131                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
5132                         </actions>
5133                 </permacrud>
5134         </class>
5135         <class id="aacs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation_slim" oils_persist:tablename="action.all_circulation_slim" reporter:core="false" reporter:label="Combined Aged and Active Circulations (Slim Version)" oils_persist:readonly="true">
5136                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5137                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5138                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5139                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5140                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5141                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5142                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5143                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5144                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5145                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5146                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5147                         <field reporter:label="Circ ID" name="id" reporter:datatype="id"/>
5148                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5149                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5150                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5151                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5152                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
5153                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5154                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int"/>
5155                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
5156                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5157                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5158                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5159                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5160                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5161                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp"/>
5162                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5163                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5164                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5165                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5166                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5167                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5168                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5169                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5170                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5171                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5172                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5173                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5174                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5175                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5176                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5177                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5178                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
5179                 </fields>
5180                 <links>
5181                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5182                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5183                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5184                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5185                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5186                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5187                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5188                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5189                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5190                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5191                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5192                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5193                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5194                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5195                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5196                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5197                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5198                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5199                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5200                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5201                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5202                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5203                 </links>
5204                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5205                         <actions>
5206                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
5207                         </actions>
5208                 </permacrud>
5209         </class>
5210
5211         <class id="combcirc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation" oils_persist:tablename="action.all_circulation" reporter:core="true" reporter:label="Combined Aged and Active Circulations" oils_persist:readonly="true">
5212                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5213                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5214                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5215                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5216                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5217                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5218                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5219                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5220                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5221                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5222                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5223                         <field reporter:label="Circ ID" name="id" reporter:datatype="id"/>
5224                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5225                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5226                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5227                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5228                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
5229                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5230                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int"/>
5231                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
5232                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5233                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5234                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5235                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5236                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5237                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5238                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp"/>
5239                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5240                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5241                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5242                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5243                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5244                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5245                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5246                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5247                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5248                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5249                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5250                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5251                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5252                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5253                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5254                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5255                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5256                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5257                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5258                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5259                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5260                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5261                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5262                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5263                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
5264                 </fields>
5265                 <links>
5266                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5267                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5268                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5269                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5270                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5271                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5272                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5273                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5274                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5275                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5276                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5277                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5278                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5279                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5280                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5281                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5282                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5283                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5284                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5285                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5286                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5287                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5288                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5289                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5290                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5291                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5292                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5293                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5294                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5295                 </links>
5296                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5297                         <actions>
5298                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
5299                         </actions>
5300                 </permacrud>
5301         </class>
5302         <class id="acirc" controller="open-ils.cstore" oils_obj:fieldmapper="action::aged_circulation" oils_persist:tablename="action.aged_circulation" reporter:core="true" reporter:label="Aged (patronless) Circulation">
5303                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5304                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5305                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5306                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5307                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
5308                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link" oils_obj:required="true"/>
5309                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool" oils_obj:required="true"/>
5310                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5311                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5312                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link" oils_obj:required="true"/>
5313                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval" oils_obj:required="true"/>
5314                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
5315                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5316                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link" oils_obj:required="true"/>
5317                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool" oils_obj:required="true"/>
5318                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool" oils_obj:required="true"/>
5319                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
5320                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link" oils_obj:required="true"/>
5321                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" oils_obj:required="true"/>
5322                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" oils_obj:required="true"/>
5323                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5324                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5325                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
5326                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5327                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5328                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" oils_obj:required="true"/>
5329                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5330                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5331                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5332                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5333                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5334                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5335                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5336                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5337                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5338                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5339                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5340                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link" oils_obj:required="true"/>
5341                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link" oils_obj:required="true"/>
5342                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5343                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link" oils_obj:required="true"/>
5344                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link" oils_obj:required="true"/>
5345                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link" oils_obj:required="true"/>
5346                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link" oils_obj:required="true"/>
5347                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link" oils_obj:required="true"/>
5348                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5349                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5350                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool" oils_obj:required="true"/>
5351                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
5352                 </fields>
5353                 <links>
5354                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5355                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5356                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5357                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5358                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5359                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5360                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5361                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5362                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5363                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5364                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5365                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5366                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5367                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5368                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5369                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5370                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5371                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5372                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5373                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5374                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5375                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5376                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5377                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5378                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5379                 </links>
5380         </class>
5381         <class id="auch" controller="open-ils.cstore" oils_obj:fieldmapper="action::user_circ_history" oils_persist:tablename="action.usr_circ_history" reporter:label="User Checkout History">
5382                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5383                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5384                         <!-- prevent reporting on the user that owns the checkout history -->
5385                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store" oils_obj:required="true"/>
5386                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
5387                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp"/>
5388                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" oils_obj:required="true"/>
5389                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp"/>
5390                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link"/>
5391                 </fields>
5392                 <links>
5393                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5394                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5395                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5396                 </links>
5397         </class>
5398         <class id="brt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_type" oils_persist:tablename="booking.resource_type" reporter:label="Resource Type">
5399                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5400                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5401                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5402                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5403                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5404                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5405                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5406                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5407                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5408                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5409                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5410                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5411                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5412                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5413                 </fields>
5414                 <links>
5415                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5416                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5417                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5418                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5419                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5420                 </links>
5421                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5422                         <actions>
5423                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field="owner"/>
5424                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field="owner"/>
5425                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field="owner"/>
5426                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field="owner"/>
5427                         </actions>
5428                 </permacrud>
5429         </class>
5430
5431         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5432                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5433                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode"/>
5434                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5435                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5436                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5437                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5438                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5439                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5440                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5441                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5442                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5443                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5444                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5445                 </fields>
5446                 <links>
5447                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5448                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5449                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5450                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5451                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5452                 </links>
5453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5454                         <actions>
5455                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field="owner"/>
5456                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field="owner"/>
5457                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field="owner"/>
5458                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field="owner"/>
5459                         </actions>
5460                 </permacrud>
5461         </class>
5462         
5463         <class id="bra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr" oils_persist:tablename="booking.resource_attr" reporter:label="Resource Attribute">
5464                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5465                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5466                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5467                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5468                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link" oils_obj:required="true"/>
5469                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5470                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5471                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5472                 </fields>
5473                 <links>
5474                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5475                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5476                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5477                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5478                 </links>
5479                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5480                         <actions>
5481                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field="owner"/>
5482                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field="owner"/>
5483                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field="owner"/>
5484                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field="owner"/>
5485                         </actions>
5486                 </permacrud>
5487         </class>
5488         
5489         <class id="brav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr_value" oils_persist:tablename="booking.resource_attr_value" reporter:label="Resource Attribute Value">
5490                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5491                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value"/>
5492                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5493                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5494                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5495                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5496                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5497                 </fields>
5498                 <links>
5499                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5500                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5501                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5502                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5503                 </links>
5504                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5505                         <actions>
5506                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field="owner"/>
5507                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field="owner"/>
5508                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field="owner"/>
5509                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field="owner"/>
5510                         </actions>
5511                 </permacrud>
5512         </class>
5513         
5514         <class id="bram" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr_map" oils_persist:tablename="booking.resource_attr_map" reporter:label="Resource Attribute Map">
5515                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5516                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5517                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5518                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5519                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5520                 </fields>
5521                 <links>
5522                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5523                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5524                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5525                 </links>
5526                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5527                         <actions>
5528                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5529                                         <context link="resource" field="owner"/>
5530                                 </create>
5531                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5532                                         <context link="resource" field="owner"/>
5533                                 </retrieve>
5534                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5535                                         <context link="resource" field="owner"/>
5536                                 </update>
5537                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5538                                         <context link="resource" field="owner"/>
5539                                 </delete>
5540                         </actions>
5541                 </permacrud>
5542         </class>
5543         
5544         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5545                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5546                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
5547                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
5548                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5549                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5550                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5551                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5552                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5553                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5554                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5555                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5556                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5557                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5558                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5559                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5560                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5561                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5562                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5563                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5564                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5565                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5566                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5567                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link" oils_obj:required="true"/>
5568                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5569                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5570                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link" oils_obj:required="true"/>
5571                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5572                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5573                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5574                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5575                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5576                 </fields>
5577                 <links>
5578                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5579                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5580                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5581                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5582                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5583                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5584                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5585                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5586                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5587                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5588                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5589                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5590                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5591                 </links>
5592                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5593                         <actions>
5594                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5595                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5596                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5597                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5598                         </actions>
5599                 </permacrud>
5600         </class>
5601         
5602         <class id="bravm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation_attr_value_map" oils_persist:tablename="booking.reservation_attr_value_map" reporter:label="Reservation Attribute Value Map">
5603                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5604                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5605                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link" oils_obj:required="true"/>
5606                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link" oils_obj:required="true"/>
5607                 </fields>
5608                 <links>
5609                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5610                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5611                 </links>
5612                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5613                         <actions>
5614                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5615                                         <context link="reservation" field="pickup_lib"/>
5616                                 </create>
5617                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5618                                         <context link="reservation" field="pickup_lib"/>
5619                                 </retrieve>
5620                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5621                                         <context link="reservation" field="pickup_lib"/>
5622                                 </update>
5623                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5624                                         <context link="reservation" field="pickup_lib"/>
5625                                 </delete>
5626                         </actions>
5627                 </permacrud>
5628         </class>
5629
5630         <class id="ccnbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_item" oils_persist:tablename="container.call_number_bucket_item" reporter:label="Call Number Bucket Item">
5631                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5632                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
5633                         <field name="id" reporter:datatype="id"/>
5634                         <field name="target_call_number" reporter:datatype="link" oils_obj:required="true"/>
5635                         <field name="create_time" reporter:datatype="timestamp"/>
5636                         <field name="pos" reporter:datatype="int"/>
5637                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5638                 </fields>
5639                 <links>
5640                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5641                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5642                         <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5643                 </links>
5644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5645                         <actions>
5646                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5647                                         <context link="bucket" field="owning_lib"/>
5648                                 </retrieve>
5649                         </actions>
5650                 </permacrud>
5651         </class>
5652         <class id="ccnbin" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket_item_note" oils_persist:tablename="container.call_number_bucket_item_note" reporter:label="Call Number Bucket Item Note">
5653                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5654                         <field name="id" reporter:datatype="id"/>
5655                         <field name="item" reporter:datatype="link" oils_obj:required="true"/>
5656                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
5657                 </fields>
5658                 <links>
5659                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5660                 </links>
5661         </class>
5662         <class id="cbreb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket" oils_persist:tablename="container.biblio_record_entry_bucket" reporter:label="Bibliographic Record Entry Bucket">
5663                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5664                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5665                         <field name="btype" reporter:datatype="text"/>
5666                         <field name="id" reporter:datatype="id" reporter:selector="id"/>
5667                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
5668                         <field name="description" reporter:datatype="text"/>
5669                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
5670                         <field name="pub" reporter:datatype="bool"/>
5671                         <field name="create_time" reporter:datatype="timestamp"/>
5672                         <field name="owning_lib" reporter:datatype="org_unit"/>
5673                 </fields>
5674                 <links>
5675                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5676                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5677                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5678                 </links>
5679                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5680                         <actions>
5681                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5682                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5683                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5684                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5685                         </actions>
5686                 </permacrud>
5687         </class>
5688         <class id="cbrebn" controller="open-ils.cstore" oils_obj:fieldmapper="container::biblio_record_entry_bucket_note" oils_persist:tablename="container.biblio_record_entry_bucket_note" reporter:label="Bibliographic Record Entry Bucket Note">
5689                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5690                         <field name="id" reporter:datatype="id"/>
5691                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
5692                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
5693                 </fields>
5694                 <links>
5695                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5696                 </links>
5697         </class>
5698         <class id="ahcm" controller="open-ils.cstore" oils_obj:fieldmapper="action::hold_copy_map" oils_persist:tablename="action.hold_copy_map" reporter:label="Hold Copy Map">
5699                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5700                         <field name="hold" reporter:datatype="link" oils_obj:required="true"/>
5701                         <field name="id" reporter:datatype="id"/>
5702                         <field name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
5703                         <field name="proximity" reporter:datatype="number"/>
5704                 </fields>
5705                 <links>
5706                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5707                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5708                 </links>
5709         </class>
5710         <class id="ahn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_notification" oils_persist:tablename="action.hold_notification" reporter:label="Hold Notification">
5711                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5712                         <field reporter:label="Hold" name="hold" reporter:datatype="link" oils_obj:required="true"/>
5713                         <field reporter:label="Notification ID" name="id" reporter:datatype="id"/>
5714                         <field reporter:label="Notification Method" name="method" reporter:datatype="text" oils_obj:required="true"/>
5715                         <field reporter:label="Notification Note" name="note" reporter:datatype="text"/>
5716                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5717                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5718                 </fields>
5719                 <links>
5720                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5721                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5722                 </links>
5723                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5724                         <actions>
5725                                 <create permission="CREATE_HOLD_NOTIFICATION">
5726                                         <context link="hold" jump="usr" field="home_ou"/>
5727                                 </create>
5728                                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5729                                         <context link="hold" jump="usr" field="home_ou"/>
5730                                 </retrieve>
5731                                 <update permission="CREATE_HOLD_NOTIFICATION">
5732                                         <context link="hold" jump="usr" field="home_ou"/>
5733                                 </update>
5734                                 <delete permission="CREATE_HOLD_NOTIFICATION">
5735                                         <context link="hold" jump="usr" field="home_ou"/>
5736                                 </delete>
5737                         </actions>
5738                 </permacrud>
5739         </class>
5740         <class id="acpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location" oils_persist:tablename="asset.copy_location" reporter:label="Shelving Location" oils_persist:field_safe="true">
5741                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5742                         <field reporter:label="Can Circulate?" name="circulate" reporter:datatype="bool"/>
5743                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5744                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5745                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5746                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
5747                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5748                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
5749                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5750                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5751                         <field reporter:label="Label Prefix" name="label_prefix" reporter:datatype="text" oils_persist:i18n="true"/>
5752                         <field reporter:label="Label Suffix" name="label_suffix" reporter:datatype="text" oils_persist:i18n="true"/>
5753                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool"/>
5754                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
5755                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
5756                 </fields>
5757                 <links>
5758                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5759                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5760                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5761                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5762                 </links>
5763                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5764                         <actions>
5765                                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5766                                 <retrieve/>
5767                                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5768                                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5769                         </actions>
5770                 </permacrud>
5771         </class>
5772         <class id="acplg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location_group" oils_persist:tablename="asset.copy_location_group" reporter:label="Copy/Shelving Location Group">
5773                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5774                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5775                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
5776                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5777                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5778                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5779                         <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5780                         <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5781                 </fields>
5782                 <links>
5783                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5784                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5785                 </links>
5786                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5787                         <actions>
5788                                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5789                                 <retrieve/>
5790                                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5791                                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5792                         </actions>
5793                 </permacrud>
5794         </class>
5795         <class id="acplgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location_group_map" oils_persist:tablename="asset.copy_location_group_map" reporter:label="Copy/Shelving Location Group Map">
5796                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5797                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5798                         <field reporter:label="Group" name="lgroup" reporter:datatype="link" oils_obj:required="true"/>
5799                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" oils_obj:required="true"/>
5800                 </fields>
5801                 <links>
5802                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5803                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5804                 </links>
5805                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5806                         <actions>
5807                                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5808                                         <context link="lgroup" field="owner"/>
5809                                 </create>
5810                                 <retrieve/>
5811                                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5812                                         <context link="lgroup" field="owner"/>
5813                                 </update>
5814                                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5815                                         <context link="lgroup" field="owner"/>
5816                                 </delete>
5817                         </actions>
5818                 </permacrud>
5819         </class>
5820
5821         <class id="acplo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location_order" oils_persist:tablename="asset.copy_location_order" reporter:label="Copy/Shelving Location Order">
5822                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5823                         <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5824                         <field reporter:label="Location ID" name="location" reporter:datatype="link" oils_obj:required="true"/>
5825                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
5826                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
5827                 </fields>
5828                 <links>
5829                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5830                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5831                 </links>
5832                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5833                         <actions>
5834                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5835                                 <retrieve/>
5836                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5837                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5838                         </actions>
5839                 </permacrud>
5840         </class>
5841
5842         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5843                 <fields>
5844                         <field name="sre_id" oils_persist:virtual="true"/>
5845                         <field name="location" oils_persist:virtual="true"/>
5846                         <field name="owning_lib" oils_persist:virtual="true"/>
5847                         <field name="basic_holdings" oils_persist:virtual="true"/>
5848                         <field name="basic_holdings_add" oils_persist:virtual="true"/>
5849                         <field name="supplement_holdings" oils_persist:virtual="true"/>
5850                         <field name="supplement_holdings_add" oils_persist:virtual="true"/>
5851                         <field name="index_holdings" oils_persist:virtual="true"/>
5852                         <field name="index_holdings_add" oils_persist:virtual="true"/>
5853                         <field name="online" oils_persist:virtual="true"/>
5854                         <field name="missing" oils_persist:virtual="true"/>
5855                         <field name="incomplete" oils_persist:virtual="true"/>
5856                 </fields>
5857         </class>
5858
5859         <class id="sre" controller="open-ils.pcrud open-ils.cstore" oils_obj:fieldmapper="serial::record_entry" oils_persist:tablename="serial.record_entry" reporter:label="Serial Record Entry">
5860                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5861                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5862                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5863                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5864                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5865                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5866                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5867                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5868                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5869                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text" oils_obj:required="true"/>
5870                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5871                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5872                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5873                 </fields>
5874                 <links>
5875                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5876                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5877                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5878                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5879                 </links>
5880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5881                         <actions>
5882                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5883                                 <retrieve/>
5884                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5885                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5886                         </actions>
5887                 </permacrud>
5888         </class>
5889
5890         <class id="scap" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::caption_and_pattern" oils_persist:tablename="serial.caption_and_pattern" reporter:label="Caption and Pattern">
5891                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5892                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5893                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link" oils_obj:required="true"/>
5894                         <field reporter:label="Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
5895                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5896                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5897                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5898                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5899                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
5900                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5901                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5902                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5903                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5904                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5905                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5906                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5907                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5908                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5909                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5910                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5911                 </fields>
5912                 <links>
5913                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5914                 </links>
5915                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5916                         <actions>
5917                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5918                                         <context link="subscription" field="owning_lib"/>
5919                                 </create>
5920                                 <retrieve/>
5921                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5922                                         <context link="subscription" field="owning_lib"/>
5923                                 </update>
5924                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5925                                         <context link="subscription" field="owning_lib"/>
5926                                 </delete>
5927                         </actions>
5928                 </permacrud>
5929         </class>
5930
5931         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
5932                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
5933                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5934                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
5935                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp" oils_obj:required="true"/>
5936                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5937                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
5938                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
5939                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
5940                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
5941                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
5942                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5943                 </fields>
5944                 <links>
5945                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5946                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
5947                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
5948                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
5949                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
5950                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
5951                 </links>
5952                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5953                         <actions>
5954                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5955                                 <retrieve/>
5956                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5957                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5958                         </actions>
5959                 </permacrud>
5960         </class>
5961
5962         <class id="ssubn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
5963                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
5964                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5965                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link" oils_obj:required="true"/>
5966                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
5967                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5968                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5969                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5970                         <field reporter:label="Title" name="title" reporter:datatype="text" oils_obj:required="true"/>
5971                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
5972                 </fields>
5973                 <links>
5974                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5975                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5976                 </links>
5977                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5978                         <actions>
5979                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5980                                         <context link="subscription" field="owning_lib"/>
5981                                 </create>
5982                                 <retrieve/>
5983                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5984                                         <context link="subscription" field="owning_lib"/>
5985                                 </update>
5986                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5987                                         <context link="subscription" field="owning_lib"/>
5988                                 </delete>
5989                         </actions>
5990                 </permacrud>
5991         </class>
5992
5993         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
5994                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
5995                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5996                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
5997                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
5998                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link" oils_obj:required="true"/>
5999                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6000                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
6001                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6002                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6003                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6004                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6005                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6006                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6007                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6008                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6009                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6010                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6011                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6012                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6013                 </fields>
6014                 <links>
6015                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6016                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6017                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6018                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6019                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6020                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6021                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6022                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6023                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6024                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6025                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6026                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6027                 </links>
6028                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6029                         <actions>
6030                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib"/>
6031                                 <retrieve/>
6032                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib"/>
6033                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib"/>
6034                         </actions>
6035                 </permacrud>
6036         </class>
6037
6038         <class id="sdistn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution_note" oils_persist:tablename="serial.distribution_note" reporter:label="Distribution Note">
6039                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6040                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6041                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link" oils_obj:required="true"/>
6042                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
6043                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6044                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6045                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6046                         <field reporter:label="Title" name="title" reporter:datatype="text" oils_obj:required="true"/>
6047                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
6048                 </fields>
6049                 <links>
6050                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6051                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6052                 </links>
6053                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6054                         <actions>
6055                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6056                                         <context link="distribution" field="holding_lib"/>
6057                                 </create>
6058                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6059                                         <context link="distribution" field="holding_lib"/>
6060                                 </retrieve>
6061                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6062                                         <context link="distribution" field="holding_lib"/>
6063                                 </update>
6064                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6065                                         <context link="distribution" field="holding_lib"/>
6066                                 </delete>
6067                         </actions>
6068                 </permacrud>
6069         </class>
6070
6071         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6072                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6073                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6074                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link" oils_obj:required="true"/>
6075                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6076                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6077                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6078                 </fields>
6079                 <links>
6080                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6081                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6082                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6083                 </links>
6084                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6085                         <actions>
6086                                 <create permission="ADMIN_SERIAL_STREAM">
6087                                         <context link="distribution" field="holding_lib"/>
6088                                 </create>
6089                                 <retrieve/>
6090                                 <update permission="ADMIN_SERIAL_STREAM">
6091                                         <context link="distribution" field="holding_lib"/>
6092                                 </update>
6093                                 <delete permission="ADMIN_SERIAL_STREAM">
6094                                         <context link="distribution" field="holding_lib"/>
6095                                 </delete>
6096                         </actions>
6097                 </permacrud>
6098         </class>
6099
6100         <class id="srlu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::routing_list_user" oils_persist:tablename="serial.routing_list_user" reporter:label="Routing List User">
6101                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6102                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6103                         <field reporter:label="Stream" name="stream" reporter:datatype="link" oils_obj:required="true"/>
6104                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6105                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6106                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6107                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6108                 </fields>
6109                 <links>
6110                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6111                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
6112                 </links>
6113                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6114                         <actions>
6115                                 <create permission="ADMIN_SERIAL_STREAM">
6116                                         <context link="stream" jump="distribution" field="holding_lib"/>
6117                                 </create>
6118                                 <retrieve permission="RECEIVE_SERIAL">
6119                                         <context link="stream" jump="distribution" field="holding_lib"/>
6120                                 </retrieve>
6121                                 <update permission="ADMIN_SERIAL_STREAM">
6122                                         <context link="stream" jump="distribution" field="holding_lib"/>
6123                                 </update>
6124                                 <delete permission="ADMIN_SERIAL_STREAM">
6125                                         <context link="stream" jump="distribution" field="holding_lib"/>
6126                                 </delete>
6127                         </actions>
6128                 </permacrud>
6129         </class>
6130
6131         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6132                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6133                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6134                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
6135                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
6136                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6137                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6138                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link" oils_obj:required="true"/>
6139                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6140                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6141                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6142                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6143                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6144                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6145                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6146                 </fields>
6147                 <links>
6148                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6149                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6150                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6151                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6152                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6153                 </links>
6154                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6155                         <actions>
6156                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6157                                         <context link="subscription" field="owning_lib"/>
6158                                 </create>
6159                                 <retrieve/>
6160                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6161                                         <context link="subscription" field="owning_lib"/>
6162                                 </update>
6163                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6164                                         <context link="subscription" field="owning_lib"/>
6165                                 </delete>
6166                         </actions>
6167                 </permacrud>
6168         </class>
6169
6170         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6171                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6172                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6173                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6174                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6175                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
6176                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link" oils_obj:required="true"/>
6177                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6178                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6179                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6180                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6181                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6182                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6183                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6184                         <field reporter:label="Creating User" name="creator" reporter:datatype="link" oils_obj:required="true"/>
6185                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6186                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6187                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6188                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
6189                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6190                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6191                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6192                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link" oils_obj:required="true"/>
6193                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int" oils_obj:required="true"/>
6194                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool"/>
6195                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int" oils_obj:required="true"/>
6196                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6197                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6198                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
6199                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6200                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6201                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6202                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6203                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6204                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6205                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6206                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text" oils_obj:required="true"/>
6207                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text" oils_obj:required="true"/>
6208                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6209                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6210                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6211                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6212                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6213                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6214                 </fields>
6215                 <links>
6216                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6217                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6218                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6219                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6220                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6221                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6222                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6223                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6224                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6225                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6226                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6227                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6228                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6229                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6230                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6231                 </links>
6232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6233                         <actions>
6234                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib"/>
6235                                 <retrieve/>
6236                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib"/>
6237                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib"/>
6238                         </actions>
6239                 </permacrud>
6240         </class>
6241
6242         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6243                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6244                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6245                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
6246                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
6247                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6248                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6249                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link" oils_obj:required="true"/>
6250                         <field reporter:label="Stream" name="stream" reporter:datatype="link" oils_obj:required="true"/>
6251                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6252                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6253                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6254                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6255                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6256                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6257                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6258                 </fields>
6259                 <links>
6260                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6261                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6262                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6263                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6264                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6265                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6266                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6267                 </links>
6268                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6269                         <actions>
6270                                 <create permission="ADMIN_SERIAL_ITEM">
6271                                         <context link="stream" jump="distribution" field="holding_lib"/>
6272                                 </create>
6273                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6274                                         <context link="stream" jump="distribution" field="holding_lib"/>
6275                                 </retrieve>
6276                                 <update permission="ADMIN_SERIAL_ITEM">
6277                                         <context link="stream" jump="distribution" field="holding_lib"/>
6278                                 </update>
6279                                 <delete permission="ADMIN_SERIAL_ITEM">
6280                                         <context link="stream" jump="distribution" field="holding_lib"/>
6281                                 </delete>
6282                         </actions>
6283                 </permacrud>
6284         </class>
6285
6286         <class id="sin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
6287                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6288                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6289                         <field reporter:label="Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
6290                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
6291                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6292                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6293                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6294                         <field reporter:label="Title" name="title" reporter:datatype="text" oils_obj:required="true"/>
6295                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
6296                 </fields>
6297                 <links>
6298                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6299                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6300                 </links>
6301                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6302                         <actions>
6303                                 <create permission="ADMIN_SERIAL_ITEM">
6304                                         <context link="item" jump="stream.distribution" field="holding_lib"/>
6305                                 </create>
6306                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6307                                         <context link="item" jump="stream.distribution" field="holding_lib"/>
6308                                 </retrieve>
6309                                 <update permission="ADMIN_SERIAL_ITEM">
6310                                         <context link="item" jump="stream.distribution" field="holding_lib"/>
6311                                 </update>
6312                                 <delete permission="ADMIN_SERIAL_ITEM">
6313                                         <context link="item" jump="stream.distribution" field="holding_lib"/>
6314                                 </delete>
6315                         </actions>
6316                 </permacrud>
6317         </class>
6318         <class id="sasum" controller="open-ils.cstore" oils_obj:fieldmapper="serial::any_summary" oils_persist:tablename="serial.any_summary" reporter:label="All Issues' Summaries" oils_persist:readonly="true">
6319                 <fields>
6320                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text"/>
6321                         <field name="id" reporter:label="Native ID" reporter:datatype="int"/><!-- not datatype="id", because id is not unique in this view -->
6322                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link"/>
6323                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text"/>
6324                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool"/>
6325                 </fields>
6326                 <links>
6327                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6328                 </links>
6329         </class>
6330         <class id="smhc" controller="open-ils.cstore" oils_obj:fieldmapper="serial::materialized_holding_code" oils_persist:tablename="serial.materialized_holding_code" reporter:label="Materialized Holding Code" oils_persist:readonly="true">
6331                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6332                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
6333                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link"/>
6334                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text"/>
6335                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text"/>
6336                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text"/>
6337                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text"/>
6338                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$"/>
6339                 </fields>
6340                 <links>
6341                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6342                 </links>
6343         </class>
6344         <class id="sbsum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::basic_summary" oils_persist:tablename="serial.basic_summary" reporter:label="Basic Issue Summary">
6345                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6346                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6347                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link" oils_obj:required="true"/>
6348                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text" oils_obj:required="true"/>
6349                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6350                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6351                 </fields>
6352                 <links>
6353                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6354                 </links>
6355                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6356                         <actions>
6357                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6358                                         <context link="distribution" field="holding_lib"/>
6359                                 </create>
6360                                 <retrieve/>
6361                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6362                                         <context link="distribution" field="holding_lib"/>
6363                                 </update>
6364                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6365                                         <context link="distribution" field="holding_lib"/>
6366                                 </delete>
6367                         </actions>
6368                 </permacrud>
6369         </class>
6370
6371         <class id="sssum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::supplement_summary" oils_persist:tablename="serial.supplement_summary" reporter:label="Supplemental Issue Summary">
6372                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6373                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6374                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link" oils_obj:required="true"/>
6375                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text" oils_obj:required="true"/>
6376                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6377                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6378                 </fields>
6379                 <links>
6380                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6381                 </links>
6382                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6383                         <actions>
6384                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6385                                         <context link="distribution" field="holding_lib"/>
6386                                 </create>
6387                                 <retrieve/>
6388                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6389                                         <context link="distribution" field="holding_lib"/>
6390                                 </update>
6391                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6392                                         <context link="distribution" field="holding_lib"/>
6393                                 </delete>
6394                         </actions>
6395                 </permacrud>
6396         </class>
6397
6398         <class id="sisum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::index_summary" oils_persist:tablename="serial.index_summary" reporter:label="Index Issue Summary">
6399                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6400                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6401                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link" oils_obj:required="true"/>
6402                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text" oils_obj:required="true"/>
6403                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6404                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6405                 </fields>
6406                 <links>
6407                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6408                 </links>
6409                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6410                         <actions>
6411                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6412                                         <context link="distribution" field="holding_lib"/>
6413                                 </create>
6414                                 <retrieve/>
6415                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6416                                         <context link="distribution" field="holding_lib"/>
6417                                 </update>
6418                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6419                                         <context link="distribution" field="holding_lib"/>
6420                                 </delete>
6421                         </actions>
6422                 </permacrud>
6423         </class>
6424
6425         <class id="spt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::pattern_template" oils_persist:tablename="serial.pattern_template" reporter:label="Prediction Pattern Template">
6426                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6427                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6428                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6429                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6430                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6431                         <field reporter:label="Share Depth" name="share_depth" reporter:datatype="int"/>
6432                 </fields>
6433                 <links>
6434                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6435                 </links>
6436                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6437                         <actions>
6438                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6439                                 <retrieve/>
6440                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6441                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6442                         </actions>
6443                 </permacrud>
6444         </class>
6445
6446         <class id="ascecm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_entry_copy_map" oils_persist:tablename="asset.stat_cat_entry_copy_map" reporter:label="Statistical Category Entry Copy Map">
6447                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6448                         <field name="id" reporter:datatype="id"/>
6449                         <field name="owning_copy" reporter:datatype="link" oils_obj:required="true"/>
6450                         <field name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
6451                         <field name="stat_cat_entry" reporter:datatype="link" oils_obj:required="true"/>
6452                 </fields>
6453                 <links>
6454                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6455                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6456                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6457                 </links>
6458                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6459                         <actions>
6460                                 <retrieve/>
6461                         </actions>
6462                 </permacrud>
6463         </class>
6464         <class id="citm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::item_type_map" oils_persist:tablename="config.item_type_map" reporter:label="Item Type Map" oils_persist:field_safe="true">
6465                 <fields oils_persist:primary="code">
6466                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6467                         <field reporter:label="Item Type" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6468                 </fields>
6469                 <links/>
6470                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6471                         <actions>
6472                                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6473                                 <retrieve/>
6474                                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6475                                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6476                         </actions>
6477                 </permacrud>
6478         </class>
6479         <class id="cblvl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::bib_level_map" oils_persist:tablename="config.bib_level_map" reporter:label="Bib Level Map" oils_persist:field_safe="true">
6480                 <fields oils_persist:primary="code">
6481                         <field reporter:label="Bib Level Code" name="code" reporter:datatype="text"/>
6482                         <field reporter:label="Bib Level" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6483                 </fields>
6484                 <links/>
6485                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6486                         <actions>
6487                                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6488                                 <retrieve/>
6489                                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6490                                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6491                         </actions>
6492                 </permacrud>
6493         </class>
6494         <class id="sra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="search::relevance_adjustment" oils_persist:tablename="search.relevance_adjustment" reporter:label="Relevance Adjustment">
6495                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6496                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6497                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
6498                         <field reporter:label="Index Field" name="field" reporter:datatype="link" oils_obj:required="true"/>
6499                         <field reporter:label="Bump Type" name="bump_type" reporter:datatype="text" oils_obj:required="true"/>
6500                         <field reporter:label="Multiplier" name="multiplier" reporter:datatype="number"/>
6501                 </fields>
6502                 <links>
6503                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6504                 </links>
6505                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6506                         <actions>
6507                                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6508                                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6509                                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6510                                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6511                         </actions>
6512                 </permacrud>
6513         </class>
6514         <class id="lasso" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_lasso" oils_persist:tablename="actor.org_lasso" reporter:label="Library Group">
6515                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6516                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6517                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6518                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6519                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6520                 </fields>
6521                 <links>
6522                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6523                 </links>
6524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6525                         <actions>
6526                                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6527                                 <retrieve/>
6528                                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6529                                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6530                         </actions>
6531                 </permacrud>
6532         </class>
6533         <class id="lmap" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_lasso_map" oils_persist:tablename="actor.org_lasso_map" reporter:label="Library Group Map">
6534                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6535                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id"/>
6536                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link" oils_obj:required="true"/>
6537                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6538                 </fields>
6539                 <links>
6540                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6541                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6542                 </links>
6543                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6544                         <actions>
6545                                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6546                                 <retrieve/>
6547                                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6548                                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6549                         </actions>
6550                 </permacrud>
6551         </class>
6552         <class id="aoupa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_proximity_adjustment" oils_persist:tablename="actor.org_unit_proximity_adjustment" reporter:label="Org Unit Proximity Adjustment">
6553                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6554                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
6555                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6556                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6557                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6558                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6559                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6560                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6561                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true"/>
6562                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool"/>
6563                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number"/>
6564                 </fields>
6565                 <links>
6566                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6567                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6568                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6569                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6570                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6571                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6572                 </links>
6573                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6574                         <actions>
6575                                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6576                                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6577                                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6578                                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6579                         </actions>
6580                 </permacrud>
6581         </class>
6582         <class id="aoup" controller="open-ils.cstore" oils_obj:fieldmapper="actor::org_unit_proximity" oils_persist:tablename="actor.org_unit_proximity" reporter:label="Org Unit Proximity">
6583                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6584                         <field name="id" reporter:datatype="id"/>
6585                         <field name="from_org" reporter:datatype="org_unit"/>
6586                         <field name="to_org" reporter:datatype="org_unit"/>
6587                         <field name="prox" reporter:datatype="int"/>
6588                 </fields>
6589                 <links>
6590                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6591                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6592                 </links>
6593         </class>
6594         <class id="ssr" controller="open-ils.cstore" oils_obj:fieldmapper="search::search_result" oils_persist:tablename="search.search_result" oils_persist:readonly="true" reporter:label="Search Result">
6595                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6596                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6597                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6598                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6599                         <field reporter:label="Total Results" name="total" reporter:datatype="int"/>
6600                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6601                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6602                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6603                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6604                 </fields>
6605                 <links/>
6606         </class>
6607         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6608                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6609                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6610                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6611                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
6612                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6613                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6614                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6615                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6616                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
6617                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6618                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6619                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6620                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6621                 </fields>
6622                 <links>
6623                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6624                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6625                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6626                 </links>
6627                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6628                         <actions>
6629                                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6630                                 <retrieve/>
6631                                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6632                                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6633                         </actions>
6634                 </permacrud>
6635         </class>
6636         <class id="aoa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_address" oils_persist:tablename="actor.org_address" reporter:label="Org Address">
6637                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6638                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true"/>
6639                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6640                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6641                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6642                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
6643                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6644                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6645                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6646                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6647                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6648                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6649                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6650                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6651                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6652                 </fields>
6653                 <links>
6654                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6655                 </links>
6656                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6657                         <actions>
6658                                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6659                                 <retrieve/>
6660                                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6661                                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6662                         </actions>
6663                 </permacrud>
6664         </class>
6665         <class id="asq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::search_query" oils_persist:tablename="actor.search_query" reporter:label="Search Query" oils_persist:field_safe="true">
6666                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6667                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6668                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
6669                         <field name="query_text" reporter:datatype="text" oils_obj:required="true"/>
6670                 </fields>
6671                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6672                         <actions>
6673                                 <retrieve/>
6674                         </actions>
6675                 </permacrud>
6676         </class>
6677
6678         <class id="asfg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::search_filter_group" oils_persist:tablename="actor.search_filter_group" reporter:label="Search Filter Group" oils_persist:field_safe="true">
6679                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6680                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6681                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6682                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6683                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6684                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6685                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6686                 </fields>
6687                 <links>
6688                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6689                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6690                 </links>
6691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6692                         <actions>
6693                                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6694                                 <retrieve/>
6695                                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6696                                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6697                         </actions>
6698                 </permacrud>
6699         </class>
6700         <class id="asfge" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::search_filter_group_entry" oils_persist:tablename="actor.search_filter_group_entry" reporter:label="Search Filter Group Entry" oils_persist:field_safe="true">
6701                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6702                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6703                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6704                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6705                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6706                 </fields>
6707                 <links>
6708                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6709                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6710                 </links>
6711                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6712                         <actions>
6713                                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6714                                         <context link="grp" field="owner"/>
6715                                 </create>
6716                                 <retrieve/>
6717                                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6718                                         <context link="grp" field="owner"/>
6719                                 </update>
6720                                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6721                                         <context link="grp" field="owner"/>
6722                                 </delete>
6723                         </actions>
6724                 </permacrud>
6725         </class>
6726
6727         <!-- A note: Please update alhr and ahopl when updating ahr -->
6728         <class id="ahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_request" oils_persist:tablename="action.hold_request" reporter:core="true" reporter:label="Hold Request">
6729                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6730                         <field reporter:label="Status" name="status" oils_persist:virtual="true"/>
6731                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true"/>
6732                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6733                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6734                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6735                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6736                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6737                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff"/>
6738                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6739                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6740                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6741                         <field reporter:label="Hold ID" name="id" reporter:datatype="id"/>
6742                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6743                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6744                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6745                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6746                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6747                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6748                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6749                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link" oils_obj:required="true"/>
6750                         <field reporter:label="Item Selection Depth" name="selection_depth"/>
6751                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit" oils_obj:required="true"/>
6752                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link" oils_obj:required="true"/>
6753                         <field reporter:label="Hold User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
6754                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6755                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6756                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int"/>
6757                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6758                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6759                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6760                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6761                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6762                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6763                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link"/>
6764                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text"/>
6765                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool"/>
6766                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6767                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6768                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6769                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6770                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6771                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link"/>
6772                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6773                 </fields>
6774                 <links>
6775                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6776                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6777                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6778                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6779                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6780                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6781                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6782                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6783                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6784                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6785                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6786                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6787                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6788                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6789                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6790                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6791                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6792                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6793                 </links>
6794                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6795                         <actions>
6796                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib"/>
6797                         </actions>
6798                 </permacrud>
6799         </class>
6800         <class id="ahopl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_on_pull_list" reporter:label="Hold On Pull List" oils_persist:readonly="true">
6801                 <oils_persist:source_definition><![CDATA[
6802                 SELECT DISTINCT
6803                         ahr.*,
6804                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6805                                 copy_location_order_position,
6806                         CASE WHEN au.alias IS NOT NULL THEN
6807                                 au.alias
6808                         ELSE
6809                                 au.first_given_name
6810                         END AS usr_alias_or_first_given_name,
6811                         au.first_given_name AS usr_first_given_name,
6812                         au.second_given_name AS usr_second_given_name,
6813                         au.family_name AS usr_family_name,
6814                         au.prefix AS usr_prefix,
6815                         au.suffix AS usr_suffix,
6816                         au.alias AS usr_alias,
6817                         CASE WHEN au.alias IS NOT NULL THEN
6818                                 au.alias
6819                         ELSE
6820                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6821                                         COALESCE(au.family_name, ''),
6822                                         COALESCE(au.suffix, ''),
6823                                         ', ',
6824                                         COALESCE(au.prefix, ''),
6825                                         COALESCE(au.first_given_name, ''),
6826                                         COALESCE(au.second_given_name, '')
6827                                 ], ' '), E'\\s+,', ',')
6828                         END AS usr_alias_or_display_name,
6829                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6830                                 COALESCE(au.family_name, ''),
6831                                 COALESCE(au.suffix, ''),
6832                                 ', ',
6833                                 COALESCE(au.prefix, ''),
6834                                 COALESCE(au.first_given_name, ''),
6835                                 COALESCE(au.second_given_name, '')
6836                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6837                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6838                                 AS call_number_label,
6839                         siss.label AS issuance_label,
6840                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6841                         ahcm_1.copy_count AS potential_copies
6842                 FROM action.hold_request ahr
6843                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6844                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6845                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6846                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6847                 JOIN actor.usr au ON (au.id = ahr.usr)
6848                 JOIN (
6849                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6850                         FROM asset.copy_location
6851                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6852                 LEFT JOIN actor.usr_standing_penalty ausp 
6853                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6854                 LEFT JOIN config.standing_penalty csp
6855                         ON (
6856                                 csp.id = ausp.standing_penalty AND 
6857                                 csp.block_list LIKE '%CAPTURE%' AND (
6858                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6859                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6860                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6861                                         )
6862                                 )
6863                         )
6864                 JOIN (
6865                         SELECT COUNT(target_copy) AS copy_count, hold
6866                         FROM action.hold_copy_map
6867                         GROUP BY 2
6868                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6869                 LEFT JOIN serial.issuance siss
6870                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6871                 LEFT JOIN asset.copy_location_order acplo
6872                         ON (acp.location = acplo.location AND
6873                                 acp.circ_lib = acplo.org)
6874                 WHERE
6875                         ahr.capture_time IS NULL AND
6876                         ahr.cancel_time IS NULL AND
6877                         csp.id IS NULL AND
6878                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6879                         acp.deleted IS FALSE AND
6880                         acp.status IN (SELECT id FROM config.copy_status WHERE holdable IS TRUE AND is_available IS TRUE)
6881                 ]]></oils_persist:source_definition>
6882                 <fields oils_persist:primary="id">
6883                         <field reporter:label="Status" name="status" oils_persist:virtual="true"/>
6884                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true"/>
6885                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6886                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6887                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6888                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6889                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6890                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff"/>
6891                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6892                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6893                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6894                         <field reporter:label="Hold ID" name="id" reporter:datatype="id"/>
6895                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6896                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6897                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6898                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6899                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6900                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6901                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6902                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6903                         <field reporter:label="Item Selection Depth" name="selection_depth"/>
6904                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6905                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6906                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6907                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6908                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6909                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int"/>
6910                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6911                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6912                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6913                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6914                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6915                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6916                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link"/>
6917                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text"/>
6918                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool"/>
6919                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6920                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6921                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6922                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6923                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link"/>
6924                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int"/>
6925                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text"/>
6926                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text"/>
6927                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text"/>
6928                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text"/>
6929                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text"/>
6930                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text"/>
6931                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text"/>
6932                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text"/>
6933                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text"/>
6934                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
6935                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text"/>
6936                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool"/>
6937                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int"/>
6938                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6939                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6940                 </fields>
6941                 <links>
6942                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6943                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6944                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6945                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6946                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6947                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6948                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6949                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6950                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6951                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6952                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6953                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6954                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6955                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6956                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6957                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6958                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6959                 </links>
6960                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6961                         <actions>
6962                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib"/>
6963                         </actions>
6964                 </permacrud>
6965         </class>
6966         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
6967                 <oils_persist:source_definition><![CDATA[
6968                         SELECT ahr.* FROM action.hold_request ahr JOIN (SELECT current_copy, MAX(capture_time) AS capture_time FROM action.hold_request WHERE capture_time IS NOT NULL AND current_copy IS NOT NULL AND fulfillment_time IS NULL GROUP BY current_copy)x USING (current_copy, capture_time)
6969                 ]]></oils_persist:source_definition>
6970                 <fields oils_persist:primary="id">
6971                         <field reporter:label="Status" name="status" oils_persist:virtual="true"/>
6972                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true"/>
6973                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6974                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6975                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6976                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6977                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6978                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff"/>
6979                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6980                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6981                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6982                         <field reporter:label="Hold ID" name="id" reporter:datatype="id"/>
6983                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6984                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6985                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6986                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6987                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6988                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6989                         <field reporter:label="Item Selection Depth" name="selection_depth"/>
6990                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6991                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6992                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6993                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6994                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6995                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int"/>
6996                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6997                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6998                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6999                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7000                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7001                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7002                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link"/>
7003                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text"/>
7004                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool"/>
7005                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
7006                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7007                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7008                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7009                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7010                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link"/>
7011                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7012                 </fields>
7013                 <links>
7014                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7015                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7016                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7017                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7018                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7019                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7020                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7021                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7022                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7023                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7024                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7025                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7026                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7027                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7028                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7029                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7030                 </links>
7031         </class>
7032
7033         <class id="ahrn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_request_note" oils_persist:tablename="action.hold_request_note" reporter:label="Hold Request Note">
7034                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7035                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7036                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link" oils_obj:required="true"/>
7037                         <field reporter:label="Title" name="title" reporter:datatype="text" oils_obj:required="true"/>
7038                         <field reporter:label="Body" name="body" reporter:datatype="text" oils_obj:required="true"/>
7039                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7040                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7041                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7042                 </fields>
7043                 <links>
7044                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7045                 </links>
7046                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7047                         <actions>
7048                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7049                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7050                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7051                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7052                         </actions>
7053                 </permacrud>
7054         </class>
7055         <class id="combahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_hold_request" oils_persist:tablename="action.all_hold_request" reporter:core="true" reporter:label="Combined (Active &amp; Aged) Hold Request">
7056                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7057                         <field reporter:label="Status" name="status" oils_persist:virtual="true"/>
7058                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7059                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7060                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7061                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7062                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7063                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff"/>
7064                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7065                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7066                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7067                         <field reporter:label="Hold ID" name="id" reporter:datatype="id"/>
7068                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7069                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7070                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7071                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7072                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7073                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7074                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7075                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7076                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7077                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7078                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7079                         <field reporter:label="Item Selection Depth" name="selection_depth"/>
7080                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7081                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7082                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7083                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7084                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7085                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7086                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7087                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link"/>
7088                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text"/>
7089                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool"/>
7090                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
7091                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7092                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7093                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7094                 </fields>
7095                 <links>
7096                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7097                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7098                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7099                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7100                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7101                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7102                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7103                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7104                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7105                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7106                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7107                 </links>
7108                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7109                         <actions>
7110                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib"/>
7111                         </actions>
7112                 </permacrud>
7113         </class>
7114         <class id="aahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::aged_hold_request" oils_persist:tablename="action.aged_hold_request" reporter:core="true" reporter:label="Aged Hold Request">
7115                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7116                         <field reporter:label="Status" name="status" oils_persist:virtual="true"/>
7117                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7118                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7119                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool" oils_obj:required="true"/>
7120                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7121                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7122                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff"/>
7123                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7124                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7125                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7126                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
7127                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool" oils_obj:required="true"/>
7128                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool" oils_obj:required="true"/>
7129                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
7130                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7131                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
7132                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp" oils_obj:required="true"/>
7133                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7134                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link" oils_obj:required="true"/>
7135                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link" oils_obj:required="true"/>
7136                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7137                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool" oils_obj:required="true"/>
7138                         <field reporter:label="Item Selection Depth" name="selection_depth" oils_obj:required="true"/>
7139                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit" oils_obj:required="true"/>
7140                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link" oils_obj:required="true"/>
7141                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7142                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7143                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool" oils_obj:required="true"/>
7144                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7145                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7146                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link"/>
7147                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text"/>
7148                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool"/>
7149                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" oils_obj:required="true"/>
7150                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7151                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7152                 </fields>
7153                 <links>
7154                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7155                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7156                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7157                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7158                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7159                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7160                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7161                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7162                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7163                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7164                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7165                 </links>
7166                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7167                         <actions>
7168                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib"/>
7169                         </actions>
7170                 </permacrud>
7171         </class>
7172
7173         <class id="aou" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit" oils_persist:tablename="actor.org_unit" reporter:label="Organizational Unit" oils_persist:field_safe="true">
7174                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7175                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7176                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7177                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7178                         <!-- @reporter:datatype="org_unit" is correct for the "id" field, and necessary for the reporter as implied by
7179                                  the XML namespace of the attr. Instead, @name == parent::fields/@oils_persist:primary is the proper test
7180                                  for "this field is the identifier column" -->
7181                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7182                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7183                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7184                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7185                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7186                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7187                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7188                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7189                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7190                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7191                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7192                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7193                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7194                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7195                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7196                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7197                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7198                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7199                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7200                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7201                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7202                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7203                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7204                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7205                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7206                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7207                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7208                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7209                 </fields>
7210                 <links>
7211                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7212                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7213                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7214                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7215                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7216                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7217                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7218                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7219                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7220                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7221                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7222                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7223                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7224                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7225                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7226                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7227                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7228                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7229                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7230                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7231                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7232                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7233                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7234                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7235                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7236                 </links>
7237                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7238                         <actions>
7239                                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7240                                 <retrieve/>
7241                                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7242                                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7243                         </actions>
7244                 </permacrud>
7245         </class>
7246         <class id="aouct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_custom_tree" oils_persist:tablename="actor.org_unit_custom_tree" reporter:label="Org Unit Custom Tree">
7247                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7248                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7249                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7250                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7251                 </fields>
7252                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7253                         <actions>
7254                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7255                                 <retrieve/>
7256                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7257                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7258                         </actions>
7259                 </permacrud>
7260         </class>
7261         <class id="aouctn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_custom_tree_node" oils_persist:tablename="actor.org_unit_custom_tree_node" reporter:label="Org Unit Custom Tree Node">
7262                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7263                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7264                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7265                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
7266                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7267                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7268                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true"/>
7269                 </fields>
7270                 <links>
7271                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7272                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7273                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7274                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7275                 </links>
7276                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7277                         <actions>
7278                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7279                                 <retrieve/>
7280                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7281                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7282                         </actions>
7283                 </permacrud>
7284         </class>
7285         <class id="ccnb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket" oils_persist:tablename="container.call_number_bucket" reporter:label="Call Number Bucket">
7286                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7287                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7288                         <field name="btype" reporter:datatype="text"/>
7289                         <field name="id" reporter:datatype="id"/>
7290                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
7291                         <field name="description" reporter:datatype="text"/>
7292                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
7293                         <field name="pub" reporter:datatype="bool"/>
7294                         <field name="create_time" reporter:datatype="timestamp"/>
7295                         <field name="owning_lib" reporter:datatype="org_unit"/>
7296                 </fields>
7297                 <links>
7298                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7299                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7300                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7301                 </links>
7302                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7303                         <actions>
7304                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7305                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7306                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7307                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7308                         </actions>
7309                 </permacrud>
7310         </class>
7311         <class id="ccnbn" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket_note" oils_persist:tablename="container.call_number_bucket_note" reporter:label="Call Number Bucket Note">
7312                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7313                         <field name="id" reporter:datatype="id"/>
7314                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7315                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
7316                 </fields>
7317                 <links>
7318                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7319                 </links>
7320         </class>
7321         <class id="asc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat" oils_persist:tablename="asset.stat_cat" reporter:label="Asset Statistical Category">
7322                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7323                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7324                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7325                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7326                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7327                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
7328                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7329                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7330                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7331                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7332                 </fields>
7333                 <links>
7334                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7335                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7336                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7337                 </links>
7338                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7339                         <actions>
7340                                 <create permission="CREATE_COPY_STAT_CAT" context_field="owner"/>
7341                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7342                                 <update permission="UPDATE_COPY_STAT_CAT" context_field="owner"/>
7343                                 <delete permission="DELETE_COPY_STAT_CAT" context_field="owner"/>
7344                         </actions>
7345                 </permacrud>
7346         </class>
7347         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7348                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7349                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7350                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
7351                         <field reporter:label="Card ID" name="id" reporter:datatype="id"/>
7352                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
7353                 </fields>
7354                 <links>
7355                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7356                 </links>
7357                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7358                         <actions>
7359                                 <retrieve permission="VIEW_USER user_request.view">
7360                                         <context link="usr" field="home_ou"/>
7361                                 </retrieve>
7362                         </actions>
7363                 </permacrud>
7364         </class>
7365         <class id="actscsf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat_sip_fields" oils_persist:tablename="actor.stat_cat_sip_fields" reporter:label="SIP Statistical Category Field Identifier">
7366                 <fields oils_persist:primary="field">
7367                         <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name" oils_obj:required="true"/>
7368                         <field reporter:label="Field Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
7369                         <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7370                 </fields>
7371                 <links/>
7372                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7373                         <actions>
7374                                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7375                                 <retrieve/>
7376                                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7377                                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7378                         </actions>
7379                 </permacrud>
7380         </class>
7381         <class id="actsc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat" oils_persist:tablename="actor.stat_cat" reporter:label="User Statistical Category">
7382                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7383                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7384                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7385                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7386                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7387                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7388                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
7389                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7390                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7391                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7392                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7393                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7394                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7395                 </fields>
7396                 <links>
7397                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7398                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7399                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7400                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7401                 </links>
7402                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7403                         <actions>
7404                                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7405                                 <retrieve/>
7406                                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7407                                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7408                         </actions>
7409                 </permacrud>
7410         </class>
7411         <class id="msefe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::series_field_entry" oils_persist:tablename="metabib.series_field_entry" reporter:label="Series Field Entry">
7412                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7413                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
7414                         <field name="id" reporter:datatype="id"/>
7415                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
7416                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
7417                 </fields>
7418                 <links>
7419                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7420                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7421                 </links>
7422         </class>
7423         <class id="cub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
7424                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7425                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7426                         <field name="btype" reporter:datatype="text"/>
7427                         <field name="id" reporter:datatype="id"/>
7428                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
7429                         <field name="description" reporter:datatype="text"/>
7430                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
7431                         <field name="pub" reporter:datatype="bool"/>
7432                         <field name="create_time" reporter:datatype="timestamp"/>
7433                         <field name="owning_lib" reporter:datatype="org_unit"/>
7434                 </fields>
7435                 <links>
7436                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7437                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7438                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7439                 </links>
7440                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7441                         <actions>
7442                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7443                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7444                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7445                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7446                         </actions>
7447                 </permacrud>
7448         </class>
7449         <class id="cubn" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket_note" oils_persist:tablename="container.user_bucket_note" reporter:label="User Bucket Note">
7450                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7451                         <field name="id" reporter:datatype="id"/>
7452                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7453                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
7454                 </fields>
7455                 <links>
7456                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7457                 </links>
7458         </class>
7459         <class id="mcrp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_payment" oils_persist:tablename="money.credit_payment" reporter:label="House Credit Payment">
7460                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7461                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7462                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7463                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7464                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7465                         <field reporter:label="Payment Note" name="note" reporter:datatype="text"/>
7466                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7467                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7468                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7469                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7470                 </fields>
7471                 <links>
7472                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7473                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7474                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7475                 </links>
7476                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7477                         <actions>
7478                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7479                                         <context link="xact" jump="usr" field="home_ou"/>
7480                                 </retrieve>
7481                         </actions>
7482                 </permacrud>
7483         </class>
7484         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7485                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7486                         <field name="id" reporter:datatype="id"/>
7487                         <field name="ind1"/>
7488                         <field name="ind2"/>
7489                         <field name="record" oils_obj:required="true"/>
7490                         <field name="subfield"/>
7491                         <field name="tag" oils_obj:required="true"/>
7492                         <field name="value" oils_obj:required="true"/>
7493                 </fields>
7494                 <links>
7495                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7496                 </links>
7497         </class>
7498         <class id="aalink" controller="open-ils.cstore" oils_obj:fieldmapper="authority::authority_linking" oils_persist:tablename="authority.authority_linking" reporter:label="Authority to Authority Linking">
7499                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7500                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
7501                         <field name="source" reporter:label="Source Record" reporter:datatype="link" oils_obj:required="true"/>
7502                         <field name="target" reporter:label="Target Record" reporter:datatype="link" oils_obj:required="true"/>
7503                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" oils_obj:required="true"/>
7504                 </fields>
7505                 <links>
7506                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7507                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7508                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7509                 </links>
7510         </class>
7511         <class id="cnct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::non_cataloged_type" oils_persist:tablename="config.non_cataloged_type" reporter:label="Non-cataloged Type">
7512                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7513                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7514                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7515                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7516                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7517                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
7518                 </fields>
7519                 <links>
7520                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7521                 </links>
7522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7523                         <actions>
7524                                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7525                                 <retrieve/>
7526                                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7527                                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7528                         </actions>
7529                 </permacrud>
7530
7531         </class>
7532         <class id="aout" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_type" oils_persist:tablename="actor.org_unit_type" reporter:label="Organizational Unit Type" oils_persist:field_safe="true">
7533                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7534                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7535                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7536                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7537                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" oils_obj:required="true"/>
7538                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7539                         <field reporter:label="Type Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7540                         <field reporter:label="OPAC Label" name="opac_label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7541                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7542                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7543                 </fields>
7544                 <links>
7545                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7546                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7547                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7548                 </links>
7549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7550                         <actions>
7551                                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7552                                 <retrieve/>
7553                                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7554                                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7555                         </actions>
7556                 </permacrud>
7557         </class>
7558         <class id="bren" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note" oils_persist:field_safe="true">
7559                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7560                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7561                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7562                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7563                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7564                         <field reporter:label="Note ID" name="id" reporter:datatype="id"/>
7565                         <field reporter:label="Bib Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
7566                         <field reporter:label="Note" name="value" reporter:datatype="text" oils_obj:required="true"/>
7567                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7568                 </fields>
7569                 <links>
7570                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7571                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7572                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7573                 </links>
7574                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7575                                 <actions>
7576                                         <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7577                                         <retrieve/>
7578                                         <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7579                                         <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7580                                 </actions>
7581                          </permacrud>
7582         </class>
7583         <class id="mucs" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_circulation_summary" oils_persist:tablename="money.usr_circulation_summary" reporter:label="User Circulation Summary">
7584                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7585                         <field name="balance_owed" reporter:datatype="money"/>
7586                         <field name="total_owed" reporter:datatype="money"/>
7587                         <field name="total_paid" reporter:datatype="money"/>
7588                         <field name="usr" reporter:datatype="link"/>
7589                 </fields>
7590                 <links>
7591                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7592                 </links>
7593         </class>
7594         <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7595                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7596                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link" oils_obj:required="true"/>
7597                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
7598                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7599                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
7600                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp"/>
7601                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp"/>
7602                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7603                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7604                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7605                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7606                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7607                 </fields>
7608                 <links>
7609                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7610                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7611                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7612                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7613                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7614                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7615                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7616                 </links>
7617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7618                         <actions>
7619                                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7620                         </actions>
7621                 </permacrud>
7622         </class>
7623         <class id="cbs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::bib_source" oils_persist:tablename="config.bib_source" reporter:label="Bib Source">
7624                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7625                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7626                         <field name="quality" reporter:datatype="int"/>
7627                         <field name="source" reporter:datatype="text" oils_obj:required="true"/>
7628                         <field name="transcendant" reporter:datatype="bool"/>
7629                         <field name="can_have_copies" reporter:datatype="bool"/>
7630                 </fields>
7631                 <links/>
7632                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7633                         <actions>
7634                                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7635                                 <retrieve/>
7636                                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7637                                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7638                         </actions>
7639                 </permacrud>
7640         </class>
7641         <class id="mbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction" oils_persist:tablename="money.billable_xact" reporter:label="Billable Transaction">
7642                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7643                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
7644                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
7645                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7646                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7647                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7648                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7649                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7650                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7651                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7652                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7653                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7654                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7655                 </fields>
7656                 <links>
7657                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7658                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7659                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7660                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7661                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7662                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7663                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7664                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7665                 </links>
7666                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7667                         <actions>
7668                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7669                                         <context link="usr" field="home_ou"/>
7670                                 </retrieve>
7671                         </actions>
7672                 </permacrud>
7673         </class>
7674         <class id="actsce" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat_entry" oils_persist:tablename="actor.stat_cat_entry" reporter:label="User Stat Cat Entry">
7675                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7676                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
7677                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
7678                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
7679                         <field reporter:label="Entry Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
7680                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7681                 </fields>
7682                 <links>
7683                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7684                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7685                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7686                 </links>
7687                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7688                         <actions>
7689                                 <create permission="CREATE_PATRON_STAT_CAT_ENTRY">
7690                                         <context link="stat_cat" field="owner"/>
7691                                 </create>
7692                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7693                                 <update permission="UPDATE_PATRON_STAT_CAT_ENTRY">
7694                                         <context link="stat_cat" field="owner"/>
7695                                 </update>
7696                                 <delete permission="DELETE_PATRON_STAT_CAT_ENTRY">
7697                                         <context link="stat_cat" field="owner"/>
7698                                 </delete>
7699                         </actions>
7700                 </permacrud>
7701         </class>
7702         <class id="actsced" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry_default" oils_persist:tablename="actor.stat_cat_entry_default" reporter:label="User Stat Cat Default Entry">
7703                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7704                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id"/>
7705                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link" oils_obj:required="true"/>
7706                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
7707                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
7708                 </fields>
7709                 <links>
7710                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7711                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7712                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7713                 </links>
7714         </class>
7715         <class id="cubi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_item" oils_persist:tablename="container.user_bucket_item" reporter:label="User Bucket Item">
7716                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7717                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7718                         <field name="id" reporter:datatype="id"/>
7719                         <field name="target_user" reporter:datatype="link" oils_obj:required="true"/>
7720                         <field name="create_time" reporter:datatype="timestamp"/>
7721                         <field name="pos" reporter:datatype="int"/>
7722                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
7723                 </fields>
7724                 <links>
7725                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7726                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7727                         <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7728                 </links>
7729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7730                         <actions>
7731                                 <retrieve permission="ADMIN_USER_BUCKET">
7732                                         <context link="bucket" field="owning_lib"/>
7733                                 </retrieve>
7734                         </actions>
7735                 </permacrud>
7736         </class>
7737         <class id="abhe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::batch_hold_event" oils_persist:tablename="action.batch_hold_event" reporter:label="Hold Group Event">
7738                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7739                         <field name="id" reporter:datatype="id"/>
7740                         <field name="staff" reporter:datatype="link" oils_obj:required="true"/>
7741                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7742                         <field name="target" reporter:datatype="int" oils_obj:required="true"/>
7743                         <field name="hold_type" reporter:datatype="text"/>
7744                         <field name="run_date" reporter:datatype="timestamp"/>
7745                         <field name="cancelled" reporter:datatype="timestamp"/>
7746                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link"/>
7747                 </fields>
7748                 <links>
7749                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7750                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7751                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7752                 </links>
7753                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7754                         <actions>
7755                                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7756                                 <retrieve/>
7757                                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7758                                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7759                         </actions>
7760                 </permacrud>
7761         </class>
7762         <class id="abhem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::batch_hold_event_map" oils_persist:tablename="action.batch_hold_event_map" reporter:label="Hold Group Event Map">
7763                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7764                         <field name="id" reporter:datatype="id"/>
7765                         <field name="batch_hold_event" reporter:datatype="link" oils_obj:required="true"/>
7766                         <field name="hold" reporter:datatype="link" oils_obj:required="true"/>
7767                 </fields>
7768                 <links>
7769                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7770                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7771                 </links>
7772                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7773                         <actions>
7774                                 <retrieve/>
7775                         </actions>
7776                 </permacrud>
7777         </class>
7778         <class id="cubin" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket_item_note" oils_persist:tablename="container.user_bucket_item_note" reporter:label="User Bucket Item Note">
7779                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7780                         <field name="id" reporter:datatype="id"/>
7781                         <field name="item" reporter:datatype="link" oils_obj:required="true"/>
7782                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
7783                 </fields>
7784                 <links>
7785                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7786                 </links>
7787         </class>
7788         <class id="mus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
7789                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7790                         <field name="balance_owed" reporter:datatype="money"/>
7791                         <field name="total_owed" reporter:datatype="money"/>
7792                         <field name="total_paid" reporter:datatype="money"/>
7793                         <field name="usr" reporter:datatype="link"/>
7794                 </fields>
7795                 <links>
7796                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7797                 </links>
7798                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7799                         <actions>
7800                                 <retrieve permission="VIEW_USER">
7801                                         <context link="usr" field="home_ou"/>
7802                                 </retrieve>
7803                         </actions>
7804                 </permacrud>
7805         </class>
7806         <class id="clfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::lit_form_map" oils_persist:tablename="config.lit_form_map" reporter:label="Literary Form" oils_persist:field_safe="true">
7807                 <fields oils_persist:primary="code" oils_persist:sequence="">
7808                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7809                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7810                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7811                 </fields>
7812                 <links/>
7813                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7814                         <actions>
7815                                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7816                                 <retrieve/>
7817                                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7818                                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7819                         </actions>
7820                 </permacrud>
7821         </class>
7822         <class id="mwp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::work_payment" oils_persist:tablename="money.work_payment" reporter:label="Work Payment">
7823                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7824                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7825                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7826                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7827                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7828                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7829                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7830                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7831                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7832                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7833                 </fields>
7834                 <links>
7835                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7836                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7837                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7838                 </links>
7839                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7840                         <actions>
7841                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7842                                         <context link="xact" jump="usr" field="home_ou"/>
7843                                 </retrieve>
7844                         </actions>
7845                 </permacrud>
7846         </class>
7847         <class id="mgp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::goods_payment" oils_persist:tablename="money.goods_payment" reporter:label="Goods Payment">
7848                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7849                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7850                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7851                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7852                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7853                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7854                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7855                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7856                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7857                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7858                 </fields>
7859                 <links>
7860                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7861                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7862                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7863                 </links>
7864                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7865                         <actions>
7866                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7867                                         <context link="xact" jump="usr" field="home_ou"/>
7868                                 </retrieve>
7869                         </actions>
7870                 </permacrud>
7871         </class>
7872         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7873                 <fields oils_persist:primary="id" oils_persist:sequence="">
7874                         <field name="checkin_lib" reporter:datatype="link"/>
7875                         <field name="checkin_staff" reporter:datatype="link"/>
7876                         <field name="checkin_time" reporter:datatype="timestamp"/>
7877                         <field name="circ_lib" reporter:datatype="org_unit"/>
7878                         <field name="circ_staff" reporter:datatype="link"/>
7879                         <field name="desk_renewal" reporter:datatype="bool"/>
7880                         <field name="due_date" reporter:datatype="timestamp"/>
7881                         <field name="duration" reporter:datatype="interval"/>
7882                         <field name="duration_rule" reporter:datatype="link"/>
7883                         <field name="fine_interval" reporter:datatype="interval"/>
7884                         <field name="id" reporter:datatype="id"/>
7885                         <field name="max_fine" reporter:datatype="money"/>
7886                         <field name="max_fine_rule" reporter:datatype="link"/>
7887                         <field name="opac_renewal" reporter:datatype="bool"/>
7888                         <field name="phone_renewal" reporter:datatype="bool"/>
7889                         <field name="recurring_fine" reporter:datatype="money"/>
7890                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7891                         <field name="renewal_remaining" reporter:datatype="int"/>
7892                         <field name="grace_period" reporter:datatype="interval"/>
7893                         <field name="stop_fines" reporter:datatype="text"/>
7894                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7895                         <field name="target_copy" reporter:datatype="link"/>
7896                         <field name="usr" reporter:datatype="link"/>
7897                         <field name="xact_finish" reporter:datatype="timestamp"/>
7898                         <field name="xact_start" reporter:datatype="timestamp"/>
7899                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7900                         <field name="auto_renewal" reporter:datatype="bool"/>
7901                         <field name="auto_renewal_remaining" reporter:datatype="int"/>
7902                 </fields>
7903                 <links>
7904                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7905                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7906                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7907                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7908                 </links>
7909         </class>
7910         <class id="msfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::subject_field_entry" oils_persist:tablename="metabib.subject_field_entry" reporter:label="Subject Field Entry">
7911                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7912                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
7913                         <field name="id" reporter:datatype="id"/>
7914                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
7915                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
7916                 </fields>
7917                 <links>
7918                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7919                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7920                 </links>
7921         </class>
7922         <class id="crrf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::recurring_fine" oils_persist:tablename="config.rule_recurring_fine" reporter:label="Recurring Fine Rule">
7923                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7924                         <field name="high" reporter:datatype="money" oils_obj:required="true"/>
7925                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7926                         <field name="low" reporter:datatype="money" oils_obj:required="true"/>
7927                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
7928                         <field name="normal" reporter:datatype="money" oils_obj:required="true"/>
7929                         <field name="recurrence_interval" reporter:datatype="interval"/>
7930                         <field name="grace_period" reporter:datatype="interval"/>
7931                 </fields>
7932                 <links/>
7933                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7934                         <actions>
7935                                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7936                                 <retrieve/>
7937                                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7938                                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7939                         </actions>
7940                 </permacrud>
7941         </class>
7942         <class id="mckp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::check_payment" oils_persist:tablename="money.check_payment" reporter:label="Check Payment">
7943                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7944                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7945                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7946                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7947                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7948                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" oils_obj:required="true"/>
7949                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7950                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7951                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7952                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7953                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7954                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7955                 </fields>
7956                 <links>
7957                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7958                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7959                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7960                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7961                 </links>
7962                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7963                         <actions>
7964                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7965                                         <context link="xact" jump="usr" field="home_ou"/>
7966                                 </retrieve>
7967                         </actions>
7968                 </permacrud>
7969         </class>
7970         <class id="mdcp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::debit_card_payment" oils_persist:tablename="money.debit_card_payment" reporter:label="Debit Card Payment">
7971                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7972                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7973                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7974                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7975                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7976                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7977                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7978                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7979                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7980                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7981                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7982                 </fields>
7983                 <links>
7984                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7985                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7986                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7987                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7988                 </links>
7989                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7990                         <actions>
7991                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7992                                         <context link="xact" jump="usr" field="home_ou"/>
7993                                 </retrieve>
7994                         </actions>
7995                 </permacrud>
7996         </class>
7997         <class id="acp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy" oils_persist:tablename="asset.copy" reporter:core="true" reporter:label="Item">
7998                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
7999                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
8000                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8001                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
8002                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link" oils_obj:required="true"/>
8003                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8004                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8005                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8006                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8007                         <field reporter:label="Item Number on Volume" name="copy_number" reporter:datatype="text"/>
8008                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8009                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8010                         <field reporter:label="Creating User" name="creator" reporter:datatype="link" oils_obj:required="true"/>
8011                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8012                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8013                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8014                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8015                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8016                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8017                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8018                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link" oils_obj:required="true"/>
8019                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int" oils_obj:required="true"/>
8020                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool"/>
8021                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8022                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int" oils_obj:required="true"/>
8023                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8024                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
8025                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8026                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8027                         <field reporter:label="Item Status" name="status" reporter:datatype="link"/>
8028                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8029                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8030                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8031                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8032                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8033                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8034                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8035                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8036                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8037                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8038                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8039                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8040                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8041                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8042                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8043                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8044                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8045                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8046                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8047                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8048                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8049                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8050                 </fields>
8051                 <links>
8052                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8053                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8054                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8055                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8056                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8057                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8058                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8059                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8060                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8061                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8062                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8063                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8064                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8065                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8066                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8067                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8068                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8069                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8070                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8071                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8072                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8073                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8074                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8075                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8076                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8077                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8078                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8079                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8080                 </links>
8081                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8082                         <actions>
8083                                 <create permission="CREATE_COPY">
8084                                         <context link="call_number" field="owning_lib"/>
8085                                 </create>
8086                                 <retrieve/>
8087                                 <update permission="UPDATE_COPY">
8088                                         <context link="call_number" field="owning_lib"/>
8089                                 </update>
8090                                 <delete permission="DELETE_COPY">
8091                                         <context link="call_number" field="owning_lib"/>
8092                                 </delete>
8093                         </actions>
8094                 </permacrud>
8095         </class>
8096
8097         <class id="aci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_inventory" oils_persist:tablename="asset.copy_inventory" reporter:core="true" reporter:label="Copy Inventory">
8098                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8099                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8100                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8101                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8102                         <field reporter:label="Copy" name="copy" reporter:datatype="link" oils_obj:required="true"/>
8103                 </fields>
8104                 <links>
8105                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8106                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8107                 </links>
8108                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8109                         <actions>
8110                                 <create permission="STAFF_LOGIN"/>
8111                                 <retrieve/>
8112                                 <update permission="STAFF_LOGIN"/>
8113                                 <delete permission="STAFF_LOGIN"/>
8114                         </actions>
8115                 </permacrud>
8116         </class>
8117
8118         <class id="alci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::latest_inventory" oils_persist:tablename="asset.latest_inventory" reporter:core="true" reporter:label="Latest Inventory" oils_persist:readonly="true">
8119                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8120                         <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8121                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8122                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8123                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8124                 </fields>
8125                 <links>
8126                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8127                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8128                 </links>
8129                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8130                         <actions>
8131                                 <retrieve/>
8132                         </actions>
8133                 </permacrud>
8134         </class>
8135
8136         <class id="ccat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_alert_type" oils_persist:tablename="config.copy_alert_type" reporter:label="Copy Alert Type" oils_persist:restrict_primary="100">
8137                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8138                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8139                         <field reporter:label="Scope Org Unit" name="scope_org" reporter:datatype="org_unit" oils_obj:required="true"/>
8140                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
8141                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8142                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8143                         <field reporter:label="Event" name="event" reporter:datatype="text"/>
8144                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool"/>
8145                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8146                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8147                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8148                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8149                 </fields>
8150                 <links>
8151                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8152                 </links>
8153                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8154                         <actions>
8155                                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8156                                 <retrieve/>
8157                                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8158                                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8159                         </actions>
8160                 </permacrud>
8161         </class>
8162
8163         <class id="acas" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::copy_alert_suppress" oils_persist:tablename="actor.copy_alert_suppress" reporter:label="Item Alert Suppression">
8164                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8165                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8166                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
8167                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" oils_obj:required="true"/>
8168                 </fields>
8169                 <links>
8170                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8171                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8172                 </links>
8173                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8174                         <actions>
8175                                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8176                                 <retrieve/>
8177                                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8178                                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8179                         </actions>
8180                 </permacrud>
8181         </class>
8182
8183         <class id="aca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_alert" oils_persist:tablename="asset.copy_alert" reporter:label="Copy Alert">
8184                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8185                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8186                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" oils_obj:required="true"/>
8187                         <field reporter:label="Copy" name="copy" reporter:datatype="link" oils_obj:required="true"/>
8188                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool"/>
8189                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
8190                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link" oils_obj:required="true"/>
8191                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8192                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp"/>
8193                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8194                 </fields>
8195                 <links>
8196                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8197                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8198                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8199                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8200                 </links>
8201                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8202                         <actions>
8203                                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8204                                         <context link="copy" field="circ_lib"/>
8205                                 </create>
8206                                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8207                                         <context link="copy" field="circ_lib"/>
8208                                 </retrieve>
8209                                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8210                                         <context link="copy" field="circ_lib"/>
8211                                 </update>
8212                                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8213                                         <context link="copy" field="circ_lib"/>
8214                                 </delete>
8215                         </actions>
8216                 </permacrud>
8217         </class>
8218
8219         <class id="aaca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::active_copy_alert" oils_persist:tablename="asset.active_copy_alert" reporter:label="Active Copy Alert" oils_persist:readonly="true">
8220                 <fields oils_persist:primary="id">
8221                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8222                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link"/>
8223                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8224                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool"/>
8225                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
8226                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8227                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8228                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp"/>
8229                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8230                 </fields>
8231                 <links>
8232                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8233                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8234                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8235                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8236                 </links>
8237                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8238                         <actions>
8239                                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8240                                         <context link="copy" field="circ_lib"/>
8241                                 </create>
8242                                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8243                                         <context link="copy" field="circ_lib"/>
8244                                 </retrieve>
8245                                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8246                                         <context link="copy" field="circ_lib"/>
8247                                 </update>
8248                                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8249                                         <context link="copy" field="circ_lib"/>
8250                                 </delete>
8251                         </actions>
8252                 </permacrud>
8253         </class>
8254
8255         <class id="act" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_template" oils_persist:tablename="asset.copy_template" reporter:label="Asset Copy Template">
8256                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8257                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
8258                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8259                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
8260                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
8261                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8262                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8263                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8264                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8265                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8266                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8267                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8268                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8269                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8270                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8271                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8272                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8273                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8274                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8275                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8276                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8277                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8278                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8279                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8280                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8281                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8282                 </fields>
8283                 <links>
8284                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8285                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8286                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8287                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8288                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8289                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8290                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8291                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8292                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8293                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8294                 </links>
8295                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8296                         <actions>
8297                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8298                                 <retrieve/>
8299                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8300                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8301                         </actions>
8302                 </permacrud>
8303         </class>
8304
8305         <class id="crahp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::age_hold_protect" oils_persist:tablename="config.rule_age_hold_protect" reporter:label="Age Hold Protection Rule" oils_persist:field_safe="true">
8306                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8307                         <field reporter:label="Item Age" name="age" reporter:datatype="interval" oils_obj:required="true"/>
8308                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8309                         <field reporter:label="Rule Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8310                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" oils_obj:required="true"/>
8311                 </fields>
8312                 <links/>
8313                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8314                         <actions>
8315                                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8316                                 <retrieve/>
8317                                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8318                                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8319                         </actions>
8320                 </permacrud>
8321         </class>
8322         <class id="crmf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::max_fine" oils_persist:tablename="config.rule_max_fine" reporter:label="Max Fine Rule">
8323                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8324                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8325                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8326                         <field reporter:label="Rule Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8327                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8328                 </fields>
8329                 <links/>
8330                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8331                         <actions>
8332                                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8333                                 <retrieve/>
8334                                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8335                                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8336                         </actions>
8337                 </permacrud>
8338         </class>
8339         <class id="pgt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_tree" oils_persist:tablename="permission.grp_tree" reporter:label="Permission Group">
8340                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8341                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8342                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8343                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8344                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
8345                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8346                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8347                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8348                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8349                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8350                 </fields>
8351                 <links>
8352                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8353                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8354                 </links>
8355                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8356                         <actions>
8357                                 <create permission="CREATE_PERM" global_required="true"/>
8358                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8359                                 <update permission="UPDATE_PERM" global_required="true"/>
8360                                 <delete permission="DELETE_PERM" global_required="true"/>
8361                         </actions>
8362                 </permacrud>
8363         </class>
8364         <class id="pgtde" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_tree_display_entry" oils_persist:tablename="permission.grp_tree_display_entry" reporter:label="Permission Group Tree Display Entry">
8365                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8366                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8367                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true" oils_obj:required="true"/>
8368                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8369                         <field reporter:label="Org Unit" name="org" reporter:datatype="link" oils_obj:required="true"/>
8370                         <field reporter:label="Position" name="position" reporter:datatype="int" oils_obj:required="true"/>
8371                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8372                 </fields>
8373                 <links>
8374                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8375                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8376                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8377                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8378                 </links>
8379                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8380                         <actions>
8381                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8382                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8383                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8384                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8385                         </actions>
8386                 </permacrud>
8387         </class>
8388         <class id="asva" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_answer" oils_persist:tablename="action.survey_answer" reporter:label="Survey Answer">
8389                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8390                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8391                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text" oils_obj:required="true"/>
8392                         <field reporter:label="Answer ID" name="id" reporter:datatype="id"/>
8393                         <field reporter:label="Question" name="question" reporter:datatype="link" oils_obj:required="true"/>
8394                 </fields>
8395                 <links>
8396                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8397                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8398                 </links>
8399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8400                         <actions>
8401                                 <create permission="ADMIN_SURVEY">
8402                                         <context link="question" jump="survey" field="owner"/>
8403                                 </create>
8404                                 <retrieve/>
8405                                 <update permission="ADMIN_SURVEY">
8406                                         <context link="question" jump="survey" field="owner"/>
8407                                 </update>
8408                                 <delete permission="ADMIN_SURVEY">
8409                                         <context link="question" jump="survey" field="owner"/>
8410                                 </delete>
8411                         </actions>
8412                 </permacrud>
8413         </class>
8414         <class id="ancc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cataloged_circulation" oils_persist:tablename="action.non_cataloged_circulation" reporter:core="true" reporter:label="Non-cataloged Circulation">
8415                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8416                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8417                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8418                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id"/>
8419                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link" oils_obj:required="true"/>
8420                         <field reporter:label="Patron" name="patron" reporter:datatype="link" oils_obj:required="true"/>
8421                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link" oils_obj:required="true"/>
8422                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8423                 </fields>
8424                 <links>
8425                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8426                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8427                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8428                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8429                 </links>
8430                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8431                         <actions>
8432                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
8433                         </actions>
8434                 </permacrud>
8435         </class>
8436         <class id="aoncc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::open_non_cataloged_circulation" oils_persist:tablename="action.open_non_cataloged_circulation" oils_persist:readonly="true" reporter:core="true" reporter:label="Open Non-cataloged Circulation">
8437                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8438                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
8439                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8440                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id"/>
8441                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8442                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8443                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8444                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8445                 </fields>
8446                 <links>
8447                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8448                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8449                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8450                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8451                 </links>
8452                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8453                         <actions>
8454                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
8455                         </actions>
8456                 </permacrud>
8457         </class>
8458         <class id="moucs" controller="open-ils.cstore" oils_obj:fieldmapper="money::open_user_circulation_summary" oils_persist:tablename="money.open_usr_circulation_summary" reporter:label="Open User Circulation Summary">
8459                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8460                         <field name="balance_owed" reporter:datatype="money"/>
8461                         <field name="total_owed" reporter:datatype="money"/>
8462                         <field name="total_paid" reporter:datatype="money"/>
8463                         <field name="usr" reporter:datatype="link"/>
8464                 </fields>
8465                 <links>
8466                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8467                 </links>
8468         </class>
8469         <class id="aufh" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_list" oils_persist:tablename="action.unfulfilled_hold_list" reporter:label="Unfulfilled Hold Targets">
8470                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8471                         <field reporter:label="Non-fulfilling Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8472                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link" oils_obj:required="true"/>
8473                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8474                         <field reporter:label="Hold" name="hold" reporter:datatype="link" oils_obj:required="true"/>
8475                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
8476                 </fields>
8477                 <links>
8478                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8479                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8480                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8481                 </links>
8482         </class>
8483         <class id="mife" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::identifier_field_entry" oils_persist:tablename="metabib.identifier_field_entry" reporter:label="Identifier Field Entry">
8484                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8485                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
8486                         <field name="id" reporter:datatype="id"/>
8487                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
8488                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
8489                 </fields>
8490                 <links>
8491                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8492                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8493                 </links>
8494         </class>
8495         <class id="mtfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::title_field_entry" oils_persist:tablename="metabib.title_field_entry" reporter:label="Title Field Entry">
8496                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8497                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
8498                         <field name="id" reporter:datatype="id"/>
8499                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
8500                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
8501                 </fields>
8502                 <links>
8503                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8504                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8505                 </links>
8506         </class>
8507         <class id="actscecm" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry_user_map" oils_persist:tablename="actor.stat_cat_entry_usr_map" reporter:label="User Statistical Category Entry">
8508                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8509                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
8510                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
8511                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text" oils_obj:required="true"/>
8512                         <field reporter:label="User" name="target_usr" reporter:datatype="link" oils_obj:required="true"/>
8513                 </fields>
8514                 <links>
8515                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8516                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8517                 </links>
8518         </class>
8519         <class id="pgpm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_perm_map" oils_persist:tablename="permission.grp_perm_map" reporter:label="Group Permission Map">
8520                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8521                         <field name="depth" reporter:datatype="int" oils_obj:required="true"/>
8522                         <field name="grantable" reporter:datatype="bool"/>
8523                         <field name="grp" reporter:datatype="link" oils_obj:required="true"/>
8524                         <field name="id" reporter:datatype="id"/>
8525                         <field name="perm" reporter:datatype="link" oils_obj:required="true"/>
8526                 </fields>
8527                 <links>
8528                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8529                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8530                 </links>
8531                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8532                         <actions>
8533                                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8534                                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8535                                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8536                                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8537                         </actions>
8538                 </permacrud>
8539         </class>
8540         <class id="ccb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
8541                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8542                         <field name="items" oils_persist:virtual="true"/>
8543                         <field name="btype" reporter:datatype="text"/>
8544                         <field name="id" reporter:datatype="id"/>
8545                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
8546                         <field name="description" reporter:datatype="text"/>
8547                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
8548                         <field name="pub" reporter:datatype="bool"/>
8549                         <field name="create_time" reporter:datatype="timestamp"/>
8550                         <field name="owning_lib" reporter:datatype="org_unit"/>
8551                 </fields>
8552                 <links>
8553                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8554                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8555                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8556                 </links>
8557                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8558                         <actions>
8559                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8560                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8561                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8562                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8563                         </actions>
8564                 </permacrud>
8565         </class>
8566         <class id="ccbn" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_note" oils_persist:tablename="container.copy_bucket_note" reporter:label="Copy Bucket Note">
8567                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8568                         <field name="id" reporter:datatype="id"/>
8569                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
8570                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
8571                 </fields>
8572                 <links>
8573                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8574                 </links>
8575         </class>
8576         <class id="puwoum" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_work_ou_map" oils_persist:tablename="permission.usr_work_ou_map" reporter:label="User Work Org Unit Map">
8577                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8578                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int"/>
8579                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
8580                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link" oils_obj:required="true"/>
8581                 </fields>
8582                 <links>
8583                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8584                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8585                 </links>
8586         </class>
8587         <class id="pupm" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_perm_map" oils_persist:tablename="permission.usr_perm_map" reporter:label="User Permission Map">
8588                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8589                         <field name="depth" reporter:datatype="int" oils_obj:required="true"/>
8590                         <field name="grantable" reporter:datatype="bool"/>
8591                         <field name="id" reporter:datatype="id"/>
8592                         <field name="perm" reporter:datatype="link" oils_obj:required="true"/>
8593                         <field name="usr" reporter:datatype="link" oils_obj:required="true"/>
8594                 </fields>
8595                 <links>
8596                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8597                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8598                 </links>
8599         </class>
8600         <class id="puopm" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_object_perm_map" oils_persist:tablename="permission.usr_object_perm_map" reporter:label="User Object Permission Map">
8601                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8602                         <field name="object_id" reporter:datatype="text" oils_obj:required="true"/>
8603                         <field name="grantable" reporter:datatype="bool"/>
8604                         <field name="id" reporter:datatype="id"/>
8605                         <field name="perm" reporter:datatype="link" oils_obj:required="true"/>
8606                         <field name="usr" reporter:datatype="link" oils_obj:required="true"/>
8607                         <field name="object_type" reporter:datatype="text" oils_obj:required="true"/>
8608                 </fields>
8609                 <links>
8610                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8611                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8612                 </links>
8613         </class>
8614         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8615                 <fields oils_persist:primary="id" oils_persist:sequence="">
8616                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8617                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8618                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8619                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8620                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8621                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8622                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8623                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8624                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8625                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8626                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8627                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8628                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8629                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8630                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8631                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8632                 </fields>
8633                 <links>
8634                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8635                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8636                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8637                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8638                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8639                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8640                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8641                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8642                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8643                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8644                 </links>
8645                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8646                         <actions>
8647                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8648                                         <context link="xact" jump="usr" field="home_ou"/>
8649                                 </retrieve>
8650                         </actions>
8651                 </permacrud>
8652         </class>
8653         <class id="map" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::aged_payment" oils_persist:tablename="money.aged_payment" reporter:label="Payments: Aged">
8654                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8655                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8656                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
8657                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8658                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp" oils_obj:required="true"/>
8659                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text" oils_obj:required="true"/>
8660                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
8661                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool" oils_obj:required="true"/>
8662                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8663                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8664                         <field name="billing" reporter:datatype="link"/>
8665                 </fields>
8666                 <links>
8667                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8668                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8669                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8670                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8671                 </links>
8672                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8673                         <actions>
8674                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8675                                         <context link="xact" field="usr_home_ou"/>
8676                                 </retrieve>
8677                         </actions>
8678                 </permacrud>
8679         </class>
8680         <class id="mallp" controller="open-ils.cstore" oils_obj:fieldmapper="money::all_payments" oils_persist:tablename="money.all_payments" oils_persist:readonly="true" reporter:core="true" reporter:label="Payments: All">
8681                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8682                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8683                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8684                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8685                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8686                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8687                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8688                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8689                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8690                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8691                         <field name="billing" reporter:datatype="link"/>
8692                 </fields>
8693                 <links>
8694                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8695                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8696                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8697                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8698                 </links>
8699         </class>
8700
8701         <class id="mbp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::bnm_payment" oils_persist:tablename="money.bnm_payment_view" reporter:core="true" reporter:label="Payments: Brick-and-mortar">
8702                 <fields oils_persist:primary="id" oils_persist:sequence="">
8703                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8704                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8705                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8706                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8707                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8708                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8709                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8710                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8711                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8712                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8713                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8714                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8715                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8716                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8717                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8718                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8719                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8720                 </fields>
8721                 <links>
8722                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8723                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8724                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8725                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8726                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8727                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8728                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8729                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8730                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8731                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8732                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8733                 </links>
8734                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8735                         <actions>
8736                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8737                                         <context link="xact" jump="usr" field="home_ou"/>
8738                                 </retrieve>
8739                         </actions>
8740                 </permacrud>
8741         </class>
8742         <class id="mndp" controller="open-ils.reporter" oils_obj:fieldmapper="money::non_drawer_payment" oils_persist:tablename="money.non_drawer_payment_view" reporter:core="true" reporter:label="Payments: Non-drawer Staff">
8743                 <fields oils_persist:primary="id" oils_persist:sequence="">
8744                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8745                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8746                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8747                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8748                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8749                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8750                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8751                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8752                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8753                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8754                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8755                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8756                 </fields>
8757                 <links>
8758                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8759                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8760                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8761                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8762                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8763                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8764                 </links>
8765         </class>
8766         <class id="mdp" controller="open-ils.cstore" oils_obj:fieldmapper="money::desk_payment" oils_persist:tablename="money.desk_payment_view" reporter:core="true" reporter:label="Payments: Desk">
8767                 <fields oils_persist:primary="id" oils_persist:sequence="">
8768                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8769                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8770                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8771                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8772                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8773                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8774                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8775                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8776                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8777                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8778                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8779                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8780                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8781                 </fields>
8782                 <links>
8783                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8784                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8785                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8786                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8787                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8788                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8789                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8790                 </links>
8791         </class>
8792         <class id="cbrebi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_item" oils_persist:tablename="container.biblio_record_entry_bucket_item" reporter:label="Biblio Record Entry Bucket Item">
8793                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8794                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
8795                         <field name="id" reporter:datatype="id"/>
8796                         <field name="target_biblio_record_entry" reporter:datatype="link" oils_obj:required="true"/>
8797                         <field name="create_time" reporter:datatype="timestamp"/>
8798                         <field name="pos" reporter:datatype="int"/>
8799                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8800                 </fields>
8801                 <links>
8802                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8803                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8804                         <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8805                 </links>
8806                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8807                         <actions>
8808                                 <retrieve permission="ADMIN_COPY_BUCKET">
8809                                         <context link="bucket" field="owning_lib"/>
8810                                 </retrieve>
8811                         </actions>
8812                 </permacrud>
8813         </class>
8814         <class id="cbrebin" controller="open-ils.cstore" oils_obj:fieldmapper="container::biblio_record_entry_bucket_item_note" oils_persist:tablename="container.biblio_record_entry_bucket_item_note" reporter:label="Biblio Record Entry Bucket Item Note">
8815                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8816                         <field name="id" reporter:datatype="id"/>
8817                         <field name="item" reporter:datatype="link" oils_obj:required="true"/>
8818                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
8819                 </fields>
8820                 <links>
8821                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8822                 </links>
8823         </class>
8824         <class id="asce" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_entry" oils_persist:tablename="asset.stat_cat_entry" reporter:label="Item Stat Cat Entry">
8825                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8826                         <field reporter:label="Entry ID" name="id" reporter:datatype="int"/>
8827                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
8828                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
8829                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
8830                 </fields>
8831                 <links>
8832                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8833                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8834                 </links>
8835                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8836                         <actions>
8837                                 <create permission="CREATE_COPY_STAT_CAT_ENTRY">
8838                                         <context link="stat_cat" field="owner"/>
8839                                 </create>
8840                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8841                                 <update permission="UPDATE_COPY_STAT_CAT_ENTRY">
8842                                         <context link="stat_cat" field="owner"/>
8843                                 </update>
8844                                 <delete permission="DELETE_COPY_STAT_CAT_ENTRY">
8845                                         <context link="stat_cat" field="owner"/>
8846                                 </delete>
8847                         </actions>
8848                 </permacrud>
8849         </class>
8850         <class id="ascsf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_sip_fields" oils_persist:tablename="asset.stat_cat_sip_fields" reporter:label="SIP Statistical Category Field Identifier">
8851                 <fields oils_persist:primary="field">
8852                         <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name" oils_obj:required="true"/>
8853                         <field reporter:label="Field Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8854                         <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8855                 </fields>
8856                 <links/>
8857                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8858                         <actions>
8859                                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8860                                 <retrieve/>
8861                                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8862                                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8863                         </actions>
8864                 </permacrud>
8865         </class>
8866         <class id="ahrcc" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="action::hold_request_cancel_cause" oils_persist:tablename="action.hold_request_cancel_cause" oils_persist:restrict_primary="100" reporter:label="Hold Request Cancel Cause">
8867                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8868                         <field reporter:label="Cause ID" name="id" reporter:datatype="id"/>
8869                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8870                         <field reporter:label="Manual Use?" name="manual" reporter:datatype="bool"/>
8871                 </fields>
8872                 <links/>
8873                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8874                         <actions>
8875                                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8876                                 <retrieve/>
8877                                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8878                                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8879                         </actions>
8880                 </permacrud>
8881         </class>
8882
8883
8884         <class id="artc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::reservation_transit_copy" oils_persist:tablename="action.reservation_transit_copy" reporter:core="true" reporter:label="Reservation Transit">
8885                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8886                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link" oils_obj:required="true"/>
8887                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit" oils_obj:required="true"/>
8888                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8889                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8890                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
8891                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8892                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8893                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit" oils_obj:required="true"/>
8894                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8895                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
8896                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8897                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8898                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8899                 </fields>
8900                 <links>
8901                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8902                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8903                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8904                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8905                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8906                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8907                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8908                 </links>
8909                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8910                         <actions>
8911                                 <create permission="TRANSIT_COPY">
8912                                         <context link="target_copy" field="owner"/>
8913                                 </create>
8914                                 <retrieve/>
8915                                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8916                                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8917                         </actions>
8918                 </permacrud>
8919         </class>
8920         <class id="ahtc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_transit_copy" oils_persist:tablename="action.hold_transit_copy" reporter:core="true" reporter:label="Hold Transit">
8921                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8922                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link" oils_obj:required="true"/>
8923                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit" oils_obj:required="true"/>
8924                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8925                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8926                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
8927                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8928                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8929                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit" oils_obj:required="true"/>
8930                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8931                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
8932                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8933                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8934                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8935                 </fields>
8936                 <links>
8937                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8938                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8939                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8940                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8941                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8942                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8943                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8944                 </links>
8945                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8946                         <actions>
8947                                 <create permission="TRANSIT_COPY" context_field="owner">
8948                                         <context link="target_copy" field="circ_lib"/>
8949                                 </create>
8950                                 <retrieve/>
8951                                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8952                                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8953                         </actions>
8954                 </permacrud>
8955         </class>
8956         <class id="mb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billing" oils_persist:tablename="money.billing" reporter:label="Billing Line Item">
8957                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8958                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8959                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8960                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8961                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8962                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp" oils_obj:required="true"/>
8963                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text" oils_obj:required="true"/>
8964                         <field reporter:label="Billing ID" name="id" reporter:datatype="id"/>
8965                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8966                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8967                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8968                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8969                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
8970                         <field reporter:label="Type" name="btype" reporter:datatype="link" oils_obj:required="true"/>
8971                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
8972                 </fields>
8973                 <links>
8974                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8975                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8976                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8977                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
8978                 </links>
8979                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8980                         <actions>
8981                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8982                                         <context link="xact" jump="usr" field="home_ou"/>
8983                                 </retrieve>
8984                         </actions>
8985                 </permacrud>
8986         </class>
8987         <class id="mab" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::aged_billing" oils_persist:tablename="money.aged_billing" reporter:label="Aged Billing Line Item">
8988                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8989                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8990                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp" oils_obj:required="true"/>
8991                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8992                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8993                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp" oils_obj:required="true"/>
8994                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text" oils_obj:required="true"/>
8995                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
8996                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8997                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8998                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool" oils_obj:required="true"/>
8999                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9000                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
9001                         <field reporter:label="Type" name="btype" reporter:datatype="link" oils_obj:required="true"/>
9002                 </fields>
9003                 <links>
9004                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9005                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9006                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9007                 </links>
9008                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9009                         <actions>
9010                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9011                                         <context link="xact" field="usr_home_ou"/>
9012                                 </retrieve>
9013                         </actions>
9014                 </permacrud>
9015         </class>
9016         <class id="mallb" controller="open-ils.cstore" oils_obj:fieldmapper="money::all_billings" oils_persist:tablename="money.all_billings" oils_persist:readonly="true" reporter:label="All Billing Line Items">
9017                 <fields oils_persist:primary="id" oils_persist:sequence="">
9018                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9019                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9020                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9021                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9022                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9023                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9024                         <field reporter:label="Billing ID" name="id" reporter:datatype="id"/>
9025                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9026                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9027                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9028                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9029                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9030                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9031                 </fields>
9032                 <links>
9033                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9034                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9035                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9036                 </links>
9037         </class>
9038         <class id="pugm" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_grp_map" oils_persist:tablename="permission.usr_grp_map" reporter:label="User Group Map">
9039                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9040                         <field name="grp" oils_obj:required="true"/>
9041                         <field name="id" reporter:datatype="id"/>
9042                         <field name="usr" oils_obj:required="true"/>
9043                 </fields>
9044                 <links>
9045                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9046                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9047                 </links>
9048         </class>
9049         <class id="i18n" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::i18n_core" oils_persist:tablename="config.i18n_core" oils_persist:field_safe="true" reporter:label="i18n Core">
9050                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9051                         <field name="id" reporter:datatype="id"/>
9052                         <field name="fq_field" reporter:datatype="text" oils_obj:required="true"/>
9053                         <field name="identity_value" reporter:datatype="text" oils_obj:required="true"/>
9054                         <field name="translation" reporter:datatype="text" oils_obj:required="true"/>
9055                         <field name="string" reporter:datatype="text" oils_obj:required="true"/>
9056                 </fields>
9057                 <links>
9058                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9059                 </links>
9060                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9061                         <actions>
9062                                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9063                                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9064                                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9065                                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9066                         </actions>
9067                 </permacrud>
9068         </class>
9069         <class id="fdoc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::idl_field_doc" oils_persist:tablename="config.idl_field_doc" oils_persist:field_safe="true" reporter:label="IDL Field Doc">
9070                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9071                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
9072                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9073                         <field name="field" reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9074                         <field name="owner" reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9075                         <field name="string" reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9076                 </fields>
9077                 <links>
9078                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9079                 </links>
9080                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9081                         <actions>
9082                                 <create permission="ADMIN_FIELD_DOC" context_field="owner"/>
9083                                 <retrieve/>
9084                                 <update permission="ADMIN_FIELD_DOC" context_field="owner"/>
9085                                 <delete permission="ADMIN_FIELD_DOC" context_field="owner"/>
9086                         </actions>
9087                 </permacrud>
9088         </class>
9089         <class id="i18n_l" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::i18n_locale" oils_persist:tablename="config.i18n_locale" oils_persist:field_safe="true" reporter:label="Locale">
9090                 <fields oils_persist:primary="code">
9091                         <field name="code" reporter:datatype="id" oils_obj:required="true"/>
9092                         <field name="marc_code" reporter:datatype="text" oils_obj:required="true"/>
9093                         <field name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9094                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9095                         <field name="rtl" reporter:datatype="bool"/>
9096                 </fields>
9097                 <links/>
9098                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9099                         <actions>
9100                                 <create permission="CREATE_LOCALE" global_required="true"/>
9101                                 <retrieve/>
9102                                 <update permission="UPDATE_LOCALE" global_required="true"/>
9103                                 <delete permission="DELETE_LOCALE" global_required="true"/>
9104                         </actions>
9105                 </permacrud>
9106         </class>
9107         <class id="cbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::billing_type" oils_persist:tablename="config.billing_type" oils_persist:restrict_primary="100" reporter:label="Billing Type">
9108                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9109                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9110                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9111                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9112                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9113                 </fields>
9114                 <links>
9115                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9116                 </links>
9117                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9118                         <actions>
9119                                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9120                                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9121                                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9122                                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9123                         </actions>
9124                 </permacrud>
9125         </class>
9126
9127         <class id="aurt" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_type" oils_persist:tablename="acq.user_request_type" reporter:label="User Purchase Request Type">
9128                 <fields oils_persist:primary="id">
9129                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9130                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9131                 </fields>
9132                 <links/>
9133                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9134                         <actions>
9135                                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9136                                 <retrieve/>
9137                                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9138                                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9139                         </actions>
9140                 </permacrud>
9141         </class>
9142
9143         <class id="aur" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request" oils_persist:tablename="acq.user_request" reporter:label="User Purchase Request">
9144                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9145                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9146                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
9147                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link"/>
9148                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool"/>
9149                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" oils_obj:required="true"/>
9150                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text"/>
9151                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text"/>
9152                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool"/>
9153                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9154                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link"/>
9155                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp"/>
9156                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp"/>
9157                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text"/>
9158                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text"/>
9159                         <field reporter:label="UPC" name="upc" reporter:datatype="text"/>
9160                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
9161                         <field reporter:label="Volume" name="volume" reporter:datatype="text"/>
9162                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9163                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text"/>
9164                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text"/>
9165                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text"/>
9166                         <field reporter:label="Publication Location" name="location" reporter:datatype="text"/>
9167                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text"/>
9168                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text"/>
9169                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text"/>
9170                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
9171                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
9172                 </fields>
9173                 <links>
9174                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9175                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9176                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9177                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9178                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9179                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9180                 </links>
9181                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9182                         <actions>
9183                                 <create permission="user_request.create">
9184                                         <context link="usr" field="home_ou"/>
9185                                 </create>
9186                                 <retrieve permission="user_request.view">
9187                                         <context link="usr" field="home_ou"/>
9188                                 </retrieve>
9189                                 <update permission="user_request.update">
9190                                         <context link="usr" field="home_ou"/>
9191                                 </update>
9192                                 <delete permission="user_request.delete">
9193                                         <context link="usr" field="home_ou"/>
9194                                 </delete>
9195                         </actions>
9196                 </permacrud>
9197         </class>
9198
9199         <class id="aurs" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_status" reporter:label="User Purchase Request with Status" oils_persist:readonly="true">
9200                 <oils_persist:source_definition><![CDATA[
9201                         SELECT r.*, CASE
9202                                                 WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9203                                                 WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9204                                                 WHEN l.state = 'received' THEN 5 -- Received
9205                                                 WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9206                                                 WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9207                                                 WHEN l.id IS NOT NULL THEN 2 -- Pending
9208                                                 WHEN l.id IS NULL THEN 1 -- New
9209                                                 ELSE 0 -- Error
9210                                         END AS request_status
9211                                         ,u.home_ou
9212                         FROM      acq.user_request r
9213                         JOIN actor.usr u ON (r.usr = u.id)
9214                         LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9215                         LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9216                         LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9217                 ]]></oils_persist:source_definition>
9218                 <fields oils_persist:primary="id">
9219                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9220                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
9221                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link"/>
9222                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool"/>
9223                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
9224                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text"/>
9225                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text"/>
9226                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool"/>
9227                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9228                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link"/>
9229                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp"/>
9230                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp"/>
9231                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text"/>
9232                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text"/>
9233                         <field reporter:label="UPC" name="upc" reporter:datatype="text"/>
9234                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
9235                         <field reporter:label="Volume" name="volume" reporter:datatype="text"/>
9236                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9237                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text"/>
9238                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text"/>
9239                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text"/>
9240                         <field reporter:label="Publication Location" name="location" reporter:datatype="text"/>
9241                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text"/>
9242                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text"/>
9243                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text"/>
9244                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
9245                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
9246                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link"/>
9247                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9248                 </fields>
9249                 <links>
9250                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9251                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9252                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9253                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9254                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9255                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9256                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9257                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9258                 </links>
9259                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9260                         <actions>
9261                                 <retrieve permission="user_request.view">
9262                                         <context link="usr" field="home_ou"/>
9263                                 </retrieve>
9264                         </actions>
9265                 </permacrud>
9266         </class>
9267
9268         <class id="aurst" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_status_type" oils_persist:tablename="acq.user_request_status_type" reporter:label="Acquisition Patron Request Status Type">
9269                 <fields oils_persist:primary="id">
9270                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9271                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9272                 </fields>
9273                 <links/>
9274                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9275                         <actions>
9276                                 <retrieve/>
9277                         </actions>
9278                 </permacrud>
9279         </class>
9280
9281         <class id="acqct" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::currency_type" oils_persist:tablename="acq.currency_type" reporter:label="Currency Type">
9282                 <fields oils_persist:primary="code">
9283                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
9284                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9285                 </fields>
9286                 <links/>
9287                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9288                         <actions>
9289                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9290                                 <retrieve/>
9291                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9292                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9293                         </actions>
9294                 </permacrud>
9295         </class>
9296
9297         <class id="acqexr" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::exchange_rate" oils_persist:tablename="acq.exchange_rate" reporter:label="Exchange Rate">
9298                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9299                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id"/>
9300                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" oils_obj:required="true"/>
9301                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" oils_obj:required="true"/>
9302                         <field reporter:label="Ratio" name="ratio" oils_obj:required="true"/>
9303                 </fields>
9304                 <links>
9305                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9306                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9307                 </links>
9308                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9309                         <actions>
9310                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9311                                 <retrieve/>
9312                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9313                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9314                         </actions>
9315                 </permacrud>
9316         </class>
9317
9318         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9319                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9320                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector="code"/>
9321                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9322                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9323                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9324                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9325                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text"/>
9326                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9327                         <field reporter:label="SAN" name="san" reporter:datatype="text"/>
9328                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link"/>
9329                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
9330                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool"/>
9331                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
9332                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9333                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9334                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9335                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link"/>
9336                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int"/>
9337                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link"/>
9338                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link"/>
9339                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link"/>
9340                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link"/>
9341                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
9342                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link"/>
9343                         <field reporter:label="Buyer SAN" name="buyer_san" reporter:datatype="text"/>
9344                 </fields>
9345                 <links>
9346                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9347                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9348                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9349                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9350                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9351                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9352                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9353                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9354                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9355                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9356                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9357                 </links>
9358                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9359                         <actions>
9360                                 <create permission="ADMIN_PROVIDER" context_field="owner"/>
9361                                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9362                                 <update permission="ADMIN_PROVIDER" context_field="owner"/>
9363                                 <delete permission="ADMIN_PROVIDER" context_field="owner"/>
9364                         </actions>
9365                 </permacrud>
9366         </class>
9367
9368         <class id="acqpron" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::provider_note" oils_persist:tablename="acq.provider_note" reporter:label="Provider Note">
9369                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9370                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id"/>
9371                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9372                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
9373                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
9374                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
9375                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
9376                         <field reporter:label="Note Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
9377                 </fields>
9378                 <links>
9379                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9380                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9381                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9382                 </links>
9383         </class>
9384
9385         <class id="acqipm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_payment_method" oils_persist:tablename="acq.invoice_payment_method" reporter:label="Invoice Payment Method">
9386                 <fields oils_persist:primary="code">
9387                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:required="true"/>
9388                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9389                 </fields>
9390                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9391                         <actions>
9392                                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9393                                 <retrieve/>
9394                                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9395                                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9396                         </actions>
9397                 </permacrud>
9398         </class>
9399
9400         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9401                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9402                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9403                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" oils_obj:required="true"/>
9404                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9405                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link" oils_obj:required="true"/>
9406                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp"/>
9407                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link"/>
9408                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text"/>
9409                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" oils_obj:required="true"/>
9410                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text"/>
9411                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link"/>
9412                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9413                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp"/>
9414                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link"/>
9415                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9416                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9417                 </fields>
9418                 <links>
9419                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9420                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9421                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9422                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9423                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9424                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9425                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9426                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9427                 </links>
9428                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9429                         <actions>
9430                                 <create permission="CREATE_INVOICE" context_field="receiver"/>
9431                                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9432                                 <update permission="CREATE_INVOICE" context_field="receiver"/>
9433                                 <delete permission="CREATE_INVOICE" context_field="receiver"/>
9434                         </actions>
9435                 </permacrud>
9436         </class>
9437
9438         <class id="acqie" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_entry" oils_persist:tablename="acq.invoice_entry" reporter:label="Invoice Entry">
9439                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9440                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9441                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" oils_obj:required="true"/>
9442                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9443                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9444                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" oils_obj:required="true"/>
9445                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int"/>
9446                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9447                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool"/>
9448                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money"/>
9449                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money"/>
9450                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money"/>
9451                 </fields>
9452                 <links>
9453                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9454                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9455                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9456                 </links>
9457                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9458                         <actions>
9459                                 <create permission="ADMIN_INVOICE">
9460                                         <context link="invoice" field="receiver"/>
9461                                 </create>
9462                                 <retrieve permission="ADMIN_INVOICE">
9463                                         <context link="invoice" field="receiver"/>
9464                                 </retrieve>
9465                                 <update permission="ADMIN_INVOICE">
9466                                         <context link="invoice" field="receiver"/>
9467                                 </update>
9468                                 <delete permission="ADMIN_INVOICE">
9469                                         <context link="invoice" field="receiver"/>
9470                                 </delete>
9471                         </actions>
9472                 </permacrud>
9473         </class>
9474
9475         <class id="acqii" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_item" oils_persist:tablename="acq.invoice_item" reporter:label="Non-bibliographic Invoice Item">
9476                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9477                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9478                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" oils_obj:required="true"/>
9479                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9480                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9481                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" oils_obj:required="true"/>
9482                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text"/>
9483                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9484                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9485                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money"/>
9486                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money"/>
9487                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9488                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money"/>
9489                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link"/>
9490                         <field reporter:label="Target" name="target" reporter:datatype="int"/>
9491                 </fields>
9492                 <links>
9493                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9494                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9495                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9496                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9497                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9498                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9499                 </links>
9500                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9501                         <actions>
9502                                 <create permission="ADMIN_INVOICE">
9503                                         <context link="invoice" field="receiver"/>
9504                                 </create>
9505                                 <retrieve permission="ADMIN_INVOICE">
9506                                         <context link="invoice" field="receiver"/>
9507                                 </retrieve>
9508                                 <update permission="ADMIN_INVOICE">
9509                                         <context link="invoice" field="receiver"/>
9510                                 </update>
9511                                 <delete permission="ADMIN_INVOICE">
9512                                         <context link="invoice" field="receiver"/>
9513                                 </delete>
9514                         </actions>
9515                 </permacrud>
9516         </class>
9517
9518         <class id="acqsn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::shipment_notification" oils_persist:tablename="acq.shipment_notification" reporter:label="Shipment Notification">
9519                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_id_seq">
9520                         <field reporter:label="Shipment Notification ID" name="id" reporter:datatype="id"/>
9521                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" oils_obj:required="true"/>
9522                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9523                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link" oils_obj:required="true"/>
9524                         <field reporter:label="Receive Date" name="recv_date" reporter:datatype="timestamp"/>
9525                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link"/>
9526                         <field reporter:label="Process Date" name="process_date" reporter:datatype="timestamp"/>
9527                         <field reporter:label="Processed By" name="processed_by" reporter:datatype="link"/>
9528                         <field reporter:label="Container Barcode" name="container_code" reporter:datatype="text" oils_obj:required="true"/>
9529                         <field reporter:label="Lading Number" name="lading_number" reporter:datatype="text"/>
9530                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9531                         <field reporter:label="Shipment Notification Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9532                 </fields>
9533                 <links>
9534                         <link field="processed_by" reltype="has_a" key="id" map="" class="au"/>
9535                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9536                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9537                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9538                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9539                         <link field="entries" reltype="has_many" key="shipment_notification" map="" class="acqsne"/>
9540                 </links>
9541                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9542                         <actions>
9543                                 <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9544                                 <update permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9545                                 <delete permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9546                         </actions>
9547                 </permacrud>
9548         </class>
9549
9550         <class id="acqsne" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::shipment_notification_entry" oils_persist:tablename="acq.shipment_notification_entry" reporter:label="Shipment Notification Entry">
9551                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_entry_id_seq">
9552                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9553                         <field reporter:label="Shipment Notification" name="shipment_notification" reporter:datatype="link" oils_obj:required="true"/>
9554                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link"/>
9555                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" oils_obj:required="true"/>
9556                 </fields>
9557                 <links>
9558                         <link field="shipment_notification" reltype="has_a" key="id" map="" class="acqsn"/>
9559                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9560                 </links>
9561                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9562                                 <actions>
9563                                         <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION">
9564                                                 <context link="shipment_notification" field="receiver"/>
9565                                         </retrieve>
9566                                         <update permission="MANAGE_SHIPMENT_NOTIFICATION">
9567                                                 <context link="shipment_notification" field="receiver"/>
9568                                         </update>
9569                                         <delete permission="MANAGE_SHIPMENT_NOTIFICATION">
9570                                                 <context link="shipment_notification" field="receiver"/>
9571                                         </delete>
9572                                 </actions>
9573                         </permacrud>
9574         </class>
9575
9576         <class id="acqpa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_address" oils_persist:tablename="acq.provider_address" reporter:label="Provider Address">
9577                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9578                         <field reporter:label="Address Type" name="address_type" reporter:datatype="text"/>
9579                         <field reporter:label="City" name="city" reporter:datatype="text" oils_obj:required="true"/>
9580                         <field reporter:label="Country" name="country" reporter:datatype="text" oils_obj:required="true"/>
9581                         <field reporter:label="County" name="county" reporter:datatype="text"/>
9582                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9583                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9584                         <field reporter:label="Post Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9585                         <field reporter:label="State" name="state" reporter:datatype="text" oils_obj:required="true"/>
9586                         <field reporter:label="Street 1" name="street1" reporter:datatype="text" oils_obj:required="true"/>
9587                         <field reporter:label="Street 2" name="street2" reporter:datatype="text"/>
9588                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9589                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9590                 </fields>
9591                 <links>
9592                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9593                 </links>
9594                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9595                         <actions>
9596                                 <create permission="ADMIN_PROVIDER">
9597                                         <context link="provider" field="owner"/>
9598                                 </create>
9599                                 <retrieve permission="ADMIN_PROVIDER">
9600                                         <context link="provider" field="owner"/>
9601                                 </retrieve>
9602                                 <update permission="ADMIN_PROVIDER">
9603                                         <context link="provider" field="owner"/>
9604                                 </update>
9605                                 <delete permission="ADMIN_PROVIDER">
9606                                         <context link="provider" field="owner"/>
9607                                 </delete>
9608                         </actions>
9609                 </permacrud>
9610         </class>
9611
9612         <class id="acqpc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_contact" oils_persist:tablename="acq.provider_contact" reporter:label="Provider Contact">
9613                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9614                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9615                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9616                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9617                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9618                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9619                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9620                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9621                 </fields>
9622                 <links>
9623                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9624                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9625                 </links>
9626                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9627                         <actions>
9628                                 <create permission="ADMIN_PROVIDER">
9629                                         <context link="provider" field="owner"/>
9630                                 </create>
9631                                 <retrieve permission="ADMIN_PROVIDER">
9632                                         <context link="provider" field="owner"/>
9633                                 </retrieve>
9634                                 <update permission="ADMIN_PROVIDER">
9635                                         <context link="provider" field="owner"/>
9636                                 </update>
9637                                 <delete permission="ADMIN_PROVIDER">
9638                                         <context link="provider" field="owner"/>
9639                                 </delete>
9640                         </actions>
9641                 </permacrud>
9642         </class>
9643         <class id="acqpca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_contact_address" oils_persist:tablename="acq.provider_contact_address" reporter:label="Provider Contact Address">
9644                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9645                         <field reporter:label="Type" name="address_type" reporter:datatype="text"/>
9646                         <field reporter:label="City" name="city" reporter:datatype="text" oils_obj:required="true"/>
9647                         <field reporter:label="Country" name="country" reporter:datatype="text" oils_obj:required="true"/>
9648                         <field reporter:label="County" name="county" reporter:datatype="text"/>
9649                         <field reporter:label="Address ID" name="id" reporter:datatype="id"/>
9650                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9651                         <field reporter:label="State" name="state" reporter:datatype="text" oils_obj:required="true"/>
9652                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text" oils_obj:required="true"/>
9653                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9654                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9655                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9656                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9657                 </fields>
9658                 <links>
9659                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9660                 </links>
9661                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9662                         <actions>
9663                                 <create permission="ADMIN_PROVIDER">
9664                                         <context link="contact" jump="provider" field="owner"/>
9665                                 </create>
9666                                 <retrieve permission="ADMIN_PROVIDER">
9667                                         <context link="contact" jump="provider" field="owner"/>
9668                                 </retrieve>
9669                                 <update permission="ADMIN_PROVIDER">
9670                                         <context link="contact" jump="provider" field="owner"/>
9671                                 </update>
9672                                 <delete permission="ADMIN_PROVIDER">
9673                                         <context link="contact" jump="provider" field="owner"/>
9674                                 </delete>
9675                         </actions>
9676                 </permacrud>
9677         </class>
9678
9679         <class id="acqftr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
9680                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9681                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9682                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link" oils_obj:required="true"/>
9683                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money" oils_obj:required="true"/>
9684                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9685                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9686                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9687                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link" oils_obj:required="true"/>
9688                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9689                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link" oils_obj:required="true"/>
9690                 </fields>
9691                 <links>
9692                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9693                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9694                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9695                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9696                 </links>
9697                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9698                         <actions>
9699                                 <create permission="ADMIN_ACQ_FUND">
9700                                         <context link="src_fund" field="org"/>
9701                                 </create>
9702                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9703                                         <context link="src_fund" field="org"/>
9704                                         <context link="dest_fund" field="org"/>
9705                                 </retrieve>
9706                                 <update permission="ADMIN_ACQ_FUND">
9707                                         <context link="src_fund" field="org"/>
9708                                 </update>
9709                                 <delete permission="ADMIN_ACQ_FUND">
9710                                         <context link="src_fund" field="org"/>
9711                                 </delete>
9712                         </actions>
9713                 </permacrud>
9714         </class>
9715
9716         <class id="acqfc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fiscal_calendar" oils_persist:tablename="acq.fiscal_calendar" reporter:label="Fiscal Calendar">
9717                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9718                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector="name" oils_obj:required="true"/>
9719                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9720                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9721                 </fields>
9722                 <links>
9723                         <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9724                 </links>
9725                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9726                         <actions>
9727                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9728                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9729                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9730                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9731                         </actions>
9732                 </permacrud>
9733         </class>
9734
9735         <class id="acqfy" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fiscal_year" oils_persist:tablename="acq.fiscal_year" reporter:label="Fiscal Year">
9736                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9737                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector="year" oils_obj:required="true"/>
9738                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link" oils_obj:required="true"/>
9739                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int" oils_obj:required="true"/>
9740                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp" oils_obj:required="true"/>
9741                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp" oils_obj:required="true"/>
9742                 </fields>
9743                 <links>
9744                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9745                 </links>
9746                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9747                         <actions>
9748                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9749                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9750                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9751                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9752                         </actions>
9753                 </permacrud>
9754         </class>
9755
9756         <class id="acqfs" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::funding_source" oils_persist:tablename="acq.funding_source" reporter:label="Funding Source">
9757                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9758                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector="code"/>
9759                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9760                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9761                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9762                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9763                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
9764                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9765                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9766                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9767                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9768                 </fields>
9769                 <links>
9770                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9771                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9772                         <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9773                         <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9774                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9775                 </links>
9776                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9777                         <actions>
9778                                 <create permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9779                                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9780                                 <update permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9781                                 <delete permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9782                         </actions>
9783                 </permacrud>
9784         </class>
9785
9786         <class id="acqfscred" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::funding_source_credit" oils_persist:tablename="acq.funding_source_credit" reporter:label="Credit to Funding Source">
9787                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9788                         <field reporter:label="Credit ID" name="id" reporter:datatype="id"/>
9789                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true"/>
9790                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
9791                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9792                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp"/>
9793                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp"/>
9794                 </fields>
9795                 <links>
9796                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9797                 </links>
9798                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9799                         <actions>
9800                                 <create permission="ADMIN_FUNDING_SOURCE">
9801                                         <context link="funding_source" field="owner"/>
9802                                 </create>
9803                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9804                                         <context link="funding_source" field="owner"/>
9805                                 </retrieve>
9806                                 <update permission="ADMIN_FUNDING_SOURCE">
9807                                         <context link="funding_source" field="owner"/>
9808                                 </update>
9809                                 <delete permission="ADMIN_FUNDING_SOURCE">
9810                                         <context link="funding_source" field="owner"/>
9811                                 </delete>
9812                         </actions>
9813                 </permacrud>
9814         </class>
9815
9816         <class id="acqofscred" controller="open-ils.cstore" oils_obj:fieldmapper="acq::ordered_funding_source_credit" oils_persist:tablename="acq.ordered_funding_source_credit" reporter:label="Ordered Funding Source Credit">
9817                 <fields oils_persist:primary="id">
9818                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9819                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9820                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9821                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9822                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9823                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9824                 </fields>
9825                 <links>
9826                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9827                 </links>
9828         </class>
9829
9830         <class id="acqfdeb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_debit" oils_persist:tablename="acq.fund_debit" reporter:label="Debit From Fund">
9831                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9832                         <field reporter:label="Debit ID" name="id" reporter:datatype="id"/>
9833                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true"/>
9834                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" oils_obj:required="true"/>
9835                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" oils_obj:required="true"/>
9836                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
9837                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool"/>
9838                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" oils_obj:required="true"/>
9839                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp"/>
9840                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link"/>
9841                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9842                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link"/>
9843                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link"/>
9844                 </fields>
9845                 <links>
9846                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9847                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9848                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9849                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9850                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9851                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9852                 </links>
9853                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9854                         <actions>
9855                                 <create permission="ADMIN_ACQ_FUND">
9856                                         <context link="fund" field="org"/>
9857                                 </create>
9858                                 <retrieve permission="ADMIN_ACQ_FUND">
9859                                         <context link="fund" field="org"/>
9860                                 </retrieve>
9861                                 <update permission="ADMIN_ACQ_FUND">
9862                                         <context link="fund" field="org"/>
9863                                 </update>
9864                                 <delete permission="ADMIN_ACQ_FUND">
9865                                         <context link="fund" field="org"/>
9866                                 </delete>
9867                         </actions>
9868                 </permacrud>
9869         </class>
9870
9871         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9872                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9873                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector="code"/>
9874                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
9875                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9876                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true"/>
9877                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true"/>
9878                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9879                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool"/>
9880                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool"/>
9881                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
9882                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int"/>
9883                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int"/>
9884                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9885                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9886                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9887                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9888                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9889                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9890                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9891                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9892                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9893                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9894                 </fields>
9895                 <links>
9896                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9897                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9898                         <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9899                         <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9900                         <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9901                         <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9902                         <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9903                         <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9904                         <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9905                         <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9906                         <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9907                 </links>
9908                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9909                         <actions>
9910                                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9911                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9912                                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9913                                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9914                         </actions>
9915                 </permacrud>
9916         </class>
9917
9918         <class id="acqfat" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_allocation_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_allocation_total" reporter:label="Fund Allocation Total">
9919                 <fields oils_persist:primary="fund">
9920                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9921                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money"/>
9922                 </fields>
9923                 <links>
9924                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9925                 </links>
9926                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9927                         <actions>
9928                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9929                                         <context link="fund" field="org"/>
9930                                 </retrieve>
9931                         </actions>
9932                 </permacrud>
9933         </class>
9934
9935         <class id="acqfdt" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_debit_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_debit_total" reporter:label="Total Debit from Fund">
9936                 <fields oils_persist:primary="fund">
9937                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9938                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money"/>
9939                 </fields>
9940                 <links>
9941                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9942                 </links>
9943                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9944                         <actions>
9945                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9946                                         <context link="fund" field="org"/>
9947                                 </retrieve>
9948                         </actions>
9949                 </permacrud>
9950         </class>
9951
9952         <class id="acqfet" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_encumbrance_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_encumbrance_total" reporter:label="Total Fund Encumbrance">
9953                 <fields oils_persist:primary="fund">
9954                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9955                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money"/>
9956                 </fields>
9957                 <links>
9958                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9959                 </links>
9960                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9961                         <actions>
9962                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9963                                         <context link="fund" field="org"/>
9964                                 </retrieve>
9965                         </actions>
9966                 </permacrud>
9967         </class>
9968
9969         <class id="acqfst" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_spent_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_spent_total" reporter:label="Total Spent from Fund">
9970                 <fields oils_persist:primary="fund">
9971                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9972                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money"/>
9973                 </fields>
9974                 <links>
9975                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9976                 </links>
9977                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9978                         <actions>
9979                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9980                                         <context link="fund" field="org"/>
9981                                 </retrieve>
9982                         </actions>
9983                 </permacrud>
9984         </class>
9985
9986         <class id="acqfcb" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_combined_balance" oils_persist:readonly="true" oils_persist:tablename="acq.fund_combined_balance" reporter:label="Fund Combined Balance">
9987                 <fields oils_persist:primary="fund">
9988                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9989                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money"/>
9990                 </fields>
9991                 <links>
9992                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9993                 </links>
9994                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9995                         <actions>
9996                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9997                                         <context link="fund" field="org"/>
9998                                 </retrieve>
9999                         </actions>
10000                 </permacrud>
10001         </class>
10002
10003    <class id="acqafat" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_allocation_total" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_allocation_total" reporter:label="All Fund Allocation Total">
10004                 <fields oils_persist:primary="fund">
10005                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10006                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money"/>
10007                 </fields>
10008                 <links>
10009                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10010                 </links>
10011         </class>
10012
10013    <class id="acqafet" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_encumbrance_total" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_encumbrance_total" reporter:label="All Fund Encumbrance Total">
10014                 <fields oils_persist:primary="fund">
10015                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10016                         <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money"/>
10017                 </fields>
10018                 <links>
10019                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10020                 </links>
10021         </class>
10022
10023    <class id="acqafst" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_spent_total" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_spent_total" reporter:label="All Fund Spent Total">
10024                 <fields oils_persist:primary="fund">
10025                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10026                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money"/>
10027                 </fields>
10028                 <links>
10029                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10030                 </links>
10031         </class>
10032
10033    <class id="acqafsb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_spent_balance" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_spent_balance" reporter:label="All Fund Spent Balance">
10034                 <fields oils_persist:primary="fund">
10035                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10036                         <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money"/>
10037                 </fields>
10038                 <links>
10039                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10040                 </links>
10041         </class>
10042
10043    <class id="acqafcb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_combined_balance" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_combined_balance" reporter:label="All Fund Combined Total">
10044                 <fields oils_persist:primary="fund">
10045                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10046                         <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money"/>
10047                 </fields>
10048                 <links>
10049                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10050                 </links>
10051         </class>
10052
10053         <class id="acqfsrcct" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_credit_total" oils_persist:readonly="true" oils_persist:tablename="acq.funding_source_credit_total" reporter:label="Total Credit to Funding Source">
10054                 <fields oils_persist:primary="funding_source">
10055                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link"/>
10056                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money"/>
10057                 </fields>
10058                 <links>
10059                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10060                 </links>
10061         </class>
10062
10063         <class id="acqfsrcat" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_allocation_total" oils_persist:readonly="true" oils_persist:tablename="acq.funding_source_allocation_total" reporter:label="Total Allocation to Funding Source">
10064                 <fields oils_persist:primary="funding_source">
10065                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link"/>
10066                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money"/>
10067                 </fields>
10068                 <links>
10069                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10070                 </links>
10071         </class>
10072
10073         <class id="acqfsrcb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_balance" oils_persist:readonly="true" oils_persist:tablename="acq.funding_source_balance" reporter:label="Funding Source Balance">
10074                 <fields oils_persist:primary="funding_source">
10075                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link"/>
10076                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money"/>
10077                 </fields>
10078                 <links>
10079                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10080                 </links>
10081         </class>
10082
10083         <class id="acqfsb" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_spent_balance" oils_persist:readonly="true" oils_persist:tablename="acq.fund_spent_balance" reporter:label="Fund Spent Balance">
10084                 <fields oils_persist:primary="fund">
10085                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10086                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money"/>
10087                 </fields>
10088                 <links>
10089                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10090                 </links>
10091                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10092                         <actions>
10093                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10094                                         <context link="fund" field="org"/>
10095                                 </retrieve>
10096                         </actions>
10097                 </permacrud>
10098         </class>
10099         <class id="acqfsum" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_summary" reporter:label="Fund Summary" reporter:core="true" oils_persist:readonly="true">
10100                 <oils_persist:source_definition><![CDATA[
10101                         SELECT
10102                                 acqf.*,
10103                                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10104                                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10105                                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10106                                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10107                         FROM
10108                                 acq.fund acqf
10109                                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10110                                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10111                                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10112                                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10113                 ]]></oils_persist:source_definition>
10114                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10115                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10116                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit"/>
10117                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10118                         <field reporter:label="Year" name="year" reporter:datatype="int"/>
10119                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link"/>
10120                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10121                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool"/>
10122                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool"/>
10123                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
10124                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int"/>
10125                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int"/>
10126
10127                         <!-- non fund-native fields -->
10128                         <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10129                         <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10130                         <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10131                         <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10132                 </fields>
10133                 <links>
10134                         <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10135                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10136                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10137                 </links>
10138                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10139                         <actions>
10140                                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10141                         </actions>
10142                 </permacrud>
10143         </class>
10144         <class id="acqfa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_allocation" oils_persist:tablename="acq.fund_allocation" reporter:label="Fund Allocation">
10145                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10146                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id"/>
10147                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true"/>
10148                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true"/>
10149                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
10150                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true"/>
10151                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10152                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp"/>
10153                 </fields>
10154                 <links>
10155                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10156                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10157                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10158                 </links>
10159                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10160                         <actions>
10161                                 <create permission="ADMIN_ACQ_FUND">
10162                                         <context link="fund" field="org"/>
10163                                 </create>
10164                                 <retrieve permission="ADMIN_ACQ_FUND">
10165                                         <context link="fund" field="org"/>
10166                                 </retrieve>
10167                                 <update permission="ADMIN_ACQ_FUND">
10168                                         <context link="fund" field="org"/>
10169                                 </update>
10170                                 <delete permission="ADMIN_ACQ_FUND">
10171                                         <context link="fund" field="org"/>
10172                                 </delete>
10173                         </actions>
10174                 </permacrud>
10175         </class>
10176
10177         <class id="acqfap" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_allocation_percent" oils_persist:tablename="acq.fund_allocation_percent" reporter:label="Fund Allocation Percent">
10178                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10179                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id"/>
10180                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true"/>
10181                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
10182                         <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text"/>
10183                         <field reporter:label="Percent" name="percent" reporter:datatype="float" oils_obj:required="true"/>
10184                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true"/>
10185                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10186                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10187                 </fields>
10188                 <links>
10189                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10190                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10191                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10192                 </links>
10193                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10194                         <actions>
10195                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10196                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10197                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10198                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10199                         </actions>
10200                 </permacrud>
10201         </class>
10202
10203         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10204                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10205                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector="name"/>
10206                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
10207                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
10208                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10209                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10210                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10211                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
10212                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10213                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10214                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10215                 </fields>
10216                 <links>
10217                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10218                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10219                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10220                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10221                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10222                 </links>
10223                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10224                         <actions>
10225                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10226                         </actions>
10227                 </permacrud>
10228         </class>
10229
10230         <class id="acqcr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::cancel_reason" oils_persist:tablename="acq.cancel_reason" reporter:label="Cancel Reason">
10231                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10232                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
10233                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
10234                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10235                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10236                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10237                 </fields>
10238                 <links>
10239                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10240                 </links>
10241                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10242                         <actions>
10243                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10244                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10245                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10246                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10247                         </actions>
10248                 </permacrud>
10249         </class>
10250
10251         <class id="acqpo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::purchase_order" oils_persist:tablename="acq.purchase_order" reporter:label="Purchase Order">
10252                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10253                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector="name"/>
10254                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
10255                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10256                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10257                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10258                         <field reporter:label="Status" name="state" reporter:datatype="link"/>
10259                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" oils_obj:required="true"/>
10260                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10261                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10262                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10263                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10264                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10265                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool"/>
10266                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link"/>
10267                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
10268                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int"/>
10269                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float"/>
10270                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float"/>
10271                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float"/>
10272                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link"/>
10273                 </fields>
10274                 <links>
10275                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10276                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10277                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10278                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10279                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10280                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10281                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10282                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10283                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10284                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10285                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10286                 </links>
10287                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10288                         <actions>
10289                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10290                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10291                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10292                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10293                         </actions>
10294                 </permacrud>
10295         </class>
10296
10297         <class id="acqpoh" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::acq_purchase_order_history" oils_persist:tablename="acq.acq_purchase_order_history" reporter:label="Purchase Order History">
10298                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10299                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id" oils_obj:required="true"/>
10300                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10301                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text" oils_obj:required="true"/>
10302                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link" oils_obj:required="true"/>
10303                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
10304                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10305                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10306                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link" oils_obj:required="true"/>
10307                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10308                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10309                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10310                         <field reporter:label="Status" name="state" reporter:datatype="text" oils_obj:required="true"/>
10311                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10312                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10313                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10314                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" oils_obj:required="true"/>
10315                 </fields>
10316                 <links>
10317                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10318                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10319                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10320                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10321                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10322                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10323                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10324                 </links>
10325                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10326                         <actions>
10327                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10328                         </actions>
10329                 </permacrud>
10330         </class>
10331
10332         <class id="acqpon" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::po_note" oils_persist:tablename="acq.po_note" reporter:label="PO Note">
10333                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10334                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id"/>
10335                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" oils_obj:required="true"/>
10336                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10337                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10338                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10339                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10340                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
10341                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool"/>
10342                 </fields>
10343                 <links>
10344                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10345                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10346                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10347                 </links>
10348                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10349                         <actions>
10350                                 <create permission="CREATE_PURCHASE_ORDER">
10351                                         <context link="purchase_order" field="ordering_agency"/>
10352                                 </create>
10353                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10354                                         <context link="purchase_order" field="ordering_agency"/>
10355                                 </retrieve>
10356                                 <update permission="CREATE_PURCHASE_ORDER">
10357                                         <context link="purchase_order" field="ordering_agency"/>
10358                                 </update>
10359                                 <delete permission="CREATE_PURCHASE_ORDER">
10360                                         <context link="purchase_order" field="ordering_agency"/>
10361                                 </delete>
10362                         </actions>
10363                 </permacrud>
10364         </class>
10365
10366         <class id="acqpoi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::po_item" oils_persist:tablename="acq.po_item" reporter:label="Purchase Order Item">
10367                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10368                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10369                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10370                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10371                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" oils_obj:required="true"/>
10372                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10373                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10374                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10375                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10376                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10377                         <field reporter:label="Target" name="target" reporter:datatype="int"/>
10378                 </fields>
10379                 <links>
10380                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10381                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10382                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10383                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10384                 </links>
10385                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10386                         <actions>
10387                                 <create permission="CREATE_PURCHASE_ORDER">
10388                                         <context link="purchase_order" field="ordering_agency"/>
10389                                 </create>
10390                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10391                                         <context link="purchase_order" field="ordering_agency"/>
10392                                 </retrieve>
10393                                 <update permission="CREATE_PURCHASE_ORDER">
10394                                         <context link="purchase_order" field="ordering_agency"/>
10395                                 </update>
10396                                 <delete permission="CREATE_PURCHASE_ORDER">
10397                                         <context link="purchase_order" field="ordering_agency"/>
10398                                 </delete>
10399                         </actions>
10400                 </permacrud>
10401         </class>
10402
10403         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10404                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10405                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id"/>
10406                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" oils_obj:required="true"/>
10407                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10408                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10409                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10410                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10411                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10412                         <field reporter:label="MARC" name="marc" reporter:datatype="text" oils_obj:required="true"/>
10413                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10414                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10415                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp"/>
10416                         <field reporter:label="Status" name="state" reporter:datatype="link"/>
10417                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10418                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10419                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10420                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10421                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money"/>
10422                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link"/>
10423                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int"/>
10424                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
10425                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link"/>
10426                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link"/>
10427                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link"/>
10428                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link"/>
10429                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link"/>
10430                 </fields>
10431                 <links>
10432                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10433                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10434                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10435                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10436                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10437                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10438                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10439                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10440                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10441                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10442                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10443                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10444                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10445                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10446                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10447                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10448                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10449                 </links>
10450                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10451                         <actions>
10452                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10453                                         <context link="purchase_order" field="ordering_agency"/>
10454                                         <context link="picklist" field="org_unit"/>
10455                                 </retrieve>
10456                         </actions>
10457                 </permacrud>
10458         </class>
10459
10460         <class id="acqlih" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::acq_lineitem_history" oils_persist:tablename="acq.acq_lineitem_history" reporter:label="Line Item History">
10461                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10462                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id" oils_obj:required="true"/>
10463                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10464                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text" oils_obj:required="true"/>
10465                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link" oils_obj:required="true"/>
10466                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10467                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10468                         <field reporter:label="Selector" name="selector" reporter:datatype="link" oils_obj:required="true"/>
10469                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10470                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10471                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10472                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10473                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10474                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10475                         <field reporter:label="MARC" name="marc" reporter:datatype="text" oils_obj:required="true"/>
10476                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10477                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10478                         <field reporter:label="Status" name="state" reporter:datatype="text" oils_obj:required="true"/>
10479                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10480                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10481                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money"/>
10482                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link"/>
10483                 </fields>
10484                 <links>
10485                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10486                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10487                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10488                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10489                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10490                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10491                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10492                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10493                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10494                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10495                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10496                 </links>
10497                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10498                         <actions>
10499                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10500                                         <context link="purchase_order" field="ordering_agency"/>
10501                                         <context link="picklist" field="org_unit"/>
10502                                 </retrieve>
10503                         </actions>
10504                 </permacrud>
10505         </class>
10506
10507         <class id="acqliat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_alert_text" oils_persist:tablename="acq.lineitem_alert_text" reporter:label="Line Item Alert Text">
10508                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10509                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10510                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10511                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10512                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true"/>
10513                 </fields>
10514                 <links>
10515                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10516                 </links>
10517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10518                         <actions>
10519                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10520                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10521                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10522                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10523                         </actions>
10524                 </permacrud>
10525         </class>
10526
10527         <class id="acqlin" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_note" oils_persist:tablename="acq.lineitem_note" reporter:label="Line Item Note">
10528                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10529                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id"/>
10530                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
10531                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10532                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10533                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10534                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10535                         <field reporter:label="Note Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
10536                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link"/>
10537                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool"/>
10538                 </fields>
10539                 <links>
10540                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10541                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10542                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10543                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10544                 </links>
10545         </class>
10546
10547         <class id="acqlia" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_attr" oils_persist:tablename="acq.lineitem_attr" reporter:label="Line Item Attribute">
10548                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10549                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id"/>
10550                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
10551                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" oils_obj:required="true"/>
10552                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" oils_obj:required="true"/>
10553                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" oils_obj:required="true"/>
10554                         <field reporter:label="Definition" name="definition" reporter:datatype="text" oils_obj:required="true"/>
10555                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool"/>
10556                 </fields>
10557                 <links>
10558                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10559                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10560                 </links>
10561         </class>
10562
10563         <class id="acqlid" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_detail" oils_persist:tablename="acq.lineitem_detail" reporter:label="Line Item Detail">
10564                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10565                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id"/>
10566                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
10567                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link"/>
10568                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
10569                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text"/>
10570                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp"/>
10571                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link"/>
10572                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10573                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10574                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10575                         <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
10576                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
10577                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10578                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
10579                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10580                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true"/>
10581                 </fields>
10582                 <links>
10583                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10584                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10585                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10586                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10587                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10588                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10589                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10590                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10591                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10592                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10593                 </links>
10594                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10595                         <actions>
10596                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10597                                         <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10598                                         <context link="lineitem" jump="picklist" field="org_unit"/>
10599                                 </retrieve>
10600                         </actions>
10601                 </permacrud>
10602         </class>
10603
10604         <class id="acqliad" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_attr_definition" oils_persist:tablename="acq.lineitem_attr_definition" reporter:label="Line Item Attribute Definition">
10605                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10606                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10607                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10608                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10609                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10610                 </fields>
10611                 <links/>
10612                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10613                         <actions>
10614                                 <retrieve/>
10615                         </actions>
10616                 </permacrud>
10617         </class>
10618
10619         <class id="acqlimad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_marc_attr_definition" oils_persist:tablename="acq.lineitem_marc_attr_definition" reporter:label="Line Item MARC Attribute Definition">
10620                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10621                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10622                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10623                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10624                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10625                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10626                         <field reporter:label="Remove" name="remove" reporter:datatype="text"/>
10627                 </fields>
10628                 <links/>
10629                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10630                         <actions>
10631                                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10632                                 <retrieve/>
10633                                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10634                                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10635                         </actions>
10636                 </permacrud>
10637         </class>
10638
10639         <class id="acqligad" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_generated_attr_definition" oils_persist:tablename="acq.lineitem_generated_attr_definition" reporter:label="Line Item Generated Attribute Definition">
10640                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10641                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10642                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10643                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10644                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10645                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10646                 </fields>
10647                 <links/>
10648         </class>
10649         <class id="acqliuad" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_usr_attr_definition" oils_persist:tablename="acq.lineitem_usr_attr_definition" reporter:label="Line Item User Attribute Definition">
10650                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10651                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10652                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10653                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10654                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
10655                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10656                 </fields>
10657                 <links>
10658                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10659                 </links>
10660         </class>
10661
10662         <class id="acqlipad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_provider_attr_definition" oils_persist:tablename="acq.lineitem_provider_attr_definition" reporter:label="Line Item Provider Attribute Definition">
10663                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10664                 <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10665                 <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10666                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10667                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10668                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10669                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10670                 <field reporter:label="Remove" name="remove" reporter:datatype="text"/>
10671
10672                 </fields>
10673                 <links>
10674                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10675                 </links>
10676                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10677                                 <actions>
10678                                         <create permission="ADMIN_PROVIDER">
10679                                                 <context link="provider" field="owner"/>
10680                                         </create>
10681                                         <retrieve permission="ADMIN_PROVIDER">
10682                                                 <context link="provider" field="owner"/>
10683                                         </retrieve>
10684                                         <update permission="ADMIN_PROVIDER">
10685                                                 <context link="provider" field="owner"/>
10686                                         </update>
10687                                         <delete permission="ADMIN_PROVIDER">
10688                                                 <context link="provider" field="owner"/>
10689                                         </delete>
10690                                 </actions>
10691                         </permacrud>
10692         </class>
10693                 
10694         <class id="acqphsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_holding_subfield_map" oils_persist:tablename="acq.provider_holding_subfield_map" reporter:label="Provider Holding Subfield Map">
10695                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10696                 <field reporter:label="ID" name="id" reporter:datatype="id"/>
10697                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10698                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10699                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true"/>
10700                 </fields>
10701                 <links>
10702                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10703                 </links>
10704                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10705                                 <actions>
10706                                         <create permission="ADMIN_PROVIDER">
10707                                                 <context link="provider" field="owner"/>
10708                                         </create>
10709                                         <retrieve permission="ADMIN_PROVIDER">
10710                                                 <context link="provider" field="owner"/>
10711                                         </retrieve>
10712                                         <update permission="ADMIN_PROVIDER">
10713                                                 <context link="provider" field="owner"/>
10714                                         </update>
10715                                         <delete permission="ADMIN_PROVIDER">
10716                                                 <context link="provider" field="owner"/>
10717                                         </delete>
10718                                 </actions>
10719                         </permacrud>
10720         </class>
10721                 
10722         <class id="acqlilad" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_local_attr_definition" oils_persist:tablename="acq.lineitem_local_attr_definition" reporter:label="Line Item Local Attribute Definition">
10723                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10724                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10725                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10726                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10727                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10728                 </fields>
10729                 <links/>
10730         </class>
10731
10732         <class id="acqedi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_account" oils_persist:tablename="acq.edi_account" reporter:label="EDI Account">
10733                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10734                         <field name="id" reporter:datatype="id" reporter:label="EDI Account ID" reporter:selector="label"/>
10735                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
10736                         <field name="host" reporter:datatype="text" reporter:label="Host" oils_obj:required="true"/>
10737                         <field name="username" reporter:datatype="text" reporter:label="Username"/>
10738                         <field name="password" reporter:datatype="text" reporter:label="Password"/>
10739                         <field name="account" reporter:datatype="text" reporter:label="Account"/>
10740                         <field name="path" reporter:datatype="text" reporter:label="Path"/>
10741                         <field name="owner" reporter:datatype="link" reporter:label="Owner" oils_obj:required="true"/>
10742                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10743                         <field name="provider" reporter:datatype="link" reporter:label="Provider" oils_obj:required="true"/>
10744                         <field name="in_dir" reporter:datatype="text" reporter:label="Incoming Directory"/>
10745                         <field name="vendacct" reporter:datatype="text" reporter:label="Vendor Account Number"/>
10746                         <field name="vendcode" reporter:datatype="text" reporter:label="Vendor Assigned Code"/>
10747                         <field name="attr_set" reporter:datatype="link" reporter:label="EDI Attribute Set"/>
10748                         <field name="use_attrs" reporter:datatype="bool" reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10749                 </fields>
10750                 <links>
10751                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10752                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10753                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10754                 </links>
10755                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10756                         <actions>
10757                                 <create permission="ADMIN_PROVIDER">
10758                                         <context link="provider" field="owner"/>
10759                                 </create>
10760                                 <retrieve permission="ADMIN_PROVIDER">
10761                                         <context link="provider" field="owner"/>
10762                                 </retrieve>
10763                                 <update permission="ADMIN_PROVIDER">
10764                                         <context link="provider" field="owner"/>
10765                                 </update>
10766                                 <delete permission="ADMIN_PROVIDER">
10767                                         <context link="provider" field="owner"/>
10768                                 </delete>
10769                         </actions>
10770                 </permacrud>
10771         </class>
10772
10773         <class id="aea" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_attr" oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10774                 <fields oils_persist:primary="key">
10775                         <field name="key" reporter:datatype="text" reporter:label="Key" reporter:selector="label" oils_obj:required="true"/>
10776                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
10777                 </fields>
10778                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10779                         <actions>
10780                                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10781                                 <retrieve/>
10782                                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10783                                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10784                         </actions>
10785                 </permacrud>
10786         </class>
10787         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_attr_set" oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10788                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10789                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="label"/>
10790                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
10791                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10792                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10793                 </fields>
10794                 <links>
10795                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10796                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10797                 </links>
10798                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10799                         <actions>
10800                                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10801                                 <retrieve/>
10802                                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10803                                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10804                         </actions>
10805                 </permacrud>
10806         </class>
10807         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_attr_set_map" oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10808                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10809                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="label"/>
10810                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set" oils_obj:required="true"/>
10811                         <field name="attr" reporter:datatype="link" reporter:label="Attribute" oils_obj:required="true"/>
10812                 </fields>
10813                 <links>
10814                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10815                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10816                 </links>
10817                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10818                         <actions>
10819                                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10820                                 <retrieve/>
10821                                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10822                                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10823                         </actions>
10824                 </permacrud>
10825         </class>
10826
10827
10828         <class id="acqedim" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_message" oils_persist:tablename="acq.edi_message" reporter:label="EDI Message">
10829                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10830                         <field name="id" reporter:datatype="id" reporter:label="EDI Message ID"/>
10831                         <field name="account" reporter:datatype="link" reporter:label="EDI Account"/>
10832                         <field name="remote_file" reporter:datatype="text" reporter:label="Filename"/>
10833                         <field name="create_time" reporter:datatype="timestamp" reporter:label="Time Created"/>
10834                         <field name="translate_time" reporter:datatype="timestamp" reporter:label="Time Translated"/>
10835                         <field name="process_time" reporter:datatype="timestamp" reporter:label="Time Processed"/>
10836                         <field name="error_time" reporter:datatype="timestamp" reporter:label="Time of Error"/>
10837                         <field name="status" reporter:datatype="text" reporter:label="Status"/>
10838                         <field name="edi" reporter:datatype="text" reporter:label="EDI Message Body"/>
10839                         <field name="jedi" reporter:datatype="text" reporter:label="JEDI Message Body"/>
10840                         <field name="error" reporter:datatype="text" reporter:label="Error"/>
10841                         <field name="purchase_order" reporter:datatype="link" reporter:label="Purchase Order"/>
10842                         <field name="message_type" reporter:datatype="text" reporter:label="Message Type" oils_obj:required="true"/>
10843                 </fields>
10844                 <links>
10845                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10846                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10847                 </links>
10848                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10849                         <actions>
10850                                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10851                                         <context link="account" jump="provider" field="owner"/>
10852                                 </retrieve>
10853                                 <update permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10854                                         <context link="account" jump="provider" field="owner"/>
10855                                 </update>
10856                                 <delete permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10857                                         <context link="account" jump="provider" field="owner"/>
10858                                 </delete>
10859                         </actions>
10860                 </permacrud>
10861         </class>
10862
10863
10864         <class id="rof" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
10865                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10866                         <field name="id" reporter:datatype="id"/>
10867                         <field name="parent" reporter:datatype="link"/>
10868                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10869                         <field name="create_time" reporter:datatype="timestamp"/>
10870                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10871                         <field name="shared" reporter:datatype="bool"/>
10872                         <field name="share_with" reporter:datatype="link"/>
10873                         <field name="simple_reporter" reporter:datatype="bool"/>
10874                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10875                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10876                 </fields>
10877                 <links>
10878                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10879                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10880                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10881                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10882                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10883                 </links>
10884                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10885                         <actions>
10886                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10887                                         <context link="owner" field="home_ou"/>
10888                                 </create>
10889                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10890                                         <context link="owner" field="home_ou"/>
10891                                 </retrieve>
10892                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10893                                         <context link="owner" field="home_ou"/>
10894                                 </update>
10895                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10896                                         <context link="owner" field="home_ou"/>
10897                                 </delete>
10898                         </actions>
10899                 </permacrud>
10900         </class>
10901         <class id="rtf" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
10902                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10903                         <field name="id" reporter:datatype="id"/>
10904                         <field name="parent" reporter:datatype="link"/>
10905                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10906                         <field name="create_time" reporter:datatype="timestamp"/>
10907                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10908                         <field name="shared" reporter:datatype="bool"/>
10909                         <field name="share_with" reporter:datatype="link"/>
10910                         <field name="simple_reporter" reporter:datatype="bool"/>
10911                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10912                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10913                 </fields>
10914                 <links>
10915                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10916                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10917                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10918                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10919                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10920                 </links>
10921                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10922                         <actions>
10923                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10924                                         <context link="owner" field="home_ou"/>
10925                                 </create>
10926                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10927                                         <context link="owner" field="home_ou"/>
10928                                 </retrieve>
10929                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10930                                         <context link="owner" field="home_ou"/>
10931                                 </update>
10932                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10933                                         <context link="owner" field="home_ou"/>
10934                                 </delete>
10935                         </actions>
10936                 </permacrud>
10937         </class>
10938         <class id="rrf" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
10939                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10940                         <field name="id" reporter:datatype="id"/>
10941                         <field name="parent" reporter:datatype="link"/>
10942                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10943                         <field name="create_time" reporter:datatype="timestamp"/>
10944                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10945                         <field name="shared" reporter:datatype="bool"/>
10946                         <field name="share_with" reporter:datatype="link"/>
10947                         <field name="simple_reporter" reporter:datatype="bool"/>
10948                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10949                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10950                 </fields>
10951                 <links>
10952                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10953                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
10954                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
10955                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10956                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
10957                 </links>
10958                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10959                         <actions>
10960                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10961                                         <context link="owner" field="home_ou"/>
10962                                 </create>
10963                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10964                                         <context link="owner" field="home_ou"/>
10965                                 </retrieve>
10966                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10967                                         <context link="owner" field="home_ou"/>
10968                                 </update>
10969                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10970                                         <context link="owner" field="home_ou"/>
10971                                 </delete>
10972                         </actions>
10973                 </permacrud>
10974         </class>
10975         <class id="rt" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::template" oils_persist:tablename="reporter.template" reporter:label="Template">
10976                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
10977                         <field name="id" reporter:datatype="id"/>
10978                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10979                         <field name="create_time" reporter:datatype="timestamp"/>
10980                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10981                         <field name="data" reporter:datatype="text" oils_obj:required="true"/>
10982                         <field name="folder" reporter:datatype="link" oils_obj:required="true"/>
10983                         <field name="description" reporter:datatype="text"/>
10984                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10985                 </fields>
10986                 <links>
10987                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10988                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
10989                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
10990                 </links>
10991                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10992                         <actions>
10993                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10994                                         <context link="owner" field="home_ou"/>
10995                                 </create>
10996                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10997                                         <context link="owner" field="home_ou"/>
10998                                 </retrieve>
10999                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11000                                         <context link="owner" field="home_ou"/>
11001                                 </update>
11002                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11003                                         <context link="owner" field="home_ou"/>
11004                                 </delete>
11005                         </actions>
11006                 </permacrud>
11007         </class>
11008         <class id="rr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
11009                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
11010                         <field name="id" reporter:datatype="id"/>
11011                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
11012                         <field name="create_time" reporter:datatype="timestamp"/>
11013                         <field name="template" reporter:datatype="link" oils_obj:required="true"/>
11014                         <field name="data" reporter:datatype="text" oils_obj:required="true"/>
11015                         <field name="folder" reporter:datatype="link" oils_obj:required="true"/>
11016                         <field name="recur" reporter:datatype="bool"/>
11017                         <field name="recurrence" reporter:datatype="interval"/>
11018                         <field name="name" reporter:datatype="text"/>
11019                         <field name="description" reporter:datatype="text"/>
11020                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
11021                 </fields>
11022                 <links>
11023                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11024                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11025                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
11026                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
11027                 </links>
11028                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11029                         <actions>
11030                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11031                                         <context link="owner" field="home_ou"/>
11032                                 </create>
11033                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11034                                         <context link="owner" field="home_ou"/>
11035                                 </retrieve>
11036                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11037                                         <context link="owner" field="home_ou"/>
11038                                 </update>
11039                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11040                                         <context link="owner" field="home_ou"/>
11041                                 </delete>
11042                         </actions>
11043                 </permacrud>
11044         </class>
11045         <class id="rs" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
11046                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11047                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
11048                         <field reporter:label="Runner" name="runner" reporter:datatype="link" oils_obj:required="true"/>
11049                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11050                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11051                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11052                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11053                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11054                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11055                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11056                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11057                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11058                         <field reporter:label="Report" name="report" reporter:datatype="link" oils_obj:required="true"/>
11059                         <field reporter:label="Folder" name="folder" reporter:datatype="link" oils_obj:required="true"/>
11060                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11061                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11062                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11063                 </fields>
11064                 <links>
11065                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11066                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11067                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11068                 </links>
11069                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11070                         <actions>
11071                                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11072                                         <context link="runner" field="home_ou"/>
11073                                 </create>
11074                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11075                                         <context link="runner" field="home_ou"/>
11076                                 </retrieve>
11077                                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11078                                         <context link="runner" field="home_ou"/>
11079                                 </update>
11080                                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11081                                         <context link="runner" field="home_ou"/>
11082                                 </delete>
11083                         </actions>
11084                 </permacrud>
11085         </class>
11086         <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports" reporter:label="Completed Report Runs" oils_persist:readonly="true">
11087                 <fields oils_persist:primary="run">
11088                         <field reporter:label="Run" name="run" reporter:datatype="link"/>
11089                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
11090                         <field reporter:label="Template" name="template" reporter:datatype="link"/>
11091                         <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11092                         <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11093                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11094                         <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11095                         <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11096                         <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11097                         <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11098                         <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11099                         <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11100                         <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11101                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11102                         <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11103                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11104                 </fields>
11105                 <links>
11106                         <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11107                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11108                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11109                         <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11110                         <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11111                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11112                         <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11113                         <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11114                         <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11115                 </links>
11116                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11117                         <actions>
11118                                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11119                                         <context link="runner" field="home_ou"/>
11120                                 </retrieve>
11121                         </actions>
11122                 </permacrud>
11123         </class>
11124         <class id="rmsr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::materialized_simple_record" oils_persist:tablename="reporter.materialized_simple_record" reporter:label="Fast Simple Record Extracts">
11125                 <fields oils_persist:primary="id">
11126                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
11127                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11128                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11129                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11130                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11131                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11132                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11133                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11134                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11135                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11136                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11137                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11138                 </fields>
11139                 <links>
11140                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11141                 </links>
11142                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11143                         <actions>
11144                                 <retrieve/>
11145                         </actions>
11146                 </permacrud>
11147         </class>
11148         <class id="rssr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::super_simple_record" oils_persist:tablename="reporter.super_simple_record" reporter:label="Simple Record Extracts">
11149                 <fields oils_persist:primary="id">
11150                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11151                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11152                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11153                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11154                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11155                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11156                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11157                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11158                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11159                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11160                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11161                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11162                 </fields>
11163                 <links>
11164                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11165                 </links>
11166         </class>
11167         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11168                 <fields oils_persist:primary="id">
11169                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11170                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11171                         <field reporter:label="Fingerprint" name="fingerprint"/>
11172                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11173                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11174                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11175                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11176                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11177                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11178                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11179                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11180                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11181                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11182                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11183                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11184                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11185                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11186                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11187                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11188                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11189                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11190                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11191                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11192                 </fields>
11193                 <links>
11194                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11195                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11196                 </links>
11197         </class>
11198         <class id="rud" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::user_demographic" oils_persist:tablename="reporter.demographic" reporter:label="User Demographics">
11199                 <fields oils_persist:primary="id">
11200                         <field reporter:label="User ID" name="id" reporter:datatype="id"/>
11201                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11202                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11203                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11204                 </fields>
11205                 <links>
11206                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11207                 </links>
11208         </class>
11209         <class id="rcirct" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::circulation_type" oils_persist:tablename="reporter.circ_type" reporter:label="Circulation Type">
11210                 <fields oils_persist:primary="id">
11211                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id"/>
11212                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11213                 </fields>
11214                 <links>
11215                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11216                 </links>
11217         </class>
11218         <class id="rhrr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::hold_request_record" oils_persist:tablename="reporter.hold_request_record" reporter:label="Hold Request Record">
11219                 <fields oils_persist:primary="id">
11220                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
11221                         <field reporter:label="Hold Target" name="target" reporter:datatype="int"/>
11222                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11223                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11224                 </fields>
11225                 <links>
11226                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11227                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11228                 </links>
11229                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11230                         <actions>
11231                                 <retrieve permission="VIEW_HOLD">
11232                                         <context link="id" field="pickup_lib"/>
11233                                 </retrieve>
11234                         </actions>
11235                 </permacrud>
11236         </class>
11237         <class id="rxbt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::xact_billing_totals" oils_persist:tablename="reporter.xact_billing_totals" reporter:label="Transaction Billing Totals">
11238                 <fields oils_persist:primary="xact">
11239                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int"/>
11240                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money"/>
11241                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11242                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11243                 </fields>
11244                 <links>
11245                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11246                 </links>
11247         </class>
11248         <class id="rxpt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::xact_paid_totals" oils_persist:tablename="reporter.xact_paid_totals" reporter:label="Transaction Paid Totals">
11249                 <fields oils_persist:primary="xact">
11250                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int"/>
11251                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money"/>
11252                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11253                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11254                 </fields>
11255                 <links>
11256                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11257                 </links>
11258         </class>
11259         <class id="ergbhu" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::global_bibs_by_holding_update" oils_persist:tablename="extend_reporter.global_bibs_by_holding_update" reporter:label="Bib IDs by Holding Add/Delete Time (OCLC batch update)">
11260                 <fields oils_persist:primary="id">
11261                         <field reporter:label="Bib ID" name="id" reporter:datatype="id"/>
11262                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp"/>
11263                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text"/>
11264                 </fields>
11265                 <links>
11266                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11267                 </links>
11268         </class>
11269         <class id="erfcc" controller="open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="extend_reporter::full_circ_count" oils_persist:tablename="extend_reporter.full_circ_count" reporter:label="Total Circulation Count, Including Legacy">
11270                 <fields oils_persist:primary="id">
11271                         <field reporter:label="Copy ID" name="id" reporter:datatype="int"/>
11272                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int"/>
11273                 </fields>
11274                 <links>
11275                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11276                 </links>
11277                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11278                         <actions>
11279                                 <retrieve permission="STAFF_LOGIN">
11280                                         <context link="id" field="circ_lib"/>
11281                                 </retrieve>
11282                         </actions>
11283                 </permacrud>
11284         </class>
11285         <class id="erccpo" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::copy_count_per_org" oils_persist:tablename="extend_reporter.copy_count_per_org" reporter:label="Library Holdings Count with Deleted">
11286                 <fields oils_persist:primary="bibid">
11287                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id"/>
11288                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link"/>
11289                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11290                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp"/>
11291                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int"/>
11292                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int"/>
11293                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int"/>
11294                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int"/>
11295                 </fields>
11296                 <links>
11297                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11298                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11299                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11300                 </links>
11301         </class>
11302         <class id="rcsv" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::copy_statistics_view" oils_persist:tablename="reporter.copy_statistics_view" reporter:label="Item Statistics View">
11303                 <fields oils_persist:primary="copy_id">
11304                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11305                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11306                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11307                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11308                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11309                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11310                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11311                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11312                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11313                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11314                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11315                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11316                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11317                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11318                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11319                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11320                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11321                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11322                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11323                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11324                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11325                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11326                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11327                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11328                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11329                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11330                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11331                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11332                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11333                 </fields>
11334                 <links>
11335                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11336                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11337                 </links>
11338         </class>
11339         <class id="acqdf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::distribution_formula" oils_persist:tablename="acq.distribution_formula" reporter:label="Distribution Formula">
11340                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11341                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11342                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
11343                         <field reporter:label="Formula Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11344                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11345                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11346                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11347                 </fields>
11348                 <links>
11349                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11350                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11351                 </links>
11352                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11353                         <actions>
11354                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11355                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11356                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11357                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11358                         </actions>
11359                 </permacrud>
11360         </class>
11361         <class id="acqdfe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::distribution_formula_entry" oils_persist:tablename="acq.distribution_formula_entry" reporter:label="Distribution Formula Entry">
11362                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11363                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11364                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link" oils_obj:required="true"/>
11365                         <field reporter:label="Position" name="position" reporter:datatype="int" oils_obj:required="true"/>
11366                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" oils_obj:required="true"/>
11367                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11368                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11369                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11370                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11371                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11372                 </fields>
11373                 <links>
11374                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11375                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11376                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11377                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11378                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11379                 </links>
11380                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11381                         <actions>
11382                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11383                                         <context link="formula" field="owner"/>
11384                                 </create>
11385                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11386                                         <context link="formula" field="owner"/>
11387                                 </retrieve>
11388                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11389                                         <context link="formula" field="owner"/>
11390                                 </update>
11391                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11392                                         <context link="formula" field="owner"/>
11393                                 </delete>
11394                         </actions>
11395                 </permacrud>
11396         </class>
11397
11398         <class id="acqdfa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::distribution_formula_application" oils_persist:tablename="acq.distribution_formula_application" reporter:label="Distribution Formula Application">
11399                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11400                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11401                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11402                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11403                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link" oils_obj:required="true"/>
11404                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
11405                 </fields>
11406                 <links>
11407                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11408                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11409                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11410                 </links>
11411                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11412                         <actions>
11413                                 <create permission="CREATE_PURCHASE_ORDER">
11414                                         <context link="formula" field="owner"/>
11415                                 </create>
11416                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11417                                         <context link="formula" field="owner"/>
11418                                 </retrieve>
11419                                 <update permission="CREATE_PURCHASE_ORDER">
11420                                         <context link="formula" field="owner"/>
11421                                 </update>
11422                                 <delete permission="CREATE_PURCHASE_ORDER">
11423                                         <context link="formula" field="owner"/>
11424                                 </delete>
11425                         </actions>
11426                 </permacrud>
11427         </class>
11428
11429         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11430                 <fields oils_persist:primary="id">
11431                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
11432                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" oils_obj:required="true"/>
11433                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money" oils_obj:required="true"/>
11434                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11435                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11436                 </fields>
11437                 <links>
11438                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11439                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11440                 </links>
11441         </class>
11442
11443         <class id="acqclt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_type" oils_persist:tablename="acq.claim_type" reporter:label="Claim Type">
11444                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11445                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code"/>
11446                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
11447                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
11448                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11449                 </fields>
11450                 <links>
11451                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11452                 </links>
11453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11454                         <actions>
11455                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11456                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11457                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11458                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11459                         </actions>
11460                 </permacrud>
11461         </class>
11462
11463         <class id="acqclet" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_event_type" oils_persist:tablename="acq.claim_event_type" reporter:label="Claim Event Type">
11464                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11465                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code"/>
11466                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
11467                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
11468                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11469                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11470                 </fields>
11471                 <links>
11472                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11473                 </links>
11474                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11475                         <actions>
11476                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11477                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11478                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11479                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11480                         </actions>
11481                 </permacrud>
11482         </class>
11483
11484         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11485                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11486                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11487                         <field reporter:label="Claim Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11488                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link" oils_obj:required="true"/>
11489                 </fields>
11490                 <links>
11491                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11492                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11493                 </links>
11494         </class>
11495
11496         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11497                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11498                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11499                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11500                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11501                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11502                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11503                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11504                 </fields>
11505                 <links>
11506                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11507                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11508                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11509                 </links>
11510         </class>
11511
11512         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11513                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11514                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11515                         <field reporter:label="Claim Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11516                         <field reporter:label="Serial Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
11517                 </fields>
11518                 <links>
11519                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11520                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11521                 </links>
11522         </class>
11523
11524         <class id="acqscle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim_event" oils_persist:tablename="acq.serial_claim_event" reporter:label="Serial Claim Event">
11525                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11526                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11527                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11528                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11529                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11530                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11531                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11532                 </fields>
11533                 <links>
11534                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11535                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11536                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11537                 </links>
11538         </class>
11539
11540         <class id="acqclp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_policy" oils_persist:tablename="acq.claim_policy" reporter:label="Claim Policy">
11541                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11542                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11543                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
11544                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11545                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11546                 </fields>
11547                 <links>
11548                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11549                 </links>
11550                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11551                         <actions>
11552                                 <create permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11553                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11554                                 <update permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11555                                 <delete permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11556                         </actions>
11557                 </permacrud>
11558         </class>
11559
11560         <class id="acqclpa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_policy_action" oils_persist:tablename="acq.claim_policy_action" reporter:label="Claim Policy Action">
11561                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11562                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11563                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" oils_obj:required="true"/>
11564                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval" oils_obj:required="true"/>
11565                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link" oils_obj:required="true"/>
11566                 </fields>
11567                 <links>
11568                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11569                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11570                 </links>
11571                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11572                         <actions>
11573                                 <create permission="ADMIN_CLAIM_POLICY">
11574                                         <context link="claim_policy" field="org_unit"/>
11575                                 </create>
11576                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11577                                         <context link="claim_policy" field="org_unit"/>
11578                                 </retrieve>
11579                                 <update permission="ADMIN_CLAIM_POLICY">
11580                                         <context link="claim_policy" field="org_unit"/>
11581                                 </update>
11582                                 <delete permission="ADMIN_CLAIM_POLICY">
11583                                         <context link="claim_policy" field="org_unit"/>
11584                                 </delete>
11585                         </actions>
11586                 </permacrud>
11587         </class>
11588
11589         <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11590                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11591                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11592                         <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11593                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11594                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11595                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11596                         <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11597                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11598                         <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11599                         <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11600                         <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11601                         <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11602                         <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11603                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11604                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11605                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11606                         <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11607                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11608                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11609                                                 <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text"/>
11610                 </fields>
11611                 <links>
11612                         <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11613                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11614                 </links>
11615         </class>
11616
11617         <class id="stgc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::card_stage" oils_persist:tablename="staging.card_stage" reporter:label="Card Stage">
11618                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11619                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11620                         <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11621                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11622                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
11623                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11624                 </fields>
11625         </class>
11626
11627         <class id="stgma" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::mailing_address_stage" oils_persist:tablename="staging.mailing_address_stage" reporter:label="Mailing Address Stage">
11628                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11629                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11630                         <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11631                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11632                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11633                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11634                         <field reporter:label="City" name="city" reporter:datatype="text"/>
11635                         <field reporter:label="County" name="county" reporter:datatype="text"/>
11636                         <field reporter:label="State" name="state" reporter:datatype="text"/>
11637                         <field reporter:label="Country" name="country" reporter:datatype="text"/>
11638                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
11639                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11640                 </fields>
11641         </class>
11642
11643         <class id="stgba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::billing_address_stage" oils_persist:tablename="staging.billing_address_stage" reporter:label="Billing Address Stage">
11644                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11645                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11646                         <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11647                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11648                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11649                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11650                         <field reporter:label="City" name="city" reporter:datatype="text"/>
11651                         <field reporter:label="County" name="county" reporter:datatype="text"/>
11652                         <field reporter:label="State" name="state" reporter:datatype="text"/>
11653                         <field reporter:label="Country" name="country" reporter:datatype="text"/>
11654                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
11655                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11656                 </fields>
11657         </class>
11658
11659         <class id="stgsc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::statcat_stage" oils_persist:tablename="staging.statcat_stage" reporter:label="Statistical Category Stage">
11660                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11661                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11662                         <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11663                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11664                         <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text" oils_obj:required="true"/>
11665                         <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
11666                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11667                 </fields>
11668         </class>
11669
11670         <class id="stgs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::setting_stage" oils_persist:tablename="staging.setting_stage" reporter:label="User Setting Stage">
11671                 <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11672                         <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11673                         <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11674                         <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11675                         <field reporter:label="User Setting Code" name="setting" reporter:datatype="text" oils_obj:required="true"/>
11676                         <field reporter:label="User Setting Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
11677                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11678                 </fields>
11679         </class>
11680
11681         <class id="afsg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset_group" oils_persist:tablename="action.fieldset_group" reporter:label="Fieldset Group">
11682                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11683                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11684                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11685                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11686                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11687                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11688                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11689                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11690                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11691                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11692                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
11693                 </fields>
11694                 <links>
11695                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11696                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11697                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11698                 </links>
11699                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11700                         <actions>
11701                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11702                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11703                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11704                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11705                         </actions>
11706                 </permacrud>
11707         </class>
11708
11709         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11710                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11711                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11712                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
11713                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true"/>
11714                         <field reporter:label="Status" name="status" reporter:datatype="text" oils_obj:required="true"/>
11715                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11716                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11717                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11718                         <field reporter:label="Class Name" name="classname" reporter:datatype="text" oils_obj:required="true"/>
11719                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11720                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11721                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11722                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11723                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11724                 </fields>
11725                 <links>
11726                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11727                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11728                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11729                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11730                 </links>
11731                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11732                         <actions>
11733                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11734                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11735                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11736                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11737                         </actions>
11738                 </permacrud>
11739         </class>
11740
11741         <class id="afscv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset_col_val" oils_persist:tablename="action.fieldset_col_val" reporter:label="Fieldset Column Value">
11742                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11743                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11744                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link" oils_obj:required="true"/>
11745                         <field reporter:label="Column Name" name="col" reporter:datatype="text" oils_obj:required="true"/>
11746                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11747                 </fields>
11748                 <links>
11749                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11750                 </links>
11751                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11752                         <actions>
11753                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11754                                         <context link="fieldset" field="owning_lib"/>
11755                                 </create>
11756                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11757                                         <context link="fieldset" field="owning_lib"/>
11758                                 </retrieve>
11759                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11760                                         <context link="fieldset" field="owning_lib"/>
11761                                 </update>
11762                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11763                                         <context link="fieldset" field="owning_lib"/>
11764                                 </delete>
11765                         </actions>
11766                 </permacrud>
11767         </class>
11768
11769         <class id="aufhl" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_loops" oils_persist:tablename="action.unfulfilled_hold_loops" oils_persist:readonly="true">
11770                 <fields>
11771                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11772                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11773                         <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11774                 </fields>
11775                 <links>
11776                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11777                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11778                 </links>
11779         </class>
11780
11781         <class id="aufhml" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_min_loop" oils_persist:tablename="action.unfulfilled_hold_min_loop" oils_persist:readonly="true">
11782                 <fields>
11783                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11784                         <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11785                 </fields>
11786                 <links>
11787                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11788                 </links>
11789         </class>
11790
11791         <class id="aufhil" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_innermost_loop" oils_persist:tablename="action.unfulfilled_hold_innermost_loop" oils_persist:readonly="true">
11792                 <fields>
11793                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11794                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11795                         <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11796                 </fields>
11797                 <links>
11798                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11799                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11800                 </links>
11801         </class>
11802
11803         <class id="aufhmxl" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_max_loop" oils_persist:tablename="action.unfulfilled_hold_max_loop" oils_persist:readonly="true">
11804                 <fields>
11805                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11806                         <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11807                 </fields>
11808                 <links>
11809                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11810                 </links>
11811         </class>
11812
11813         <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11814                 <oils_persist:source_definition><![CDATA[
11815
11816                 SELECT  DISTINCT l.*
11817                   FROM  action.unfulfilled_hold_loops l
11818                                 JOIN action.unfulfilled_hold_max_loop m USING (hold)
11819                   WHERE l.count = m.max
11820
11821                 ]]></oils_persist:source_definition>
11822                 <fields>
11823                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11824                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11825                         <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11826                 </fields>
11827                 <links>
11828                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11829                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11830                 </links>
11831         </class>
11832
11833         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11834                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11835                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11836                         <field reporter:label="Query type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11837                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11838                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11839                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11840                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11841                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11842                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11843                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11844                 </fields>
11845                 <links>
11846                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11847                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11848                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11849                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11850                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11851                 </links>
11852         </class>
11853
11854         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11855                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11856                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11857                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link" oils_obj:required="true"/>
11858                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11859                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link" oils_obj:required="true"/>
11860                 </fields>
11861                 <links>
11862                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11863                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11864                 </links>
11865         </class>
11866
11867         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11868                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11869                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11870                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text" oils_obj:required="true"/>
11871                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11872                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11873                 </fields>
11874                 <links>
11875                 </links>
11876         </class>
11877
11878         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11879                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11880                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11881                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link" oils_obj:required="true"/>
11882                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11883                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link" oils_obj:required="true"/>
11884                 </fields>
11885                 <links>
11886                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11887                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11888                 </links>
11889         </class>
11890         
11891         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11892                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11893                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11894                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text" oils_obj:required="true"/>
11895                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11896                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11897                 </fields>
11898                 <links>
11899                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11900                 </links>
11901         </class>
11902         
11903         <class id="qfpd" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_param_def" oils_persist:tablename="query.function_param_def" reporter:label="Function Parameter Definition">
11904                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11905                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11906                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link" oils_obj:required="true"/>
11907                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11908                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link" oils_obj:required="true"/>
11909                 </fields>
11910                 <links>
11911                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11912                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11913                 </links>
11914         </class>
11915
11916         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11917                 <fields oils_persist:primary="name">
11918                         <field reporter:label="Name" name="name" reporter:datatype="id" oils_obj:required="true"/>
11919                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
11920                         <field reporter:label="Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11921                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11922                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11923                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11924                 </fields>
11925                 <links>
11926                 </links>
11927         </class>
11928
11929         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11930                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11931                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11932                         <field reporter:label="Expression Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11933                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11934                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11935                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11936                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11937                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11938                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11939                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11940                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11941                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11942                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11943                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11944                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11945                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11946                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11947                 </fields>
11948                 <links>
11949                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11950                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11951                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
11952                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11953                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11954                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11955                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11956                 </links>
11957         </class>
11958
11959         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
11960                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
11961                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
11962                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link" oils_obj:required="true"/>
11963                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11964                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
11965                         <field reporter:label="Result" name="result" reporter:datatype="link" oils_obj:required="true"/>
11966                 </fields>
11967                 <links>
11968                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11969                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
11970                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
11971                 </links>
11972         </class>
11973
11974         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
11975                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
11976                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
11977                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11978                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
11979                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
11980                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
11981                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
11982                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11983                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
11984                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11985                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
11986                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
11987                 </fields>
11988                 <links>
11989                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11990                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
11991                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
11992                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
11993                 </links>
11994         </class>
11995
11996         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
11997                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
11998                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
11999                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link" oils_obj:required="true"/>
12000                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
12001                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text" oils_obj:required="true"/>
12002                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link" oils_obj:required="true"/>
12003                 </fields>
12004                 <links>
12005                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
12006                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
12007                 </links>
12008         </class>
12009
12010         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
12011                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
12012                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
12013                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link" oils_obj:required="true"/>
12014                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
12015                         <field reporter:label="Expression" name="expression" reporter:datatype="link" oils_obj:required="true"/>
12016                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
12017                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
12018                 </fields>
12019                 <links>
12020                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12021                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12022                 </links>
12023         </class>
12024
12025         <class id="qobi" controller="open-ils.cstore" oils_obj:fieldmapper="query::order_by_item" oils_persist:tablename="query.order_by_item" reporter:label="Order By Item">
12026                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
12027                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
12028                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link" oils_obj:required="true"/>
12029                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
12030                         <field reporter:label="Expression" name="expression" reporter:datatype="link" oils_obj:required="true"/>
12031                 </fields>
12032                 <links>
12033                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12034                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12035                 </links>
12036         </class>
12037
12038         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
12039                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12040                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12041                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12042                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12043                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12044                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12045                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12046                 </fields>
12047                 <links>
12048                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12049                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12050                 </links>
12051         </class>
12052
12053         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
12054                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12055                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12056                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12057                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12058                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12059                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12060                 </fields>
12061                 <links>
12062                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12063                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12064                 </links>
12065         </class>
12066
12067         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12068                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12069                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12070                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12071                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12072                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12073                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12074                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12075                 </fields>
12076                 <links>
12077                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12078                 </links>
12079         </class>
12080
12081         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12082                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12083                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12084                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12085                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12086                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12087                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12088                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12089                 </fields>
12090                 <links>
12091                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12092                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12093                 </links>
12094         </class>
12095
12096         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12097                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12098                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12099                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12100                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12101                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12102                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12103                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12104                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12105                 </fields>
12106                 <links>
12107                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12108                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12109                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12110                 </links>
12111         </class>
12112
12113         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12114                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12115                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12116                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12117                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12118                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12119                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12120                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12121                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12122                 </fields>
12123                 <links>
12124                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12125                 </links>
12126         </class>
12127
12128         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12129                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12130                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12131                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12132                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12133                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12134                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12135                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12136                 </fields>
12137                 <links>
12138                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12139                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12140                 </links>
12141         </class>
12142
12143         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12144                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12145                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12146                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12147                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12148                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12149                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12150                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12151                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12152                 </fields>
12153                 <links>
12154                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12155                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12156                 </links>
12157         </class>
12158
12159         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12160                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12161                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12162                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12163                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12164                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12165                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12166                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12167                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12168                 </fields>
12169                 <links>
12170                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12171                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12172                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12173                 </links>
12174         </class>
12175
12176         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
12177                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12178                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12179                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12180                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12181                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12182                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12183                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12184                 </fields>
12185                 <links>
12186                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12187                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12188                 </links>
12189         </class>
12190
12191         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12192                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12193                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12194                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12195                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12196                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12197                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12198                 </fields>
12199                 <links>
12200                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12201                 </links>
12202         </class>
12203
12204         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12205                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12206                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12207                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12208                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12209                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12210                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12211                 </fields>
12212                 <links>
12213                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12214                 </links>
12215         </class>
12216
12217         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12218                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12219                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12220                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12221                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12222                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12223                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12224                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12225                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12226                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12227                 </fields>
12228                 <links>
12229                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12230                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12231                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12232                 </links>
12233         </class>
12234
12235         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12236                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12237                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12238                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12239                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12240                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12241                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12242                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12243                 </fields>
12244                 <links>
12245                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12246                 </links>
12247         </class>
12248
12249         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12250                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12251                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12252                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12253                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12254                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12255                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12256                 </fields>
12257                 <links>
12258                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12259                 </links>
12260         </class>
12261
12262         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12263                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12264                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12265                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12266                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12267                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12268                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12269                 </fields>
12270                 <links>
12271                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12272                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12273                 </links>
12274         </class>
12275
12276         <class id="bmpc" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::marc21_physical_characteristics" oils_persist:tablename="biblio.marc21_physical_characteristics" reporter:label="MARC21 Physical Characteristics" oils_persist:field_safe="true" oils_persist:readonly="true">
12277                 <fields oils_persist:primary="id">
12278                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12279                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12280                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12281                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12282                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12283                 </fields>
12284                 <links>
12285                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12286                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12287                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12288                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12289                 </links>
12290         </class>
12291
12292         <class id="cmfpm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_ff_pos_map" oils_persist:tablename="config.marc21_ff_pos_map" reporter:label="MARC21 Fixed Field Map" oils_persist:field_safe="true">
12293                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12294                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12295                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text" oils_obj:required="true"/>
12296                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
12297                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text" oils_obj:required="true"/>
12298                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int" oils_obj:required="true"/>
12299                         <field reporter:label="Length" name="length" reporter:datatype="int" oils_obj:required="true"/>
12300                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12301                 </fields>
12302                 <links/>
12303                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12304                         <actions>
12305                                 <retrieve/>
12306                         </actions>
12307                 </permacrud>
12308         </class>
12309
12310         <class id="cmpctm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_physical_characteristic_type_map" oils_persist:tablename="config.marc21_physical_characteristic_type_map" reporter:label="MARC21 Physical Characteristic Type Map" oils_persist:field_safe="true">
12311                 <fields oils_persist:primary="ptype_key">
12312                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id" oils_obj:required="true"/>
12313                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12314                 </fields>
12315                 <links/>
12316                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12317                         <actions>
12318                                 <retrieve/>
12319                         </actions>
12320                 </permacrud>
12321         </class>
12322
12323         <class id="cmpcsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_physical_characteristic_subfield_map" oils_persist:tablename="config.marc21_physical_characteristic_subfield_map" reporter:label="MARC21 Physical Characteristic Subfield Map" oils_persist:field_safe="true">
12324                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12325                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12326                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link" oils_obj:required="true"/>
12327                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true"/>
12328                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int" oils_obj:required="true"/>
12329                         <field reporter:label="Length" name="length" reporter:datatype="int" oils_obj:required="true"/>
12330                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12331                 </fields>
12332                 <links>
12333                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12334                 </links>
12335                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12336                         <actions>
12337                                 <retrieve/>
12338                         </actions>
12339                 </permacrud>
12340         </class>
12341
12342         <class id="cmpcvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_physical_characteristic_value_map" oils_persist:tablename="config.marc21_physical_characteristic_value_map" reporter:label="MARC21 Physical Characteristic Value Map" oils_persist:field_safe="true">
12343                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12344                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12345                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
12346                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link" oils_obj:required="true"/>
12347                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12348                 </fields>
12349                 <links>
12350                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12351                 </links>
12352                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12353                         <actions>
12354                                 <retrieve/>
12355                         </actions>
12356                 </permacrud>
12357         </class>
12358
12359         <!-- This is what you see in Catalog -> Link Checker -->
12360         <class id="uvsa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::sessions_and_attempts" reporter:label="Combined URL Verify Sessions and Batches View" oils_persist:readonly="true">
12361                 <oils_persist:source_definition><![CDATA[
12362                         SELECT
12363                                 coalesce(uvva.id,-uvs.id) as id,
12364                                 uvs.id as session_id,
12365                                 uvs.name,
12366                                 uvs.owning_lib,
12367                                 uvs.creator,
12368                                 uvs.container,
12369                                 uvs.create_time,
12370                                 uvs.search,
12371                                 (select string_agg(xpath,',')
12372                                  from url_verify.url_selector uvus
12373                                  where uvus.session = uvs.id
12374                                  group by session) as selectors,
12375                                 uvva.id as batch_id,
12376                                 uvva.usr,
12377                                 uvva.start_time,
12378                                 uvva.finish_time
12379                         FROM
12380                                 url_verify.session uvs
12381                         LEFT JOIN
12382                                 url_verify.verification_attempt uvva
12383                         ON
12384                                 (uvs.id = uvva.session)
12385                 ]]></oils_persist:source_definition>
12386                 <fields oils_persist:primary="id">
12387                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
12388                         <field reporter:label="Session ID" name="session_id" reporter:datatype="link"/>
12389                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12390                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12391                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12392                         <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12393                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12394                         <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12395                         <field reporter:label="Selectors" name="selectors" reporter:datatype="text" oils_obj:required="true"/>
12396                         <field reporter:label="Batch ID" name="batch_id" reporter:datatype="link"/>
12397                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12398                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12399                         <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12400                 </fields>
12401                 <links>
12402                         <link field="session_id" reltype="has_a" key="id" map="" class="uvs"/>
12403                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12404                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12405                         <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12406                         <link field="batch_id" reltype="has_a" key="id" map="" class="uvva"/>
12407                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12408                 </links>
12409                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12410                         <actions>
12411                                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12412                         </actions>
12413                 </permacrud>
12414         </class>
12415
12416         <!-- This is what gets created with Catalog -> Link Checker -> New Session -->
12417         <class id="uvs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::session" oils_persist:tablename="url_verify.session" reporter:label="URL Verification Session">
12418                 <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12419                         <field reporter:label="Session ID" name="id" reporter:datatype="id" reporter:selector="name"/>
12420                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12421                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12422                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12423                         <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12424                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12425                         <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12426                         <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12427                         <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12428                 </fields>
12429
12430                 <links>
12431                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12432                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12433                         <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12434                         <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12435                         <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12436                 </links>
12437
12438                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12439                         <actions>
12440                                 <create permission="URL_VERIFY" context_field="owning_lib"/>
12441                                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12442                                 <update permission="URL_VERIFY" context_field="owning_lib"/>
12443                                 <delete permission="URL_VERIFY" context_field="owning_lib"/>
12444                         </actions>
12445                 </permacrud>
12446
12447         </class>
12448
12449         <!-- A biblio bucket gets populated with search results from Catalog -> Link Checker -> New Session -->
12450         <class id="uvsbrem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::session_biblio_record_entry_map" oils_persist:readonly="true" reporter:label="URL Verify Session Biblio Record Entry Map">
12451                 <oils_persist:source_definition><![CDATA[
12452                         SELECT
12453                                 cbrebi.id AS id,  -- so we can have a pkey in our view
12454                                 uvs.id AS session,
12455                                 uvs.owning_lib,
12456                                 cbrebi.target_biblio_record_entry
12457                         FROM url_verify.session uvs
12458                         JOIN container.biblio_record_entry_bucket cbreb
12459                                 ON (uvs.container = cbreb.id)
12460                         JOIN container.biblio_record_entry_bucket_item cbrebi
12461                                 ON (cbrebi.bucket = cbreb.id)
12462                 ]]></oils_persist:source_definition>
12463                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12464                         <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id"/>
12465                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12466                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12467                         <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link"/>
12468                 </fields>
12469                 <links>
12470                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
12471                         <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12472                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12473                 </links>
12474                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12475                         <actions>
12476                                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12477                         </actions>
12478                 </permacrud>
12479         </class>
12480
12481         <!-- Also created with Catalog -> Link Checker -> New Session -->
12482         <class id="uvus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::url_selector" oils_persist:tablename="url_verify.url_selector" reporter:label="URL Verification URL Selector">
12483                 <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12484                         <field reporter:label="URL Selector ID" name="id" reporter:datatype="id" reporter:selector="xpath"/>
12485                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12486                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12487                         <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12488                 </fields>
12489
12490                 <links>
12491                         <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12492                         <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12493                 </links>
12494
12495                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12496                         <actions>
12497                                 <create permission="URL_VERIFY">
12498                                         <context link="session" field="owning_lib"/>
12499                                 </create>
12500                                 <retrieve permission="URL_VERIFY">
12501                                         <context link="session" field="owning_lib"/>
12502                                 </retrieve>
12503                                 <update permission="URL_VERIFY">
12504                                         <context link="session" field="owning_lib"/>
12505                                 </update>
12506                                 <delete permission="URL_VERIFY">
12507                                         <context link="session" field="owning_lib"/>
12508                                 </delete>
12509                         </actions>
12510                 </permacrud>
12511
12512         </class>
12513
12514         <!-- URLs extracted by URL selectors -->
12515         <class id="uvu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::url" oils_persist:tablename="url_verify.url" reporter:label="URL Verification URL">
12516                 <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12517                         <field reporter:label="URL ID" name="id" reporter:datatype="id" reporter:selector="full_url"/>
12518                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12519                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12520                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12521                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12522                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12523                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12524                         <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12525                         <field reporter:label="URL" name="full_url" reporter:datatype="text" oils_obj:required="true"/>
12526                         <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12527                         <field reporter:label="Host" name="host" reporter:datatype="text"/>
12528                         <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12529                         <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12530                         <field reporter:label="Path" name="path" reporter:datatype="text"/>
12531                         <field reporter:label="Page" name="page" reporter:datatype="text"/>
12532                         <field reporter:label="Query" name="query" reporter:datatype="text"/>
12533                         <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12534                         <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true"/>
12535                 </fields>
12536
12537                 <links>
12538                         <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12539                         <link field="item" reltype="has_a" key="id" map="" class="uvsbrem"/>
12540                         <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12541                         <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12542                         <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12543                 </links>
12544
12545                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12546                         <actions>
12547                                 <create permission="URL_VERIFY">
12548                                         <context link="session" field="owning_lib"/>
12549                                 </create>
12550                                 <retrieve permission="URL_VERIFY">
12551                                         <context link="session" field="owning_lib"/>
12552                                 </retrieve>
12553                                 <update permission="URL_VERIFY">
12554                                         <context link="session" field="owning_lib"/>
12555                                 </update>
12556                                 <delete permission="URL_VERIFY">
12557                                         <context link="session" field="owning_lib"/>
12558                                 </delete>
12559                         </actions>
12560                 </permacrud>
12561
12562         </class>
12563
12564         <!-- What we now call Batches in the UI -->
12565         <class id="uvva" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::verification_attempt" oils_persist:tablename="url_verify.verification_attempt" reporter:label="URL Verification Attempt">
12566                 <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12567                         <field reporter:label="Batch ID" name="id" reporter:datatype="id"/>
12568                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
12569                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12570                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12571                         <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12572                 </fields>
12573
12574                 <links>
12575                         <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12576                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12577                 </links>
12578
12579                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12580                         <actions>
12581                                 <create permission="URL_VERIFY">
12582                                         <context link="session" field="owning_lib"/>
12583                                 </create>
12584                                 <retrieve permission="URL_VERIFY">
12585                                         <context link="session" field="owning_lib"/>
12586                                 </retrieve>
12587                                 <update permission="URL_VERIFY">
12588                                         <context link="session" field="owning_lib"/>
12589                                 </update>
12590                                 <delete permission="URL_VERIFY">
12591                                         <context link="session" field="owning_lib"/>
12592                                 </delete>
12593                         </actions>
12594                 </permacrud>
12595
12596         </class>
12597
12598         <!-- what we now call Attempts in the UI -->
12599         <class id="uvuv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::url_verification" oils_persist:tablename="url_verify.url_verification" reporter:label="URL Verification">
12600                 <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12601                         <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12602                         <field reporter:label="URL" name="url" reporter:datatype="link" oils_obj:required="true"/>
12603                         <field reporter:label="Batch" name="attempt" reporter:datatype="link" oils_obj:required="true"/>
12604                         <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12605                         <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12606                         <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12607                         <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12608                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12609                 </fields>
12610
12611                 <links>
12612                         <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12613                         <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12614                         <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12615                 </links>
12616
12617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12618                         <actions>
12619                                 <create permission="URL_VERIFY">
12620                                         <context link="attempt" jump="session" field="owning_lib"/>
12621                                 </create>
12622                                 <retrieve permission="URL_VERIFY">
12623                                         <context link="attempt" jump="session" field="owning_lib"/>
12624                                 </retrieve>
12625                                 <update permission="URL_VERIFY">
12626                                         <context link="attempt" jump="session" field="owning_lib"/>
12627                                 </update>
12628                                 <delete permission="URL_VERIFY">
12629                                         <context link="attempt" jump="session" field="owning_lib"/>
12630                                 </delete>
12631                         </actions>
12632                 </permacrud>
12633
12634         </class>
12635
12636         <class id="cfdi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::filter_dialog_interface" oils_persist:tablename="config.filter_dialog_interface" reporter:label="FilterDialog Interface">
12637                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12638                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" oils_obj:required="true"/>
12639                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
12640                 </fields>
12641                 <links>
12642                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12643                 </links>
12644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12645                         <actions>
12646                                 <retrieve/>
12647                         </actions>
12648                 </permacrud>
12649         </class>
12650
12651         <class id="cfdfs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::filter_dialog_filter_set" oils_persist:tablename="config.filter_dialog_filter_set" reporter:label="FilterDialog Filter Set">
12652                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12653                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12654                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12655                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12656                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12657                         <field reporter:label="Interface" name="interface" reporter:datatype="link" oils_obj:required="true"/>
12658                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12659                         <field reporter:label="Filters" name="filters" reporter:datatype="text" oils_obj:required="true"/>
12660                 </fields>
12661                 <links>
12662                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12663                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12664                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12665                 </links>
12666                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12667                         <actions>
12668                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12669                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12670                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12671                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12672                         </actions>
12673                 </permacrud>
12674
12675         </class>
12676
12677         <class id="cmrtm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_rec_type_map" oils_persist:tablename="config.marc21_rec_type_map" reporter:label="MARC21 Record Type Map" oils_persist:field_safe="true">
12678                 <fields oils_persist:primary="code">
12679                         <field reporter:label="Code" name="code" reporter:datatype="id" oils_obj:required="true"/>
12680                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text" oils_obj:required="true"/>
12681                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text" oils_obj:required="true"/>
12682                 </fields>
12683                 <links/>
12684                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12685                         <actions>
12686                                 <retrieve/>
12687                         </actions>
12688                 </permacrud>
12689         </class>
12690
12691         <class id="rlcd" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::last_copy_deleted" oils_persist:readonly="true" reporter:core="true" reporter:label="Last Copy Delete Time">
12692                 <oils_persist:source_definition><![CDATA[
12693
12694                         SELECT  b.id,
12695                                         MAX(dcp.edit_date) AS last_delete_date
12696                          FROM   biblio.record_entry b
12697                                         JOIN asset.call_number cn ON (cn.record = b.id)
12698                                         JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12699                          WHERE  NOT b.deleted
12700                          GROUP BY b.id
12701                          HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12702
12703                 ]]></oils_persist:source_definition>
12704                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12705                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12706                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12707                 </fields>
12708                 <links>
12709                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12710                 </links>
12711                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12712                         <actions>
12713                                 <retrieve/>
12714                         </actions>
12715                 </permacrud>
12716         </class>
12717
12718         <class id="jubstlbl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::li_state_label" oils_persist:tablename="acq.li_state_label" oils_persist:readonly="true" reporter:label="Line Item State Labels" oils_persist:field_safe="true">
12719                 <fields oils_persist:primary="id">
12720                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12721                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12722                 </fields>
12723                         <links/>
12724                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12725                         <actions>
12726                                 <retrieve/>
12727                         </actions>
12728                 </permacrud>
12729         </class>
12730
12731         <class id="acqpostlbl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::po_state_label" oils_persist:tablename="acq.po_state_label" oils_persist:readonly="true" reporter:label="PO State Labels">
12732                 <fields oils_persist:primary="id">
12733                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12734                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12735                 </fields>
12736                         <links/>
12737                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12738                         <actions>
12739                                 <retrieve/>
12740                         </actions>
12741                 </permacrud>
12742         </class>
12743
12744
12745         <class id="rhcrpb" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib" oils_persist:readonly="true" reporter:core="true" reporter:label="Hold/Copy Ratio per Bib">
12746                 <oils_persist:source_definition><![CDATA[
12747                                 SELECT
12748                                         x.id,
12749                                         COALESCE( y.copy_count, 0 ) AS copy_count,
12750                                         x.hold_count AS hold_count,
12751                                         CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12752                                 FROM
12753                                         (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12754                                                 FROM
12755                                                         action.hold_request ahr
12756                                                         JOIN reporter.hold_request_record rhrr USING (id)
12757                                                 WHERE
12758                                                         ahr.cancel_time IS NULL
12759                                                         AND ahr.fulfillment_time IS NULL
12760                                                 GROUP BY bib_record
12761                                         )x
12762                                         JOIN
12763                                         (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12764                                                 FROM
12765                                                         action.hold_request ahr
12766                                                         JOIN reporter.hold_request_record rhrr USING (id)
12767                                                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12768                                                 WHERE
12769                                                         ahr.cancel_time IS NULL
12770                                                         AND ahr.fulfillment_time IS NULL
12771                                                         AND ahr.capture_time IS NULL
12772                                                         AND ahr.frozen IS FALSE
12773                                                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12774                                                         AND ahr.hold_type != 'M'
12775                                                    GROUP BY bib_record
12776                                         )y
12777                                         USING (id)
12778                 ]]></oils_persist:source_definition>
12779                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12780                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12781                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12782                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12783                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12784                 </fields>
12785                 <links>
12786                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12787                 </links>
12788                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12789                         <actions>
12790                                 <retrieve/>
12791                         </actions>
12792                 </permacrud>
12793         </class>
12794
12795         <class id="rhcrpbap" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_pickup" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Pickup Library">
12796                 <oils_persist:source_definition><![CDATA[
12797                         SELECT *,
12798                                 CASE WHEN copy_count_at_pickup_library = 0 THEN 'Infinity'::FLOAT ELSE holds_at_pickup_library::FLOAT/copy_count_at_pickup_library END AS pickup_library_ratio,
12799                                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12800                         FROM
12801                                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12802                                         FROM
12803                                                 action.hold_request ahr
12804                                                 JOIN reporter.hold_request_record rhrr USING (id)
12805                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12806                                                 LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12807                                         WHERE
12808                                                 ahr.cancel_time IS NULL
12809                                                 AND ahr.fulfillment_time IS NULL
12810                                         GROUP BY bib_record, pickup_lib
12811                                 )x
12812                                 JOIN
12813                                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12814                                         FROM
12815                                                 action.hold_request ahr
12816                                                 JOIN reporter.hold_request_record rhrr USING (id)
12817                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12818                                                 LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12819                                         WHERE
12820                                                 ahr.cancel_time IS NULL
12821                                                 AND ahr.fulfillment_time IS NULL
12822                                                 AND ahr.capture_time IS NULL
12823                                                 AND ahr.frozen IS FALSE
12824                                                 -- Comment out the next line to count copies included from other bibs by metarecord holds
12825                                                 AND ahr.hold_type != 'M'
12826                                         GROUP BY bib_record, pickup_lib
12827                                 )y
12828                                 USING(id,pickup_lib)
12829                                 JOIN
12830                                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12831                                         FROM
12832                                                 action.hold_request ahr
12833                                                 JOIN reporter.hold_request_record rhrr USING (id)
12834                                         WHERE
12835                                                 ahr.cancel_time IS NULL
12836                                                 AND ahr.fulfillment_time IS NULL
12837                                         GROUP BY bib_record
12838                                 )z
12839                                 USING (id)
12840                                 JOIN
12841                                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12842                                         FROM
12843                                                 action.hold_request ahr
12844                                                 JOIN reporter.hold_request_record rhrr USING (id)
12845                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12846                                         WHERE
12847                                                 ahr.cancel_time IS NULL
12848                                                 AND ahr.fulfillment_time IS NULL
12849                                                 AND ahr.capture_time IS NULL
12850                                                 AND ahr.frozen IS FALSE
12851                                                 -- Comment out the next line to count copies included from other bibs by metarecord holds
12852                                                 AND ahr.hold_type != 'M'
12853                                                 GROUP BY bib_record
12854                                 )u
12855                                 USING (id)
12856                 ]]></oils_persist:source_definition>
12857                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12858                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12859                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12860                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12861                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12862                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12863                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12864                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12865                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12866                 </fields>
12867                 <links>
12868                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12869                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12870                 </links>
12871                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12872                         <actions>
12873                                 <retrieve/>
12874                         </actions>
12875                 </permacrud>
12876         </class>
12877
12878         <class id="rhcrpbah" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_home" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Home Library">
12879                 <oils_persist:source_definition><![CDATA[
12880                         SELECT *,
12881                                 CASE WHEN copy_count_at_home_library = 0 THEN 'Infinity'::FLOAT ELSE holds_at_home_library::FLOAT/copy_count_at_home_library END AS home_library_ratio,
12882                                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12883                         FROM
12884                                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12885                                         FROM
12886                                                 action.hold_request ahr
12887                                                 JOIN actor.usr au ON (ahr.usr = au.id)
12888                                                 JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12889                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12890                                                 LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12891                                         WHERE
12892                                                 ahr.cancel_time IS NULL
12893                                                 AND ahr.fulfillment_time IS NULL
12894                                         GROUP BY bib_record, home_ou
12895                                 )x
12896                                 JOIN
12897                                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12898                                         FROM
12899                                                 action.hold_request ahr
12900                                                 JOIN actor.usr au ON (ahr.usr = au.id)
12901                                                 JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12902                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12903                                                 LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12904                                         WHERE
12905                                                 ahr.cancel_time IS NULL
12906                                                 AND ahr.fulfillment_time IS NULL
12907                                                 AND ahr.capture_time IS NULL
12908                                                 AND ahr.frozen IS FALSE
12909                                                 -- Comment out the next line to count copies included from other bibs by metarecord holds
12910                                                 AND ahr.hold_type != 'M'
12911                                         GROUP BY bib_record, home_ou
12912                                 )y
12913                                 USING (id,home_ou)
12914                                 JOIN
12915                                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12916                                         FROM
12917                                                 action.hold_request ahr
12918                                                 JOIN reporter.hold_request_record rhrr USING (id)
12919                                         WHERE
12920                                                 ahr.cancel_time IS NULL
12921                                                 AND ahr.fulfillment_time IS NULL
12922                                         GROUP BY bib_record
12923                                 )z
12924                                 USING (id)
12925                                 JOIN
12926                                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12927                                         FROM
12928                                                 action.hold_request ahr
12929                                                 JOIN reporter.hold_request_record rhrr USING (id)
12930                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12931                                         WHERE
12932                                                 ahr.cancel_time IS NULL
12933                                                 AND ahr.fulfillment_time IS NULL
12934                                                 AND ahr.capture_time IS NULL
12935                                                 AND ahr.frozen IS FALSE
12936                                                 -- Comment out the next line to count copies included from other bibs by metarecord holds
12937                                                 AND ahr.hold_type != 'M'
12938                                         GROUP BY bib_record
12939                                 )u
12940                                 USING (id)
12941         ]]></oils_persist:source_definition>
12942         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12943                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12944                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12945                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
12946                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
12947                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12948                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12949                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
12950                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12951         </fields>
12952         <links>
12953                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12954                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12955         </links>
12956         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12957                 <actions>
12958                         <retrieve/>
12959                 </actions>
12960         </permacrud>
12961 </class>
12962
12963         <class id="rhcrpbapd" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_pickup_desc" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Pickup Library (and Descendants) ">
12964                 <oils_persist:source_definition><![CDATA[
12965                                 WITH counts_at_ou AS (
12966                                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
12967                                 FROM
12968                                         (SELECT rhrr.bib_record AS id,
12969                                                         aou.id AS pickup_lib_or_desc,
12970                                                         COUNT(DISTINCT ahr.id) AS holds_at_or_below
12971                                            FROM actor.org_unit aou
12972                                                         JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12973                                                         action.hold_request ahr
12974                                                         JOIN reporter.hold_request_record rhrr USING (id)
12975                                                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12976                                                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12977                                           WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
12978                                                         AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12979                                                         AND (actor.org_unit_ancestor_at_depth(ahr.pickup_lib,aout.depth)).id = (actor.org_unit_ancestor_at_depth(ac.circ_lib,aout.depth)).id
12980                                           GROUP BY 1, 2
12981                                 ) a
12982                                 JOIN
12983                                         (SELECT rhrr.bib_record AS id,
12984                                                         aou.id AS pickup_lib_or_desc,
12985                                                         COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
12986                                            FROM actor.org_unit aou
12987                                                         JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12988                                                         action.hold_request ahr
12989                                                         JOIN reporter.hold_request_record rhrr USING (id)
12990                                                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12991                                                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12992                                           WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
12993                                                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12994                                                         AND ahr.hold_type != 'M'
12995                                                         AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12996                                                         AND (actor.org_unit_ancestor_at_depth(ahr.pickup_lib,aout.depth)).id = (actor.org_unit_ancestor_at_depth(ac.circ_lib,aout.depth)).id
12997                                           GROUP BY 1, 2
12998                                 ) b
12999                                 USING (id,pickup_lib_or_desc)
13000                         )
13001                         SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
13002                                    y.holds_everywhere, z.copy_count_everywhere,
13003                                 CASE WHEN copy_count_at_or_below = 0 THEN 'Infinity'::FLOAT ELSE x.holds_at_or_below::FLOAT/x.copy_count_at_or_below END AS hold_copy_ratio_at_or_below_ou,
13004                                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
13005                         FROM counts_at_ou x
13006                                 JOIN
13007                                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
13008                                         FROM
13009                                                 action.hold_request ahr
13010                                                 JOIN reporter.hold_request_record rhrr USING (id)
13011                                         WHERE
13012                                                 ahr.cancel_time IS NULL
13013                                                 AND ahr.fulfillment_time IS NULL
13014                                         GROUP BY bib_record
13015                                 )y
13016                                 USING (id)
13017                                 JOIN
13018                                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
13019                                         FROM
13020                                                 action.hold_request ahr
13021                                                 JOIN reporter.hold_request_record rhrr USING (id)
13022                                                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13023                                         WHERE
13024                                                 ahr.cancel_time IS NULL
13025                                                 AND ahr.fulfillment_time IS NULL
13026                                                 AND ahr.capture_time IS NULL
13027                                                 AND ahr.frozen IS FALSE
13028                                                 -- Comment out the next line to count copies included from other bibs by metarecord holds
13029                                                 AND ahr.hold_type != 'M'
13030                                                 GROUP BY bib_record
13031                                 )z
13032                                 USING (id)
13033                 ]]></oils_persist:source_definition>
13034                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13035                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13036                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
13037                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
13038                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
13039                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13040                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13041                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
13042                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13043                 </fields>
13044                 <links>
13045                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13046                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
13047                 </links>
13048                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13049                         <actions>
13050                                 <retrieve/>
13051                         </actions>
13052                 </permacrud>
13053         </class>
13054
13055         <class id="rlc" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::last_circ_date" oils_persist:readonly="true" reporter:label="Last Circulation or Creation Date">
13056                 <oils_persist:source_definition><![CDATA[
13057                         SELECT
13058                                 ac.id,
13059                                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
13060                                 MAX(actac.xact_start) AS last_circ
13061                         FROM asset.copy ac
13062                                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13063                         GROUP BY ac.id
13064
13065                         -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13066                         --SELECT
13067                         --      ac.id,
13068                         --      GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13069                         --      GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13070                         --FROM asset.copy ac
13071                         --       LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13072                         --       LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13073                         --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13074                 ]]></oils_persist:source_definition>
13075                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13076                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13077                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13078                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13079                 </fields>
13080                 <links>
13081                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13082                 </links>
13083                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13084                         <actions>
13085                                 <retrieve/>
13086                         </actions>
13087                 </permacrud>
13088         </class>
13089
13090         <class id="ctcl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::ts_config_list" oils_persist:tablename="config.ts_config_list" reporter:label="Text Search Configs">
13091                 <fields oils_persist:primary="id">
13092                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id" oils_obj:required="true"/>
13093                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name" oils_obj:required="true"/>
13094                 </fields>
13095                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13096                         <actions>
13097                                 <retrieve/>
13098                         </actions>
13099                 </permacrud>
13100         </class>
13101
13102         <class id="cmcts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_class_ts_map" oils_persist:tablename="config.metabib_class_ts_map" reporter:label="Metabib Class TS Map">
13103                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13104                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13105                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class" oils_obj:required="true"/>
13106                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config" oils_obj:required="true"/>
13107                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13108                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13109                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13110                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13111                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13112                 </fields>
13113                 <links>
13114                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13115                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13116                 </links>
13117                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13118                         <actions>
13119                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13120                                 <retrieve/>
13121                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13122                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13123                         </actions>
13124                 </permacrud>
13125         </class>
13126
13127         <class id="cmfts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_ts_map" oils_persist:tablename="config.metabib_field_ts_map" reporter:label="Metabib Field TS Map">
13128                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13129                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13130                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field" oils_obj:required="true"/>
13131                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config" oils_obj:required="true"/>
13132                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13133                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13134                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13135                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13136                 </fields>
13137                 <links>
13138                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13139                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13140                 </links>
13141                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13142                         <actions>
13143                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13144                                 <retrieve/>
13145                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13146                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13147                         </actions>
13148                 </permacrud>
13149         </class>
13150
13151
13152         <!-- ********************************************************************************************************************* -->
13153         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13154         <!-- ********************************************************************************************************************* -->
13155         <class id="rccc" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::classic_current_circ" oils_persist:tablename="reporter.classic_current_circ" reporter:core="true" reporter:label="Classic Circulation View">
13156                 <fields oils_persist:primary="id">
13157                         <field reporter:label="Circulation" name="id" reporter:datatype="id"/>
13158                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13159                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13160                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13161                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13162                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13163                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13164                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13165                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13166                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13167                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13168                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13169                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13170                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13171                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13172                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13173                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13174                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13175                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13176                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13177                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13178                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13179                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13180                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13181                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13182                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13183                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13184                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13185                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13186                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13187                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13188                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13189                 </fields>
13190                 <links>
13191                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13192                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13193                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13194                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13195                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13196                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13197                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13198                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13199                 </links>
13200         </class>
13201
13202         <class id="rsce1" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::legacy_cat1" oils_persist:tablename="reporter.legacy_cat1" reporter:label="CAT1 Entry">
13203                 <fields oils_persist:primary="id">
13204                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id"/>
13205                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13206                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13207                 </fields>
13208                 <links>
13209                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13210                 </links>
13211         </class>
13212
13213         <class id="rsce2" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::legacy_cat2" oils_persist:tablename="reporter.legacy_cat2" reporter:label="CAT2 Entry">
13214                 <fields oils_persist:primary="id">
13215                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id"/>
13216                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13217                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13218                 </fields>
13219                 <links>
13220                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13221                 </links>
13222         </class>
13223
13224         <class id="rccbs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::classic_current_billing_summary" oils_persist:tablename="reporter.classic_current_billing_summary" reporter:core="true" reporter:label="Classic Open Transaction Summary">
13225                 <fields oils_persist:primary="id">
13226                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
13227
13228                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13229                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13230                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13231
13232                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13233                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13234                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13235
13236                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13237                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13238
13239                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13240                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13241                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13242
13243                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13244                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13245
13246                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13247                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13248                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13249
13250                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13251                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13252                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13253
13254                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13255                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13256                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13257                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13258
13259                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13260                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13261
13262                 </fields>
13263                 <links>
13264                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13265                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13266                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13267                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13268                 </links>
13269         </class>
13270
13271         <class id="acrlid" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_ready_lineitem_detail" oils_persist:readonly="true" reporter:label="Claim Ready Lineitem Details">
13272                 <oils_persist:source_definition><![CDATA[
13273
13274                         SELECT
13275                                 po.ordering_agency AS ordering_agency,
13276                                 po.id AS purchase_order,
13277                                 li.id AS lineitem,
13278                                 lid.id AS lineitem_detail,
13279                                 cpa.id AS claim_policy_action
13280                         FROM
13281                                 acq.lineitem_detail lid
13282                                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13283                                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13284                                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13285                                 JOIN acq.claim_policy_action cpa ON (
13286                                         cpa.claim_policy = cp.id
13287
13288                                         -- we only care about claim policy actions whose claim
13289                                         -- interval we'd reached or exceeded
13290                                         AND (NOW() - cpa.action_interval) > po.order_date
13291
13292                                         -- filter out all claim policy actions where claim events
13293                                         -- have occurred on or after the action's action_interval
13294                                         AND NOT EXISTS (
13295                                                 SELECT 1
13296                                                 FROM
13297                                                         acq.claim_event evt
13298                                                         JOIN acq.claim claim ON (
13299                                                                 claim.id = evt.claim
13300                                                                 AND claim.lineitem_detail = lid.id
13301                                                         )
13302                                                 WHERE
13303                                                         evt.event_date >= (po.order_date + cpa.action_interval)
13304                                         )
13305                                 )
13306                         WHERE
13307                                 lid.cancel_reason IS NULL
13308                                 AND li.cancel_reason IS NULL -- belt/suspenders
13309                                 AND po.cancel_reason IS NULL -- belt/suspenders
13310                                 AND lid.recv_time IS NULL
13311                                 AND po.state = 'on-order'
13312                         ORDER BY 1, 2, 3, 4, 5
13313
13314                 ]]></oils_persist:source_definition>
13315                 <fields>
13316                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13317                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13318                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13319                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13320                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13321                 </fields>
13322                 <links>
13323                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13324                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13325                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13326                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13327                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13328                 </links>
13329         </class>
13330         <class id="acqlisum" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary" oils_persist:readonly="true" reporter:label="Lineitem Summary" oils_persist:tablename="acq.lineitem_summary">
13331                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13332                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13333                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13334                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13335                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13336                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13337                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13338                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13339                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13340                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13341                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13342                 </fields>
13343                 <links>
13344                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13345                 </links>
13346         </class>
13347         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13348                 <oils_persist:source_definition><![CDATA[
13349                         SELECT * FROM acq.lineitem_summary 
13350                                 WHERE item_count > (invoice_count + cancel_count)
13351                 ]]></oils_persist:source_definition>
13352                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13353                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13354                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13355                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13356                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13357                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13358                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13359                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13360                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13361                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13362                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13363                 </fields>
13364                 <links>
13365                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13366                 </links>
13367         </class>
13368         <class id="iatc" controller="open-ils.reporter-store" oils_obj:fieldmapper="action::intersystem_transit_copy" oils_persist:readonly="true" reporter:core="true" reporter:label="Inter-system Copy Transit">
13369                 <oils_persist:source_definition><![CDATA[
13370
13371                         SELECT  t.*
13372                           FROM  action.transit_copy t
13373                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13374                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13375                           WHERE s.parent_ou <> d.parent_ou
13376
13377                 ]]></oils_persist:source_definition>
13378                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13379                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13380                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13381                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13382                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13383                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13384                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13385                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13386                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13387                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13388                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13389                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13390                 </fields>
13391                 <links>
13392                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13393                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13394                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13395                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13396                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13397                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13398                 </links>
13399         </class>
13400
13401         <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13402                 <oils_persist:source_definition><![CDATA[
13403
13404         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13405                 SELECT
13406                         cp.id as copy,
13407                         COUNT(circ.id),
13408                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13409                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13410                 FROM
13411                         asset.copy cp
13412                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13413                 GROUP BY 1, 3, 4
13414                 UNION ALL
13415                 SELECT
13416                         cp.id as copy,
13417                         COUNT(circ.id),
13418                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13419                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13420                 FROM
13421                         asset.copy cp
13422                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13423                 GROUP BY 1, 3, 4
13424                 UNION ALL
13425                 SELECT
13426                         id as copy,
13427                         circ_count,
13428                         -1 AS year,
13429                         false as is_renewal
13430                 FROM
13431                         extend_reporter.legacy_circ_count
13432         )x GROUP BY 1, 3, 4
13433
13434                 ]]></oils_persist:source_definition>
13435                 <fields>
13436                         <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13437                         <field reporter:label="Count" name="count" reporter:datatype="int"/>
13438                         <field reporter:label="Year" name="year" reporter:datatype="int"/>
13439                         <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13440                 </fields>
13441                 <links>
13442                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13443                 </links>
13444                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13445                         <actions>
13446                                 <retrieve/>
13447                         </actions>
13448                 </permacrud>
13449         </class>
13450
13451         <class id="rodcirc" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::overdue_circs" oils_persist:tablename="reporter.overdue_circs" reporter:core="true" reporter:label="Overdue Circulation">
13452                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13453                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13454                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13455                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13456                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13457                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13458                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13459                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13460                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13461                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13462                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13463                         <field reporter:label="Circ ID" name="id" reporter:datatype="id"/>
13464                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
13465                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13466                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13467                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13468                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
13469                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13470                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int"/>
13471                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13472                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13473                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13474                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13475                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13476                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13477                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13478                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13479                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13480                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13481                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13482                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13483                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13484                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
13485                 </fields>
13486                 <links>
13487                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13488                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13489                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13490                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13491                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13492                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13493                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13494                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13495                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13496                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13497                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13498                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13499                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13500                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13501                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13502                 </links>
13503         </class>
13504
13505         <class id="rocit" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::classic_item_list" oils_persist:tablename="reporter.classic_item_list" reporter:core="true" reporter:label="Classic Item List">
13506                 <fields oils_persist:primary="id">
13507                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
13508                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
13509                         <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13510                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13511                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
13512                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13513                         <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13514                         <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13515                         <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13516                         <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13517                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13518                         <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13519                         <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13520                         <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13521                         <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13522                         <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13523                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13524                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13525                         <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13526                         <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13527                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13528                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13529                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13530                         <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13531                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13532                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13533                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13534                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13535                         <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13536                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
13537                         <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13538                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13539                         <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13540                         <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13541                 </fields>
13542                 <links>
13543                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13544                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13545                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13546                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13547                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13548                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13549                         <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13550                 <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13551                 </links>
13552         </class>
13553
13554         <class id="rmocbbol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_owning_lib" oils_persist:tablename="money.open_circ_balance_by_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by Owning Library">
13555                 <fields oils_persist:primary="id">
13556                         <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13557                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13558                         <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13559                         <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13560                 </fields>
13561                 <links>
13562                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13563                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13564                 </links>
13565         </class>
13566
13567         <class id="rmobbol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_owning_lib" oils_persist:tablename="money.open_balance_by_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by Owning Library">
13568                 <fields oils_persist:primary="owning_lib">
13569                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13570                         <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13571                         <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13572                 </fields>
13573                 <links>
13574                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13575                 </links>
13576         </class>
13577
13578         <class id="rmocbbcol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_circ_and_owning_lib" oils_persist:tablename="money.open_circ_balance_by_circ_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by Circulating Library and Owning Library">
13579                 <fields oils_persist:primary="id">
13580                         <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13581                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13582                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13583                         <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13584                         <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13585                 </fields>
13586                 <links>
13587                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13588                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13589                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13590                 </links>
13591         </class>
13592
13593         <class id="rmobbcol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_circ_and_owning_lib" oils_persist:tablename="money.open_balance_by_circ_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by Circulating Library and Owning Library">
13594                 <fields oils_persist:primary="circ_lib">
13595                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13596                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13597                         <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13598                         <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13599                 </fields>
13600                 <links>
13601                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13602                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13603                 </links>
13604         </class>
13605
13606         <class id="rmocbbhol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_usr_home_and_owning_lib" oils_persist:tablename="money.open_circ_balance_by_usr_home_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by User Home Library and Owning Library">
13607                 <fields oils_persist:primary="id">
13608                         <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13609                         <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13610                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13611                         <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13612                         <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13613                 </fields>
13614                 <links>
13615                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13616                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13617                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13618                 </links>
13619         </class>
13620
13621         <class id="rmobbhol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_usr_home_and_owning_lib" oils_persist:tablename="money.open_balance_by_usr_home_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by User Home Library and Owning Library">
13622                 <fields oils_persist:primary="home_ou">
13623                         <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13624                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13625                         <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13626                         <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13627                 </fields>
13628                 <links>
13629                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13630                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13631                 </links>
13632         </class>
13633         <class id="acqft" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_tag" oils_persist:tablename="acq.fund_tag" reporter:label="Fund Tag">
13634                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13635                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13636                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13637                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13638                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13639                 </fields>
13640                 <links>
13641                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13642                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13643                 </links>
13644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13645                         <actions>
13646                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13647                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13648                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13649                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13650                         </actions>
13651                 </permacrud>
13652         </class>
13653         <class id="acqftm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_tag_map" oils_persist:tablename="acq.fund_tag_map" reporter:label="Fund Tag Map">
13654                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13655                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13656                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" oils_obj:required="true"/>
13657                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13658                 </fields>
13659                 <links>
13660                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13661                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13662                         </links>
13663                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13664                         <actions>
13665                                 <create permission="ADMIN_ACQ_FUND_TAG">
13666                                         <context link="tag" field="owner"/>
13667                                 </create>
13668                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13669                                         <context link="tag" field="owner"/>
13670                                 </retrieve>
13671                                 <update permission="ADMIN_ACQ_FUND_TAG">
13672                                         <context link="tag" field="owner"/>
13673                                 </update>
13674                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13675                                         <context link="tag" field="owner"/>
13676                                 </delete>
13677                         </actions>
13678                 </permacrud>
13679         </class>
13680         <class id="acqmapinv" controller="open-ils.cstore" oils_obj:fieldmapper="acq::map_to_invoice" reporter:label="Acq Map to Invoice View" oils_persist:readonly="true">
13681                 <oils_persist:source_definition><![CDATA[
13682                 SELECT
13683                         poi.purchase_order AS purchase_order,
13684                         ii.invoice AS invoice,
13685                         NULL AS lineitem,
13686                         poi.id AS po_item,
13687                         NULL AS picklist
13688                 FROM
13689                         acq.po_item poi
13690                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13691                 UNION SELECT
13692                         jub.purchase_order AS purchase_order,
13693                         ie.invoice AS invoice,
13694                         jub.id AS lineitem,
13695                         NULL AS po_item,
13696                         jub.picklist AS picklist
13697                 FROM
13698                         acq.lineitem jub
13699                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13700                 UNION SELECT
13701                         ii.purchase_order AS purchase_order,
13702                         ii.invoice AS invoice,
13703                         NULL AS lineitem,
13704                         NULL AS po_item,
13705                         NULL AS picklist
13706                 FROM
13707                         acq.invoice_item ii
13708                 WHERE ii.po_item IS NULL
13709                 UNION SELECT
13710                         ie.purchase_order AS purchase_order,
13711                         ie.invoice AS invoice,
13712                         NULL AS lineitem,
13713                         NULL AS po_item,
13714                         NULL AS picklist
13715                 FROM
13716                         acq.invoice_entry ie
13717                 WHERE ie.lineitem IS NULL
13718                 UNION SELECT
13719                         NULL AS purchase_order,
13720                         NULL AS invoice,
13721                         jub.id AS lineitem,
13722                         NULL AS po_item,
13723                         jub.picklist AS picklist
13724                 FROM
13725                         acq.lineitem jub
13726                 WHERE jub.purchase_order IS NULL
13727                 ]]></oils_persist:source_definition>
13728                 <fields>
13729                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13730                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13731                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13732                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13733                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13734                 </fields>
13735                 <links>
13736                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13737                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13738                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
13739                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
13740                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
13741                 </links>
13742         </class>
13743         <class id="cbc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::barcode_completion" oils_persist:tablename="config.barcode_completion" reporter:label="Barcode Completions">
13744                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13745                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13746                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13747                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
13748                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13749                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13750                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13751                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13752                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13753                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13754                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13755                 </fields>
13756                 <links>
13757                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13758                 </links>
13759                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13760                         <actions>
13761                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13762                                 <retrieve/>
13763                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13764                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13765                         </actions>
13766                 </permacrud>
13767         </class>
13768
13769         <class id="coustl" controller="open-ils.cstore" oils_obj:fieldmapper="config::org_unit_setting_type_log" oils_persist:tablename="config.org_unit_setting_type_log" reporter:label="Organizational Unit Setting Type Log">
13770                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13771                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13772                         <field name="date_applied" reporter:datatype="timestamp"/>
13773                         <field name="org" reporter:datatype="org_unit"/>
13774                         <field name="original_value" reporter:datatype="text"/>
13775                         <field name="new_value" reporter:datatype="text"/>
13776                         <field name="field_name" reporter:datatype="link"/>
13777                 </fields>
13778                 <links>
13779                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13780                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13781                 </links>
13782         </class>
13783         <class id="aaactsc" controller="open-ils.reporter-store" oils_obj:fieldmapper="action::archive_actor_stat_cat" oils_persist:tablename="action.archive_actor_stat_cat" reporter:label="Circ-Archived Patron Statistical Category Entries">
13784                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13785                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13786                         <field reporter:label="Circ" name="xact" reporter:datatype="link" oils_obj:required="true"/>
13787                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
13788                         <field reporter:label="Entry Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13789                 </fields>
13790                 <links>
13791                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13792                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13793                 </links>
13794         </class>
13795         <class id="aaasc" controller="open-ils.reporter-store" oils_obj:fieldmapper="action::archive_asset_stat_cat" oils_persist:tablename="action.archive_asset_stat_cat" reporter:label="Circ-Archived Copy Statistical Category Entries">
13796                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13797                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13798                         <field reporter:label="Circ" name="xact" reporter:datatype="link" oils_obj:required="true"/>
13799                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
13800                         <field reporter:label="Entry Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13801                 </fields>
13802                 <links>
13803                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13804                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13805                 </links>
13806         </class>
13807         <class id="cfg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::floating_group" oils_persist:tablename="config.floating_group" reporter:label="Floating Group">
13808                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13809                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13810                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13811                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13812                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13813                 </fields>
13814                 <links>
13815                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13816                 </links>
13817                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13818                         <actions>
13819                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13820                                 <retrieve/>
13821                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13822                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13823                         </actions>
13824                 </permacrud>
13825         </class>
13826         <class id="cfgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::floating_group_member" oils_persist:tablename="config.floating_group_member" reporter:label="Floating Group Members">
13827                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13828                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13829                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13830                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13831                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13832                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13833                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13834                 </fields>
13835                 <links>
13836                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13837                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13838                 </links>
13839                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13840                         <actions>
13841                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13842                                 <retrieve/>
13843                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13844                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13845                         </actions>
13846                 </permacrud>
13847         </class>
13848         <class id="cctt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_tag_type" oils_persist:tablename="config.copy_tag_type" reporter:label="Copy Tag Types" oils_persist:field_safe="true">
13849                 <fields oils_persist:primary="code">
13850                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13851                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13852                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13853                 </fields>
13854                 <links>
13855                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13856                 </links>
13857                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13858                         <actions>
13859                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13860                                 <retrieve/>
13861                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13862                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13863                         </actions>
13864                 </permacrud>
13865         </class>
13866         <class id="acpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_tag" oils_persist:tablename="asset.copy_tag" reporter:label="Item Tags" oils_persist:field_safe="true">
13867                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13868                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13869                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13870                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13871                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13872                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13873                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13874                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13875                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13876                 </fields>
13877                 <links>
13878                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13879                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13880                 </links>
13881                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13882                         <actions>
13883                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13884                                 <retrieve/>
13885                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13886                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13887                         </actions>
13888                 </permacrud>
13889         </class>
13890         <class id="acptcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_tag_copy_map" oils_persist:tablename="asset.copy_tag_copy_map" reporter:label="Copy Tag Copy Map" oils_persist:field_safe="true">
13891                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13892                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13893                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13894                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13895                 </fields>
13896                 <links>
13897                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13898                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13899                 </links>
13900                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13901                         <actions>
13902                                 <create permission="UPDATE_COPY">
13903                                         <context link="copy" field="circ_lib"/>
13904                                 </create>
13905                                 <retrieve/>
13906                                 <update permission="UPDATE_COPY">
13907                                         <context link="copy" field="circ_lib"/>
13908                                 </update>
13909                                 <delete permission="UPDATE_COPY">
13910                                         <context link="copy" field="circ_lib"/>
13911                                 </delete>
13912                         </actions>
13913                 </permacrud>
13914         </class>
13915         <class id="hasholdscount" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::has_holds_count" reporter:label="Copy Has Holds Count" oils_persist:readonly="true">
13916                 <oils_persist:source_definition><![CDATA[
13917         SELECT ahcm.target_copy AS id,count(*) AS count
13918          FROM
13919          action.hold_request ahr,
13920          action.hold_copy_map ahcm
13921          WHERE
13922          ahr.cancel_time IS NULL AND
13923          ahr.fulfillment_time IS NULL AND
13924          ahr.capture_time IS NULL AND
13925          ahr.id = ahcm.hold
13926          GROUP BY ahcm.target_copy
13927                 ]]></oils_persist:source_definition>
13928                 <fields oils_persist:primary="id">
13929                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13930                         <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13931                 </fields>
13932         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13933                         <actions>
13934                            <retrieve/>
13935                         </actions>
13936         </permacrud>
13937                 </class>
13938
13939         <class id="cwst" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::workstation_setting_type" oils_persist:tablename="config.workstation_setting_type" reporter:label="Workstation Setting Type">
13940                 <fields oils_persist:primary="name">
13941                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13942                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
13943                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13944                         <field name="datatype" reporter:datatype="text"/>
13945                         <field name="fm_class" reporter:datatype="text"/>
13946                         <field name="grp" reporter:datatype="link"/>
13947                 </fields>
13948                 <links>
13949                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
13950                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
13951                 </links>
13952                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13953                         <actions>
13954                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13955                                 <retrieve/>
13956                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13957                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13958                         </actions>
13959                 </permacrud>
13960         </class>
13961
13962         <!-- no pcrud access is granted for now, because it's assumed these
13963                          setting values will be applied and retrived via the API. -->
13964         <class id="awss" controller="open-ils.cstore" oils_obj:fieldmapper="actor::workstation_setting" oils_persist:tablename="actor.workstation_setting" reporter:label="Workstation Setting">
13965                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
13966                         <field reporter:label="Setting ID" name="id" reporter:datatype="id"/>
13967                         <field reporter:label="Name" name="name" reporter:datatype="link" oils_obj:required="true"/>
13968                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13969                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link" oils_obj:required="true"/>
13970                 </fields>
13971                 <links>
13972                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
13973                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
13974                 </links>
13975         </class>
13976
13977         <class id="cht" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_type" oils_persist:tablename="config.hold_type" reporter:label="Hold Type" oils_persist:readonly="true">
13978                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
13979                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
13980                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13981                         <field name="hold_type" reporter:datatype="text" oils_persist:i18n="true"/>
13982                 </fields>
13983         </class>
13984
13985         <class id="cpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::print_template" oils_persist:tablename="config.print_template" reporter:label="Print Templates">
13986                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
13987                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
13988                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13989                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13990                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
13991                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13992                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
13993                         <field name="content_type" reporter:datatype="text"/>
13994                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
13995                 </fields>
13996                 <links>
13997                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13998                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
13999                 </links>
14000                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14001                         <actions>
14002                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14003                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14004                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14005                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14006                         </actions>
14007                 </permacrud>
14008         </class>
14009
14010         <class id="cct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::carousel_type" oils_persist:tablename="config.carousel_type" reporter:label="Carousel Types">
14011                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
14012                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id"/>
14013                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14014                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
14015                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
14016                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
14017                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
14018                 </fields>
14019                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14020                         <actions>
14021                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14022                                 <retrieve/>
14023                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14024                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14025                         </actions>
14026                 </permacrud>
14027         </class>
14028
14029         <class id="cc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::carousel" oils_persist:tablename="container.carousel" reporter:label="Carousels">
14030                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
14031                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
14032                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
14033                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14034                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14035                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
14036                         <field reporter:label="Creating User" name="creator" reporter:datatype="link" oils_obj:required="true"/>
14037                         <field reporter:label="Editing User" name="editor" reporter:datatype="link" oils_obj:required="true"/>
14038                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
14039                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
14040                         <field reporter:label="Age Limit" name="age_filter" reporter:datatype="interval"/>
14041                         <field reporter:label="Item Libraries" name="owning_lib_filter" reporter:datatype="text"/>        <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
14042                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text"/> <!-- ditto -->
14043                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14044                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14045                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14046                 </fields>
14047                 <links>
14048                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14049                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14050                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14051                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14052                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14053                 </links>
14054                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14055                         <actions>
14056                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14057                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14058                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14059                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14060                         </actions>
14061                 </permacrud>
14062         </class>
14063
14064         <class id="ccou" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::carousel_org_unit" oils_persist:tablename="container.carousel_org_unit" reporter:label="Carousels Visible at Library">
14065                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14066                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
14067                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link" oils_obj:required="true"/>
14068                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14069                         <field reporter:label="Library" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
14070                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int" oils_obj:required="true"/>
14071                 </fields>
14072                 <links>
14073                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14074                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14075                 </links>
14076                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14077                         <actions>
14078                                 <create permission="ADMIN_CAROUSEL">
14079                                         <context link="carousel" field="owner"/>
14080                                 </create>
14081                                 <retrieve permission="ADMIN_CAROUSEL">
14082                                         <context link="carousel" field="owner"/>
14083                                 </retrieve>
14084                                 <update permission="ADMIN_CAROUSEL">
14085                                         <context link="carousel" field="owner"/>
14086                                 </update>
14087                                 <delete permission="ADMIN_CAROUSEL">
14088                                         <context link="carousel" field="owner"/>
14089                                 </delete>
14090                         </actions>
14091                 </permacrud>
14092         </class>
14093
14094         <class id="cra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remoteauth_profile" oils_persist:tablename="config.remoteauth_profile" reporter:label="Remote Patron Authentication Configuration Profile">
14095                 <fields oils_persist:primary="name">
14096                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_obj:required="true"/>
14097                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
14098                         <field name="context_org" reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14099                         <field name="enabled" reporter:datatype="bool" reporter:label="Enabled"/>
14100                         <field name="perm" reporter:datatype="link" reporter:label="Permission Required by User" oils_obj:required="true"/>
14101                         <field name="restrict_to_org" reporter:datatype="bool" reporter:label="Restrict by Home Library"/>
14102                         <field name="allow_inactive" reporter:datatype="bool" reporter:label="Allow Inactive Users"/>
14103                         <field name="allow_expired" reporter:datatype="bool" reporter:label="Allow Expired Users"/>
14104                         <field name="block_list" reporter:datatype="text" reporter:label="Block List"/>
14105                         <field name="usr_activity_type" reporter:datatype="link" reporter:label="User Activity Type"/>
14106                 </fields>
14107                 <links>
14108                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14109                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14110                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14111                 </links>
14112                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14113                         <actions>
14114                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14115                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14116                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14117                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14118                         </actions>
14119                 </permacrud>
14120         </class>
14121         <class id="cgs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::geolocation_service" oils_persist:tablename="config.geolocation_service" reporter:label="Geographic Location Service">
14122                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14123                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14124                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14125                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14126                         <field name="name" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14127                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14128                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14129                 </fields>
14130                 <links>
14131                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14132                 </links>
14133                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14134                         <actions>
14135                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14136                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14137                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14138                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14139                         </actions>
14140                 </permacrud>
14141         </class>
14142
14143         <class id="cusppet" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::ui_staff_portal_page_entry_type" oils_persist:tablename="config.ui_staff_portal_page_entry_type" reporter:label="Portal Page Entry Type">
14144                 <fields oils_persist:primary="code">
14145                         <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14146                         <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14147                 </fields>
14148                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14149                         <actions>
14150                                 <retrieve/>
14151                         </actions>
14152                 </permacrud>
14153         </class>
14154
14155         <class id="cusppe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::ui_staff_portal_page_entry" oils_persist:tablename="config.ui_staff_portal_page_entry" reporter:label="Portal Page Entry">
14156                 <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14157                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14158                         <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14159                         <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14160                         <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14161                         <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14162                         <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14163                         <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14164                         <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14165                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14166                 </fields>
14167                 <links>
14168                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14169                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14170                 </links>
14171                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14172                         <actions>
14173                                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14174                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14175                                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14176                                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14177                         </actions>
14178                 </permacrud>
14179         </class>
14180
14181         <!-- Simple Reporter classes are currently used only by the SR UI -->
14182         <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14183                 <oils_persist:source_definition><![CDATA[
14184                         SELECT
14185                           -- Circ id; just for counting
14186                           combcirc.id AS circ_id,
14187
14188                           -- User info, currently limiting to what's available from action.all_circulation
14189                           combcirc.usr_post_code AS usr_post_code,
14190                           combcirc.usr_birth_year AS usr_bith_year,
14191                           combcirc.usr_profile AS usr_profile_id,
14192                           pgtu.name AS usr_profile,
14193                           combcirc.usr_home_ou AS usr_home_ou_id,
14194                           aouuh.shortname AS usr_home_ou_shortname,
14195                           aouuh.name AS usr_home_ou_name,
14196                           (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14197                           aouus.shortname AS usr_sys_shortname,
14198                           aouus.name AS usr_sys_name,
14199
14200                           -- Circ info
14201                           -- Checkout
14202                           combcirc.xact_start AS xact_start,
14203                           CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14204                           TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14205                           TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14206                           combcirc.circ_lib AS circ_lib_id,
14207                           aouco.shortname AS circ_lib_shortname,
14208                           aouco.name AS circ_lib_name,
14209                           (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14210                           aoucos.shortname AS circ_sys_shortname,
14211                           aoucos.name AS circ_sys_name,
14212                           auco.usrname AS circ_staff,
14213                           awso.name AS checkout_workstation,
14214
14215                           combcirc.due_date AS due_date,
14216                           CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14217                           TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14218                           TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14219
14220                           -- Checkin
14221                           combcirc.xact_finish AS xact_finish,
14222                           CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14223                           TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14224                           TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14225                           aouci.shortname AS checkin_lib_shortname,
14226                           aouci.name AS checkin_lib_name,
14227                           auci.usrname AS checkin_staff,
14228                           awsi.name AS checkin_workstation,
14229                           aoucis.shortname AS checkin_sys_shortname,
14230                           aoucis.name AS checkin_sys_name,
14231
14232                           combcirc.checkin_time AS checkin_time,
14233
14234                           -- Misc circ info
14235                           combcirc.renewal_remaining AS renewal_remaining,
14236                           combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14237                           combcirc.grace_period AS grace_period,
14238
14239                           combcirc.stop_fines AS stop_fines,
14240                           combcirc.stop_fines_time AS stop_fines_time,
14241
14242                           combcirc.duration AS duration,
14243                           combcirc.fine_interval AS fine_interval,
14244                           combcirc.recurring_fine AS recurring_fine,
14245                           combcirc.max_fine AS max_fine,
14246                           combcirc.duration_rule AS duration_rule,
14247                           combcirc.recurring_fine_rule AS recurring_fine_rule,
14248                           combcirc.max_fine_rule AS max_fine_rule,
14249                           CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14250                           CASE WHEN phone_renewal THEN 'phone' WHEN desk_renewal THEN 'desk' WHEN opac_renewal THEN 'opac' WHEN auto_renewal THEN 'auto' ELSE null END AS renewal_type,
14251                           CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14252
14253                           -- Copy info
14254                           acp.barcode AS copy_barcode,
14255                           acp.circ_modifier AS copy_circ_modifier_code,
14256                           ccm.name AS copy_circ_modifier_name,
14257                           acp.circ_lib AS copy_circ_lib_id,
14258                           acp.location AS location_id,
14259                           acpl.name AS location_name,
14260                           aoucp.shortname AS copy_circ_lib_shortname,
14261                           aoucp.name AS copy_circ_lib_name,
14262                           (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14263                           aoucps.shortname AS copy_sys_shortname,
14264                           aoucps.name AS copy_sys_name,
14265                           combcirc.copy_owning_lib AS copy_owning_lib_id,
14266                           aoucpo.shortname AS copy_owning_lib_shortname,
14267                           aoucpo.name AS copy_owning_lib_name,
14268                           TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14269                           acnp.label AS copy_call_number_prefix,
14270                           acn.label AS copy_call_number_label,
14271                           acns.label AS copy_call_number_suffix,
14272                           TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14273                           acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14274                           acn.label_sortkey AS copy_call_number_label_sortkey,
14275                           acns.label_sortkey AS copy_call_number_suffix_sortkey,
14276                           COALESCE(rmsr.title, acp.dummy_title) AS title,
14277                           COALESCE(rmsr.author, acp.dummy_author) AS author,
14278                           rmsr.publisher AS publisher,
14279                           public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14280                           array_to_string(rmsr.isbn, ', ') AS isbn,
14281                           array_to_string(rmsr.issn, ', ') AS issn,
14282                           part.label AS part_label,
14283                           part.label_sortkey AS part_label_sortkey,
14284                           acn.record AS bib_id,
14285                           rmsr.tcn_value AS tcn_value
14286
14287                         FROM
14288                           action.all_circulation combcirc
14289
14290                           -- User
14291                           INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14292                           LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14293                           LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14294
14295                           -- Circ
14296                           LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14297                           LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14298                           INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14299                           LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14300                           LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14301                           LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14302                           LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14303                           LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14304
14305                           -- Copy / call / title
14306                           INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14307                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14308                           INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14309                           LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14310                           LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14311                           LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14312                           LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14313                           INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14314                           INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14315                           INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14316                           LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14317                           LEFT JOIN (
14318                                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14319                                 FROM biblio.monograph_part bmp
14320                                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14321                                 WHERE NOT bmp.deleted
14322                           ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14323                 ]]></oils_persist:source_definition>
14324                 <field_groups>
14325                         <group name="common" reporter:label="Common Fields"/>
14326                         <group name="item" reporter:label="Item Fields"/>
14327                         <group name="user" reporter:label="Patron Fields"/>
14328                         <group name="title" reporter:label="Call Number and Title Fields"/>
14329                         <group name="org" reporter:label="Libraries"/>
14330                 </field_groups>
14331                 <fields oils_persist:primary="circ_id">
14332                         <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14333                         <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14334                         <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14335                         <field reporter:label="Patron Profile Group" name="usr_profile_id" sr:hide_from="display" reporter:datatype="link" field_groups="user,common" sr:suggest_filter="true"/>
14336                         <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14337                         <field reporter:label="Patron Home Library" name="usr_home_ou_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,user,common" sr:suggest_filter="true"/>
14338                         <field reporter:label="Patron Home Library Short (Policy) Name" sr:hide_from="filter" name="usr_home_ou_shortname" reporter:datatype="text" field_groups="org,user,common"/>
14339                         <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14340                         <field reporter:label="Patron System Library" name="usr_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,user,common" sr:suggest_filter="true"/>
14341                         <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14342                         <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14343                         <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14344                         <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14345                         <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14346                         <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14347                         <field reporter:label="Checkout Library" name="circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,common" sr:suggest_filter="true"/>
14348                         <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14349                         <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14350                         <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14351                         <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14352                         <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14353                         <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14354                         <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14355                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14356                         <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14357                         <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14358                         <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14359                         <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14360                         <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14361                         <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14362                         <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14363                         <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14364                         <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14365                         <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14366                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14367                         <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14368                         <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14369                         <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14370                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14371                         <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14372                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14373                         <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14374                         <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14375                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14376                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14377                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14378                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14379                         <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14380                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14381                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14382                         <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14383                         <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14384                         <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14385                         <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14386                         <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14387                         <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14388                         <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14389                         <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14390                         <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14391                         <field reporter:label="Item Circulating Library Short (Policy) Name" name="copy_circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14392                         <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14393                         <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14394                         <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14395                         <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14396                         <field reporter:label="Item Owning Library" name="copy_owning_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item" sr:suggest_filter="true"/>
14397                         <field reporter:label="Item Owning Library Short (Policy) Name" name="copy_owning_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14398                         <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14399                         <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14400                         <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14401                         <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14402                         <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14403                         <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14404                         <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14405                         <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14406                         <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14407                         <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14408                         <field reporter:label="Call Number Dewey Block Tens" name="copy_call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14409                         <field reporter:label="Call Number Dewey Block Hundreds" name="copy_call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14410                         <field reporter:label="Call Number Dewey Range Tens" name="copy_call_number_dewey_range_tens" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14411                         <field reporter:label="Call Number Dewey Range Hundreds" name="copy_call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14412                         <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14413                         <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14414                         <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14415                         <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14416                         <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14417                         <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14418                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14419                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14420                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14421                         <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14422                 </fields>
14423                 <links>
14424                         <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14425                         <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14426                         <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14427                 </links>
14428         </class>
14429
14430         <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14431                 <oils_persist:source_definition><![CDATA[
14432                         SELECT
14433                           au.home_ou AS home_ou_filter,
14434                           au.id AS user_id,
14435                           cardp.barcode AS barcode_primary,
14436                           au.usrname AS usrname,
14437                           au.email AS email,
14438                           CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14439                           au.prefix AS prefix,
14440                           au.first_given_name AS first_given_name,
14441                           au.second_given_name AS second_given_name,
14442                           au.family_name AS family_name,
14443                           au.suffix AS suffix,
14444                           CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14445                           COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14446                           COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14447                           COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14448                           COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14449                           COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14450                           COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14451                           COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14452                           au.profile AS profile_id,
14453                           pgt.name AS profile,
14454                           au.alias AS alias,
14455                           CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14456                           au.day_phone AS day_phone,
14457                           au.evening_phone AS evening_phone,
14458                           au.other_phone AS other_phone,
14459                           au.dob AS dob,
14460                           CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14461                           TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14462                           EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14463                           au.active AS active,
14464                           au.barred AS barred,
14465                           au.deleted AS deleted,
14466                           au.juvenile AS juvenile,
14467                           au.claims_returned_count AS claims_returned_count,
14468                           au.credit_forward_balance AS credit_forward_balance,
14469                           au.create_date AS create_date,
14470                           CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14471                           TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14472                           TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14473                           au.expire_date AS expire_date,
14474                           CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14475                           TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14476                           TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14477                           au.claims_never_checked_out_count AS claims_never_checked_out_count,
14478                           au.last_update_time AS last_update_time,
14479                           au.home_ou AS home_ou_id,
14480                           aouh.shortname AS home_ou_shortname,
14481                           aouh.name AS home_ou_name,
14482                           (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14483                           aous.shortname AS home_sys_shortname,
14484                           aous.name AS home_sys_name,
14485                           auam.valid AS mailing_valid,
14486                           auam.address_type AS mailing_address_type,
14487                           auam.street1 AS mailing_street1,
14488                           auam.street2 AS mailing_street2,
14489                           auam.city AS mailing_city,
14490                           auam.state AS mailing_state,
14491                           auam.country AS mailing_country,
14492                           auam.post_code AS mailing_post_code,
14493                           auam.county AS mailing_county,
14494                           auam.within_city_limits AS mailing_within_city_limits,
14495                           auam.pending AS mailing_pending,
14496                           CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14497                           auap.valid AS physical_valid,
14498                           auap.address_type AS physical_address_type,
14499                           auap.street1 AS physical_street1,
14500                           auap.street2 AS physical_street2,
14501                           auap.city AS physical_city,
14502                           auap.state AS physical_state,
14503                           auap.country AS physical_country,
14504                           auap.post_code AS physical_post_code,
14505                           auap.county AS physical_county,
14506                           auap.within_city_limits AS physical_within_city_limits,
14507                           auap.pending AS physical_pending,
14508                           CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14509                           CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14510                           CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14511                           CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14512                           CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14513                           CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14514                           asceum1.stat_cat_entry AS legacy_stat_cat1,
14515                           asceum2.stat_cat_entry AS legacy_stat_cat2,
14516
14517                           -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14518                           STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14519                           STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14520                           STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14521                           COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL AND now() > circ.due_date THEN circ.id ELSE NULL END) AS circs_overdue,
14522                           COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14523
14524                         FROM
14525                           actor.usr au
14526                           INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14527                           INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14528                           LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14529                           LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14530                           LEFT JOIN actor.card cards ON (au.id = cards.usr)
14531                           INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14532                           LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14533                           LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14534                           LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14535                           LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14536                           LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14537                           LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14538                           LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14539                           LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14540                           LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14541                           LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14542
14543                         GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14544                           16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14545                           31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14546                           46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14547                           61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14548                           76,77,78,79,80,81
14549                 ]]></oils_persist:source_definition>
14550                 <field_groups>
14551                         <group name="common" reporter:label="Common Fields"/>
14552                         <group name="name" reporter:label="Name Fields"/>
14553                         <group name="contact" reporter:label="Contact Fields"/>
14554                         <group name="address" reporter:label="Address Related Fields"/>
14555                         <group name="org" reporter:label="Libraries"/>
14556                 </field_groups>
14557                 <fields oils_persist:primary="user_id">
14558                         <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int" sr:hide_from="display,filter" sr:force_transform="reporter.intersect_user_perm_ou,SR__USER_ID,VIEW_USER" sr:force_filter="true" sr:force_filtervalues="t"/>
14559                         <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14560                         <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14561                         <field reporter:label="OPAC/Staff Client Username" name="usrname" reporter:datatype="text" field_groups="common"/>
14562                         <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14563                         <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14564                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14565                         <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14566                         <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14567                         <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14568                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14569                         <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14570                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14571                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14572                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14573                         <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14574                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14575                         <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14576                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14577                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14578                         <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14579                         <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14580                         <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14581                         <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14582                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14583                         <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14584                         <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14585                         <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14586                         <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14587                         <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14588                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14589                         <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14590                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14591                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14592                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14593                         <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14594                         <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14595                         <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14596                         <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14597                         <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14598                         <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14599                         <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14600                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14601                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14602                         <field reporter:label="Home Library" name="home_ou_id" reporter:datatype="org_unit" sr:suggest_filter="true" sr:hide_from="display" field_groups="org,common"/>
14603                         <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14604                         <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14605                         <field reporter:label="Home System" name="home_sys_id" reporter:datatype="org_unit" sr:suggest_filter="true" sr:hide_from="display" field_groups="org,common"/>
14606                         <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14607                         <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14608                         <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14609                         <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14610                         <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14611                         <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14612                         <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14613                         <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14614                         <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14615                         <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14616                         <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14617                         <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14618                         <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14619                         <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14620                         <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14621                         <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14622                         <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14623                         <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14624                         <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14625                         <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14626                         <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14627                         <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14628                         <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14629                         <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14630                         <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14631                         <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14632                         <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14633                         <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14634                         <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14635                         <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14636                         <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14637                         <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14638                         <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14639                         <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14640                         <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14641                         <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14642                         <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14643                         <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14644                 </fields>
14645                 <links>
14646                         <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14647                 </links>
14648         </class>
14649
14650         <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14651                 <oils_persist:source_definition><![CDATA[
14652                         SELECT
14653                           -- ids
14654                           acp.id AS copy_id,
14655                           acp.floating AS floating_id,
14656                           acn.id AS acn_id,
14657                           acp.circ_lib AS circ_lib_id,
14658                           acp.status AS status_id,
14659                           acp.location AS location_id,
14660                           acp.age_protect AS age_protect_id,
14661                           aous.id AS circ_sys_id,
14662                           acn.owning_lib AS owning_lib_id,
14663                           aouos.id AS owning_sys_id,
14664                           awsi.id AS inv_workstation_id,
14665
14666                           -- OUs
14667                           aou.shortname AS circ_lib_shortname,
14668                           aou.name AS circ_lib_name,
14669                           aous.shortname AS circ_sys_shortname,
14670                           aous.name AS circ_sys_name,
14671                           aouo.shortname AS owning_lib_shortname,
14672                           aouo.name AS owning_lib_name,
14673                           aouos.shortname AS owning_sys_shortname,
14674                           aouos.name AS owning_sys_name,
14675
14676                           -- dates
14677                           acp.create_date AS create_date_time,
14678                           CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14679                           TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14680                           TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14681                           acp.active_date AS active_date_time,
14682                           CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14683                           TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14684                           TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14685                           acp.edit_date AS edit_date_time,
14686                           CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14687                           TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14688                           TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14689                           acp.status_changed_time AS status_changed_time_time,
14690                           CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14691                           TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14692                           TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14693                           ali.inventory_date AS latest_inv_date,
14694                           CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14695                           TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14696                           TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14697
14698                           -- acp
14699                           acp.barcode AS barcode,
14700                           ccs.name AS status,
14701                           acpl.name AS location_name,
14702                                                         acp.circ_modifier AS copy_circ_modifier_code,
14703                                                         ccm.name AS copy_circ_modifier_name,
14704                           acp.price AS price,
14705                           acp.cost AS acq_price,
14706                           acp.deleted AS copy_deleted,
14707                           acp.ref AS reference,
14708                           acp.circulate AS copy_circulate,
14709                           (acp.circulate AND acpl.circulate) AS circulate,
14710                           acp.holdable AS copy_holdable,
14711                           acp.deposit AS deposit,
14712                           acp.deposit_amount AS deposit_amount,
14713                           acp.alert_message AS alert_message,
14714                           acp.opac_visible AS copy_opac_visible,
14715                           (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14716                           crahp.name AS age_protect,
14717                           CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14718                           (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14719                           acp.copy_number AS copy_number,
14720                           acp.circ_as_type AS circ_as_type,
14721                           acp.loan_duration AS loan_duration_int,
14722                           CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14723                           acp.fine_level AS fine_level_int,
14724                           CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14725
14726                           -- Call Number
14727                           TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14728                           acnp.label AS copy_call_number_prefix,
14729                           acn.label AS copy_call_number_label,
14730                           acns.label AS copy_call_number_suffix,
14731                           TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14732                           acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14733                           acn.label_sortkey AS copy_call_number_label_sortkey,
14734                           acns.label_sortkey AS copy_call_number_suffix_sortkey,
14735                           racnd.dewey AS call_number_dewey,
14736                           racnd.dewey_block_tens AS call_number_dewey_block_tens,
14737                           racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14738                           racnd.dewey_range_tens AS call_number_dewey_range_tens,
14739                           racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14740
14741                           -- Misc
14742                           COALESCE(rmsr.title, acp.dummy_title) AS title,
14743                           COALESCE(rmsr.author, acp.dummy_author) AS author,
14744                           rmsr.publisher AS publisher,
14745                           public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14746                           COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14747                           array_to_string(rmsr.issn, ', ') AS issn,
14748                           part.label AS part_label,
14749                           part.label_sortkey AS part_label_sortkey,
14750                           acn.record AS bib_id,
14751                           rmsr.tcn_value AS tcn_value,
14752                           acn.deleted AS call_deleted,
14753                           bre.deleted AS bib_deleted,
14754                           ccs.holdable AS status_holdable,
14755                           acpl.holdable AS location_holdable,
14756                           acp.circulate AS location_circulate,
14757                           awsi.name AS inventory_workstation,
14758                           aucr.usrname AS creating_user,
14759                           aued.usrname AS editing_user,
14760
14761                           -- Aggregates
14762                           -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14763                           COALESCE(acp.cost, acp.price, (select first(value::numeric(8,2)) from actor.org_unit_ancestor_setting('cat.default_item_price', acp.circ_lib)), 5.00) AS est_price,
14764                           COUNT(DISTINCT combcirc.id) AS circ_total,
14765                           STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14766
14767                         FROM
14768                           asset.copy acp
14769                           LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14770                           INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14771                           LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14772                           INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14773                           LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14774                           INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14775                           INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14776                           INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14777                           LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14778                           LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14779                           LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14780                           INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14781                           LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14782                           INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14783                           LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14784                           INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14785                           LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14786                           LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14787                           INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14788                           INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14789                           LEFT JOIN (
14790                                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14791                                 FROM biblio.monograph_part bmp
14792                                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14793                                 WHERE NOT bmp.deleted
14794                           ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14795
14796                         GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14797                           16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14798                           31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14799                           46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14800                           61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14801                           76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14802                           91,92,93,94,95,96
14803
14804                 ]]></oils_persist:source_definition>
14805                 <field_groups>
14806                         <group name="common" reporter:label="Common Fields"/>
14807                         <group name="dates" reporter:label="Date Fields"/>
14808                         <group name="title" reporter:label="Call Number and Title Fields"/>
14809                         <group name="org" reporter:label="Libraries"/>
14810                 </field_groups>
14811                 <fields oils_persist:primary="copy_id">
14812                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14813                         <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14814                         <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14815                         <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14816                         <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14817                         <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14818                         <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14819                         <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14820                         <field reporter:label="Owning Library" name="owning_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
14821                         <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
14822                         <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14823                         <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14824                         <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14825                         <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14826                         <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14827                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14828                         <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14829                         <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14830                         <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14831                         <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14832                         <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14833                         <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14834                         <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14835                         <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14836                         <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14837                         <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14838                         <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14839                         <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14840                         <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14841                         <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14842                         <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14843                         <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14844                         <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14845                         <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14846                         <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14847                         <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14848                         <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14849                         <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14850                         <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14851                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14852                         <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14853                         <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14854                         <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14855                         <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14856                         <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14857                         <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14858                         <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14859                         <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14860                         <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14861                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14862                         <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14863                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14864                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14865                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14866                         <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14867                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14868                         <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14869                         <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14870                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14871                         <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14872                         <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14873                         <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14874                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14875                         <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14876                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14877                         <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14878                         <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14879                         <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14880                         <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14881                         <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14882                         <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14883                         <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14884                         <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14885                         <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14886                         <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14887                         <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14888                         <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14889                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14890                         <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14891                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14892                         <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14893                         <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14894                         <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14895                         <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14896                         <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14897                         <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14898                         <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14899                         <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14900                         <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14901                         <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14902                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14903                         <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14904                         <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14905                         <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14906                 </fields>
14907                 <links>
14908                         <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14909                         <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14910                         <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14911                         <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14912                         <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14913                         <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
14914                 </links>
14915         </class>
14916
14917         <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
14918                 <oils_persist:source_definition><![CDATA[
14919
14920                         SELECT
14921                           -- ids
14922                           acp.id AS copy_id,
14923                           acn.id AS acn_id,
14924                           acp.circ_lib AS circ_lib_id,
14925                           acp.status AS status_id,
14926                           acp.location AS location_id,
14927                           acp.age_protect AS age_protect_id,
14928                           aous.id AS circ_sys_id,
14929                           acn.owning_lib AS owning_lib_id,
14930                           aouos.id AS owning_sys_id,
14931                           awsi.id AS inv_workstation_id,
14932
14933                           -- OUs
14934                           aou.shortname AS circ_lib_shortname,
14935                           aou.name AS circ_lib_name,
14936                           aous.shortname AS circ_sys_shortname,
14937                           aous.name AS circ_sys_name,
14938                           aouo.shortname AS owning_lib_shortname,
14939                           aouo.name AS owning_lib_name,
14940                           aouos.shortname AS owning_sys_shortname,
14941                           aouos.name AS owning_sys_name,
14942
14943                           -- dates
14944                           acp.create_date AS create_date_time,
14945                           (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
14946                           (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
14947                           EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
14948                           CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14949                           TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14950                           TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14951                           acp.active_date AS active_date_time,
14952                           (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
14953                           EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
14954                           EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
14955                           CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14956                           TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14957                           TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14958                           acp.edit_date AS edit_date_time,
14959                           (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
14960                           (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
14961                           EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
14962                           CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14963                           TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14964                           TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14965                           acp.status_changed_time AS status_changed_time_time,
14966                           CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14967                           TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14968                           TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14969                           ali.inventory_date AS latest_inv_date,
14970                           (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
14971                           EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
14972                           EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
14973                           CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
14974                           TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
14975                           TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
14976
14977                           -- acp
14978                           acp.barcode AS barcode,
14979                           ccs.name AS status,
14980                           acpl.name AS location_name,
14981                           acp.circ_modifier AS circ_modifier_code,
14982                           ccm.name AS circ_modifier_name,
14983                           acp.price AS price,
14984                           acp.cost AS acq_price,
14985                           acp.deleted AS copy_deleted,
14986                           acp.ref AS reference,
14987                           acp.circulate AS copy_circulate,
14988                           (acp.circulate AND acpl.circulate) AS circulate,
14989                           acp.holdable AS copy_holdable,
14990                           acp.deposit AS deposit,
14991                           acp.deposit_amount AS deposit_amount,
14992                           acp.alert_message AS alert_message,
14993                           acp.opac_visible AS copy_opac_visible,
14994                           (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14995                           crahp.name AS age_protect,
14996                           CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14997                           (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14998                           acp.copy_number AS copy_number,
14999                           acp.circ_as_type AS circ_as_type,
15000                           acp.loan_duration AS loan_duration_int,
15001                           CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
15002                           acp.fine_level AS fine_level_int,
15003                           CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
15004
15005                           -- Call Number
15006                           TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
15007                           acnp.label AS copy_call_number_prefix,
15008                           acn.label AS copy_call_number_label,
15009                           acns.label AS copy_call_number_suffix,
15010                           TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
15011                           acnp.label_sortkey AS copy_call_number_prefix_sortkey,
15012                           acn.label_sortkey AS copy_call_number_label_sortkey,
15013                           acns.label_sortkey AS copy_call_number_suffix_sortkey,
15014                           racnd.dewey AS call_number_dewey,
15015                           racnd.dewey_block_tens AS call_number_dewey_block_tens,
15016                           racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
15017                           racnd.dewey_range_tens AS call_number_dewey_range_tens,
15018                           racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
15019
15020                           -- Misc
15021                           COALESCE(rmsr.title, acp.dummy_title) AS title,
15022                           COALESCE(rmsr.author, acp.dummy_author) AS author,
15023                           rmsr.publisher AS publisher,
15024                           public.approximate_date(rmsr.pubdate, '0') AS pubdate,
15025                           COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
15026                           array_to_string(rmsr.issn, ', ') AS issn,
15027                           part.label AS part_label,
15028                           part.label_sortkey AS part_label_sortkey,
15029                           acn.record AS bib_id,
15030                           rmsr.tcn_value AS tcn_value,
15031                           acn.deleted AS call_deleted,
15032                           bre.deleted AS bib_deleted,
15033                           ccs.holdable AS status_holdable,
15034                           acpl.holdable AS location_holdable,
15035                           acp.circulate AS location_circulate,
15036                           awsi.name AS inventory_workstation,
15037
15038                           -- Aggregates
15039                           -- may decide these price games aren't worth it, but estimated collection value is useful
15040                           COALESCE(acp.cost, acp.price, (select first(value::numeric(8,2)) from actor.org_unit_ancestor_setting('cat.default_item_price', acp.circ_lib)), 5.00) AS est_price,
15041                           STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15042                           MAX(combcirc.xact_start) AS last_circ_datetime,
15043                           (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15044                           (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15045                           EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15046                           CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15047                           TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15048                           TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15049                           COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15050                           (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15051                           (EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) * 12) + EXTRACT(MONTH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_months,
15052                           EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15053                           CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15054                           TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15055                           TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15056                           COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15057                           COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15058                           COUNT(DISTINCT CASE WHEN date_part('year', now() - '1 year'::interval) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_last_year,
15059                           COUNT(DISTINCT CASE WHEN date_part('year', now() - '2 year'::interval) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_two_years_ago,
15060                           COUNT(DISTINCT CASE WHEN date_part('year', now() - '3 year'::interval) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_three_years_ago,
15061                           COUNT(DISTINCT CASE WHEN date_part('year', now() - '5 year'::interval) <= date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_last_five_years
15062
15063                         FROM
15064                           asset.copy acp
15065                           LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15066                           INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15067                           LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15068                           INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15069                           LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15070                           INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15071                           INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15072                           INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15073                           LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15074                           LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15075                           LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15076                           INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15077                           LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15078                           INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15079                           LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15080                           INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15081                           LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15082                           LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15083                           LEFT JOIN (
15084                                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15085                                 FROM biblio.monograph_part bmp
15086                                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15087                                 WHERE NOT bmp.deleted
15088                           ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15089
15090                         GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15091                           16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15092                           31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15093                           46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15094                           61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15095                           76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15096                           91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15097
15098                 ]]></oils_persist:source_definition>
15099                 <field_groups>
15100                         <group name="common" reporter:label="Common Fields"/>
15101                         <group name="dates" reporter:label="Date Fields"/>
15102                         <group name="inv" reporter:label="Inventory Fields"/>
15103                         <group name="title" reporter:label="Call Number and Title Fields"/>
15104                         <group name="org" reporter:label="Libraries"/>
15105                 </field_groups>
15106                 <fields oils_persist:primary="copy_id">
15107                          <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15108                          <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15109                          <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
15110                          <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15111                          <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15112                          <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15113                          <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15114                          <field reporter:label="Owning Library" name="owning_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
15115                          <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15116                          <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15117                          <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15118                          <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15119                          <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15120                          <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15121                          <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15122                          <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15123                          <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15124                          <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15125                          <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15126                          <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15127                          <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15128                          <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15129                          <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15130                          <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15131                          <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15132                          <field reporter:label="Last Circulated or Item Created Date / Time" name="last_circ_create_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15133                          <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15134                          <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15135                          <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15136                          <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15137                          <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15138                          <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15139                          <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15140                          <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15141                          <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15142                          <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15143                          <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15144                          <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15145                          <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15146                          <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15147                          <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15148                          <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15149                          <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15150                          <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15151                          <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15152                          <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15153                          <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15154                          <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15155                          <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15156                          <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15157                          <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15158                          <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15159                          <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15160                          <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15161                          <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15162                          <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15163                          <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15164                          <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15165                          <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15166                          <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15167                          <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15168                          <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15169                          <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15170                          <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15171                          <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15172                          <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15173                          <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15174                          <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15175                          <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15176                          <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15177                          <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15178                          <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15179                          <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15180                          <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15181                          <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15182                          <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15183                          <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15184                          <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15185                          <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15186                          <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15187                          <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15188                          <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15189                          <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15190                          <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15191                          <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15192                          <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15193                          <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15194                          <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15195                          <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15196                          <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15197                          <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15198                          <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15199                          <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15200                          <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15201                          <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15202                          <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15203                          <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15204                          <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15205                          <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15206                          <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15207                          <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15208                          <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15209                          <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15210                          <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15211                          <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15212                          <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15213                          <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15214                          <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15215                          <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15216                          <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15217                          <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15218                          <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15219                          <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15220                          <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15221                          <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15222                          <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15223                          <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15224                          <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15225                          <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15226                          <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15227                          <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15228                          <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15229                          <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15230                          <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15231                          <field reporter:label="Circulation Two Years Ago" name="circ_two_years_ago" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15232                          <field reporter:label="Circulation Three Years Ago" name="circ_three_years_ago" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15233                          <field reporter:label="Circulation Total Last Five Years" name="circ_last_five_years" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15234                 </fields>
15235                 <links>
15236                         <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15237                         <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15238                         <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15239                         <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15240                         <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15241                 </links>
15242         </class>
15243
15244         <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15245                 <oils_persist:source_definition><![CDATA[
15246
15247                         SELECT
15248                           -- ids
15249                           xact.id AS xact_id,
15250                           COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15251                           COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15252
15253                           -- OUs
15254                           COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15255                           COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15256                           COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15257                           COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15258
15259                           -- billings
15260                           billings.total_amount AS billing_grand_total,
15261                           billings.total_unvoided_amount AS billing_total,
15262
15263                           billings.voided_billing_count AS billing_voided_count,
15264                           billings.all_billing_types AS all_billing_types,
15265                           billings.billing_types AS billing_types,
15266
15267                           billings.total_voided_amount AS billing_total_voided,
15268                           billings.total_overdue_amount AS billing_overdue_amount,
15269                           billings.total_lost_amount AS billing_lost_amount,
15270                           billings.total_long_od_amount AS billing_long_od_amount,
15271                           billings.total_damaged_amount AS billing_damaged_amount,
15272                           billings.total_deposit_amount AS billing_deposit_amount,
15273                           billings.total_rental_amount AS billing_rental_amount,
15274
15275                           -- payments
15276                           payments.total_amount AS payment_grand_total,
15277                           payments.total_unvoided_amount AS payment_total,
15278
15279                           payments.voided_payment_count AS payment_voided_count,
15280                           payments.all_payment_types AS all_payment_types,
15281                           payments.payment_types AS payment_types,
15282
15283                           payments.total_voided_amount AS payment_total_voided,
15284                           payments.total_account_adjustment AS payment_account_adjustment_amount,
15285                           payments.total_cash_payment AS payment_cash_amount,
15286                           payments.total_check_payment AS payment_check_amount,
15287                           payments.total_credit_card_payment AS payment_credit_card_amount,
15288                           payments.total_debit_card_payment AS payment_debit_card_amount,
15289                           payments.total_credit_payment AS payment_credit_amount,
15290                           payments.total_forgive_payment AS payment_forgive_amount,
15291                           payments.total_work_payment AS payment_work_amount,
15292                           payments.total_goods_payment AS payment_goods_amount,
15293                           payments.total_currency_payment AS payment_currency_amount,
15294                           payments.total_non_currency_payment AS payment_non_currency_amount,
15295
15296                           -- dates
15297                           xact.xact_start AS xact_start,
15298                           CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15299                           TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15300                           TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15301                           xact.xact_finish AS xact_finish,
15302                           CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15303                           TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15304                           TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15305                           billings.earliest_billing_ts AS earliest_billing_ts,
15306                           CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15307                           TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15308                           TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15309                           billings.latest_billing_ts AS latest_billing_ts,
15310                           CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15311                           TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15312                           TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15313                           payments.earliest_payment_ts AS earliest_payment_ts,
15314                           CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15315                           TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15316                           TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15317                           payments.latest_payment_ts AS latest_payment_ts,
15318                           CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15319                           TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15320                           TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15321
15322                           -- Misc
15323                           CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15324                           (xact.xact_finish IS NOT NULL) AS xact_closed
15325
15326                         FROM
15327                           money.billable_xact xact
15328                           LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15329                           LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15330                           LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15331                           LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15332                           LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15333                           LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15334
15335                           -- oohh nooo.... If not done this way you encounter situations
15336                           -- like multiplying billing totals x number of payments and
15337                           -- payment totals x number of billings and other fabulous fiduciary fantasies.
15338                           LEFT JOIN (
15339                                 SELECT
15340                                   xact,
15341                                   MIN(billing_ts) AS earliest_billing_ts,
15342                                   MAX(billing_ts) AS latest_billing_ts,
15343
15344                                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15345                                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15346                                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15347
15348                                   SUM(amount) AS total_amount,
15349                                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15350                                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15351                                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15352                                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15353                                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15354                                   SUM(CASE WHEN NOT voided AND btype IN (7,8) THEN amount ELSE NULL END) AS total_damaged_amount, -- Likely incomplete because damaged billing interface is whack.
15355                                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15356                                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15357
15358                                 FROM
15359                                   money.all_billings
15360                                 GROUP BY 1
15361                           ) billings ON (xact.id = billings.xact)
15362                           -- Can't include accepting user or cash_drawer because that will "duplicate"
15363                           -- rows if multiple staff accept payments on a single xact...
15364                           LEFT JOIN (
15365                                 SELECT
15366                                   xact,
15367                                   MIN(payment_ts) AS earliest_payment_ts,
15368                                   MAX(payment_ts) AS latest_payment_ts,
15369
15370                                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15371                                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15372                                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15373
15374                                   SUM(amount) AS total_amount,
15375                                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15376                                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15377                                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15378                                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15379                                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15380                                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15381                                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15382                                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15383                                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15384                                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15385                                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15386                                   SUM(CASE WHEN NOT voided AND payment_type IN ('cash_payment', 'check_payment', 'credit_card_payment', 'debit_card_payment', 'credit_payment') THEN amount ELSE NULL END) AS total_currency_payment,
15387                                   SUM(CASE WHEN NOT voided AND payment_type NOT IN ('cash_payment', 'check_payment', 'credit_card_payment', 'debit_card_payment', 'credit_payment') THEN amount ELSE NULL END) AS total_non_currency_payment
15388
15389                                 FROM
15390                                   money.all_payments
15391                                 GROUP BY 1
15392                           ) payments ON (xact.id = payments.xact)
15393
15394                 ]]></oils_persist:source_definition>
15395                 <field_groups>
15396                         <group name="common" reporter:label="Common Fields"/>
15397                         <group name="bill" reporter:label="Billing Fields"/>
15398                         <group name="pay" reporter:label="Payment Fields"/>
15399                         <group name="dates" reporter:label="Date Fields"/>
15400                         <group name="org" reporter:label="Libraries"/>
15401                 </field_groups>
15402                 <fields oils_persist:primary="xact_id">
15403                          <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15404                          <field reporter:label="Billing Library" name="billing_lib_id" reporter:datatype="org_unit" sr:hide_from="display" sr:suggest_filter="true" field_groups="org,common"/>
15405                          <field reporter:label="Billing System" name="billing_sys_id" reporter:datatype="org_unit" sr:hide_from="display" sr:suggest_filter="true" field_groups="org,common"/>
15406                          <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15407                          <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15408                          <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15409                          <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15410                          <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15411                          <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15412                          <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15413                          <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15414                          <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15415                          <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15416                          <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15417                          <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15418                          <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15419                          <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15420                          <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15421                          <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15422                          <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15423                          <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15424                          <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15425                          <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15426                          <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15427                          <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15428                          <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15429                          <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15430                          <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15431                          <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15432                          <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15433                          <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15434                          <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15435                          <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15436                          <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15437                          <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15438                          <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15439                          <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15440                          <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15441                          <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15442                          <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15443                          <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15444                          <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15445                          <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15446                          <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15447                          <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15448                          <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15449                          <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15450                          <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15451                          <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15452                          <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15453                          <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15454                          <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15455                          <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15456                          <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15457                          <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15458                          <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15459                          <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15460                          <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15461                          <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15462                          <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15463                          <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15464                          <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15465                 </fields>
15466         </class>
15467
15468         <class id="coauf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::openathens_uid_field" oils_persist:tablename="config.openathens_uid_field" reporter:label="OpenAthens unique identifiers">
15469                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_uid_field_id_seq">
15470                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
15471                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15472                 </fields>
15473                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15474                         <actions>
15475                                 <retrieve/>
15476                         </actions>
15477                 </permacrud>
15478         </class>
15479
15480         <class id="coanf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::openathens_name_field" oils_persist:tablename="config.openathens_name_field" reporter:label="OpenAthens name fields">
15481                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_name_field_id_seq">
15482                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
15483                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15484                 </fields>
15485                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15486                         <actions>
15487                                 <retrieve/>
15488                         </actions>
15489                 </permacrud>
15490         </class>
15491
15492         <class id="coai" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::openathens_identity" oils_persist:tablename="config.openathens_identity" reporter:label="Sign-on to OpenAthens">
15493                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_identity_id_seq">
15494                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
15495                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
15496                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
15497                         <field reporter:label="API key" name="api_key" reporter:datatype="text" oils_obj:required="true"/>
15498                         <field reporter:label="Connection ID" name="connection_id" reporter:datatype="text" oils_obj:required="true"/>
15499                         <field reporter:label="Connection URI" name="connection_uri" reporter:datatype="text" oils_obj:required="true"/>
15500                         <field reporter:label="Auto sign-on" name="auto_signon_enabled" reporter:datatype="bool"/>
15501                         <field reporter:label="Auto sign-out" name="auto_signout_enabled" reporter:datatype="bool"/>
15502                         <field reporter:label="Unique identifier field" name="unique_identifier" reporter:datatype="link" oils_obj:required="true"/>
15503                         <field reporter:label="Display name field" name="display_name" reporter:datatype="link" oils_obj:required="true"/>
15504                         <field reporter:label="Release prefix" name="release_prefix" reporter:datatype="bool"/>
15505                         <field reporter:label="Release first name" name="release_first_given_name" reporter:datatype="bool"/>
15506                         <field reporter:label="Release middle name" name="release_second_given_name" reporter:datatype="bool"/>
15507                         <field reporter:label="Release surname" name="release_family_name" reporter:datatype="bool"/>
15508                         <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
15509                         <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
15510                         <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
15511                         <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
15512                 </fields>
15513                 <links>
15514                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
15515                         <link field="unique_identifier" reltype="has_a" key="id" map="" class="coauf"/>
15516                         <link field="display_name" reltype="has_a" key="id" map="" class="coanf"/>
15517                 </links>
15518                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15519                         <actions>
15520                                 <create permission="ADMIN_OPENATHENS" global_required="true"/>
15521                                 <retrieve/>
15522                                 <update permission="ADMIN_OPENATHENS" global_required="true"/>
15523                                 <delete permission="ADMIN_OPENATHENS" global_required="true"/>
15524                         </actions>
15525                 </permacrud>
15526         </class>
15527
15528         <class id="acqr_inv_totals" controller="open-ils.reporter" oils_persist:virtual="true" reporter:label="Invoice Totals">
15529                 <oils_persist:source_definition><![CDATA[
15530                         WITH invoice_entry_totals AS (
15531                                 SELECT acqinv.id,
15532                                         SUM(COALESCE(acqie.cost_billed, 0.00)) AS total_invoice_entry_cost_billed,
15533                                         SUM(COALESCE(acqie.amount_paid, 0.00)) AS total_invoice_entry_amount_paid
15534                                 FROM acq.invoice acqinv
15535                                 LEFT JOIN acq.invoice_entry acqie ON (acqinv.id = acqie.invoice)
15536                                 GROUP BY 1
15537                         ), invoice_item_totals AS (
15538                                 SELECT acqinv.id,
15539                                         SUM(COALESCE(acqii.cost_billed, 0.00)) AS total_invoice_item_cost_billed,
15540                                         SUM(COALESCE(acqii.amount_paid, 0.00)) AS total_invoice_item_amount_paid
15541                                 FROM acq.invoice acqinv
15542                                 LEFT JOIN acq.invoice_item  acqii ON (acqinv.id = acqii.invoice)
15543                                 GROUP BY 1
15544                         )
15545                         SELECT id,
15546                                 total_invoice_entry_cost_billed, total_invoice_entry_amount_paid,
15547                                 total_invoice_item_cost_billed, total_invoice_item_amount_paid,
15548                                 total_invoice_entry_cost_billed + total_invoice_item_cost_billed AS total_cost_billed,
15549                                 total_invoice_entry_amount_paid + total_invoice_item_amount_paid AS total_amount_paid
15550                         FROM invoice_entry_totals
15551                         JOIN invoice_item_totals USING (id)
15552                 ]]></oils_persist:source_definition>
15553                 <fields oils_persist:primary="id">
15554                         <field reporter:label="Invoice" name="id" reporter:datatype="link"/>
15555                         <field reporter:label="Total Billed for Line Items" name="total_invoice_entry_cost_billed" reporter:datatype="money"/>
15556                         <field reporter:label="Total Paid for Line Items" name="total_invoice_entry_amount_paid" reporter:datatype="money"/>
15557                         <field reporter:label="Total Billed for Direct Charges" name="total_invoice_item_cost_billed" reporter:datatype="money"/>
15558                         <field reporter:label="Total Paid for Direct Charges" name="total_invoice_item_amount_paid" reporter:datatype="money"/>
15559                         <field reporter:label="Total Billed" name="total_cost_billed" reporter:datatype="money"/>
15560                         <field reporter:label="Total Paid" name="total_amount_paid" reporter:datatype="money"/>
15561                 </fields>
15562                 <links>
15563                         <link field="id" reltype="has_a" key="id" map="" class="acqinv"/>
15564                 </links>
15565         </class>
15566
15567         <class id="acqr_debit_by_fund" controller="open-ils.reporter" oils_persist:virtual="true" reporter:label="Invoice Debits by Fund">
15568                 <oils_persist:source_definition><![CDATA[
15569                         WITH invoice_funds AS (
15570                                 SELECT invoice, fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15571                                 FROM acq.invoice_entry acqie
15572                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.invoice_entry = acqie.id)
15573                                 UNION ALL
15574                                 SELECT invoice, acqfdeb.fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15575                                 FROM acq.invoice_item acqii
15576                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.id = acqii.fund_debit)
15577                         )
15578                         SELECT invoice, fund, encumbrance, SUM (amount) AS total_amount
15579                         FROM invoice_funds
15580                         GROUP BY 1, 2, 3
15581                 ]]></oils_persist:source_definition>
15582                 <fields>
15583                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link"/>
15584                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
15585                         <field reporter:label="Encumbrance?" name="encumbrance" reporter:datatype="bool"/>
15586                         <field reporter:label="Total Amount" name="total_amount" reporter:datatype="money"/>
15587                 </fields>
15588                 <links>
15589                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
15590                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
15591                 </links>
15592         </class>
15593
15594         <class id="acqr_debit_by_fund_tag" controller="open-ils.reporter" oils_persist:virtual="true" reporter:label="Invoice Debits by Fund Tag">
15595                 <oils_persist:source_definition><![CDATA[
15596                         WITH invoice_funds AS (
15597                                 SELECT invoice, fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15598                                 FROM acq.invoice_entry acqie
15599                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.invoice_entry = acqie.id)
15600                                 UNION ALL
15601                                 SELECT invoice, acqfdeb.fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15602                                 FROM acq.invoice_item acqii
15603                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.id = acqii.fund_debit)
15604                         )
15605                         SELECT invoice, tag, encumbrance, SUM(amount) AS total_amount
15606                         FROM invoice_funds
15607                         LEFT JOIN acq.fund_tag_map acqftm ON (invoice_funds.fund = acqftm.fund)
15608                         GROUP BY 1, 2, 3
15609                 ]]></oils_persist:source_definition>
15610                 <fields>
15611                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link"/>
15612                         <field reporter:label="Fund Tag" name="tag" reporter:datatype="link"/>
15613                         <field reporter:label="Encumbrance?" name="encumbrance" reporter:datatype="bool"/>
15614                         <field reporter:label="Total Amount" name="total_amount" reporter:datatype="money"/>
15615                 </fields>
15616                 <links>
15617                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
15618                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
15619                 </links>
15620         </class>
15621
15622         <!-- ********************************************************************************************************************* -->
15623 </IDL>
15624 <!-- Local Variables: -->
15625 <!-- indent-tabs-mode: t -->
15626 <!-- tab-width: 4 -->
15627 <!-- nxml-child-indent: 4 -->
15628 <!-- End: -->
15629 <!--
15630         vim:noet:ts=4:sw=4:
15631 -->